* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  background: #faf8f3;
  color: #2c2c2c;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-light: #e8f5e9;
  --primary-50: #f1f8f1;
  --bg: #faf8f3;
  --bg-warm: #f5f0e6;
  --card: #ffffff;
  --text: #2c2c2c;
  --text-2: #5a5a5a;
  --text-3: #8a8a8a;
  --line: #e8e4dc;
  --tag-bg: #f5f3ee;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(46,125,50,0.06);
  --border: 1px solid #ece8e0;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { border: none; outline: none; cursor: pointer; font-family: inherit; background: none; }
input { outline: none; font-family: inherit; }

.app { max-width: 750px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.app.has-tab { padding-bottom: 68px; }

/* 顶部导航栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 14px;
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(46,125,50,0.15);
}
.topbar .back { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.topbar .back:active { opacity: .6; }
.topbar .title { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.topbar .actions { display: flex; gap: 8px; }
.topbar .actions .act { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; opacity: .9; }
.topbar .actions .act:active { opacity: .5; }

/* 首页头部 */
.home-head { padding: 32px 20px 10px; text-align: center; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); }
.home-head h1 { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: 2px; }
.home-head .std { display: inline-block; margin-top: 12px; padding: 5px 14px; background: var(--primary-50); color: var(--primary-dark); font-size: 13px; border-radius: 20px; border: 1px solid var(--primary-light); }

/* 信息卡片组 */
.info-cards { display: flex; gap: 10px; padding: 20px 16px 8px; }
.info-cards .ic { flex: 1; background: var(--card); border-radius: var(--radius); padding: 16px 6px; text-align: center; box-shadow: var(--shadow); border: var(--border); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.info-cards .ic .ico { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
.info-cards .ic .t { font-size: 14px; color: var(--text-2); font-weight: 500; }

/* 主按钮 */
.btn-primary {
  display: block; width: calc(100% - 32px); margin: 24px 16px;
  height: 54px; line-height: 54px; text-align: center;
  background: var(--primary); color: #fff;
  font-size: 18px; font-weight: 600; letter-spacing: 2px; border-radius: 27px;
  box-shadow: 0 4px 14px rgba(46,125,50,0.25);
  transition: transform .1s;
}
.btn-primary:active { transform: scale(.98); background: var(--primary-dark); }
.btn-primary.disabled { background: #bdbdbd; box-shadow: none; }

/* 法律声明 */
.legal { padding: 6px 22px 10px; font-size: 13px; color: var(--text-3); line-height: 1.8; text-align: justify; }

/* 区块标题 */
.section-title { display: flex; align-items: center; gap: 10px; padding: 26px 16px 14px; font-size: 19px; font-weight: 700; color: var(--text); }
.section-title::before { content: ""; width: 5px; height: 18px; background: var(--primary); border-radius: 2px; }

/* 九种体质网格 */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px 8px; }
.type-grid .tg { background: var(--card); border-radius: var(--radius); padding: 16px 6px; text-align: center; box-shadow: var(--shadow); border: var(--border); transition: transform .1s; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.type-grid .tg:active { transform: scale(.96); }
.type-grid .tg .ico { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.type-grid .tg .n { font-size: 14px; color: var(--text); font-weight: 500; }

/* 温馨提示 */
.tips { margin: 16px 16px 24px; background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: var(--border); }
.tips .tt { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.tips ul li { position: relative; padding: 6px 0 6px 18px; font-size: 14px; color: var(--text-2); }
.tips ul li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 6px; height: 6px; background: var(--primary); border-radius: 50%; opacity: .7; }

/* 底部导航 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; max-width: 750px; margin: 0 auto; height: 60px; background: #fff; display: flex; border-top: 1px solid #ece8e0; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 40; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); font-size: 12px; }
.tabbar a .ico { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.tabbar a.active { color: var(--primary); font-weight: 600; }

/* 性别选择页 */
.gender-page { min-height: 100vh; background: var(--bg-warm); }
.gender-main { padding: 48px 24px; text-align: center; }
.gender-main h2 { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: 2px; }
.gender-main .std { display: inline-block; margin-top: 14px; padding: 6px 16px; background: #fff; color: var(--primary-dark); font-size: 13px; border-radius: 20px; border: 1px solid var(--primary-light); }
.gender-main .desc { margin-top: 22px; font-size: 16px; color: var(--text-2); }
.gender-group { display: flex; gap: 24px; justify-content: center; margin-top: 40px; }
.gender-btn { width: 130px; height: 130px; background: #fff; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; box-shadow: var(--shadow); border: 2px solid transparent; transition: all .15s; }
.gender-btn:active { transform: scale(.97); }
.gender-btn.selected { border-color: var(--primary); background: var(--primary-50); }
.gender-btn .sym { font-size: 44px; line-height: 1; color: var(--primary); }
.gender-btn .lab { font-size: 17px; color: var(--text); font-weight: 500; }
.gender-foot { text-align: center; margin-top: 44px; font-size: 14px; color: var(--text-3); }
.gender-next { display: block; width: calc(100% - 48px); margin: 32px 24px; height: 54px; line-height: 54px; text-align: center; background: var(--primary); color: #fff; font-size: 18px; font-weight: 600; letter-spacing: 2px; border-radius: 27px; box-shadow: 0 4px 14px rgba(46,125,50,0.25); }
.gender-next:active { background: var(--primary-dark); }
.gender-next.disabled { background: #bdbdbd; box-shadow: none; }

/* 问卷页 */
.quiz-progress { padding: 16px 16px 8px; background: #fff; border-bottom: 1px solid var(--line); }
.quiz-progress .pt { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.quiz-progress .pt b { color: var(--primary); font-weight: 600; font-size: 15px; }
.quiz-progress .bar { height: 8px; background: #ece8e0; border-radius: 4px; overflow: hidden; }
.quiz-progress .bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .2s; }
.quiz-progress .steps { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.quiz-progress .steps .s { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #f0ede5; color: var(--text-3); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.quiz-progress .steps .s.done { background: var(--primary); color: #fff; }
.quiz-progress .steps .s.cur { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px rgba(46,125,50,0.2); }

.quiz-card { margin: 14px 12px; background: #fff; border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); border: var(--border); }
.quiz-card .qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.quiz-card .qnum { padding: 4px 12px; background: var(--primary); color: #fff; font-size: 13px; border-radius: 12px; font-weight: 600; }
.quiz-card .qtype { padding: 4px 12px; background: var(--tag-bg); color: var(--text-2); font-size: 13px; border-radius: 12px; }
.quiz-card .qtext { font-size: 19px; font-weight: 600; color: var(--text); line-height: 1.6; margin-bottom: 20px; }

.opt-list { display: flex; flex-direction: column; gap: 12px; }
.opt { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: #faf8f3; border-radius: 10px; border: 2px solid transparent; transition: all .12s; }
.opt:active { background: #f0ede5; }
.opt.selected { background: var(--primary-50); border-color: var(--primary); }
.opt .ol { display: flex; align-items: center; gap: 14px; }
.opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c4c0b8; display: flex; align-items: center; justify-content: center; transition: all .12s; }
.opt.selected .radio { border-color: var(--primary); background: var(--primary); }
.opt.selected .radio::after { content: ""; width: 8px; height: 8px; background: #fff; border-radius: 50%; }
.opt .otext { font-size: 16px; color: var(--text); }
.opt .oscore { font-size: 13px; color: var(--text-3); background: #ece8e0; padding: 3px 10px; border-radius: 10px; }

.quiz-foot { position: sticky; bottom: 0; background: #fff; padding: 16px; display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(0,0,0,0.04); }
.quiz-foot .nav-btn { width: 48px; height: 48px; border-radius: 50%; background: #f0ede5; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.quiz-foot .nav-btn:active { background: #e0ddd5; }
.quiz-foot .nav-btn.disabled { opacity: .4; }
.quiz-foot .mid { flex: 1; text-align: center; font-size: 14px; color: var(--text-2); }
.quiz-foot .mid .submit-btn { display: inline-block; padding: 10px 28px; background: var(--primary); color: #fff; border-radius: 22px; font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.quiz-foot .mid .submit-btn:active { background: var(--primary-dark); }

/* 结果页 */
.result-hero { padding: 36px 20px 28px; text-align: center; background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }
.result-hero .label { font-size: 14px; opacity: .9; }
.result-hero .name { font-size: 32px; font-weight: 700; margin-top: 8px; letter-spacing: 2px; }
.result-hero .score { font-size: 14px; opacity: .9; margin-top: 10px; }
.result-hero .desc { font-size: 14px; opacity: .88; margin-top: 16px; line-height: 1.8; padding: 0 12px; }

.result-section { margin: 16px; background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: var(--border); }
.result-section h3 { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.result-section h3::before { content: ""; width: 5px; height: 16px; background: var(--primary); border-radius: 2px; }
.result-section .row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #ece8e0; font-size: 15px; }
.result-section .row:last-child { border-bottom: none; }
.result-section .row .k { color: var(--text-2); flex: 0 0 84px; }
.result-section .row .v { color: var(--text); flex: 1; line-height: 1.7; }

.radar-wrap { display: flex; justify-content: center; padding: 12px 0; }
.radar-wrap svg { max-width: 100%; }

.score-list { display: flex; flex-direction: column; gap: 10px; }
.score-list .sl { display: flex; align-items: center; gap: 12px; }
.score-list .sl .n { flex: 0 0 68px; font-size: 14px; color: var(--text-2); }
.score-list .sl .bar { flex: 1; height: 10px; background: #ece8e0; border-radius: 5px; overflow: hidden; }
.score-list .sl .bar i { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.score-list .sl .v { flex: 0 0 40px; text-align: right; font-size: 14px; color: var(--text); font-weight: 600; }

.result-actions { display: flex; gap: 14px; padding: 10px 16px 26px; }
.result-actions a { flex: 1; height: 50px; line-height: 50px; text-align: center; border-radius: 25px; font-size: 16px; font-weight: 600; letter-spacing: 1px; }
.result-actions .ret { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.result-actions .det { background: var(--primary); color: #fff; }

/* 详情页 */
.detail-hero { padding: 36px 20px; text-align: center; color: #fff; }
.detail-hero .ico { width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; }
.detail-hero .n { font-size: 26px; font-weight: 700; letter-spacing: 2px; }
.detail-hero .en { font-size: 14px; opacity: .85; margin-top: 6px; }

/* 通用SVG图标尺寸 */
.svg-24 { width: 24px; height: 24px; }
.svg-20 { width: 20px; height: 20px; }
.svg-18 { width: 18px; height: 18px; }

/* 动画 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .25s ease; }

@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: pop .2s ease; }

/* 加载提示 */
.loading { text-align: center; padding: 48px; color: var(--text-3); font-size: 15px; }

/* 商品推荐区域 */
.goods-section { margin: 16px; background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: var(--border); }
.goods-section .gh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.goods-section .gh .gt { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--text); }
.goods-section .gh .gt::before { content: ""; width: 5px; height: 16px; background: var(--primary); border-radius: 2px; }
.goods-section .gh .more { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 2px; }
.goods-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.goods-card { background: #faf8f3; border-radius: 10px; overflow: hidden; transition: transform .1s; border: var(--border); }
.goods-card:active { transform: scale(.97); }
.goods-card .gimg { position: relative; width: 100%; aspect-ratio: 1 / 1; background: linear-gradient(135deg, #f5f3ee 0%, #ece8e0 100%); display: flex; align-items: center; justify-content: center; }
.goods-card .gimg .ph { color: #b8b4ac; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.goods-card .gimg .tag { position: absolute; left: 8px; top: 8px; background: rgba(46,125,50,0.9); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 8px; }
.goods-card .gbody { padding: 12px; }
.goods-card .gname { font-size: 14px; color: var(--text); line-height: 1.5; height: 42px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.goods-card .gprice { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.goods-card .gprice .now { color: var(--primary); font-size: 17px; font-weight: 700; }
.goods-card .gprice .now small { font-size: 13px; font-weight: 600; }
.goods-card .gprice .old { color: var(--text-3); font-size: 13px; text-decoration: line-through; }
.goods-card .gbtn { margin-top: 10px; width: 100%; height: 34px; line-height: 34px; text-align: center; background: var(--primary); color: #fff; font-size: 13px; border-radius: 17px; letter-spacing: 1px; }
.goods-card .gbtn:active { background: var(--primary-dark); }
