:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --ink: #17211f;
  --muted: #64726f;
  --subtle: #8b9894;
  --line: #d9e2df;
  --accent: #16766c;
  --accent-strong: #0f5f58;
  --blue: #315d91;
  --amber: #b76825;
  --danger: #a6403f;
  --danger-soft: #f7e7e4;
  --shadow: 0 18px 48px rgba(21, 33, 31, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(238, 244, 242, 0.9), rgba(246, 248, 247, 0.25) 360px),
    var(--bg);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 22px;
}

.brand {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-panel,
.main-panel,
.result-panel,
.loading-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.side-panel {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.main-panel,
.result-panel,
.loading-panel {
  padding: 24px;
}

.loading-panel {
  margin-top: 16vh;
}

.mode-grid {
  display: grid;
  gap: 12px;
}

.mode-button,
.option-button,
.utility-button,
.primary-button,
.ghost-button,
.text-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.mode-button:hover,
.option-button:hover,
.utility-button:hover,
.primary-button:hover,
.ghost-button:hover,
.text-button:hover {
  border-color: rgba(22, 118, 108, 0.45);
  box-shadow: 0 8px 22px rgba(21, 33, 31, 0.07);
}

.mode-button {
  width: 100%;
  padding: 16px;
  text-align: left;
}

.mode-button strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 16px;
}

.mode-button span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mode-button.active {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.mode-pill,
.tag,
.mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--accent-strong);
  background: #e3efed;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.mini-pill.blue {
  color: #244e7c;
  background: #e7eef6;
}

.mini-pill.amber {
  color: #854d18;
  background: #f5eadf;
}

.mini-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.stat-list,
.dimension-note,
.meta-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-list li,
.dimension-note li,
.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stat-list strong,
.meta-list strong {
  color: var(--ink);
}

.dimension-note li {
  display: block;
}

.dimension-note strong {
  color: var(--ink);
}

.progress-block {
  margin-bottom: 22px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.question-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.question-context {
  color: var(--muted);
  font-size: 14px;
}

.question-title {
  margin-bottom: 22px;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.35;
  letter-spacing: 0;
}

.options {
  display: grid;
  gap: 12px;
}

.option-button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 15px;
  text-align: left;
}

.option-button.selected {
  border-color: var(--accent);
  background: #edf7f5;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--surface);
  font-weight: 780;
}

.option-button.selected .option-letter {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.option-text {
  padding-top: 5px;
  line-height: 1.55;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.nav-row > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.utility-button,
.text-button {
  min-height: 42px;
  padding: 10px 15px;
  font-weight: 720;
}

.primary-button {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.ghost-button {
  background: transparent;
}

.text-button {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.utility-button {
  background: var(--surface);
}

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

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.type-name {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.type-summary {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.risk-meter {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-soft);
}

.risk-meter strong {
  display: block;
  margin-bottom: 4px;
  font-size: 34px;
  line-height: 1;
}

.risk-meter span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  margin-top: 22px;
}

.section-block {
  margin-top: 24px;
}

.section-block:first-child {
  margin-top: 0;
}

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

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.scores {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  gap: 7px;
}

.score-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.score-label strong {
  color: var(--ink);
}

.score-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e2e8e6;
}

.score-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.score-fill.hot {
  background: var(--amber);
}

.score-fill.risk {
  background: var(--danger);
}

.topic-list,
.blind-list,
.review-list,
.notice-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-item,
.blind-list li,
.review-item,
.notice-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface);
}

.topic-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.topic-item strong,
.review-item strong {
  display: block;
  margin-bottom: 5px;
}

.topic-item span,
.blind-list li,
.review-item p,
.notice-list li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.review-item p {
  margin-bottom: 8px;
}

.review-choice {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.copy-status {
  min-height: 20px;
  color: var(--accent-strong);
  font-size: 13px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 22px, 720px);
    padding-top: 14px;
  }

  .topbar,
  .layout,
  .result-grid,
  .result-hero {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .side-panel {
    position: static;
  }

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

@media (max-width: 560px) {
  .app-shell {
    width: 100%;
    padding: 0 0 28px;
  }

  .topbar {
    padding: 18px 14px;
  }

  .layout,
  .result-panel,
  .main-panel,
  .side-panel {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .layout {
    gap: 0;
  }

  .option-button {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 13px;
  }

  .option-letter {
    width: 30px;
    height: 30px;
  }

  .nav-row {
    display: grid;
  }

  .nav-row > div,
  .primary-button,
  .ghost-button,
  .utility-button {
    width: 100%;
  }
}
