/* ============ 测评系统样式（多测评版） ============ */
:root {
  --bg: #f7f4ee;
  --card: #ffffff;
  --ink: #2d2a26;
  --ink-soft: #6b655c;
  --line: #e8e2d6;
  --accent: #5e8c6a;
  --accent-deep: #3f6b4d;
  --amber: #d9a04a;
  --red: #c94f4f;
  --blue: #3d6b9e;
  --radius: 16px;
  --shadow: 0 2px 16px rgba(45, 42, 38, 0.08);
  --fs-base: 17px;      /* 正文基准：舒适偏大，适配手机 */
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs-base); }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
}
.screen { display: none; max-width: 720px; margin: 0 auto; padding: 20px 18px 48px; }
.screen.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- 通用组件 ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 24px; margin-bottom: 16px;
}
.btn {
  display: inline-block; border: none; cursor: pointer;
  font-size: 1.02rem; font-weight: 600; font-family: inherit;
  padding: 14px 34px; border-radius: 999px;
  background: var(--accent); color: #fff;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--accent-deep); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: rgba(94, 140, 106, 0.08); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-link {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: 0.85rem; font-family: inherit;
  text-decoration: underline; text-underline-offset: 3px;
}
.section-title {
  font-size: 1.02rem; font-weight: 700; margin: 26px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: var(--accent); display: inline-block;
}
.muted { color: var(--ink-soft); font-size: 0.88rem; }

/* ---- 授权码门禁 ---- */
.gate-wrap { max-width: 480px; margin: 0 auto; padding-top: 8vh; text-align: center; }
.gate-icon { font-size: 3.2rem; }
.gate-wrap h1 { font-size: 1.5rem; margin: 12px 0 4px; }
.gate-sub { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 22px; }
.gate-card { text-align: center; }
.code-input {
  width: 100%; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.5em;
  text-align: center; padding: 14px 10px; margin-bottom: 16px;
  border: 2px solid var(--line); border-radius: 12px;
  color: var(--ink); background: #fbfaf7; outline: none;
  font-family: inherit;
}
.code-input:focus { border-color: var(--accent); background: #fff; }
.code-input::placeholder { font-size: 1rem; letter-spacing: 0; font-weight: 400; color: #b3ac9f; }
.gate-card .btn { width: 100%; }
.gate-error {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: #fdf0f0; border: 1px solid #e8b8b8;
  color: var(--red); font-size: 0.88rem;
}
.gate-saved { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.gate-saved p { font-size: 0.88rem; color: var(--accent-deep); margin-bottom: 10px; }
.gate-card .hint { margin-top: 16px; }

/* ---- 首页测评列表 ---- */
.hero { text-align: center; padding: 40px 0 24px; }
.hero.small { padding: 24px 0 12px; }
.hero .logo { font-size: 3rem; }
.hero h1 { font-size: 1.75rem; letter-spacing: 2px; margin: 10px 0 6px; }
.hero .sub { color: var(--ink-soft); font-size: 0.95rem; }
.test-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--tc, #5e8c6a);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 20px; margin-bottom: 14px; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.test-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(45,42,38,0.13); }
.test-card:active { transform: scale(0.99); }
.test-emoji { font-size: 2.4rem; flex-shrink: 0; }
.test-info { flex: 1; min-width: 0; }
.test-name { font-size: 1.08rem; font-weight: 800; }
.test-tagline { font-size: 0.85rem; color: var(--ink-soft); }
.test-meta { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.test-go { color: var(--tc, #5e8c6a); font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }

/* ---- 答题页 ---- */
.progress-wrap { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 10px 0 12px; }
.progress-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #8fb996); border-radius: 4px; transition: width 0.3s ease; width: 0; }
.progress-text { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-soft); margin-top: 6px; }
.q-card { min-height: 320px; }
.q-num { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 8px; }
.q-text { font-size: 1.3rem; font-weight: 700; line-height: 1.65; margin-bottom: 24px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 14px; padding: 13px 16px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  font-family: inherit; text-align: left; font-size: 1rem; color: var(--ink);
}
.opt:hover { border-color: var(--accent); }
.opt:active { transform: scale(0.99); }
.opt.selected { border-color: var(--accent); background: rgba(94, 140, 106, 0.07); }
.opt .dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: var(--ink-soft);
}
.opt.selected .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt-body { flex: 1; }
.opt-label { font-weight: 700; font-size: 1rem; }
.opt-desc { display: block; font-size: 0.76rem; color: var(--ink-soft); margin-top: 1px; }
.nav-row { display: flex; gap: 12px; margin-top: 18px; }
.nav-row .btn { flex: 1; padding: 13px 0; }
.hint { text-align: center; font-size: 0.75rem; color: var(--ink-soft); margin-top: 12px; }
.notice {
  background: #fbf6ea; border: 1px solid #ecdcb8; border-radius: 12px;
  padding: 14px 16px; font-size: 0.85rem; color: #7a6233; margin: 16px 0;
}
.start-area { text-align: center; padding: 12px 0 6px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.start-area .btn, .start-area .btn.ghost { min-width: 240px; }

/* ---- 报告页 ---- */
.report-head { text-align: center; padding: 26px 0 8px; }
.report-head .date { font-size: 0.8rem; color: var(--ink-soft); }
.report-head h2 { margin-top: 2px; }
.type-card {
  text-align: center; padding: 34px 22px;
  background: linear-gradient(160deg, #ffffff 0%, #f0f5ef 100%);
}
.type-card .emoji { font-size: 3.2rem; line-height: 1; }
.type-card .t-name { font-size: 1.65rem; font-weight: 800; margin: 10px 0 4px; letter-spacing: 1px; }
.type-card .t-tagline { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 16px; }
.type-card .t-desc { text-align: left; font-size: 0.95rem; }
.status-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 18px; font-weight: 700; font-size: 0.92rem;
  padding: 10px; border-radius: 12px;
}
.status-banner.normal { background: rgba(94,156,118,.12); color: #3f6b4d; }
.status-banner.mild { background: rgba(217,160,74,.14); color: #8a6420; }
.status-banner.marked { background: rgba(201,79,79,.1); color: #a03c3c; }
.radar-box { display: flex; justify-content: center; }
.radar-box svg { max-width: 100%; height: auto; }
.legend { display: flex; justify-content: center; gap: 24px; font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.idx-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.idx-cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.idx-cell .v { font-size: 1.45rem; font-weight: 800; }
.idx-cell .k { font-size: 0.8rem; color: var(--ink-soft); }
.idx-cell .note { font-size: 0.72rem; color: var(--ink-soft); }
.factor-row { margin-bottom: 18px; }
.factor-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.factor-head .fname { font-weight: 700; font-size: 0.95rem; }
.factor-head .fscore { font-weight: 800; font-size: 0.95rem; }
.factor-head .fscore small { font-weight: 400; color: var(--ink-soft); font-size: 0.7rem; }
.bar-track { position: relative; height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width 0.8s cubic-bezier(.2,.7,.3,1); width: 0; }
.bar-mark { position: absolute; top: -3px; width: 2px; height: 18px; background: #9a9284; }
.bar-scale { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--ink-soft); margin-top: 3px; }
.factor-analysis { margin-top: 10px; font-size: 0.9rem; }
.factor-analysis .zline { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 4px; }
.theory-box {
  background: #f2f4f9; border-left: 3px solid var(--blue);
  padding: 12px 14px; border-radius: 0 10px 10px 0;
  font-size: 0.85rem; margin-top: 8px;
}
.echo-list { list-style: none; margin: 8px 0; }
.echo-list li { padding: 8px 0 8px 26px; position: relative; font-size: 0.92rem; border-bottom: 1px dashed var(--line); }
.echo-list li::before { content: "✓"; position: absolute; left: 4px; color: var(--accent); font-weight: 800; }
.crisis-box { background: #fdf0f0; border: 1.5px solid #e8b8b8; border-radius: 12px; padding: 18px; margin: 16px 0; }
.crisis-box .hotline { font-size: 1.2rem; font-weight: 800; color: var(--red); margin: 6px 0; }
.share-area { text-align: center; margin: 26px 0 10px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.share-area .btn { width: 100%; max-width: 320px; }
.share-area .btn-link { max-width: 320px; margin-top: 0; }
.footer-note { text-align: center; font-size: 0.75rem; color: var(--ink-soft); padding: 26px 10px 40px; line-height: 1.9; }

/* ---- 长图弹窗 ---- */
#shareModal {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 28, 25, 0.6);
  align-items: center; justify-content: center; padding: 20px;
}
#shareModal.open { display: flex; }
#shareModal .modal-inner { max-width: 380px; width: 100%; max-height: 92vh; overflow-y: auto; text-align: center; }
#shareModal img { max-width: 100%; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.3); display: block; margin: 0 auto 12px; }
#shareModal .btn { width: 100%; max-width: 320px; }
#shareModal .close-btn { margin-top: 10px; }

@media (max-width: 480px) {
  :root { --fs-base: 16.5px; }
  .q-text { font-size: 1.18rem; }
  .gate-wrap { padding-top: 6vh; }
}
