#diy-box-room-admin-host {
  display: none;
  min-height: calc(100vh - 64px);
  padding: 20px;
  background: #f5f7fa;
  color: #1d2129;
  font-size: 14px;
}

#diy-box-room-admin-host *,
.dbr-modal-mask * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.dbr-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
}

.dbr-header,
.dbr-toolbar,
.dbr-actions,
.dbr-inline,
.dbr-modal-head,
.dbr-modal-foot,
.dbr-section-head {
  display: flex;
  align-items: center;
}

.dbr-header {
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.dbr-title {
  margin: 0;
  color: #1d2129;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

.dbr-subtitle,
.dbr-muted,
.dbr-help {
  color: #86909c;
}

.dbr-subtitle {
  margin-top: 4px;
  font-size: 13px;
}

.dbr-panel {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}

.dbr-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e6eb;
}

.dbr-tab {
  position: relative;
  min-height: 40px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
}

.dbr-tab.active {
  color: #165dff;
  font-weight: 600;
}

.dbr-tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #165dff;
  content: '';
}

.dbr-toolbar {
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e6eb;
  flex-wrap: wrap;
}

.dbr-actions,
.dbr-inline {
  gap: 8px;
  flex-wrap: wrap;
}

.dbr-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #c9cdd4;
  border-radius: 4px;
  background: #fff;
  color: #1d2129;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.dbr-button:hover {
  border-color: #165dff;
  color: #165dff;
}

.dbr-button.primary {
  border-color: #165dff;
  background: #165dff;
  color: #fff;
}

.dbr-button.primary:hover {
  border-color: #4080ff;
  background: #4080ff;
  color: #fff;
}

.dbr-button.danger {
  border-color: #ffb4b4;
  color: #f53f3f;
}

.dbr-button.small {
  min-height: 27px;
  padding: 0 9px;
  font-size: 12px;
}

.dbr-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.dbr-input,
.dbr-select,
.dbr-textarea {
  width: 100%;
  border: 1px solid #c9cdd4;
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: #1d2129;
  font: inherit;
}

.dbr-input,
.dbr-select {
  height: 34px;
  padding: 0 10px;
}

.dbr-textarea {
  min-height: 88px;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}

.dbr-input:focus,
.dbr-select:focus,
.dbr-textarea:focus {
  border-color: #165dff;
  box-shadow: 0 0 0 2px rgba(22, 93, 255, .1);
}

.dbr-search {
  width: 240px;
}

.dbr-table-wrap {
  overflow: auto;
}

.dbr-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.dbr-table th {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e6eb;
  background: #f7f8fa;
  color: #4e5969;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.dbr-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f1f2;
  color: #1d2129;
  vertical-align: middle;
}

.dbr-table tr:hover td {
  background: #fafcff;
}

.dbr-table-title {
  display: block;
  max-width: 260px;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbr-user-cell {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 10px;
}

.dbr-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  object-fit: cover;
}

.dbr-readonly {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #f7f8fa;
}

.dbr-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #165dff;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.dbr-link.danger {
  color: #f53f3f;
}

.dbr-muted,
.dbr-help {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
}

.dbr-tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 3px;
  background: #f2f3f5;
  color: #4e5969;
  font-size: 12px;
  white-space: nowrap;
}

.dbr-tag.green { background: #e8ffea; color: #00a870; }
.dbr-tag.blue { background: #e8f3ff; color: #165dff; }
.dbr-tag.orange { background: #fff7e8; color: #d46b08; }
.dbr-tag.red { background: #ffece8; color: #f53f3f; }

.dbr-empty,
.dbr-loading {
  padding: 64px 20px;
  color: #86909c;
  text-align: center;
}

.dbr-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid #f0f1f2;
  color: #86909c;
}

.dbr-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #e5e6eb;
}

.dbr-summary-item {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid #e5e6eb;
}

.dbr-summary-item:nth-child(4n) {
  border-right: 0;
}

.dbr-summary-label {
  color: #86909c;
  font-size: 12px;
}

.dbr-summary-value {
  margin-top: 5px;
  overflow: hidden;
  color: #1d2129;
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbr-section-head {
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e6eb;
}

.dbr-section-title {
  font-size: 16px;
  font-weight: 600;
}

.dbr-callout {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-left: 3px solid #165dff;
  background: #f7faff;
  color: #4e5969;
  line-height: 1.7;
}

.dbr-number-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dbr-number {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
}

.dbr-number.excluded {
  border-color: #ffb4b4;
  background: #fff2f0;
  color: #f53f3f;
}

.dbr-display-mode-options {
  display: grid;
  overflow: hidden;
  border: 1px solid #c9cdd4;
  border-radius: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dbr-display-mode-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.dbr-display-mode-option + .dbr-display-mode-option {
  border-left: 1px solid #c9cdd4;
}

.dbr-display-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.dbr-display-mode-option span {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: #fff;
  text-align: center;
}

.dbr-display-mode-option small {
  color: #86909c;
  font-size: 12px;
}

.dbr-display-mode-option input:checked + span {
  background: #e8f3ff;
  color: #165dff;
  box-shadow: inset 0 -2px #165dff;
}

.dbr-display-mode-option input:focus-visible + span {
  outline: 2px solid #165dff;
  outline-offset: -2px;
}

.dbr-display-preview {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 3px solid #165dff;
  background: #f7faff;
  color: #4e5969;
}

.dbr-display-preview strong {
  max-width: 70%;
  overflow: hidden;
  color: #1d2129;
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbr-number-label-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dbr-number-label-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.dbr-number-label-index {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #f7f8fa;
  color: #4e5969;
  font-variant-numeric: tabular-nums;
}

.dbr-modal-mask {
  position: fixed;
  z-index: 2100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .45);
}

.dbr-modal {
  display: flex;
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  flex-direction: column;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.dbr-modal.wide {
  width: min(1040px, 100%);
}

.dbr-modal-head {
  min-height: 56px;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid #e5e6eb;
  font-size: 16px;
  font-weight: 600;
}

.dbr-modal-body {
  overflow: auto;
  padding: 20px;
}

.dbr-modal-foot {
  min-height: 60px;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #e5e6eb;
}

.dbr-form-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e6eb;
}

.dbr-form-section:last-child {
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.dbr-form-title {
  margin-bottom: 12px;
  color: #1d2129;
  font-size: 15px;
  font-weight: 600;
}

.dbr-section-help {
  margin: -5px 0 12px;
  color: #86909c;
}

.dbr-disclosure-config {
  padding: 16px;
  border: 1px solid #dbe7ff;
  border-radius: 4px;
  background: #f7faff;
}

.dbr-disclosure-config .dbr-field.is-muted {
  opacity: .58;
}

.dbr-disclosure-config .dbr-field.is-muted .dbr-label::after {
  margin-left: 6px;
  color: #86909c;
  content: '（已隐藏）';
}

.dbr-agreement-head,
.dbr-agreement-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dbr-agreement-head .dbr-form-title {
  margin-bottom: 4px;
}

.dbr-agreement-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.dbr-agreement-item {
  padding: 14px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fafbfc;
}

.dbr-agreement-item-head {
  margin-bottom: 12px;
}

.dbr-agreement-item-head strong,
.dbr-agreement-item-head span {
  display: block;
}

.dbr-agreement-item-head span {
  margin-top: 2px;
  color: #86909c;
  font-size: 12px;
}

.dbr-agreement-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dbr-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dbr-field {
  min-width: 0;
}

.dbr-field.full {
  grid-column: 1 / -1;
}

.dbr-label {
  display: block;
  margin-bottom: 6px;
  color: #4e5969;
  font-size: 13px;
}

.dbr-label.required::before {
  margin-right: 4px;
  color: #f53f3f;
  content: '*';
}

.dbr-rule-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.dbr-rule-preview > div {
  padding: 10px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #fafbfc;
}

.dbr-rule-preview strong {
  display: block;
  margin-top: 3px;
  color: #1d2129;
}

.dbr-prize-options {
  max-height: 340px;
  overflow: auto;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
}

.dbr-prize-option {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f1f2;
}

.dbr-prize-option:last-child {
  border-bottom: 0;
}

.dbr-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4e5969;
  cursor: pointer;
  white-space: nowrap;
}

.dbr-check input {
  width: 16px;
  height: 16px;
  accent-color: #165dff;
}

.dbr-chat-preview {
  display: grid;
  max-width: 360px;
  gap: 2px;
}

.dbr-chat-preview strong,
.dbr-chat-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbr-chat-preview small {
  color: #86909c;
}

.dbr-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.dbr-chat-main,
.dbr-chat-members {
  margin-bottom: 0;
}

.dbr-chat-stream {
  height: min(620px, calc(100vh - 350px));
  min-height: 360px;
  padding: 16px;
  overflow-y: auto;
  border-top: 1px solid #e5e6eb;
  border-bottom: 1px solid #e5e6eb;
  background: #f7f8fa;
}

.dbr-chat-message {
  max-width: 78%;
  margin-bottom: 14px;
}

.dbr-chat-message.system {
  max-width: 100%;
  text-align: center;
}

.dbr-chat-message-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  color: #4e5969;
  font-size: 12px;
}

.dbr-chat-message-head time {
  margin-left: auto;
  color: #86909c;
}

.dbr-chat-bubble {
  padding: 9px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
  color: #1d2129;
  line-height: 1.6;
  word-break: break-word;
}

.dbr-chat-message.system .dbr-chat-bubble {
  display: inline-block;
  max-width: 82%;
  border: 0;
  background: #e8f3ff;
  color: #165dff;
}

.dbr-chat-system-label {
  margin-bottom: 4px;
  color: #86909c;
  font-size: 12px;
}

.dbr-chat-message time {
  color: #86909c;
  font-size: 12px;
}

.dbr-chat-message-actions {
  min-height: 22px;
  margin-top: 4px;
  color: #86909c;
  font-size: 12px;
  text-align: right;
}

.dbr-chat-message.recalled .dbr-chat-bubble {
  color: #86909c;
  text-decoration: line-through;
}

.dbr-chat-notice-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
}

.dbr-chat-notice-editor .dbr-textarea {
  min-height: 64px;
  resize: vertical;
}

.dbr-chat-members {
  padding-bottom: 8px;
}

.dbr-chat-members > .dbr-section-title {
  padding: 16px;
  border-bottom: 1px solid #e5e6eb;
}

.dbr-chat-member-list {
  max-height: min(680px, calc(100vh - 280px));
  overflow-y: auto;
}

.dbr-chat-member {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid #f0f1f2;
}

.dbr-chat-member strong,
.dbr-chat-member span {
  display: block;
}

.dbr-chat-member span {
  margin-top: 2px;
  color: #86909c;
  font-size: 12px;
}

.dbr-toast {
  position: fixed;
  z-index: 2300;
  top: 78px;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 4px;
  background: #00a870;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
  color: #fff;
  transform: translateX(-50%);
}

.dbr-toast.error {
  background: #f53f3f;
}

.diy-box-room-admin-menu-link {
  cursor: pointer;
}

.diy-box-room-admin-menu-link .dbr-menu-mark {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
  vertical-align: -3px;
}

.diy-box-room-admin-menu-link .dbr-menu-mark::before,
.diy-box-room-admin-menu-link .dbr-menu-mark::after {
  position: absolute;
  background: currentColor;
  content: '';
}

.diy-box-room-admin-menu-link .dbr-menu-mark::before {
  top: 6px;
  right: 2px;
  left: 2px;
  height: 2px;
}

.diy-box-room-admin-menu-link .dbr-menu-mark::after {
  top: 2px;
  bottom: 2px;
  left: 6px;
  width: 2px;
}

@media (max-width: 1100px) {
  .dbr-summary-grid,
  .dbr-rule-preview,
  .dbr-number-label-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dbr-summary-item:nth-child(2n) {
    border-right: 0;
  }

  .dbr-chat-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
}

@media (max-width: 760px) {
  #diy-box-room-admin-host {
    padding: 12px;
  }

  .dbr-header,
  .dbr-section-head,
  .dbr-prize-option {
    align-items: flex-start;
    flex-direction: column;
  }

  .dbr-form-grid,
  .dbr-agreement-fields,
  .dbr-summary-grid,
  .dbr-rule-preview,
  .dbr-number-label-grid {
    grid-template-columns: 1fr;
  }

  .dbr-display-mode-options {
    grid-template-columns: 1fr;
  }

  .dbr-display-mode-option + .dbr-display-mode-option {
    border-top: 1px solid #c9cdd4;
    border-left: 0;
  }

  .dbr-field.full {
    grid-column: auto;
  }

  .dbr-agreement-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dbr-summary-item,
  .dbr-summary-item:nth-child(2n),
  .dbr-summary-item:nth-child(4n) {
    border-right: 0;
    border-bottom: 1px solid #e5e6eb;
  }

  .dbr-search {
    width: 100%;
  }

  .dbr-toolbar,
  .dbr-actions {
    align-items: stretch;
  }

  .dbr-toolbar > .dbr-inline,
  .dbr-toolbar > .dbr-actions {
    width: 100%;
  }

  .dbr-modal-mask {
    padding: 10px;
  }

  .dbr-chat-layout,
  .dbr-chat-notice-editor {
    grid-template-columns: 1fr;
  }

  .dbr-chat-stream {
    height: 52vh;
    min-height: 320px;
  }

  .dbr-chat-message {
    max-width: 94%;
  }

  .dbr-chat-member-list {
    max-height: 360px;
  }
}
