:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #333333;
  --muted: #999999;
  --line: #e4e7ed;
  --soft: #f5f7fa;
  --accent: #20a53a;
  --accent-strong: #1a8c31;
  --gold: #e6a23c;
  --gold-soft: #fdf6ec;
  --green: #20a53a;
  --red: #f56c6c;
  --yellow: #e6a23c;
  --purple: #9055ff;
  --cyan: #409eff;
  --shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.08);
  --radius: 0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: var(--text);
  min-height: 100vh;
}
.shell { max-width: 1000px; margin: 0 auto; padding: 24px 16px 56px; }
.site-footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.footer-bt-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.footer-bt-link:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-bt-icon { width: 16px; height: 16px; vertical-align: middle; border-radius: 3px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero {
  padding: 28px; margin-top: 20px; overflow: hidden; position: relative;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(32, 165, 58, 0.12), rgba(32, 165, 58, 0.02));
  pointer-events: none;
}
h1, h2, h3, p { margin: 0; }
.hero h1 {
  font-size: clamp(28px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.03em;
  max-width: 680px;
  background: linear-gradient(135deg, var(--accent-strong), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-minimal {
  min-height: 48vh; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start; text-align: left; padding: 42px 20px;
}
.hero-minimal::after { display: none; }
.hero-minimal h1 { max-width: none; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-actions-single { justify-content: flex-start; margin-top: 28px; }
.hero-subtitle { font-size: 16px; color: #666666; margin-top: 12px; line-height: 1.7; }
.hero-info {
  margin-top: 18px; font-size: 13px; color: var(--muted);
  display: flex; flex-direction: column; gap: 4px;
}
.disclaimer-box {
  margin-top: 24px; width: 100%;
}
.disclaimer-scroll {
  max-height: 220px; overflow-y: auto; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--soft); margin-bottom: 14px;
  scroll-behavior: smooth;
}
.disclaimer-scroll h3 {
  font-size: 15px; margin-bottom: 12px; color: var(--accent);
}
.disclaimer-scroll p {
  margin: 10px 0; font-size: 13px; line-height: 1.8; color: #666666;
}
.disclaimer-scroll p strong {
  color: var(--text); font-weight: 700;
}
.disclaimer-end-mark {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
  text-align: center; font-size: 12px; color: var(--muted); font-style: italic;
}
.disclaimer-scroll::-webkit-scrollbar {
  width: 6px;
}
.disclaimer-scroll::-webkit-scrollbar-track {
  background: var(--panel); border-radius: 999px;
}
.disclaimer-scroll::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 999px;
}
.disclaimer-scroll::-webkit-scrollbar-thumb:hover {
  background: #c0c4cc;
}
.agree-checkbox {
  display: flex; align-items: flex-start; gap: 10px; cursor: not-allowed;
  font-size: 13px; color: #666666; line-height: 1.6;
  opacity: 0.5; transition: opacity .2s ease;
  position: relative;
}
.agree-checkbox.active {
  opacity: 1; cursor: pointer;
}
.agree-checkbox input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border: 2px solid var(--line);
  border-radius: var(--radius); margin-top: 2px; flex-shrink: 0;
  cursor: inherit; position: relative; transition: all .2s ease;
}
.agree-checkbox input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.agree-checkbox input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.agree-checkbox::after {
  content: ''; position: absolute; inset: 0; cursor: not-allowed;
}
.agree-checkbox.active::after {
  display: none;
}
.agree-checkbox.active input[type="checkbox"] {
  cursor: pointer;
}
.agree-checkbox.active input[type="checkbox"]:hover {
  border-color: var(--accent);
}
.disclaimer-note {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
  background: #fdf6ec;
}
.disclaimer-note p {
  margin: 0; font-size: 12px; line-height: 1.8; color: #666666;
}
.disclaimer-note p strong {
  color: var(--yellow); font-weight: 700;
}
.scroll-hint {
  margin-top: 10px; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  transition: opacity .3s ease;
}
.scroll-hint-icon { font-size: 14px; }
.scroll-hint.hidden { opacity: 0; pointer-events: none; }
.scroll-hint-error {
  margin-top: 8px; font-size: 12px; color: var(--red);
  display: flex; align-items: center; gap: 6px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.scroll-hint-error.show { opacity: 1; pointer-events: auto; }
.scroll-hint-error-icon { font-size: 14px; }
.agree-checkbox.disabled-flash {
  animation: flashRed 0.6s ease;
}
@keyframes flashRed {
  0% { color: var(--red); }
  50% { color: var(--red); }
  100% { color: var(--muted); }
}
button {
  border: 0; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
  font: inherit;
}
button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2bc448);
  color: #fff; padding: 14px 24px; border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(32, 165, 58, 0.25); font-weight: 700; font-size: 16px;
}
.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(32, 165, 58, 0.35);
}
.btn-secondary {
  background: var(--panel); color: var(--accent); padding: 14px 20px;
  border-radius: var(--radius); border: 1px solid var(--line); font-weight: 700;
}
.screen { display: none; }
.screen.active { display: block; }
.test-wrap, .result-wrap { margin-top: 22px; padding: 22px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.progress {
  flex: 1; min-width: 240px; height: 10px;
  background: var(--soft); border-radius: var(--radius); overflow: hidden;
}
.progress > span {
  display: block; width: 0; height: 100%;
  background: linear-gradient(90deg, var(--accent), #2bc448);
  border-radius: inherit; transition: width .22s ease;
}
.progress-text { color: var(--muted); font-size: 13px; white-space: nowrap; }
.question-list { display: grid; gap: 16px; }
.question {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  background: var(--panel);
}
.question:hover {
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.12);
}
.question-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 12px;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius); padding: 6px 10px;
  background: var(--soft); border: 1px solid var(--line);
}
.question-title { font-size: 16px; line-height: 1.7; white-space: pre-wrap; }
.options { display: grid; gap: 10px; margin-top: 14px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
  transition: border-color .16s ease, background .16s ease; cursor: pointer;
}
.option:hover { border-color: var(--accent); background: #f0f9f1; }
.option input { margin-top: 3px; accent-color: var(--accent); transform: scale(1.1); flex-shrink: 0; }
.option-code { font-weight: 800; color: var(--accent); min-width: 22px; }
.actions-bottom {
  display: flex; justify-content: flex-start; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 6px;
}
.hint { color: var(--muted); font-size: 13px; line-height: 1.7; }
.result-layout { display: grid; gap: 18px; }
.result-top { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.type-box, .analysis-box, .dim-box, .note-box {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  background: var(--panel);
}
.type-kicker { font-size: 12px; color: var(--accent); margin-bottom: 8px; letter-spacing: .06em; }
.type-name { font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.03em; }
.type-subname { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.match {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--radius); padding: 10px 14px; background: var(--soft);
  border: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: 14px;
}
.poster-box {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  min-height: 320px;
}
.poster-img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; border-radius: var(--radius);
  filter: contrast(1.08) saturate(1.1);
  transition: transform 0.4s ease;
}
.poster-box:hover .poster-img { transform: scale(1.03); }
.poster-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 18px;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  border-radius: var(--radius);
  text-align: left;
}
.poster-element {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius); padding: 6px 14px;
  color: #fff; font-size: 14px; font-weight: 700;
}
.poster-element-icon { font-size: 18px; }
.analysis-box h3, .dim-box h3, .note-box h3 { font-size: 16px; margin-bottom: 12px; }
.analysis-box p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.9; white-space: pre-wrap; }
.dim-list { display: grid; gap: 12px; }
.dim-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel); }
.dim-item-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}
.dim-item-name { font-size: 14px; font-weight: 700; color: var(--text); }
.dim-item-score { color: var(--accent); font-weight: 800; font-size: 14px; white-space: nowrap; }
.dim-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.note-box p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.result-actions {
  display: flex; justify-content: flex-start; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-top: 22px;
}
details.author-box {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
}
.author-box summary {
  list-style: none; cursor: pointer; padding: 18px; font-size: 16px;
  font-weight: 700; color: var(--text); display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.author-box summary::-webkit-details-marker { display: none; }
.author-box summary::after {
  content: '展开'; font-size: 12px; font-weight: 700; color: var(--accent);
  border: 1px solid var(--line); background: var(--soft);
  padding: 6px 10px; border-radius: var(--radius); flex-shrink: 0;
}
.author-box[open] summary::after { content: '收起'; }
.author-content { border-top: 1px solid var(--line); padding: 0 18px 18px; }
.author-content p { margin: 14px 0 0; color: var(--text); font-size: 14px; line-height: 1.9; }
@media (max-width: 860px) { .result-top { grid-template-columns: 1fr; } }
@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; }
}

/* ── Share Poster ─────────────────────────────────────────────────────────── */
.btn-share {
  background: linear-gradient(135deg, #1a6fd4, #409eff);
  color: #fff; padding: 14px 24px; border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.28); font-weight: 700; font-size: 16px;
  border: 0; cursor: pointer;
}
.btn-share:hover { box-shadow: 0 6px 16px rgba(64, 158, 255, 0.4); transform: translateY(-1px); }
.poster-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85); z-index: 9999;
  align-items: center; justify-content: center; padding: 20px;
}
.poster-modal.active { display: flex; }
.poster-modal-inner {
  background: #1a1f2b; border-radius: 12px; padding: 20px;
  max-width: 420px; width: 100%; max-height: 92vh;
  overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.poster-modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.poster-modal-tip {
  font-size: 13px; color: rgba(255,255,255,0.5);
}
.poster-modal-inner .btn-secondary {
  background: transparent; color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2); padding: 8px 16px; font-size: 14px;
}
#shareCanvas {
  width: 100%; height: auto; border-radius: 8px; display: block;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.poster-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 48px 0; color: rgba(255,255,255,0.6); font-size: 15px;
}
.poster-loading-spinner {
  width: 24px; height: 24px; border: 3px solid rgba(32,165,58,0.3);
  border-top-color: #20a53a; border-radius: 50%;
  animation: posterSpin 0.8s linear infinite;
}
@keyframes posterSpin { to { transform: rotate(360deg); } }
.poster-modal-actions { display: flex; gap: 10px; }
.poster-modal-inner .btn-primary {
  box-shadow: 0 4px 12px rgba(32,165,58,0.3);
}
