:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #182126;
  --muted: #60717a;
  --line: #d8e1e5;
  --line-strong: #9fb0b8;
  --primary: #126c63;
  --primary-dark: #0b514b;
  --accent: #c9782d;
  --soft: #eaf2f1;
  --danger: #b23a48;
  --shadow: 0 16px 44px rgba(21, 42, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 18px 16px 32px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.28;
  letter-spacing: 0;
}

.intro-panel,
.survey-panel,
.result-panel,
.question-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-panel,
.result-panel {
  padding: 18px;
}

.intro-panel h2,
.result-panel h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.note-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.note {
  padding: 10px 12px;
  border: 1px solid #f0d6bd;
  border-radius: 8px;
  background: #fff7ed;
  color: #6f421d;
  font-size: 14px;
}

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

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

.field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfcfc;
  color: var(--text);
}

.survey-panel {
  padding: 12px;
}

.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -12px -12px 12px;
  padding: 12px;
  background: rgba(244, 247, 248, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.progress-meta span:first-child {
  color: var(--text);
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #dce7ea;
  border-radius: 999px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 180ms ease;
}

.question-card {
  padding: 14px;
  box-shadow: none;
}

.question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.group-label,
.answered-text {
  color: var(--muted);
  font-size: 13px;
}

.answered-text.done {
  color: var(--primary);
  font-weight: 700;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.metric span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric h2 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.metric p {
  margin-bottom: 0;
  color: #36474f;
  font-size: 14px;
}

.metric-left {
  border-top: 4px solid var(--primary);
}

.metric-right {
  border-top: 4px solid var(--accent);
}

.scale-block {
  margin-top: 16px;
}

.judge-prompt {
  margin-bottom: 10px;
  color: #34454d;
  font-size: 14px;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.direction-option,
.score-option {
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.direction-option.left {
  color: var(--primary-dark);
}

.direction-option.right {
  color: #8a4b12;
}

.direction-option.equal {
  background: var(--soft);
}

.direction-option.selected,
.score-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(18, 108, 99, 0.16);
}

.score-option:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.score-help {
  margin: 8px 0 12px;
}

.text-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.scale-help-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.scale-help-table th,
.scale-help-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
}

.scale-help-table tr:last-child th,
.scale-help-table tr:last-child td {
  border-bottom: 0;
}

.scale-help-table th {
  width: 54px;
  color: var(--primary-dark);
  font-size: 15px;
}

.score-title {
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

.score-option {
  color: var(--primary-dark);
  font-size: 18px;
}

.nav-row,
.result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.result-actions {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.submit-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.submit-status.ok {
  color: var(--primary);
  font-weight: 700;
}

.submit-status.error {
  color: var(--danger);
  font-weight: 700;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
}

.ghost-btn {
  min-height: 38px;
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px 10px 28px;
  }

  .topbar {
    align-items: center;
  }

  h1 {
    font-size: 19px;
  }

  .info-grid,
  .compare-grid,
  .nav-row,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 0;
  }

  .direction-grid,
  .score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .direction-option,
  .score-option {
    min-height: 54px;
  }
}
