:root {
  --bg: #f6f3ee;
  --paper: #fffdf8;
  --ink: #172033;
  --muted: #667085;
  --line: #ded8cf;
  --navy: #17233f;
  --gold: #b8893b;
  --green: #2f6f55;
  --green-soft: #e8f3ed;
  --gold-soft: #f7eddc;
  --shadow: 0 16px 50px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 8px;
}

.top-note {
  color: var(--muted);
  font-size: 14px;
}

.main {
  width: min(1200px, calc(100vw - 48px));
  margin: 36px auto;
}

.hero-line {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.hero-copy {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 22px;
}

.step {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.step:last-child {
  border-right: 0;
}

.step.active {
  color: var(--ink);
  background: var(--gold-soft);
  font-weight: 700;
}

.assessment {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  gap: 24px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.question-panel {
  padding: 34px;
}

.side-panel {
  padding: 28px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

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

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  background: white;
  color: var(--ink);
  outline: none;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 137, 59, 0.12);
}

.q-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.q-title {
  font-size: 26px;
  line-height: 1.35;
  margin: 0 0 24px;
}

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

.option {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 15px 16px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #b8b0a5;
  border-radius: 50%;
  flex: 0 0 auto;
}

.option.selected {
  border-color: var(--green);
  background: var(--green-soft);
  font-weight: 700;
}

.option.selected::before {
  border-color: var(--green);
  box-shadow: inset 0 0 0 4px var(--green-soft);
  background: var(--green);
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 12px 18px;
  color: var(--ink);
  cursor: pointer;
}

.btn.primary {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.explain-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.side-panel p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 18px;
}

.progress-line {
  height: 8px;
  background: #ede7dc;
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0 26px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 0.25s ease;
}

.privacy {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.result-page {
  max-width: 1120px;
  margin: 36px auto;
  padding: 0 24px 48px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.score-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.score-card strong {
  display: block;
  font-size: 32px;
  margin-top: 8px;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.report-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.report-block.full {
  grid-column: 1 / -1;
}

.report-block h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.report-block ul,
.report-block ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #785823;
  padding: 0 14px;
  font-weight: 700;
}

.admin-shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 32px auto 60px;
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.primary-link {
  color: white;
  background: var(--navy);
  border-radius: 7px;
  padding: 12px 16px;
  text-decoration: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stat span {
  color: var(--muted);
}

.stat strong {
  display: block;
  font-size: 28px;
  margin-top: 6px;
}

.data-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar input {
  width: 320px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

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

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

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: #faf7f0;
}

@media (max-width: 860px) {
  .topbar {
    padding: 0 20px;
  }

  .main {
    width: calc(100vw - 28px);
    margin: 24px auto;
  }

  .hero-line,
  .assessment,
  .result-header,
  .report-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .step {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-grid,
  .score-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .result-page {
    width: calc(100vw - 20px);
    margin: 8px auto 12px;
    padding: 0;
  }

  .result-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .result-header .eyebrow {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .result-header h1 {
    display: grid;
    gap: 2px;
    margin: 0;
    font-size: 18px;
    line-height: 1.18;
  }

  .result-name {
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .type-badge {
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 11px;
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .score-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .score-card {
    padding: 9px 10px;
    min-height: 0;
  }

  .score-card span {
    font-size: 11px;
  }

  .score-card strong {
    margin-top: 2px;
    font-size: 24px;
    line-height: 1;
  }

  .score-card p {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.25;
  }

  .path-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    align-items: baseline;
  }

  .path-card span {
    grid-column: 1;
  }

  .path-card strong {
    grid-column: 2;
    margin: 0;
    font-size: 15px;
    text-align: right;
  }

  .path-card p {
    grid-column: 1 / -1;
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .report-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .report-block {
    padding: 9px 10px;
  }

  .report-block h2 {
    margin-bottom: 5px;
    font-size: 13px;
  }

  .summary-block .hero-copy {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .detail-block {
    display: none;
  }

  .plan-block ol {
    display: grid;
    gap: 3px;
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.25;
  }

  .plan-block li:nth-child(n + 4) {
    display: none;
  }
}

