:root {
  --primary: #7c5cff;
  --primary-2: #a78bfa;
  --secondary: #ff6b9d;
  --accent: #4ecdc4;
  --text: #2c2c3a;
  --text-sub: #8a8aa0;
  --radius: 16px;
  --radius-sm: 12px;
  --card-bg: rgba(255, 255, 255, .82);
  --shadow: 0 6px 20px rgba(124, 92, 255, .08);
  --wechat-green: #07c160;
  --alipay-blue: #1677ff;
  --price-red: #ff4d6d;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(-45deg, #f3e7ff, #e0f7fa, #fff0f5, #e8f5e9);
  background-size: 400% 400%;
  animation: gradientBG 18s ease infinite;
  color: var(--text);
  min-height: 100vh;
  font-size: 14px; line-height: 1.6;
  overflow-x: hidden;
}
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* 装饰粒子 */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.particle { position: absolute; border-radius: 50%; opacity: .35; filter: blur(8px); animation: floatUp linear infinite; }
@keyframes floatUp { 0% { transform: translateY(100vh) scale(.8); opacity: 0; } 20% { opacity: .4; } 80% { opacity: .3; } 100% { transform: translateY(-20vh) scale(1.2); opacity: 0; } }

.container { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 0 16px 90px; min-height: 100vh; }

/* ===== Hero ===== */
.hero { text-align: center; padding: 52px 12px 26px; position: relative; }
.hero-title {
  font-size: 32px; font-weight: 800; line-height: 1.22; margin: 0 0 8px;
  background: linear-gradient(90deg, #7c5cff, #ff6b9d, #4ecdc4);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.hero-subtitle { color: var(--text-sub); font-size: 14px; margin: 0 0 22px; }
.hero-stats { display: flex; justify-content: center; gap: 26px; }
.stat-item { text-align: center; }
.stat-num { font-size: 22px; font-weight: 800; background: linear-gradient(135deg, #ff6b9d, #7c5cff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* ===== 搜索 ===== */
.search-box { position: relative; margin: 0 2px 18px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-sub); font-size: 14px; }
.search-input {
  width: 100%; padding: 12px 14px 12px 38px; border: none; border-radius: 999px;
  background: rgba(255, 255, 255, .9); box-shadow: var(--shadow); font-size: 14px; outline: none; color: var(--text);
}
.search-input:focus { box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }

/* ===== 分类胶囊 ===== */
.category-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; margin: 0 -2px; }
.category-scroll::-webkit-scrollbar { display: none; }
.category-pill {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 9px 15px;
  border-radius: 999px; font-size: 13px; color: #6b6b80; background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .9); cursor: pointer; white-space: nowrap; transition: all .2s;
}
.category-pill i { font-size: 12px; }
.category-pill:active { transform: scale(.96); }
.category-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  border-color: transparent; box-shadow: 0 6px 18px rgba(124, 92, 255, .35); transform: scale(1.04);
}

/* ===== 区块标题 ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 12px; }
.section-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--secondary); }
.section-more { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 2px; }

/* ===== 精选推荐（横滑）===== */
.recommend-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.recommend-scroll::-webkit-scrollbar { display: none; }
.recommend-card {
  flex: 0 0 auto; width: 78vw; max-width: 320px; border-radius: var(--radius); padding: 20px; color: #fff;
  position: relative; overflow: hidden; scroll-snap-align: start; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); transition: transform .3s; cursor: pointer; text-decoration: none;
}
.recommend-card:active { transform: scale(.98); }
.recommend-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)); z-index: 1; }
.recommend-card::after { content: ''; position: absolute; top: -30%; right: -20%; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .15); filter: blur(20px); }
.rec-content { position: relative; z-index: 2; }
.rec-tag { display: inline-block; font-size: 10px; padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, .25); backdrop-filter: blur(4px); margin-bottom: 10px; }
.rec-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.rec-desc { font-size: 12px; opacity: .95; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
.rec-footer { display: flex; align-items: center; justify-content: space-between; }
.rec-price { font-weight: 700; font-size: 16px; }
.rec-btn { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--text); font-size: 12px; font-weight: 700; }

/* ===== 全部测试（双列）===== */
.test-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 4px 10px; }
.test-card {
  background: var(--card-bg); backdrop-filter: blur(10px); border-radius: var(--radius-sm); padding: 14px;
  box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .9); transition: transform .25s, box-shadow .25s;
  cursor: pointer; position: relative; overflow: hidden; text-decoration: none; color: var(--text); display: block;
}
.test-card:active { transform: scale(.97); }
.test-icon-wrap {
  width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 10px; position: relative; color: #fff;
}
.test-icon-wrap::after { content: ''; position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(135deg, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0)); }
.test-type-tag { position: absolute; top: 10px; right: 10px; font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 600; background: rgba(245, 245, 245, .92); color: #777; }
.test-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.test-desc { font-size: 11px; color: var(--text-sub); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; min-height: 30px; }
.test-price { font-size: 13px; }
.test-price b { color: var(--price-red); font-weight: 800; font-size: 15px; }
.test-price .free { color: #1d9e75; font-weight: 700; }
.test-price .old { color: #c2c2d2; text-decoration: line-through; margin-left: 6px; font-size: 11px; }

/* ===== 详情页 ===== */
.page { padding: 14px 0 20px; }
.back { color: var(--primary); text-decoration: none; font-size: 14px; display: inline-block; margin: 6px 0 10px; }
.cover-big { height: 150px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 60px; color: #fff; margin: 6px 0 14px; box-shadow: var(--shadow); }
.detail-title { font-size: 22px; font-weight: 800; margin: 4px 0; }
.detail-sub { color: var(--text-sub); margin: 0 0 12px; font-size: 13px; }
.detail-meta { font-size: 13px; color: #6b6b80; margin: 10px 0 4px; }
.desc { background: rgba(255, 255, 255, .7); border-radius: var(--radius-sm); padding: 14px; color: #555; font-size: 13px; margin: 12px 0; line-height: 1.7; }

/* 底部支付区 */
.pay-section { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 30px rgba(0, 0, 0, .1); z-index: 60; }
.pay-inner { max-width: 480px; margin: 0 auto; }
.price-box { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.price-current { font-size: 1.8rem; font-weight: 800; color: var(--price-red); }
.price-tag { background: var(--price-red); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: .7rem; font-weight: 600; }
.price-original { font-size: .9rem; color: #999; text-decoration: line-through; }
.payment-methods { display: flex; gap: 12px; margin-bottom: 12px; }
.payment-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 2px solid #e0e0e0; border-radius: var(--radius-sm); background: #fff; cursor: pointer; transition: all .2s; font-size: 14px; }
.payment-btn i { font-size: 20px; }
.payment-btn .fa-weixin { color: var(--wechat-green); }
.payment-btn .fa-alipay { color: var(--alipay-blue); }
.payment-btn.active { border-color: var(--primary); background: #f5f3ff; }
.pay-btn {
  width: 100%; padding: 15px; border: none; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 4px 15px rgba(124, 92, 255, .3); transition: transform .15s;
}
.pay-btn:active { transform: scale(.98); }
.pay-security { display: flex; justify-content: center; gap: 18px; margin-top: 10px; font-size: 11px; color: #999; }
.pay-security span { display: flex; align-items: center; gap: 4px; }

/* ===== 测试详情页（对齐参考站）===== */
.t-page { background: #f5f5f5; min-height: 100vh; }
.t-hero { position: relative; padding: 50px 20px 70px; text-align: center; color: #fff; overflow: hidden; }
.t-hero::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px); background-size: 20px 20px; opacity: .3; }
.t-hero > * { position: relative; z-index: 1; }
.t-hero-badge { display: inline-block; background: rgba(255,255,255,.2); padding: 6px 16px; border-radius: 20px; font-size: 13px; margin-bottom: 16px; backdrop-filter: blur(10px); }
.t-hero-title { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.t-hero-sub { font-size: 14px; opacity: .92; max-width: 400px; margin: 0 auto 20px; line-height: 1.6; }
.t-hero-stats { display: flex; justify-content: center; gap: 36px; }
.t-hero-stat { text-align: center; }
.t-hero-stat-v { font-size: 22px; font-weight: 700; }
.t-hero-stat-l { font-size: 12px; opacity: .85; }

.t-bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; height: 60px; z-index: 100; box-shadow: 0 -2px 12px rgba(0,0,0,.08); }
.t-bottom-share { width: 100px; display: flex; align-items: center; justify-content: center; background: #fff; color: #666; font-size: 12px; cursor: pointer; gap: 4px; border: none; }
.t-bottom-cta { flex: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ff9800, #ff5722); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; gap: 8px; }
.t-bottom-cta:active { opacity: .9; }

.t-notes { padding: 16px 20px calc(80px + env(safe-area-inset-bottom)); color: #666; font-size: 12px; line-height: 1.8; }
.t-notes h4 { font-size: 14px; font-weight: 700; color: #333; margin-bottom: 6px; }
.t-notes p { margin: 0; }

/* ===== 答题页（对齐参考站）===== */
.quiz-bg { background: #f5f5f5; min-height: 100vh; }
.quiz-hero-img { width: 100%; height: 220px; object-fit: cover; display: block; }
.quiz-hero-gradient { width: 100%; height: 220px; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; overflow: hidden; }
.quiz-hero-gradient::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,.1) 1px, transparent 1px); background-size: 20px 20px; opacity: .3; }
.quiz-hero-gradient h2 { position: relative; z-index: 1; font-size: 20px; font-weight: 700; text-align: center; padding: 0 20px; }

.quiz-content { background: #fff; border-radius: 16px 16px 0 0; margin-top: -30px; position: relative; z-index: 10; padding: 20px 16px 100px; max-width: 600px; margin-left: auto; margin-right: auto; }
.t-progress-info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 8px; }
.t-progress-info .bar-text { color: #0dbf9b; font-weight: 600; }
.t-progress-info .pct { color: #999; font-weight: 600; }
.t-progress-bar { height: 8px; background: #eafbf7; border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.t-progress-fill { height: 100%; background: #0dbf9b; border-radius: 4px; transition: width .4s ease; }
.t-encourage { text-align: center; padding: 4px 0 12px; color: #0dbf9b; font-size: 13px; font-style: italic; }

.t-q-num { color: #0dbf9b; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.t-q-text { font-size: 17px; color: #333; margin-bottom: 18px; line-height: 1.6; font-weight: 700; }
.t-opts { display: flex; flex-direction: column; gap: 10px; }
.t-opt {
  background: #f8fcfb; border: 1px solid #f0f0f0; border-radius: 60px;
  padding: 12px 18px; cursor: pointer; transition: all .25s;
  display: flex; align-items: center; gap: 10px; text-align: left;
  font: inherit; color: #333; width: 100%;
}
.t-opt:active { transform: scale(.98); }
.t-opt .opt-label { font-weight: 600; font-size: 15px; }
.t-opt.sel { background: #eafbf7; border-color: #0dbf9b; }
.t-opt.sel .opt-label { color: #0dbf9b; font-weight: 700; }
.t-opt .opt-radio { width: 22px; height: 22px; border: 2px solid #ddd; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .25s; }
.t-opt.sel .opt-radio { border-color: #149078; background: #149078; }
.t-opt.sel .opt-radio::after { content: '✓'; color: #fff; font-size: 12px; }

/* 题目切换动画 */
.q-block { animation: qIn .25s ease; }
@keyframes qIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.t-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.t-btn-nav { height: 42px; cursor: pointer; display: inline-flex; align-items: center; padding: 0 24px; border-radius: 21px; font-size: 15px; font-weight: 600; transition: all .25s; border: none; }
.t-btn-prev { border: 1px solid #0dbf9b; border-radius: 21px; color: #0dbf9b; background: #fff; }
.t-btn-prev:active { background: #eafbf7; }
.t-btn-next { background: linear-gradient(135deg, #ff9800, #ff5722); color: #fff; box-shadow: 0 4px 15px rgba(255,152,0,.35); }
.t-btn-next:active { transform: translateY(1px); }
.t-btn-nav:disabled { opacity: .4; cursor: not-allowed; }

.t-foot-notes { padding: 16px 4px; color: #666; font-size: 12px; line-height: 1.8; }
.t-foot-notes h4 { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 5px; }
.t-foot-notes p { margin: 0; }

/* ===== 结果/支付页（对齐参考站）===== */
.r-header { color: #fff; padding: 20px 20px 50px; display: flex; align-items: center; gap: 14px; }
.r-header-icon { width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: rgba(255,255,255,.2); flex-shrink: 0; }
.r-header-info { flex: 1; }
.r-header-sub { font-size: 12px; opacity: .9; }
.r-header-title { font-size: 20px; font-weight: 600; margin: 4px 0; }
.r-header-desc { font-size: 12px; opacity: .85; }
.r-body { max-width: 600px; margin: -30px auto 0; padding: 0 16px 80px; position: relative; z-index: 10; }
.r-card { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.r-card-title { text-align: center; color: #149078; font-size: 17px; font-weight: 700; margin-bottom: 16px; position: relative; }
.r-card-title::before, .r-card-title::after { content: '●'; color: #b8d8c8; margin: 0 8px; font-size: 8px; vertical-align: middle; }
.r-summary-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; font-weight: 500; }
.r-summary-label { color: #555; }
.r-summary-value { color: #333; font-weight: 500; }
.r-summary-value.locked { color: #d48806; display: flex; align-items: center; gap: 4px; }
.r-score-overview { text-align: center; padding: 16px 0; }
.r-score-value { font-size: 36px; font-weight: 800; color: #149078; }
.r-score-total { font-size: 13px; color: #888; margin-top: 4px; }
.r-score-badge { display: inline-block; margin-top: 12px; padding: 6px 20px; border-radius: 20px; font-size: 14px; font-weight: 600; color: #fff; background: #149078; }
.r-bars { margin-top: 12px; }
.r-bar { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.r-bar .name { width: 84px; color: #555; flex-shrink: 0; font-size: 12px; }
.r-bar .track { flex: 1; height: 8px; background: #eafbf7; border-radius: 4px; overflow: hidden; }
.r-bar .track > i { display: block; height: 100%; background: #0dbf9b; border-radius: 4px; }
.r-bar b { width: 30px; text-align: right; flex-shrink: 0; font-weight: 700; color: #333; }
.r-advice { background: #eafaf2; border-radius: 8px; padding: 14px; color: #1d7a55; font-size: 13px; line-height: 1.7; }
.r-promo { text-align: center; }
.r-promo-title { color: #149078; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.r-promo-sub { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.r-participant { font-size: 13px; color: #666; margin-bottom: 10px; }
.r-participant strong { color: #d63031; }
.r-discount { font-size: 20px; color: #d63031; font-weight: 700; margin-bottom: 12px; }
.r-original-price { font-size: 13px; color: #999; text-decoration: line-through; margin-right: 8px; }
.r-discount-note { color: #d48806; font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.r-pay-methods { display: flex; gap: 16px; justify-content: center; margin-bottom: 18px; }
.r-pay-btn { border: 1px solid #ddd; border-radius: 8px; padding: 8px 14px; display: flex; align-items: center; gap: 8px; background: #fff; cursor: pointer; transition: all .2s; }
.r-pay-btn.active { border-color: #ff9800; }
.r-pay-btn .pay-name { font-size: 14px; font-weight: 500; }
.r-pay-btn .pay-sub { font-size: 11px; color: #999; }
.r-unlock-btn { width: 100%; background: linear-gradient(135deg, #ff9800, #ff5722); color: #fff; border: none; border-radius: 30px; padding: 14px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(255,152,0,.3); text-decoration: none; display: block; text-align: center; }
.r-unlock-btn:active { opacity: .9; }

/* ===== 结果页旧样式已移至 .r- 前缀（见上方）===== */

/* ===== 页脚 / 备案 ===== */
.page-footer { text-align: center; padding: 22px 16px 6px; color: #9ca3af; font-size: 12px; line-height: 1.8; }
.page-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.footer-divider { width: 40px; height: 2px; background: linear-gradient(90deg, var(--primary), var(--secondary)); margin: 0 auto 14px; border-radius: 2px; }
.footer-beian { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 6px; color: #9ca3af; }
.footer-beian img { width: 14px; height: 14px; }

.note { font-size: 12px; color: #9a9ab0; text-align: center; margin-top: 10px; }
.empty { text-align: center; color: #9a9ab0; padding: 60px 20px; }

/* ===== 微信防封引导浮层 ===== */
.wx-guide { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; }
.wx-guide__mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.wx-guide__card {
  position: relative; z-index: 1; width: 84%; max-width: 320px; background: #fff; border-radius: 18px; padding: 26px 20px 20px;
  text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); animation: modalPop .25s ease;
}
@keyframes modalPop { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
.wx-guide__arrow { position: relative; height: 64px; margin-bottom: 8px; color: var(--primary); font-size: 26px; font-weight: 800; }
.wx-guide__arrow::before { content: ''; position: absolute; top: 4px; right: 22%; width: 22px; height: 22px; border-top: 4px solid var(--primary); border-right: 4px solid var(--primary); transform: rotate(-45deg); border-radius: 2px; }
.wx-guide__title { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: #333; }
.wx-guide__txt { font-size: 13px; color: #555; line-height: 1.7; margin-bottom: 18px; }
.wx-guide__close { width: 100%; padding: 11px; border: none; border-radius: 999px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }

/* 滚动入场 */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
