/* ===== 基础 ===== */
:root {
  --brand: #6d5efc;
  --brand-dark: #5646e0;
  --accent: #ff7a59;
  --ink: #171a21;
  --ink-soft: #3d4351;
  --muted: #6b7280;
  --line: #e8eaf0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(23, 26, 33, 0.06);
  --shadow-lg: 0 18px 50px rgba(23, 26, 33, 0.1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, a, label, input, summary { touch-action: manipulation; }
body { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 12px; }
h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 14px; }
ul { margin: 0; padding: 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.grad-text {
  background: linear-gradient(120deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section { margin: 40px auto 56px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
.section-head h2 { margin: 0; }
.more { color: var(--brand); font-size: 0.9375rem; font-weight: 600; }
.more:hover { text-decoration: underline; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.9375rem; font-weight: 600; cursor: pointer; transition: all 0.18s ease;
  font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(109, 94, 252, 0.28); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 14px 30px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.875rem; }

/* ===== 头部 ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1875rem; }
.logo-mark { font-size: 1.35rem; }
.main-nav { display: flex; gap: 18px; font-size: 0.9375rem; color: var(--ink-soft); }
.main-nav a:hover { color: var(--brand); }
.header-search {
  margin-left: auto; display: flex; align-items: center;
  background: #f1f2f7; border-radius: 999px; padding: 4px 6px 4px 14px;
}
.header-search input {
  border: 0; background: transparent; outline: none; font-family: inherit;
  font-size: 0.875rem; width: 150px; color: var(--ink);
}
.header-search button {
  border: 0; background: #fff; border-radius: 999px; width: 30px; height: 30px;
  cursor: pointer; font-size: 0.8125rem;
}

/* ===== 首页 Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 400px at 15% -10%, rgba(109, 94, 252, 0.16), transparent 60%),
    radial-gradient(700px 380px at 90% 0%, rgba(255, 122, 89, 0.14), transparent 60%),
    #fff;
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding: 64px 20px 56px; text-align: center; }
.hero-badge {
  display: inline-block; background: #eef0ff; color: var(--brand-dark);
  border-radius: 999px; padding: 6px 16px; font-size: 0.8125rem; font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 { font-size: 3rem; margin-bottom: 14px; }
.hero-sub { max-width: 620px; margin: 0 auto 26px; color: var(--ink-soft); font-size: 1.0625rem; }
.hero-search {
  display: flex; gap: 10px; max-width: 560px; margin: 0 auto 18px;
  background: #fff; padding: 8px; border-radius: 999px; box-shadow: var(--shadow);
}
.hero-search input {
  flex: 1; border: 0; outline: none; padding: 0 18px; font-size: 0.9375rem;
  font-family: inherit; background: transparent;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: inline-block; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 0.875rem; color: var(--ink-soft);
  transition: all 0.16s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-active:hover { color: #fff; }

/* ===== 分类卡片 ===== */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.category-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
  transition: all 0.18s ease;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dcd9ff; }
.category-emoji { font-size: 1.75rem; }
.category-name { font-weight: 700; font-size: 1.0625rem; }
.category-desc { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.category-count { color: var(--brand); font-size: 0.8125rem; font-weight: 600; margin-top: auto; }

/* ===== 测试卡片 ===== */
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.test-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: all 0.18s ease;
}
.test-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.test-cover {
  position: relative; height: 148px; display: flex; align-items: center; justify-content: center;
}
.test-emoji { font-size: 3.25rem; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18)); }
.badge {
  position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, 0.92);
  border-radius: 999px; padding: 3px 10px; font-size: 0.75rem; font-weight: 700;
}
.badge-hot { color: #e1563a; }
.badge-new { color: var(--brand); }
.badge-new { left: auto; right: 12px; }
.test-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.test-body h3 { margin: 0; font-size: 1.0625rem; }
.test-body p { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.test-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.tag {
  background: #f0f0ff; color: var(--brand-dark); border-radius: 999px;
  padding: 3px 10px; font-size: 0.75rem; font-weight: 600;
}

/* 封面渐变主题 */
.g-sunrise { background: linear-gradient(135deg, #ffc46b, #ff7a59); }
.g-ocean { background: linear-gradient(135deg, #7b6bff, #3aa8ff); }
.g-forest { background: linear-gradient(135deg, #3ecf8e, #2f9e6b); }
.g-berry { background: linear-gradient(135deg, #ff7fae, #b060ff); }
.g-candy { background: linear-gradient(135deg, #ffa8e2, #8ec5ff); }
.g-night { background: linear-gradient(135deg, #2b2f5b, #4a3f8f); }
.g-gold { background: linear-gradient(135deg, #f8c14a, #e08b1f); }
.g-mint { background: linear-gradient(135deg, #5ad7c9, #34b37a); }

/* ===== 内页头部 ===== */
.page-head { padding: 28px 20px 8px; }
.breadcrumb { font-size: 0.8125rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 4px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.page-wrap { padding-top: 24px; }
.narrow { max-width: 780px; }

/* ===== 测试详情 ===== */
.test-hero {
  display: grid; grid-template-columns: 300px 1fr; gap: 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 28px;
}
.test-hero-cover {
  border-radius: var(--radius); min-height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.test-emoji-xl { font-size: 5rem; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.2)); }
.test-hero-body h1 { margin-bottom: 8px; }
.lead { font-size: 1.0625rem; color: var(--ink-soft); }
.meta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px 0 18px; }
.meta-item { font-size: 0.875rem; color: var(--muted); }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.highlight-list { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: 0.875rem; color: var(--ink-soft); }
.highlight-list li { list-style: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.prose-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.prose-card h2:not(:first-child) { margin-top: 26px; }
.notice {
  background: #fff8ee; border-left: 3px solid #f0ad4e; color: #8a5a12;
  padding: 12px 16px; border-radius: 8px; font-size: 0.875rem;
}
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 10px; background: #fcfcfe;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 0.9375rem; }
.faq p { margin: 10px 0 0; color: var(--ink-soft); font-size: 0.9375rem; }

.side-col { display: flex; flex-direction: column; gap: 16px; }
.side-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.side-card h3 { margin-bottom: 14px; }
.side-card-cta { background: linear-gradient(150deg, #f3f1ff, #fff); border-color: #e2ddff; }
.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-list li { list-style: none; }
.side-list a { display: flex; gap: 10px; align-items: flex-start; }
.side-list a:hover strong { color: var(--brand); }
.side-emoji { font-size: 1.25rem; line-height: 1.4; }
.side-list strong { display: block; font-size: 0.9375rem; }
.side-list em { display: block; font-style: normal; color: var(--muted); font-size: 0.8125rem; }
.match-list { display: flex; flex-wrap: wrap; gap: 8px; }
.match-list li {
  list-style: none; background: #f4f3ff; color: var(--brand-dark);
  border-radius: 999px; padding: 6px 14px; font-size: 0.875rem; font-weight: 600;
}

/* ===== 答题 ===== */
.quiz-shell { max-width: 720px; margin: 0 auto; padding: 24px 20px 64px; }
.quiz-topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.quiz-back { font-size: 0.875rem; color: var(--muted); }
.quiz-back:hover { color: var(--brand); }
.quiz-progress { flex: 1; display: flex; align-items: center; gap: 10px; }
.quiz-progress-bar { flex: 1; height: 8px; background: #e6e7ef; border-radius: 999px; overflow: hidden; }
.quiz-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width 0.28s ease; }
#progress-text, #game-round { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.quiz-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 26px; box-shadow: var(--shadow);
}
.quiz-header { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.quiz-emoji { font-size: 1.5rem; }
.quiz-title { font-weight: 700; }
.quiz-question { border: 0; padding: 0; margin: 0; }
.quiz-question-title {
  font-size: 1.1875rem; font-weight: 700; line-height: 1.55;
  display: flex; gap: 10px; padding: 0; margin-bottom: 20px;
}
.quiz-number {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #eef0ff; color: var(--brand-dark); font-size: 0.8125rem;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 3px;
}
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; transition: all 0.16s ease; background: #fff;
}
.quiz-option:hover { border-color: var(--brand); background: #fafaff; }
.quiz-option input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-option-key {
  flex: none; width: 26px; height: 26px; border-radius: 8px; background: #f1f2f7;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 700; color: var(--muted);
}
.quiz-option-label { font-size: 0.9375rem; }
.quiz-option.selected { border-color: var(--brand); background: #f6f5ff; }
.quiz-option.selected .quiz-option-key { background: var(--brand); color: #fff; }
.quiz-actions { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.quiz-actions .btn[hidden] { display: none; }
#quiz-submit { margin-left: auto; }
#quiz-hint { margin-left: auto; }
.quiz-loading { text-align: center; padding: 60px 0; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid #e6e7ef; border-top-color: var(--brand); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 小游戏 ===== */
.game-shell { max-width: 720px; margin: 0 auto; padding: 24px 20px 64px; }
.game-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 40px 26px; box-shadow: var(--shadow); text-align: center;
  min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background 0.06s linear;
}
.game-card.waiting { background: #ff6b6b; color: #fff; }
.game-card.ready { background: #25c07d; color: #fff; }
.game-card.waiting h1, .game-card.ready h1 { color: #fff; }
.game-card.waiting .game-desc, .game-card.ready .game-desc,
.game-card.waiting .muted, .game-card.ready .muted { color: rgba(255, 255, 255, 0.9); }
.game-title { font-size: 1.5rem; }
.game-desc { color: var(--muted); max-width: 420px; }
.game-big { font-size: 2.5rem; font-weight: 800; margin: 0 0 6px; }
.game-result { text-align: center; padding: 40px 0; }

/* ===== 结果页 ===== */
.result-hero {
  border-radius: 24px; padding: 44px 26px; text-align: center; color: #fff;
  box-shadow: var(--shadow-lg); margin-bottom: 20px;
}
.result-emoji { font-size: 4rem; display: block; margin-bottom: 8px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.2)); }
.result-kicker { margin: 0; opacity: 0.92; font-size: 0.9375rem; }
.result-hero h1 { font-size: 2.25rem; margin: 6px 0 10px; }
.result-tagline { font-size: 1.0625rem; margin: 0; opacity: 0.96; }
.result-headline { margin: 8px 0 0; font-size: 0.9375rem; opacity: 0.85; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; text-align: center; box-shadow: var(--shadow);
}
.stat-label { display: block; color: var(--muted); font-size: 0.8125rem; margin-bottom: 4px; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.bullet-list li { list-style: none; position: relative; padding-left: 20px; margin-bottom: 8px; font-size: 0.9375rem; }
.bullet-list li::before { content: "·"; position: absolute; left: 8px; font-weight: 800; }
.bullet-good li::before { content: "✓"; color: #25a06b; left: 4px; }
.bullet-warn li::before { content: "!"; color: #e0932f; left: 7px; }
.bullet-tip li::before { content: "→"; color: var(--brand); left: 3px; }
.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-head { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 6px; }
.bar-track { height: 8px; background: #eef0f6; border-radius: 999px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; }
.bar-foot { display: flex; justify-content: space-between; margin-top: 4px; }
.levels details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.levels details:last-child { border-bottom: 0; }
.levels summary { display: flex; justify-content: space-between; cursor: pointer; font-size: 0.9375rem; font-weight: 600; }
.level-label { color: var(--brand); font-size: 0.8125rem; font-weight: 600; }
.levels p { margin: 10px 0 0; color: var(--ink-soft); font-size: 0.875rem; }
.share-row { display: flex; flex-direction: column; gap: 10px; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 60px 20px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-emoji { font-size: 3rem; margin-bottom: 8px; }
.empty .btn { margin: 6px; }

/* ===== 页脚 ===== */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 40px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px;
  padding-top: 40px; padding-bottom: 24px;
}
.footer-brand .logo { margin-bottom: 10px; }
.footer-col h4 { font-size: 0.9375rem; margin-bottom: 12px; }
.footer-col li { list-style: none; margin-bottom: 8px; }
.footer-col a { color: var(--muted); font-size: 0.875rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 24px;
  color: var(--muted); font-size: 0.8125rem;
}

/* ===== 响应式 ===== */
@media (max-width: 980px) {
  .test-grid, .category-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .test-hero { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .qr-card { display: none; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 2.125rem; }
  .hero-inner { padding: 44px 20px 40px; }
  .hero-search { flex-direction: column; border-radius: 20px; padding: 10px; }
  .hero-search input { padding: 10px 12px; }
  .test-grid, .category-grid { grid-template-columns: 1fr; }
  .header-search input { width: 96px; }
  .quiz-card, .prose-card { padding: 20px; }
  h1 { font-size: 1.625rem; }
  .result-hero h1 { font-size: 1.75rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ===== 移动端专用组件 ===== */
.mobile-tabbar { display: none; }
.mobile-cta { display: none; }
.share-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.qr-card { text-align: center; }
.qr-image { display: block; margin: 0 auto 10px; width: 150px; height: 150px; }

/* 微信分享引导层 */
.wx-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 18, 27, 0.82);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.18s ease;
  padding: max(20px, env(safe-area-inset-top)) 20px 20px;
}
.wx-overlay-open { opacity: 1; }
.wx-overlay-arrow {
  font-size: 2.5rem; color: #fff; text-align: right;
  padding-right: 12px; margin-bottom: 6px; line-height: 1;
  animation: wx-bounce 1.1s ease-in-out infinite;
}
@keyframes wx-bounce {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -6px); }
}
.wx-overlay-card {
  background: #fff; border-radius: 18px; padding: 22px;
  margin-top: 12px; text-align: center; box-shadow: var(--shadow-lg);
}
.wx-overlay-card h3 { margin-bottom: 10px; }
.wx-overlay-card p { color: var(--ink-soft); font-size: 0.9375rem; }
.wx-overlay-card strong { color: var(--brand); font-size: 1.125rem; }
.wx-overlay-tip { color: var(--muted) !important; font-size: 0.8125rem !important; min-height: 1.2em; }

/* 轻提示 */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: rgba(23, 26, 33, 0.92); color: #fff;
  padding: 12px 20px; border-radius: 999px; font-size: 0.875rem;
  z-index: 300; opacity: 0; transition: all 0.2s ease;
  max-width: calc(100% - 40px); text-align: center;
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  /* 给底部导航留出空间，并适配 iPhone 刘海屏 */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
  body.focus-mode { padding-bottom: 0; }
  body.focus-mode .mobile-tabbar { display: none; }
  body.focus-mode .site-footer { display: none; }

  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 8px 0 7px; font-size: 0.6875rem; color: var(--muted);
    min-height: 52px;
  }
  .tab-item .tab-icon { font-size: 1.25rem; line-height: 1.1; }
  .tab-active { color: var(--brand); font-weight: 600; }

  .site-footer { padding-bottom: 8px; }

  /* 详情页吸底开始按钮 */
  .mobile-cta {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom));
    z-index: 110; padding: 10px 16px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
  }
  .mobile-cta-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .mobile-cta-info strong {
    font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mobile-cta .btn { padding: 12px 24px; }

  /* 触控区域加大 */
  .btn { min-height: 44px; }
  .chip { min-height: 36px; display: inline-flex; align-items: center; }
  .quiz-option { min-height: 58px; padding: 15px 16px; }
  .quiz-option-label { font-size: 1rem; }
  .faq summary { min-height: 44px; display: flex; align-items: center; }
  .side-list a { min-height: 44px; }

  /* 输入框 16px 以下 iOS 会自动放大页面 */
  input, select, textarea { font-size: 16px !important; }
  .header-search input { width: 100%; }
  .header-search { flex: 1; margin-left: 12px; }

  /* 答题页：进度条吸顶，选项更大 */
  .quiz-shell { padding: 12px 16px 40px; }
  .quiz-topbar {
    position: sticky; top: 64px; z-index: 20;
    background: #f6f7fb; padding: 10px 0; margin-bottom: 12px;
  }
  .quiz-card { border-radius: 18px; }
  .quiz-question-title { font-size: 1.0625rem; }
  .quiz-actions { position: sticky; bottom: 0; background: #fff; padding-top: 12px; }
  .quiz-actions .btn { flex: 1; }
  #quiz-submit { margin-left: 0; }

  .game-card { min-height: 320px; padding: 32px 20px; }
  .game-shell { padding: 12px 16px 40px; }
  .game-card, .game-card * { user-select: none; -webkit-user-select: none; }

  /* 结果页移动端 */
  .result-hero { padding: 32px 20px; border-radius: 20px; }
  .result-emoji { font-size: 3.25rem; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 1.25rem; }
  .share-row .btn { min-height: 48px; }
  .side-card { padding: 18px; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.875rem; }
  .hero-chips .chip { font-size: 0.8125rem; }
  .tab-item { font-size: 0.625rem; }
}

/* ===== 赛博求签 ===== */
.fortune-banner {
  display: flex; align-items: center; gap: 22px;
  background: linear-gradient(135deg, #fff4e6, #f4f0ff);
  border: 1px solid #ece2ff; border-radius: 22px;
  padding: 22px 24px; margin-bottom: 22px;
  transition: all 0.18s ease;
}
.fortune-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fortune-banner-visual { flex: none; }
.fortune-tube {
  position: relative; width: 74px; height: 96px; border-radius: 10px 10px 16px 16px;
  background: linear-gradient(160deg, #b6473a, #7d2a22);
  box-shadow: 0 10px 22px rgba(23, 26, 33, 0.16);
  display: flex; justify-content: center; gap: 4px;
}
.fortune-tube span {
  width: 7px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #ffe7bd, #e8b878);
  position: relative; top: -16px;
}
.fortune-tube span:nth-child(1) { height: 30px; }
.fortune-tube span:nth-child(2) { height: 38px; }
.fortune-tube span:nth-child(3) { height: 24px; }
.fortune-tube span:nth-child(4) { height: 34px; }
.fortune-tube span:nth-child(5) { height: 28px; }
.fortune-tag {
  display: inline-block; background: #fff; border-radius: 999px; padding: 4px 12px;
  font-size: 0.75rem; font-weight: 700; color: #c1502a; margin-bottom: 8px;
}
.fortune-banner-body h3 { margin: 0 0 6px; font-size: 1.25rem; }
.fortune-banner-body p { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.65; }
.fortune-banner-cta { color: var(--brand); font-weight: 700; font-size: 0.9375rem; }

.ft-shell { max-width: 640px; margin: 0 auto; padding: 28px 20px 80px; }
.ft-head { text-align: center; margin-bottom: 22px; }
.ft-head h1 {
  font-size: 2rem;
  background: linear-gradient(120deg, #6d5efc, #ff7a59);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ft-sub { color: var(--muted); font-size: 0.9375rem; }
.ft-meta { font-size: 0.875rem; color: var(--muted); margin-top: 10px; }
.ft-meta a { color: var(--brand); }
.ft-dot { margin: 0 6px; }

.ft-stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 0 20px;
}
.ft-tube-wrap {
  position: relative; width: 190px; padding-top: 74px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: none; transition: transform 0.2s ease;
}
.ft-tube-wrap.ft-holding { transform: scale(1.05); }
.ft-tube-wrap.ft-holding .ft-tube { box-shadow: 0 0 0 6px rgba(109, 94, 252, 0.18), 0 20px 40px rgba(23, 26, 33, 0.18); }
.ft-tube-wrap.ft-shaking { animation: tube-shake 0.42s ease-in-out 2; }
@keyframes tube-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg) translateY(-4px); }
  75% { transform: rotate(7deg) translateY(-4px); }
}

.ft-tube-sticks {
  position: absolute; top: 12px; left: 0; right: 0; height: 80px;
  display: flex; justify-content: center; gap: 7px; align-items: flex-end;
}
.ft-tube-sticks span {
  width: 11px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #ffe7bd, #e8b878);
  box-shadow: inset 0 0 0 1px rgba(180, 130, 70, 0.35);
}
.ft-tube-sticks span:nth-child(1) { height: 52px; }
.ft-tube-sticks span:nth-child(2) { height: 68px; }
.ft-tube-sticks span:nth-child(3) { height: 44px; }
.ft-tube-sticks span:nth-child(4) { height: 74px; }
.ft-tube-sticks span:nth-child(5) { height: 56px; }
.ft-tube-sticks span:nth-child(6) { height: 64px; }
.ft-tube-sticks span:nth-child(7) { height: 48px; }

.ft-tube {
  position: relative; height: 200px; border-radius: 16px 16px 22px 22px;
  background: linear-gradient(160deg, #b6473a, #7d2a22);
  box-shadow: 0 18px 36px rgba(23, 26, 33, 0.18);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.22);
}
.ft-tube::after {
  content: ""; position: absolute; inset: 14px; border-radius: 10px;
  border: 1px dashed rgba(255, 226, 180, 0.4);
}
.ft-tube-label {
  color: #ffe9c9; font-weight: 800; font-size: 1.5rem; line-height: 1.3;
  text-align: center; letter-spacing: 2px; writing-mode: vertical-rl;
  text-orientation: upright;
}
.ft-hold { margin: 20px 0 10px; color: var(--muted); font-size: 0.9375rem; }
.ft-progress { width: 190px; height: 6px; background: #e9e9f2; border-radius: 999px; overflow: hidden; }
.ft-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); }

.ft-param { margin: 8px 0 26px; }
.ft-param label { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 8px; }
.ft-param input {
  width: 100%; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--line);
  font-family: inherit; font-size: 0.9375rem; outline: none; background: #fff;
}
.ft-param input:focus { border-color: var(--brand); }
.ft-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ft-chip { font-size: 0.8125rem; padding: 6px 12px; background: #fff; }

.ft-result { margin-top: 8px; }
.ft-actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 8px; }
.ft-rarity-banner {
  text-align: center; font-weight: 700; margin-bottom: 12px;
  padding: 10px; border-radius: 12px;
}
.ft-rarity-rare { background: #efeaff; color: var(--brand-dark); }
.ft-rarity-hidden {
  background: linear-gradient(120deg, #fff2d8, #ffe0e0); color: #c1502a;
  animation: hidden-pulse 1.4s ease-in-out infinite;
}
@keyframes hidden-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }

/* 签文卡 */
.sign-card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: 24px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.sign-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: #cfd4e2;
}
.sign-rare::before { background: linear-gradient(90deg, #6d5efc, #3aa8ff); }
.sign-hidden::before { background: linear-gradient(90deg, #ffb347, #ff5f6d); }
.sign-rare { border-color: #ded8ff; box-shadow: 0 14px 38px rgba(109, 94, 252, 0.14); }
.sign-hidden { border-color: #ffd9b0; box-shadow: 0 14px 38px rgba(255, 138, 64, 0.18); }

.sign-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.sign-discipline { font-size: 0.875rem; color: var(--muted); }
.sign-rarity {
  font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: #f1f2f7; color: #6b7280;
}
.sign-rarity-rare { background: #efeaff; color: var(--brand-dark); }
.sign-rarity-hidden { background: #fff0dc; color: #c1502a; }
.sign-state { font-size: 2rem; font-weight: 800; letter-spacing: 1px; margin-bottom: 14px; }
.sign-yiji { margin: 0 0 16px; }
.sign-yiji > div { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.sign-yiji dt {
  flex: none; width: 30px; height: 30px; border-radius: 9px; background: #f1f2f7;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9375rem; color: var(--ink-soft);
}
.sign-yiji > div:first-child dt { background: #e8f7f0; color: #1f8f61; }
.sign-yiji > div:last-child dt { background: #fdeeea; color: #cf5a3d; }
.sign-yiji dd { margin: 3px 0 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.6; }
.sign-reading {
  font-size: 0.9375rem; line-height: 1.85; color: var(--ink-soft);
  background: #fafbff; border-radius: 14px; padding: 16px; margin: 0 0 16px;
}
.sign-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8125rem; color: var(--muted); padding-top: 14px; border-top: 1px dashed var(--line);
}
.sign-crash { color: var(--brand-dark); font-weight: 600; }
.sign-matched { margin: 12px 0 0; font-size: 0.8125rem; color: #1f8f61; }

.sign-cta { display: flex; align-items: center; gap: 14px; margin: 20px 0 26px; flex-wrap: wrap; }
.sign-list { display: flex; flex-direction: column; gap: 10px; }
.sign-list li { list-style: none; }
.sign-list a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; font-size: 0.9375rem;
  transition: all 0.16s ease;
}
.sign-list a:hover { border-color: var(--brand); background: #fafaff; }
.sign-list-id { flex: none; color: var(--muted); font-size: 0.8125rem; }

/* 签文墙 */
.wall-head { margin-bottom: 22px; }
.wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.wall-item {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; transition: all 0.18s ease;
}
.wall-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.wall-rare { border-color: #ded8ff; }
.wall-hidden { border-color: #ffd9b0; }
.wall-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.wall-state { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.sign-state-inline { font-size: 1rem; font-weight: 700; }
.wall-yi, .wall-ji { font-size: 0.875rem; line-height: 1.6; margin: 0 0 6px; color: var(--ink-soft); }
.wall-yi { color: #1f8f61; }
.wall-ji { color: #b8563c; }
.wall-id { display: block; margin-top: 10px; font-size: 0.75rem; color: var(--muted); }

body.fortune-mode { padding-bottom: 0; }
body.fortune-mode .site-footer { margin-top: 20px; }

@media (max-width: 980px) {
  .wall-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wall-grid { grid-template-columns: 1fr; }
  .ft-head h1 { font-size: 1.75rem; }
  .ft-tube { height: 176px; }
  .sign-card { padding: 20px; }
  .sign-state { font-size: 1.75rem; }
  .fortune-banner { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
  .fortune-banner-visual { align-self: center; }
}
