* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.1), transparent 28%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.12), transparent 24%),
    linear-gradient(180deg, #f5f7fb 0%, #eef2f7 100%);
  color: #132238;
}

.admin-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.hero,
.card,
.tab-bar {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(19, 34, 56, 0.08);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(19, 34, 56, 0.08);
}

.hero {
  padding: 24px;
  margin-bottom: 18px;
}

.card {
  padding: 20px;
  margin-bottom: 18px;
}

.sticky-card {
  position: sticky;
  top: 12px;
  z-index: 10;
}

.eyebrow {
  margin: 0 0 8px;
  color: #3c78d8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.subcopy,
.section-head p,
.list-card-head p,
.meta-block,
.message-item,
.info-item span {
  color: #57657a;
  line-height: 1.6;
}

.section-head {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tab-bar {
  display: flex;
  gap: 10px;
  padding: 10px;
  margin-bottom: 18px;
}

.tab-button {
  flex: 1;
  border: 1px solid #d8e0ec;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-weight: 700;
  padding: 12px 14px;
  cursor: pointer;
}

.tab-button.active {
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  color: #fff;
  border-color: transparent;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 14px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfd7e3;
  border-radius: 12px;
  font: inherit;
  color: #132238;
  background: #fff;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #cfd7e3;
  border-radius: 12px;
  background: #fff;
}

.checkbox-field input {
  width: auto;
}

.block-field {
  margin-top: 14px;
}

.compact-field span {
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-stack {
  flex-wrap: wrap;
}

.grow {
  flex: 1;
}

.helper-text {
  margin: -2px 0 16px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

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

.info-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d8e0ec;
  background: #f8fafc;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.danger-button {
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
}

.primary-button {
  background: #1d4ed8;
  color: #fff;
}

.primary-button:hover {
  background: #1e40af;
}

.secondary-button {
  background: #e2e8f0;
  color: #0f172a;
}

.danger-button {
  background: #fee2e2;
  color: #b91c1c;
}

.list-grid {
  display: grid;
  gap: 14px;
}

.list-card,
.empty-card {
  border: 1px solid #d8e0ec;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}

.list-card.active {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.list-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.list-card-head h3 {
  font-size: 16px;
  color: #132238;
}

.list-card-body {
  display: grid;
  gap: 12px;
}

.answer-block {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #132238;
}

.meta-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.detail-block summary {
  cursor: pointer;
  font-weight: 700;
  color: #1d4ed8;
}

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

.message-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.identifier-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.identifier-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d8e0ec;
  background: #f8fafc;
}

.identifier-item strong {
  color: #0f172a;
  font-size: 13px;
}

.identifier-item span {
  color: #57657a;
  line-height: 1.5;
  word-break: break-all;
}

.preview-list,
.conversation-message-list {
  display: grid;
  gap: 10px;
}

.preview-item,
.conversation-message {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d8e0ec;
  background: #fff;
  display: grid;
  gap: 6px;
}

.preview-item.outgoing,
.conversation-message.outgoing {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.preview-item.incoming,
.conversation-message.incoming {
  background: #f8fafc;
}

.preview-item strong,
.conversation-message-head strong {
  color: #0f172a;
}

.preview-item span,
.conversation-message-body {
  color: #57657a;
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-panel {
  margin-top: 18px;
  border: 1px solid #d8e0ec;
  border-radius: 18px;
  background: #f9fbff;
  padding: 18px;
}

.detail-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.detail-panel-head p,
.conversation-message-head span {
  color: #64748b;
  line-height: 1.5;
}

.conversation-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.empty-card {
  text-align: center;
  color: #64748b;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #eef2ff;
  color: #1d4ed8;
}

.status {
  position: sticky;
  bottom: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(19, 34, 56, 0.92);
  color: #fff;
  text-align: center;
}

@media (max-width: 900px) {
  .two-col,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .section-head,
  .list-card-head,
  .detail-panel-head,
  .conversation-message-head,
  .tab-bar {
    flex-direction: column;
  }

  .tab-button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 14px;
  }

  .sticky-card {
    position: static;
  }
}
