﻿:root {
  --bg: #f4efe9;
  --panel: #fffdf9;
  --text: #2a221d;
  --muted: #6f645a;
  --line: #ded2c5;
  --brand: #0f766e;
  --brand-2: #115e59;
  --danger: #9f1239;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.container {
  width: min(1080px, 92vw);
  margin: 28px auto 36px;
}

.hero {
  background: linear-gradient(130deg, #f6eee4, #e8f5f4);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.auth-panel {
  width: 100%;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.login-form {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(42, 34, 29, 0.08);
}

.login-form h1 {
  margin: 0;
  font-size: 30px;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-copy span {
  display: block;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.session-actions .status-pill {
  margin-top: 0;
}

.session-actions button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}

.backend-line {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.backend-line button {
  width: auto;
  padding: 8px 10px;
}

.backend-tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.backend-tag.good {
  color: #065f46;
  background: #d1fae5;
}

.backend-tag.bad {
  color: #9f1239;
  background: #ffe4e6;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card h2 {
  margin-top: 0;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.file-label {
  display: block;
  flex: 1;
}

.status-pill {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #374151;
  background: #e5e7eb;
}

.status-pill.good {
  color: #065f46;
  background: #d1fae5;
}

.status-pill.bad {
  color: #9f1239;
  background: #ffe4e6;
}

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

.grid .full {
  grid-column: span 3;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

input,
textarea,
button,
select {
  width: 100%;
  margin-top: 6px;
  font: inherit;
  border-radius: 8px;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  padding: 10px;
  background: #fff;
}

button {
  border: none;
  color: #fff;
  background: var(--brand);
  padding: 10px 12px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-2);
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

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

.toolbar > * {
  flex: 1;
}

.toolbar button {
  flex: 0 0 140px;
}

.primary-action {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.primary-action button {
  flex: 1 1 auto;
  margin-top: 0;
}

.primary-action .status-pill {
  min-width: 180px;
  text-align: center;
}

.status-pill.loading {
  color: #0f766e;
  background: #d7ece9;
}

.status {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.status-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.status-text.good {
  color: #065f46;
}

.rec-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.rec-meta .status {
  margin-bottom: 0;
}

.rec-preview {
  min-height: 20px;
}

.hint {
  color: var(--muted);
  margin: 6px 0 12px;
}

.empty {
  padding: 10px;
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 8px;
}

.question-meta {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #cfe4e1;
  border-radius: 10px;
  background: linear-gradient(180deg, #f7fcfb, #fdfaf5);
}

.question-meta-top {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.question-meta-summary {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.7;
}

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

.question-meta-block {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.question-meta-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f5f4;
  color: var(--brand-2);
  font-size: 13px;
  line-height: 1.4;
}

.chip.chip-muted {
  background: #f1ece5;
  color: var(--muted);
}

.hidden {
  display: none;
}

.question-row-active {
  background: #eef8f7;
}

.table-action-btn {
  width: auto;
  min-width: 92px;
  margin-top: 0;
  padding: 8px 10px;
}

.table-action-btn.is-active {
  background: var(--brand-2);
}

.table-action-btn.danger {
  background: var(--danger);
}

.followup-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfaf6;
}

.followup-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.followup-current {
  flex: 1 1 auto;
  min-width: 0;
}

.followup-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.followup-current strong {
  display: block;
  line-height: 1.6;
}

.followup-top button {
  flex: 0 0 180px;
  margin-top: 0;
}

.followup-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.followup-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.followup-round {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefb;
}

.followup-round-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.followup-round-title {
  font-size: 16px;
  font-weight: 700;
}

.followup-round-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.followup-round-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.followup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.followup-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.followup-section h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.followup-list {
  margin: 0;
  padding-left: 18px;
}

.followup-list li + li {
  margin-top: 8px;
}

.followup-question-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.followup-question-item.is-asked {
  opacity: 0.9;
}

.followup-question-text {
  flex: 1 1 auto;
  line-height: 1.6;
}

.followup-question-text.is-asked {
  color: var(--muted);
}

.followup-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.followup-actions button {
  width: auto;
  min-width: 74px;
  margin-top: 0;
  padding: 7px 10px;
}

.ghost-btn {
  background: #d7ece9;
  color: var(--brand-2);
}

.ghost-btn:hover {
  background: #c5e3df;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #faf6f1;
}

.score {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

#dimensionScores {
  margin: 6px 0 14px;
  padding-left: 18px;
}

.archive-list {
  margin: 0;
  padding-left: 18px;
}

.archive-list li {
  margin-bottom: 6px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.archive-list li span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.5;
}

.admin-user-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.admin-user-actions .table-action-btn {
  width: auto;
  min-width: 72px;
  margin-top: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.inline-form > * {
  margin-top: 0;
}

.inline-form button {
  width: 100%;
}

.warn {
  color: var(--danger);
}

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

  .grid .full {
    grid-column: span 1;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar button {
    flex: 1 1 40%;
  }

  .primary-action {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-action .status-pill {
    min-width: 0;
  }

  .rec-meta {
    align-items: stretch;
  }

  .followup-top {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .followup-top button {
    flex: 1 1 100%;
  }

  .followup-grid {
    grid-template-columns: 1fr;
  }

  .question-meta-grid {
    grid-template-columns: 1fr;
  }

  .followup-round-header {
    flex-direction: column;
  }

  .session-bar,
  .session-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .followup-question-item {
    flex-direction: column;
  }

  .followup-actions {
    width: 100%;
  }

  .backend-line,
  .upload-row {
    flex-wrap: wrap;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }
}
