:root {
  --bg: #0e0f13;
  --bg-elev: #181a22;
  --fg: #e9eaf0;
  --fg-dim: #9aa0b0;
  --line: #2a2d39;
  --accent: #ffb84a;
  --accent-2: #ff5d8f;
  --ok: #4ade80;
  --bad: #f87171;
  --radius: 14px;
  --max-w: 760px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

main#root {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 18px 80px;
  min-height: calc(100vh - 60px);
}

.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
  padding: 18px 12px 28px;
  border-top: 1px solid var(--line);
}

/* loading */
.loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 120px 0 60px; color: var(--fg-dim);
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
  margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* shared */
h1.title { font-size: 32px; margin: 0 0 8px; letter-spacing: 1px; }
h2 { font-size: 22px; margin: 28px 0 12px; }
h3 { font-size: 17px; margin: 18px 0 8px; }
p  { line-height: 1.7; color: var(--fg); }
.subtitle { color: var(--fg-dim); margin-bottom: 28px; line-height: 1.7; }

button {
  font: inherit; cursor: pointer; border-radius: 10px;
  padding: 12px 18px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--fg);
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
button:hover { background: #20232c; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: not-allowed; }

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #1a1206; font-weight: 600;
}
button.primary:hover { filter: brightness(1.07); }
button.ghost { background: transparent; }

/* intro */
.intro-card {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px; margin-bottom: 18px;
}
.intro-card h3 { margin: 0 0 10px; }

.option-row { display: flex; flex-wrap: wrap; gap: 10px; }
.option-row .opt {
  flex: 1 1 calc(50% - 10px);
  min-width: 120px;
  padding: 12px;
  background: #1f222b; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
  transition: all .12s ease;
}
.option-row .opt:hover { border-color: var(--accent); }
.option-row .opt.selected {
  background: linear-gradient(135deg, rgba(255,184,74,0.15), rgba(255,93,143,0.15));
  border-color: var(--accent);
}
.option-row .opt strong { display: block; color: var(--accent); margin-bottom: 4px; font-size: 13px; }
.option-row .opt small { color: var(--fg-dim); font-size: 12px; line-height: 1.5; display: block; }

.count-row { display: flex; gap: 8px; }
.count-row .opt { flex: 1; text-align: center; }

.start-btn-row { margin-top: 28px; }
.start-btn-row button { width: 100%; padding: 16px; font-size: 16px; }

.hint { color: var(--fg-dim); font-size: 13px; margin-top: 10px; }

/* test */
.progress-wrap { position: sticky; top: 0; background: var(--bg);
  padding: 12px 0; z-index: 10; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.progress-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s ease; width: 0; }
.progress-text { display: flex; justify-content: space-between; font-size: 12px; color: var(--fg-dim); margin-top: 6px; }

.q-card {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px;
}
.q-card.is-hidden { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255,184,74,0.2); }
.q-card .q-text { margin: 0 0 14px; line-height: 1.7; font-size: 15px; }
.q-card .q-meta { font-size: 11px; color: var(--fg-dim); margin-bottom: 8px; letter-spacing: 1px; }
.q-card .q-meta .badge { display: inline-block; background: var(--line); padding: 2px 8px; border-radius: 4px; margin-right: 6px; }
.q-card .q-meta .badge.hidden { background: var(--accent); color: #1a1206; }

.q-options label {
  display: block; padding: 12px 14px; margin-bottom: 8px;
  background: #1f222b; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: all .12s ease; line-height: 1.5;
}
.q-options label:hover { border-color: var(--accent); }
.q-options input[type=radio] { display: none; }
.q-options input[type=radio]:checked + span {
  color: var(--accent); font-weight: 600;
}
.q-options label:has(input:checked) {
  background: linear-gradient(135deg, rgba(255,184,74,0.13), rgba(255,93,143,0.13));
  border-color: var(--accent);
}

.test-bottom { display: flex; gap: 10px; margin-top: 24px; }
.test-bottom button { flex: 1; padding: 14px; }

/* result */
.result-hero {
  background: linear-gradient(135deg, var(--bg-elev), #20212a);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; margin-bottom: 18px; text-align: center;
  position: relative; overflow: hidden;
}
.result-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,184,74,0.15), transparent 60%);
  pointer-events: none;
}
.result-hero .emoji { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.result-hero .code { font-size: 32px; font-weight: 700; letter-spacing: 2px; margin: 0; }
.result-hero .cn { font-size: 18px; color: var(--fg-dim); margin: 4px 0 14px; }
.result-hero .intro { font-size: 14px; font-style: italic; color: var(--accent); margin-bottom: 12px; }
.result-hero .tagline { font-size: 13px; color: var(--fg-dim); }

.section {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px;
}
.section h2 { margin-top: 0; font-size: 18px; }
.section .body { line-height: 1.85; white-space: pre-wrap; }

.models-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.model-card {
  background: #1f222b; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px;
}
.model-card .label { font-size: 12px; color: var(--accent); margin-bottom: 6px; letter-spacing: 1px; }
.model-card .text { font-size: 13px; line-height: 1.6; color: var(--fg); }

.defining-list .def-item {
  border-left: 3px solid var(--accent); padding: 8px 12px; margin-bottom: 12px;
  background: #1f222b; border-radius: 6px;
}
.defining-list .def-item .q { font-size: 13px; color: var(--fg-dim); margin-bottom: 4px; }
.defining-list .def-item .a { font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.defining-list .def-item .why { font-size: 13px; line-height: 1.6; }

.similar-list { display: grid; gap: 12px; }
.similar-card {
  background: #1f222b; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px;
}
.similar-card .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.similar-card .top .name { font-weight: 600; }
.similar-card .top .sim { color: var(--accent); font-size: 13px; }
.similar-card .row { font-size: 13px; line-height: 1.6; margin-bottom: 4px; }
.similar-card .row strong { color: var(--fg-dim); margin-right: 6px; }

.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.share-row button { flex: 1 1 140px; }
.share-link {
  margin-top: 12px; padding: 10px; background: #1f222b;
  border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--accent); word-break: break-all;
}

/* radar */
svg.radar { width: 100%; max-width: 480px; height: auto; display: block; margin: 0 auto; }
svg.radar .grid { fill: none; stroke: var(--line); stroke-width: 1; }
svg.radar .axis { stroke: var(--line); stroke-width: 1; }
svg.radar .label { fill: var(--fg-dim); font-size: 10px; text-anchor: middle; dominant-baseline: middle; }
svg.radar .user-poly { fill: rgba(255,184,74,0.25); stroke: var(--accent); stroke-width: 1.5; }
svg.radar .user-dot { fill: var(--accent); }

/* error */
.err { background: rgba(248,113,113,0.1); border: 1px solid var(--bad);
  color: var(--bad); padding: 12px; border-radius: 8px; }

/* small screens */
@media (max-width: 480px) {
  h1.title { font-size: 26px; }
  .option-row .opt { flex: 1 1 100%; }
}
