/* ============================================================
 * 《劝退报告》样式 —— 浅青色系设计令牌（见 前端设计文档.md 第 4 章）
 * ============================================================ */
:root {
  --bg-top: #eefafc;
  --bg-bottom: #d8f1f7;
  --card: #ffffff;
  --primary: #1490a8;
  --primary-dark: #0c6e83;
  --primary-soft: #e3f6fa;
  --accent: #f2846b;
  --text: #25333a;
  --muted: #7b929b;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(20, 144, 168, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  max-width: 100%;
  overflow-x: hidden; /* 严格禁止横向滚动 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(20, 144, 168, .14), transparent 60%),
    radial-gradient(900px 520px at -12% 108%, rgba(43, 182, 205, .12), transparent 55%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  -webkit-font-smoothing: antialiased;
}

/* 氛围装饰：光斑 + 星点（神秘感，fixed 层不参与布局、不产生滚动） */
.bg-deco { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-deco::before {
  content: ""; position: absolute; inset: 0; opacity: .4;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(12, 110, 131, .5) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, rgba(12, 110, 131, .4) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 62% 48%, rgba(12, 110, 131, .35) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 72%, rgba(12, 110, 131, .4) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 88% 66%, rgba(12, 110, 131, .3) 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 90%, rgba(12, 110, 131, .35) 50%, transparent 51%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(46px); }
.orb-1 { width: 220px; height: 220px; left: -70px; top: 8%;
  background: rgba(43, 182, 205, .30); animation: drift 16s ease-in-out infinite alternate; }
.orb-2 { width: 180px; height: 180px; right: -60px; top: 34%;
  background: rgba(20, 144, 168, .22); animation: drift 20s ease-in-out infinite alternate-reverse; }
.orb-3 { width: 150px; height: 150px; left: 18%; bottom: -50px;
  background: rgba(242, 132, 107, .14); animation: drift 24s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(26px, -20px, 0) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
}

#app {
  position: relative; z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100%;
  padding: 20px 16px 32px;
}

/* ---------- 悬浮返回主页按钮（答题/生成/结果页显示，封面隐藏） ---------- */
.btn-home {
  position: fixed; top: 12px; left: 12px; z-index: 50;
  padding: 6px 12px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(20, 144, 168, .30); border-radius: 999px;
  color: var(--primary-dark); font-size: 12px; letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 144, 168, .12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform .12s ease, background .15s ease;
}
.btn-home:hover { background: var(--primary-soft); }
.btn-home:active { transform: scale(.94); }

.screen { display: none; animation: fadeIn .35s ease; }
.screen.active { display: block; }
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 通用按钮 ---------- */
.btn-primary {
  display: block; width: 100%;
  padding: 15px 20px;
  border: none; border-radius: 999px;
  background: var(--primary);
  color: #fff; font-size: 17px; font-weight: 600;
  letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(20, 144, 168, .30);
  transition: transform .15s ease, background .15s ease;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { background: #b7d8de; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  display: block; width: 100%;
  padding: 13px 20px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  background: transparent;
  color: var(--primary); font-size: 15px; font-weight: 500;
  letter-spacing: 1px; cursor: pointer;
  transition: background .15s ease;
}
.btn-secondary:hover { background: var(--primary-soft); }
.btn-secondary:disabled { border-color: #b7d8de; color: #9dbfc6; cursor: not-allowed; }

/* ---------- 封面 ---------- */
.entry-card {
  margin-top: 12vh;
  background: var(--card);
  border-radius: 24px;
  padding: 44px 28px 30px;
  text-align: center;
  box-shadow: var(--shadow);
}
.entry-brand {
  font-size: clamp(30px, 9vw, 40px); font-weight: 800; letter-spacing: 6px;
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, #2bb6cd);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.entry-sub {
  margin-top: 10px; font-size: 15px; letter-spacing: 4px;
  color: var(--primary);
}
.entry-desc {
  margin: 22px 0 28px; font-size: 14px; line-height: 1.9;
  color: var(--muted);
}
.entry-privacy {
  margin-top: 18px; font-size: 11px; line-height: 1.7;
  color: #a9bcc2;
}
.invite-box {
  margin: 18px 0 4px; padding: 14px;
  background: var(--primary-soft); border-radius: var(--radius);
}
.invite-title { font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.invite-body { margin-top: 6px; font-size: 13px; color: var(--text); }

/* ---------- 答题 ---------- */
.quiz-top { margin-bottom: 14px; }
.progress-track {
  height: 8px; border-radius: 999px;
  background: rgba(20, 144, 168, .15); overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #2bb6cd);
  transition: width .3s ease;
}
.quiz-counter {
  margin-top: 8px; text-align: right;
  font-size: 12px; color: var(--muted); letter-spacing: 1px;
}
.scene-card {
  background: var(--card); border-radius: 14px;
  padding: 18px 16px; box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.scene-label {
  display: inline-block; font-size: 11px; letter-spacing: 2px;
  color: #fff; background: var(--primary);
  padding: 3px 10px; border-radius: 999px;
}
.scene-text { margin-top: 10px; font-size: clamp(16px, 4.6vw, 19px); font-weight: 600; line-height: 1.65; }
.options { display: flex; flex-direction: column; gap: 9px; }
/* 窄细选项条 + 固定 A/B/C/D 标识 */
.option {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%;
  background: var(--card); border: 1px solid rgba(20, 144, 168, .22);
  border-radius: 12px;
  padding: 9px 12px; font-size: clamp(13.5px, 3.8vw, 14.5px); line-height: 1.6;
  text-align: left; cursor: pointer; color: var(--text);
  box-shadow: 0 1px 6px rgba(20, 144, 168, .05);
  transition: border-color .15s ease, background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.option:hover { border-color: var(--primary); background: var(--primary-soft); }
.option:active { transform: scale(.985); }
.option.picked {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 2px 10px rgba(20, 144, 168, .16);
}
.opt-key {
  flex: none; width: 20px; height: 20px; margin-top: 2px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--primary-dark); background: var(--primary-soft);
  border: 1px solid rgba(20, 144, 168, .38);
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.option.picked .opt-key { color: #fff; background: var(--primary); border-color: var(--primary); }
.opt-text { flex: 1; min-width: 0; }
.link-prev {
  display: block; margin: 18px auto 0;
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--muted); text-decoration: underline;
}
.link-prev:disabled { opacity: .35; cursor: not-allowed; }

.quip-bubble {
  position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%);
  background: rgba(37, 51, 58, .88); color: #fff;
  font-size: 13px; padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  animation: fadeIn .25s ease; white-space: nowrap; z-index: 60;
}

/* ---------- 生成页 ---------- */
.done-wrap {
  margin-top: 38vh; text-align: center;
}
.done-spinner {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 4px solid rgba(20, 144, 168, .18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.done-text { font-size: 15px; color: var(--primary-dark); letter-spacing: 1px; }

/* ---------- 结果页 ---------- */
.result-head {
  position: relative;
  background: var(--card); border-radius: 24px;
  padding: 30px 24px 24px; text-align: center;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.result-index-label {
  font-size: 12px; letter-spacing: 4px; color: var(--muted);
}
.result-index {
  margin-top: 4px;
  font-size: clamp(46px, 15vw, 64px); font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.result-summary {
  margin-top: 8px; font-size: 14px; line-height: 1.8; color: var(--text);
}
.gentle-switch {
  position: absolute; top: 14px; right: 16px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.gentle-switch input { accent-color: var(--primary); }

.result-list { display: flex; flex-direction: column; gap: 12px; }
.item-card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: 0 4px 14px rgba(20, 144, 168, .08);
  border-left: 4px solid var(--primary);
}
.item-card.severe { border-left-color: var(--accent); }
.item-title-row { display: flex; align-items: center; gap: 8px; }
.item-index { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.item-badge {
  flex-shrink: 0; font-size: 10px; color: #fff;
  background: var(--accent); padding: 2px 8px; border-radius: 999px;
}
.item-body { margin-top: 8px; font-size: 13px; line-height: 1.8; color: var(--text); }
.item-evidence { color: var(--primary); }
.item-exception {
  margin-top: 8px; font-size: 12px; line-height: 1.7;
  color: var(--muted); font-style: italic;
}
.disclaimer {
  margin: 20px 0 16px; text-align: center;
  font-size: 11px; color: #a9bcc2;
}
.result-actions { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.link-tail {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--primary); text-decoration: underline;
  padding: 6px 0;
}

/* ---------- 海报弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(15, 40, 48, .55);
}
.modal-body {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 392px);
  max-height: 92vh; overflow: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.poster-scale { width: 100%; overflow: hidden; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { flex: 1; }
.poster-tip { text-align: center; font-size: 12px; color: #fff; }

/* 海报本体：750 设计宽，由 app.js 按容器宽等比缩放（transform） */
.poster {
  width: 750px;
  transform-origin: top left;
  background: linear-gradient(180deg, #eefafc, #d8f1f7);
  border-radius: 28px;
  padding: 52px 44px 40px;
}
.poster-head { text-align: center; }
.poster-head-main {
  font-size: 44px; font-weight: 800; letter-spacing: 4px;
  color: var(--primary-dark);
}
.poster-head-sub {
  margin-top: 10px; font-size: 26px; font-weight: 600;
  color: var(--accent);
}
.poster-head-index {
  margin-top: 6px; font-size: 22px; color: var(--muted);
}
.poster-items { margin-top: 36px; display: flex; flex-direction: column; gap: 20px; }
.poster-item {
  background: #fff; border-radius: 20px;
  border-left: 6px solid var(--primary);
  padding: 24px 26px;
}
.poster-item.severe { border-left-color: var(--accent); }
.poster-item-title { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.poster-item-body { margin-top: 10px; font-size: 19px; line-height: 1.7; color: var(--text); }
.poster-item-exception { margin-top: 8px; font-size: 17px; color: var(--muted); font-style: italic; }
.poster-footer {
  margin-top: 36px; display: flex; align-items: center; justify-content: space-between;
}
.poster-footer-left { max-width: 430px; }
.poster-footer-note { font-size: 18px; font-weight: 600; color: var(--primary-dark); }
.poster-footer-disclaimer { margin-top: 8px; font-size: 14px; color: #a9bcc2; }
.poster-qr { text-align: center; }
.poster-qr-box {
  width: 120px; height: 120px; padding: 8px; background: #fff;
  border-radius: 12px; box-shadow: 0 4px 12px rgba(20,144,168,.15);
}
.poster-qr-box img, .poster-qr-box canvas { width: 100%; height: 100%; display: block; }
.poster-qr-text { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  max-width: 92vw;
  background: rgba(37, 51, 58, .9); color: #fff;
  font-size: 13px; line-height: 1.6; padding: 10px 20px; border-radius: 999px;
  text-align: center; z-index: 120; animation: fadeIn .25s ease;
}
