/* ============================================================
   睡愈力 · AI 睡眠测评 — 页面视觉
   月夜暖金暗夜风（tokens 见 site.css）
   签名元素：月相进度（新月 → 满月，随答题圆满）
   ============================================================ */

[x-cloak] { display: none !important; }

:root { --weak: #c77e52; } /* 陶土色：薄弱维度警示，暖色系内、暗底可读 */

.st { position: relative; z-index: 1; }
.st-intro, .st-quiz, .st-result__inner {
  width: min(640px, 100% - 32px);
  margin: 0 auto;
}

/* ============================================================
   屏 1 · 开场
   ============================================================ */
.st-intro {
  padding: calc(var(--nav-h) + 84px) 0 110px;
  text-align: center;
}
.st-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: var(--radius-full);
  border: 1px solid rgba(196,162,101,0.2);
  font-size: 12px; font-weight: 500; color: var(--gold-dim);
  letter-spacing: 0.14em; background: rgba(196,162,101,0.05);
}
.st-intro__title {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 52px); font-weight: 600;
  line-height: 1.3; letter-spacing: 0.04em;
  margin: 26px 0 18px;
}
.st-intro__title em { font-style: normal; color: var(--gold); }
.st-intro__sub {
  font-size: 15px; color: var(--text-muted); line-height: 1.9;
}
.st-intro__dims {
  display: flex; flex-wrap: wrap; justify-content: center;
  margin: 34px 0 42px;
  font-size: 13px; color: var(--text-dim); letter-spacing: 0.06em;
}
.st-intro__dims li { display: flex; align-items: center; }
.st-intro__dims li + li::before {
  content: '·'; margin: 0 14px; color: var(--gold-dim);
}
.st-intro__cta { padding: 14px 44px; font-size: 16px; }
.st-intro__note,
.st-result__note {
  margin-top: 30px; font-size: 12px; color: var(--text-dim); text-align: center;
}

/* ============================================================
   屏 2 · 逐题作答
   ============================================================ */
.st-quiz { padding: calc(var(--nav-h) + 52px) 0 110px; }

/* — 月相进度 — */
.st-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 46px; }
.st-moon {
  position: relative; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, var(--gold-pale), var(--gold) 74%);
  box-shadow: 0 0 0 1px rgba(196,162,101,0.3), 0 0 14px rgba(196,162,101,0.28);
  overflow: hidden;
}
/* 夜色遮罩：从完全遮蔽（新月）滑出（满月） */
.st-moon::after {
  content: ''; position: absolute; top: -3%; left: -3%;
  width: 118%; height: 118%; border-radius: 50%;
  background: #0d0f15;
  transform: translateX(var(--shadowx, 0%));
  transition: transform 0.8s var(--ease);
}
.st-progress__track {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.st-progress__bar {
  height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width 0.5s var(--ease);
}
.st-progress__txt {
  font-family: var(--font-display); font-size: 13px;
  color: var(--text-muted); letter-spacing: 0.12em; white-space: nowrap;
}

/* — 题卡 — */
.st-q__dim {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.14em; color: var(--gold-dim);
  margin-bottom: 16px;
}
.st-q__dim::before { content: ''; width: 22px; height: 1px; background: var(--gold-dim); }
.st-q__title {
  font-family: var(--font-display);
  font-size: clamp(23px, 4vw, 32px); font-weight: 600;
  line-height: 1.45; letter-spacing: 0.02em;
  margin-bottom: 36px; outline: none;
}
.st-q__opts { display: flex; flex-direction: column; gap: 12px; }
.st-opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 56px; padding: 14px 20px;
  text-align: left; font-size: 15.5px; line-height: 1.6; color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: border-color 0.12s, background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.st-opt:hover {
  border-color: var(--gold-dim);
  background: rgba(196,162,101,0.04);
  transform: translateY(-1px);
}
.st-opt:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.st-opt__dot {
  position: relative; flex-shrink: 0;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  transition: border-color 0.12s;
}
.st-opt__dot::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--gold);
  transform: scale(0); transition: transform 0.15s var(--ease);
}
.st-opt--on {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(196,162,101,0.1), rgba(196,162,101,0.04));
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.st-opt--on .st-opt__dot { border-color: var(--gold); }
.st-opt--on .st-opt__dot::after { transform: scale(1); }

.st-q__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 30px;
}
.st-q__back {
  font-size: 13px; color: var(--text-muted); padding: 8px 4px;
  transition: color 0.2s;
}
.st-q__back:hover:not(:disabled) { color: var(--gold-pale); }
.st-q__back:disabled { opacity: 0.3; cursor: default; }
.st-q__hint { font-size: 12px; color: var(--text-dim); }

/* ============================================================
   屏 3 · 结果页
   ============================================================ */
.st-result { padding: calc(var(--nav-h) + 60px) 0 110px; }

/* — 总分 — */
.st-score {
  text-align: center;
  padding-bottom: 44px; margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
}
.st-score__row {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; margin-top: 22px;
}
.st-score__num {
  font-family: var(--font-display);
  font-size: clamp(72px, 14vw, 104px); font-weight: 500;
  line-height: 1; color: var(--gold-pale);
  text-shadow: 0 0 40px rgba(196,162,101,0.25);
}
.st-score__num::after {
  content: '/ 100';
  font-family: var(--font-body); font-size: 16px;
  color: var(--text-dim); margin-left: 12px; text-shadow: none;
}
.st-score__grade {
  padding: 7px 20px; border: 1px solid var(--gold); border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600; letter-spacing: 0.08em; color: var(--gold);
  background: rgba(196,162,101,0.06); white-space: nowrap;
}
.st-score__desc {
  max-width: 480px; margin: 24px auto 0;
  font-size: 15px; color: var(--text-muted); line-height: 1.9;
}

/* — 五维度条形图 — */
.st-dims { display: flex; flex-direction: column; gap: 26px; margin-bottom: 48px; }
.st-dim__hd { display: flex; justify-content: space-between; align-items: baseline; }
.st-dim__name { font-size: 14px; font-weight: 500; }
.st-dim--weak .st-dim__name::after {
  content: '· 待加强'; margin-left: 8px;
  font-size: 12px; font-weight: 400; color: var(--weak);
}
.st-dim__val { font-family: Georgia, serif; font-size: 13px; color: var(--text-muted); }
.st-dim--weak .st-dim__val { color: var(--weak); }
.st-dim__track {
  height: 6px; margin: 9px 0 10px; border-radius: 3px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.st-dim__fill {
  height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width 1.1s var(--ease);
}
.st-dim--weak .st-dim__fill { background: linear-gradient(90deg, #96522f, var(--weak)); }
/* 阶梯延迟：五条 bar 依次生长 */
.st-dim:nth-child(1) .st-dim__fill { transition-delay: 0.20s; }
.st-dim:nth-child(2) .st-dim__fill { transition-delay: 0.28s; }
.st-dim:nth-child(3) .st-dim__fill { transition-delay: 0.36s; }
.st-dim:nth-child(4) .st-dim__fill { transition-delay: 0.44s; }
.st-dim:nth-child(5) .st-dim__fill { transition-delay: 0.52s; }
.st-dim__tip { font-size: 13.5px; color: var(--text-muted); line-height: 1.75; }

/* — 内容推荐 — */
.st-recs { margin-bottom: 48px; }
.st-recs__title {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  letter-spacing: 0.03em; margin-bottom: 18px;
}
.st-rec {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: border-color 0.12s, transform 0.12s;
}
.st-rec:hover { border-color: var(--gold-dim); transform: translateY(-1px); }
.st-rec__tag {
  flex-shrink: 0; padding: 3px 10px;
  border: 1px solid rgba(196,162,101,0.25); border-radius: var(--radius-full);
  font-size: 11px; color: var(--gold-dim); letter-spacing: 0.06em;
}
.st-rec__dim { flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.st-rec__title { flex: 1; font-size: 14.5px; line-height: 1.6; }
.st-rec__arrow { color: var(--gold-dim); transition: transform 0.12s; }
.st-rec:hover .st-rec__arrow { transform: translateX(4px); }
/* 暂无内容标记态：不可交互、无悬停反馈 */
.st-rec--empty, .st-rec--empty:hover {
  border-color: var(--border); transform: none; cursor: default;
}
.st-rec--empty .st-rec__title { color: var(--text-dim); font-size: 13.5px; }

/* — 转化区 — */
.st-cta { display: flex; flex-direction: column; gap: 12px; margin-bottom: 48px; }
.st-cta .btn { justify-content: center; padding: 13px 28px; font-size: 15px; }
.st-cta__again {
  align-self: center; padding: 8px 12px;
  font-size: 13px; color: var(--text-muted); transition: color 0.2s;
}
.st-cta__again:hover { color: var(--gold-pale); }

/* — 分享卡片预览 — */
.st-share { text-align: center; margin-bottom: 40px; }
.st-share img {
  width: min(320px, 82%);
  border: 1px solid rgba(196,162,101,0.3); border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.st-share__actions { margin-top: 18px; }
.st-share__hint { margin-top: 10px; font-size: 12px; color: var(--text-dim); }

/* ============================================================
   移动端
   ============================================================ */
@media (max-width: 768px) {
  .st-intro { padding-top: calc(var(--nav-h) + 56px); }
  .st-quiz { padding-top: calc(var(--nav-h) + 36px); }
  .st-result { padding-top: calc(var(--nav-h) + 40px); }
  .st-score__row { flex-direction: column; gap: 14px; }
  .st-q__hint { display: none; } /* 小屏省空间，自动推进不言自明 */
}

/* ============================================================
   降低动效（系统偏好）
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-ambiance::before, .bg-ambiance::after { animation: none; }
  .st-moon::after,
  .st-progress__bar,
  .st-dim__fill { transition: none; }
  .st-opt, .st-rec, .btn { transition-duration: 0.01ms; }
  .st-dim:nth-child(n) .st-dim__fill { transition-delay: 0s; }
}
