:root {
  --bg: #f6faf6;
  --panel: #fff;
  --text: #1e2a22;
  --muted: #6a786f;
  --line: #dbe8dd;
  --soft: #edf6ef;
  --accent: #6c8d71;
  --accent-strong: #4d6a53;
  --shadow: 0 16px 40px #2f493714;
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  color: var(--text);
  background: radial-gradient(circle at 0 0, #f8fff8 0, #f6faf6 36%, #f2f7f3 100%);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

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

/* ── intro ── */
.hero {
  margin-top: 20px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  pointer-events: none;
  background: linear-gradient(#7fa5862e, #7fa58605);
  border-radius: 50%;
  width: 180px;
  height: 180px;
  position: absolute;
  top: -60px;
  right: -60px;
}

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

.hero h1 {
  letter-spacing: -0.03em;
  max-width: 680px;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.08;
}

.hero-minimal {
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 48vh;
  padding: 42px 20px;
  display: flex;
}

.hero-minimal::after { display: none; }
.hero-minimal h1 { max-width: none; margin: 0; }

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  display: flex;
}

.hero-actions-single { justify-content: center; margin-top: 28px; }

.intro-disclaimer {
  color: var(--muted);
  opacity: 0.75;
  max-width: 320px;
  margin-top: 20px;
  font-size: 10px;
  line-height: 1.7;
}

.intro-author {
  color: var(--muted);
  opacity: 0.7;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
}

.intro-author a {
  color: inherit;
  text-decoration: underline;
}

/* ── buttons ── */
button {
  cursor: pointer;
  font: inherit;
  border: 0;
  transition: transform 0.16s, box-shadow 0.16s, opacity 0.16s;
}

button:hover { transform: translateY(-1px); }

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 700;
  box-shadow: 0 12px 30px #4d6a532e;
}

.btn-secondary {
  color: var(--accent-strong);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 700;
}

/* ── screens ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── test ── */
.test-wrap, .result-wrap {
  margin-top: 22px;
  padding: 22px;
}

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

.progress {
  background: #edf3ee;
  border-radius: 999px;
  flex: 1;
  min-width: 240px;
  height: 10px;
  position: relative;
  overflow: hidden;
}

.progress > span {
  border-radius: inherit;
  background: linear-gradient(90deg, #97b59c, #5b7a62);
  width: 0;
  height: 100%;
  transition: width 0.22s;
  display: block;
}

.progress-text {
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}

.question-list {
  gap: 16px;
  display: grid;
}

.question {
  border: 1px solid var(--line);
  background: linear-gradient(#fff, #fbfdfb);
  border-radius: 18px;
  padding: 18px;
}

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

.badge {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  display: inline-flex;
}

.question-title {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.7;
}

.options {
  gap: 10px;
  margin-top: 14px;
  display: grid;
}

.option {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
  display: flex;
  cursor: pointer;
}

.option:hover {
  background: #f8fcf9;
  border-color: #bcd0c1;
}

.option input {
  accent-color: var(--accent-strong);
  flex-shrink: 0;
  margin-top: 3px;
  transform: scale(1.1);
}

.option-code {
  color: var(--accent-strong);
  min-width: 22px;
  font-weight: 800;
}

.actions-bottom {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 6px;
  display: flex;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ── result ── */
.result-layout {
  gap: 18px;
  display: grid;
}

.result-top {
  grid-template-columns: 0.9fr auto 1.1fr;
  align-items: stretch;
  gap: 18px;
  display: grid;
}

.poster-box,
.type-box,
.analysis-box,
.dim-box,
.note-box {
  border: 1px solid var(--line);
  background: linear-gradient(#fff, #fbfdfb);
  border-radius: 18px;
  padding: 18px;
}

.poster-box {
  background: radial-gradient(circle at 100% 0, #7fa58629, #7fa58600 40%),
    linear-gradient(#fff, #f7fbf8);
  grid-template-rows: 1fr auto;
  min-height: 280px;
  display: grid;
  position: relative;
  overflow: hidden;
}

.poster-box::after {
  content: "";
  pointer-events: none;
  background: linear-gradient(#7fa5861f, #7fa58603);
  border-radius: 50%;
  width: 140px;
  height: 140px;
  position: absolute;
  bottom: -46px;
  right: -46px;
}

.poster-image {
  object-fit: contain;
  z-index: 1;
  background: #ffffffbf;
  border-radius: 18px;
  width: 100%;
  min-height: 220px;
  max-height: 460px;
  position: relative;
}

.poster-box.no-image .poster-image { display: none; }

.poster-qr-wrap {
  z-index: 2;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  display: flex;
  position: absolute;
  bottom: 0;
  right: 6px;
}

.poster-qr {
  border-radius: 4px;
  width: 50px;
  height: 50px;
  display: block;
}

.poster-qr-label {
  color: var(--muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-size: 9px;
}

.poster-caption {
  color: var(--muted);
  z-index: 1;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  position: relative;
}

.poster-search-tip {
  color: var(--muted);
  opacity: 0.7;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  letter-spacing: 0.05em;
  align-self: center;
  font-size: 10px;
}

.type-kicker {
  color: var(--accent-strong);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  font-size: 12px;
}

.type-name {
  letter-spacing: -0.03em;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
}

.type-subname {
  color: var(--muted);
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.8;
}

.match {
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  display: inline-flex;
}

.analysis-box h3,
.dim-box h3,
.note-box h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.analysis-box p {
  color: #304034;
  white-space: pre-wrap;
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
}

.dim-list {
  gap: 12px;
  display: grid;
}

.dim-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
}

.dim-item-top {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  display: flex;
}

.dim-item-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.dim-item-score {
  color: var(--accent-strong);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.dim-item p,
.note-box p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

.author-box {
  border: 1px solid var(--line);
  background: linear-gradient(#fff, #fbfdfb);
  border-radius: 18px;
  overflow: hidden;
}

.author-box summary {
  cursor: pointer;
  color: var(--text);
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px;
  font-size: 16px;
  font-weight: 700;
  list-style: none;
  display: flex;
}

.author-box summary::-webkit-details-marker { display: none; }

.author-box summary::after {
  content: "展开";
  color: var(--accent-strong);
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 999px;
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.author-box[open] summary::after { content: "收起"; }

.author-content {
  border-top: 1px solid var(--line);
  padding: 0 18px 18px;
}

.author-content p {
  color: #304034;
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.9;
}

.result-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  display: flex;
}

/* ── responsive ── */
@media (max-width: 860px) {
  .result-top {
    grid-template-columns: 1fr;
  }
  .poster-search-tip {
    writing-mode: horizontal-tb;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 14px 12px 42px;
  }
  .hero, .test-wrap, .result-wrap {
    padding: 16px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .question-title {
    font-size: 15px;
  }
}

