/* ============================================================
   style.css —— 宝宝的秘密玩具盒（手机优先，桌面兼容）
   风格：奶油暖色底 + 糖果色卡片 + 圆角软阴影（参考需求配图）
   ============================================================ */

:root {
  --bg: #FFF7EC;
  --bg-deep: #FFEFDA;
  --card: #FFFFFF;
  --ink: #5C4A38;
  --ink-light: #9B876F;
  --accent: #F08C4B;
  --accent-deep: #E5762E;
  --soft-line: #F2E3CF;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(214, 165, 106, 0.18);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #FFF9F0 0%, var(--bg-deep) 100%);
  color: var(--ink);
  line-height: 1.6;
}

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 0 20px 40px; position: relative; }

/* ---------- 屏幕切换 ---------- */
.screen { display: none; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 首页（手机一屏展示） ---------- */
.screen#screen-home.active {
  display: flex; flex-direction: column;
  min-height: calc(100vh - 70px); padding-top: 10px;
}
.home-hero { position: relative; margin: 0 -20px; overflow: hidden; flex-shrink: 0; }
.hero-img { width: 100%; height: clamp(120px, 18vh, 180px); object-fit: cover; object-position: center 68%; display: block; }
.hero-glow { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,247,236,0) 55%, var(--bg) 100%); }

.brand-en { margin-top: 10px; text-align: center; font-size: 11px; letter-spacing: 3px; color: var(--ink-light); font-weight: 600; }
.brand-title { text-align: center; font-size: 26px; margin-top: 3px; letter-spacing: 2px; }
.brand-slogan { text-align: center; margin: 4px 0 12px; color: var(--ink-light); font-size: 13px; }

.home-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 16px 18px; }
.home-intro { font-size: 13px; margin-bottom: 12px; color: #6B5844; }

.feature-row { display: flex; justify-content: space-between; margin-bottom: 14px; }
.feature-item { flex: 1; text-align: center; background: var(--bg); border-radius: 14px; padding: 8px 4px; margin: 0 4px; }
.feature-num { display: block; font-size: 19px; font-weight: 700; color: var(--accent); }
.feature-label { font-size: 11px; color: var(--ink-light); }

.home-card .btn-primary { padding: 13px; font-size: 16px; }

.home-notice {
  background: rgba(255,255,255,0.65); border: 1px dashed #EBD3AE; border-radius: 16px;
  padding: 12px 16px; margin-top: 12px; margin-bottom: auto;
}
.home-notice h3 { font-size: 13px; margin-bottom: 5px; }
.home-notice ul { padding-left: 16px; font-size: 12px; color: var(--ink-light); }
.home-notice li { margin: 2px 0; }

/* ---------- 按钮 ---------- */
.btn-primary {
  display: block; width: 100%; padding: 15px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff; font-size: 17px; font-weight: 600; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 8px 18px rgba(229, 118, 46, 0.35); transition: transform 0.15s ease, opacity 0.15s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }

.btn-ghost {
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid #E8D2B2;
  background: #FFFDF9; color: var(--ink-light); font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-ghost:active { background: var(--bg); }

.btn-secondary {
  padding: 13px 20px; border-radius: 999px; border: none;
  background: #FDEBD6; color: var(--accent-deep); font-size: 15px; font-weight: 600; cursor: pointer;
}

/* ---------- 宝宝信息 ---------- */
.info-head { padding: 26px 4px 10px; }
.back-link { font-size: 14px; color: var(--ink-light); cursor: pointer; }
.info-head h2 { margin-top: 10px; font-size: 24px; }
.info-sub { color: var(--ink-light); font-size: 13px; margin-top: 4px; }

.info-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 22px; margin-top: 14px; }
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field-label i { font-style: normal; font-size: 12px; color: var(--ink-light); font-weight: 400; margin-left: 6px; }
.field input, .field select {
  width: 100%; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--soft-line);
  background: var(--bg); font-size: 15px; color: var(--ink); outline: none; appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field-tip { font-size: 12px; color: var(--ink-light); margin: -6px 0 16px; }

/* ---------- 答题页 ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; padding: 22px 0 14px; }
.quiz-count { font-size: 14px; font-weight: 700; color: var(--accent-deep); white-space: nowrap; }
.progress-track { flex: 1; height: 10px; background: #FBE8CE; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #F7B36B); transition: width 0.3s ease; }
.quiz-tip { font-size: 12px; color: var(--ink-light); background: var(--bg); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

.quiz-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; }
.quiz-prompt { font-size: 12px; color: var(--ink-light); margin-bottom: 10px; }
.quiz-text { font-size: 19px; font-weight: 600; line-height: 1.55; min-height: 58px; margin-bottom: 18px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border: 1.5px solid var(--soft-line); border-radius: 16px; cursor: pointer;
  background: #FFFDF9; transition: all 0.15s ease; font-size: 15px;
}
.option .opt-code {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg); color: var(--ink-light);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
  transition: all 0.15s ease;
}
.option.selected { border-color: var(--accent); background: #FFF3E4; font-weight: 600; }
.option.selected .opt-code { background: var(--accent); color: #fff; }
.option:active { transform: scale(0.98); }
.option.opt-missing { color: var(--ink-light); }

.quiz-nav { display: flex; gap: 12px; margin-top: 20px; }
.quiz-nav .btn-primary { flex: 1.2; padding: 13px; font-size: 15px; }
.quiz-nav .btn-ghost { flex: 1; }
.quiz-nav .btn-ghost[disabled] { opacity: 0.4; cursor: not-allowed; }

.quiz-state { text-align: center; font-size: 12px; color: var(--ink-light); margin-top: 14px; }

/* ---------- 计算过场 ---------- */
.screen#screen-calc { display: none; }
.screen#screen-calc.active { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.calc-box { text-align: center; }
.calc-box-emoji { font-size: 56px; animation: bounce 0.9s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-12px); } }
.calc-box p { margin-top: 14px; color: var(--ink-light); font-size: 15px; }

/* ---------- 结果报告 ---------- */
.report { padding-top: 20px; }

.report-hero {
  text-align: center; color: #fff; border-radius: var(--radius); padding: 30px 20px 26px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; margin-bottom: 18px;
}
.r-lead { font-size: 14px; opacity: 0.9; letter-spacing: 2px; }
.r-name { font-size: 34px; margin-top: 6px; letter-spacing: 2px; text-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.r-theme {
  display: inline-block; margin-top: 8px; padding: 5px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.28); font-size: 13px; letter-spacing: 1px;
}
.r-img { width: 210px; height: 210px; object-fit: cover; border-radius: 50%; border: 6px solid rgba(255,255,255,0.55); margin: 16px auto 8px; display: block; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.r-brief { font-size: 15px; opacity: 0.95; padding: 0 12px; }

.report-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px; margin-bottom: 14px; }
.rc-title { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.rc-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.rc-text { font-size: 14.5px; color: #6B5844; }
.rc-note { font-size: 12px; color: var(--ink-light); margin-top: 10px; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.rc-hint { font-size: 11px; color: var(--ink-light); margin-top: 12px; }

.r-keywords { display: flex; flex-wrap: wrap; gap: 8px; }
.r-keywords span { padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; }

.dim-list { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.dim-row { display: flex; align-items: center; gap: 10px; }
.dim-name { width: 88px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.dim-bar { flex: 1; height: 12px; background: #F6ECDC; border-radius: 999px; overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.dim-score { width: 34px; text-align: right; font-size: 13px; font-weight: 700; color: var(--accent-deep); }
.dim-desc { font-size: 12px; color: var(--ink-light); margin: -6px 0 0 98px; }

.game-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--soft-line); }
.game-item:last-child { border-bottom: none; }
.game-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--accent-deep); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.game-title { font-size: 14.5px; font-weight: 600; }
.game-how { font-size: 13px; color: var(--ink-light); margin-top: 2px; }

.r-secondary { text-align: center; font-size: 13px; color: var(--ink-light); background: rgba(255,255,255,0.7); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.r-disclaimer { font-size: 11px; color: var(--ink-light); line-height: 1.7; margin-bottom: 18px; }

.r-actions { display: flex; gap: 10px; margin-top: 4px; }
.r-actions .btn-primary { flex: 1; }
.r-save-tip { text-align: center; font-size: 12px; color: var(--ink-light); margin-top: 12px; }

/* ---------- 页脚 / Toast ---------- */
.app-footer { text-align: center; font-size: 11px; color: #C4AE92; margin-top: 26px; }

.toast {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%);
  background: rgba(70, 52, 34, 0.9); color: #fff; font-size: 13px;
  padding: 10px 20px; border-radius: 999px; z-index: 99; max-width: 82vw; text-align: center;
}

/* ---------- 桌面适配 ---------- */
@media (min-width: 700px) {
  .app { padding-top: 24px; }
  .brand-title { font-size: 34px; }
  .quiz-text { font-size: 20px; }
}
