:root {
  --ink: #1f2933;
  --muted: #697586;
  --line: #d9deea;
  --paper: #fbf8f0;
  --surface: #ffffff;
  --navy: #1f3a5f;
  --navy-dark: #10233d;
  --gold: #c79a2b;
  --green: #28765a;
  --orange: #b86525;
  --red: #a83f3a;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: #0d1525;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

@media (min-width: 560px) {
  body { display: grid; place-items: center; padding: 20px; }
  .app-shell {
    min-height: min(896px, calc(100vh - 40px));
    border: 8px solid #05070a;
    border-radius: 30px;
    box-shadow: 0 32px 90px rgba(0, 0, 0, .45);
  }
}

.screen {
  display: none;
  min-height: inherit;
  height: 100vh;
  max-height: inherit;
  overflow-y: auto;
  padding: 28px 24px;
}
.screen.active { display: block; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 3px;
  margin-bottom: 54px;
}
.brand-mark {
  width: 18px;
  height: 18px;
  background: conic-gradient(from 45deg, var(--gold), var(--navy), var(--gold));
  border-radius: 50%;
}
.hero-block { margin-bottom: 34px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}
h1 {
  margin: 0;
  color: var(--navy-dark);
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: 0;
}
.hero-copy {
  margin: 20px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  line-height: 1.8;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  margin-bottom: 28px;
}
.metric-grid div {
  min-height: 82px;
  display: grid;
  place-items: center;
  align-content: center;
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--line);
}
.metric-grid strong {
  color: var(--navy);
  font-size: 24px;
}
.metric-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.primary-btn, .secondary-btn, .icon-btn {
  border: 0;
  border-radius: 6px;
  min-height: 48px;
}
.primary-btn {
  width: 100%;
  color: #fff;
  background: var(--navy);
  font-weight: 700;
}
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }
.secondary-btn {
  padding: 0 18px;
  color: var(--navy);
  background: transparent;
  border: 1px solid var(--navy);
  font-weight: 700;
}
.secondary-btn.small {
  width: auto;
  min-height: 38px;
  font-size: 13px;
}
.icon-btn {
  width: 42px;
  color: var(--navy);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 28px;
}
.footnote, .disclaimer {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.footnote { margin-top: 16px; text-align: center; }
.quota-notice,
.quota-exhausted {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 13px;
}
.quota-notice {
  color: var(--navy-dark);
  background: #efe7d5;
  border: 1px solid #dfd1b2;
}
.quota-exhausted {
  display: grid;
  gap: 2px;
  color: var(--red);
  background: #fff;
  border: 1px solid rgba(168, 63, 58, .35);
}
.quota-exhausted[hidden] {
  display: none;
}
.quota-exhausted strong {
  font-size: 16px;
}
.quota-exhausted span {
  color: var(--muted);
}

.page-head, .quiz-head, .result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head span, .quiz-head span {
  color: var(--muted);
  font-size: 14px;
}
.quiz-head strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
}

.form-stack {
  display: grid;
  gap: 18px;
}
.form-stack label {
  display: grid;
  gap: 8px;
  color: var(--navy-dark);
  font-weight: 700;
}
.form-stack input, .form-stack select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 14px;
  color: var(--ink);
}
.check-row {
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  font-weight: 500 !important;
  color: var(--muted) !important;
}
.check-row input { min-height: 18px; }
.notice-box {
  margin-top: 24px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, .55);
  padding: 14px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.progress-track {
  height: 8px;
  background: #e7e1d2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}
#progress-fill {
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width .2s ease;
}
.question-panel {
  min-height: 440px;
}
#question-text {
  margin: 0 0 22px;
  color: var(--navy-dark);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.55;
}
.option-list {
  display: grid;
  gap: 12px;
}
.option-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}
.option-btn strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef1f7;
  color: var(--navy);
}
.option-btn.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(199, 154, 43, .15);
}
.option-btn.selected strong {
  color: #fff;
  background: var(--gold);
}
.quiz-actions {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
}

.loading-state {
  min-height: 70vh;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 12px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #e7e1d2;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-screen { padding-bottom: 42px; }
.result-top h2 {
  margin: 0;
  color: var(--navy-dark);
  font-size: 20px;
}
.score-panel {
  position: relative;
  background: var(--navy-dark);
  color: #fff;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}
.score-panel::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(199, 154, 43, .65);
  transform: rotate(24deg);
}
.score-panel span { color: rgba(255, 255, 255, .72); }
.score-panel strong {
  display: inline-block;
  margin-top: 8px;
  font-size: 72px;
  line-height: 1;
}
.score-panel em {
  color: rgba(255, 255, 255, .65);
  font-style: normal;
}
.score-panel p {
  margin: 8px 0 0;
  color: var(--gold);
  font-weight: 800;
}

.dimension-section, .report-section, .cta-section {
  margin-top: 24px;
}
h3 {
  margin: 0 0 14px;
  color: var(--navy-dark);
  font-size: 18px;
}
.radar-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.64));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.radar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.radar-head span {
  color: var(--navy-dark);
  font-weight: 800;
}
.radar-head strong {
  color: var(--gold);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
#radar-chart {
  width: 100%;
  aspect-ratio: 1;
  display: block;
}
.radar-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.radar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.radar-legend i {
  width: 12px;
  height: 7px;
  display: inline-block;
  border-radius: 999px;
}
.legend-fill {
  background: rgba(199, 154, 43, .75);
}
.legend-grid {
  border: 1px solid rgba(31, 58, 95, .35);
}
.dim-item {
  background: rgba(255, 255, 255, .68);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.dim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dim-row strong { color: var(--navy-dark); }
.dim-row span { color: var(--muted); font-size: 13px; }
.bar {
  height: 7px;
  margin-top: 10px;
  background: #e7e1d2;
  border-radius: 999px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--gold);
}
.tag {
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff !important;
  font-size: 12px !important;
}
.tag.strong { background: var(--green); }
.tag.mid { background: var(--orange); }
.tag.weak { background: var(--red); }
.source-pill {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eee7d8;
  color: var(--muted);
  font-size: 12px;
}
.report-part {
  background: rgba(255, 255, 255, .7);
  border-left: 3px solid var(--gold);
  padding: 14px;
  margin-bottom: 12px;
  line-height: 1.75;
}
.report-part h4 {
  margin: 0 0 8px;
  color: var(--navy);
}
.report-part p {
  margin: 0;
  color: var(--ink);
  white-space: pre-line;
}
.cta-section {
  background: #efe7d5;
  padding: 18px;
  border-radius: 8px;
}
.cta-section p {
  color: var(--muted);
  line-height: 1.7;
}
.wechat-card {
  margin-top: 16px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.wechat-card[hidden] {
  display: none;
}
.wechat-card img {
  width: min(100%, 280px);
  height: auto;
  display: block;
}
.wechat-card strong {
  color: var(--navy-dark);
}
.wechat-card span {
  color: var(--muted);
  font-size: 13px;
}
