/* ===== AI沉香灸 · H5 前端样式（手机优先） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f7f2ea;
  color: #3a2f26;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 66px;
  position: relative;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* 顶部标题栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, #7c4a24, #a06a35);
  color: #fff; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 8px rgba(90,55,25,.15);
}
.topbar .back { font-size: 20px; width: 28px; text-align: center; }
.topbar .title { font-size: 17px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .action { font-size: 14px; color: #ffe3c0; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 60;
  background: #fff; border-top: 1px solid #efe6d8;
  display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; text-align: center; padding: 6px 0 2px; font-size: 11px; color: #9b8d7b;
}
.tabbar a .ic { font-size: 21px; line-height: 1.2; display: block; }
.tabbar a.active { color: #8a5a33; font-weight: 600; }

/* 首页 Banner（设计稿风格：沉香燃香图 + 文字叠层） */
.banner {
  position: relative; margin: 10px 12px 0; border-radius: 16px; overflow: hidden;
  height: 300px; color: #fff;
  background: #2d2320 url('../img/banner.jpg') no-repeat center/cover;
  box-shadow: 0 8px 20px rgba(90,55,25,.18);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.banner .mask {
  position: absolute; inset: 0; border-radius: 16px;
  background: linear-gradient(180deg, rgba(45,35,32,0) 20%, rgba(45,35,32,.35) 62%, rgba(45,35,32,.82) 100%);
}
.banner .tags { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; z-index: 2; }
.banner .tags span {
  font-size: 12px; padding: 3px 12px; border-radius: 20px; letter-spacing: 1px;
  background: rgba(255,255,255,.92); color: #6f4a26; font-weight: 600;
}
.banner .tags span.tag2 { background: rgba(111,74,38,.9); color: #f5e9da; }
.banner .body { position: relative; z-index: 2; padding: 16px; }
.banner .slogan { font-size: 26px; font-weight: 800; letter-spacing: 3px; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.banner .sub { font-size: 13px; opacity: .95; margin-top: 5px; letter-spacing: 2px; }
.banner .desc { font-size: 12px; opacity: .85; margin-top: 4px; }
.banner .cta {
  display: inline-block; margin-top: 12px; padding: 8px 22px; border-radius: 24px;
  background: linear-gradient(135deg, #d9a45f, #b07a3e); color: #3a2412; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

/* 首页轻色顶部条（设计稿风格） */
.topbar-light {
  background: #fff; color: #3a2f26; box-shadow: 0 1px 6px rgba(90,55,25,.06);
}
.topbar-light .title { font-size: 17px; font-weight: 800; letter-spacing: 1px; color: #6f4a26; }
.topbar-light .ic-link { font-size: 19px; color: #6f4a26; position: relative; padding: 0 2px; }

/* 六大功能入口（2×3 宫格） */
.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.grid-6 .cell { padding: 16px 6px 14px; text-align: center; }
.grid-6 .cell .ic {
  width: 52px; height: 52px; border-radius: 18px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff;
  box-shadow: 0 4px 10px rgba(90,55,25,.14);
}
.grid-6 .cell .nm { font-size: 14px; font-weight: 700; color: #3a2f26; }
.grid-6 .cell .ds { font-size: 11px; color: #9b8d7b; margin-top: 2px; }

/* 中医舌诊专区 */
.tongue-zone { position: relative; padding: 18px 14px 16px; overflow: hidden; }
.tongue-zone .zone-head { display: flex; align-items: center; justify-content: space-between; }
.tongue-zone .zone-title { font-size: 17px; font-weight: 800; color: #3a2f26; }
.tongue-zone .zone-title::before { content: ""; display: inline-block; width: 4px; height: 16px; background: #a06a35; border-radius: 2px; margin-right: 8px; vertical-align: -2px; }
.tongue-zone .zone-link { font-size: 12px; color: #9b8d7b; }
.tongue-zone .zone-body { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.tongue-zone .zone-text { flex: 1; }
.tongue-zone .zone-slogan { font-size: 17px; font-weight: 800; color: #6f4a26; }
.tongue-zone .zone-slogan .ai-tag {
  display: inline-block; font-size: 10px; font-weight: 600; color: #fff; background: linear-gradient(135deg,#b07a3e,#8a5a33);
  border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; letter-spacing: 1px;
}
.tongue-zone .zone-desc { font-size: 12px; color: #7d6f5d; margin-top: 6px; line-height: 1.7; }
.tongue-zone .zone-btn {
  display: inline-block; margin-top: 10px; padding: 8px 20px; border-radius: 24px;
  background: linear-gradient(135deg, #b07a3e, #8a5a33); color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(160,106,53,.3);
}
.tongue-zone .zone-fig {
  width: 108px; height: 108px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 30% 25%, #f7e8d4, #e3c9a4);
  display: flex; align-items: center; justify-content: center; font-size: 58px;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.6), 0 6px 16px rgba(160,106,53,.18);
  position: relative;
}
.tongue-zone .zone-fig::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  border: 2px dashed rgba(160,106,53,.35);
}

/* 入口按钮 */
.entry-actions { display: flex; gap: 10px; padding: 12px; }
.entry-actions .btn-main {
  flex: 1; border: none; border-radius: 12px; padding: 14px 0;
  color: #fff; font-size: 16px; font-weight: 600; text-align: center;
}
.entry-actions .detect { background: linear-gradient(135deg, #b07a3e, #8a5a33); }
.entry-actions .mall { background: linear-gradient(135deg, #6f8f5f, #557a45); }
.entry-actions .btn-main small { display: block; font-size: 11px; font-weight: 400; opacity: .85; }

/* 通用卡片 */
.card {
  background: #fff; border-radius: 14px; margin: 0 12px 12px;
  padding: 14px 14px; box-shadow: 0 2px 8px rgba(90,55,25,.05);
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 700; color: #3a2f26; margin-bottom: 12px;
}
.card-title::before { content: ""; width: 4px; height: 16px; background: #a06a35; border-radius: 2px; margin-right: 8px; }
.card-title .more { font-size: 12px; color: #9b8d7b; font-weight: 400; }

/* 商品网格 */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.prod-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 6px rgba(90,55,25,.06); }
.prod-card .thumb {
  height: 120px; display: flex; align-items: center; justify-content: center;
  font-size: 46px; color: #fff; position: relative;
}
.prod-card .info { padding: 10px 10px 12px; }
.prod-card .name { font-size: 13px; line-height: 1.4; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prod-card .cat { font-size: 11px; color: #9b8d7b; margin-top: 2px; }
.prod-card .price { color: #c0392b; font-weight: 700; font-size: 16px; margin-top: 6px; }
.prod-card .price .ori { color: #b9ad9c; font-size: 12px; font-weight: 400; text-decoration: line-through; margin-left: 4px; }

/* 检测页步骤 */
.step {
  display: flex; align-items: center; margin: 12px 12px 0; font-size: 15px; font-weight: 700; color: #3a2f26;
}
.step .num {
  width: 22px; height: 22px; border-radius: 50%; background: #a06a35; color: #fff;
  font-size: 13px; display: flex; align-items: center; justify-content: center; margin-right: 8px;
}
.step .hint { font-size: 12px; color: #9b8d7b; font-weight: 400; margin-left: 8px; }

/* 舌象选择（手动） */
.tongue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tongue-item {
  border: 1.5px solid #e4d9c8; border-radius: 12px; padding: 12px 6px; text-align: center;
  background: #fff; font-size: 14px; color: #5c4e40; transition: all .15s;
}
.tongue-item .swatch {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 8px; border: 2px solid #f0e7d8;
}
.tongue-item .swatch .t-icon { font-size: 22px; line-height: 38px; }
.tongue-item.selected { border-color: #a06a35; background: #fbf3e7; color: #8a5a33; font-weight: 600; box-shadow: 0 2px 8px rgba(160,106,53,.15); }
.tongue-item.selected .swatch { border-color: #a06a35; }

/* 症状选择 */
.symptom-list { display: flex; flex-wrap: wrap; gap: 8px; }
.symptom-item {
  padding: 7px 14px; border-radius: 20px; border: 1.5px solid #e4d9c8; background: #fff;
  font-size: 13px; color: #5c4e40; transition: all .15s;
}
.symptom-item.selected { border-color: #a06a35; background: #fbf3e7; color: #8a5a33; font-weight: 600; }

/* 方式切换 */
.mode-switch { display: flex; background: #efe6d8; border-radius: 10px; padding: 4px; margin: 12px 12px 0; }
.mode-switch button {
  flex: 1; border: none; background: transparent; padding: 9px 0; border-radius: 8px;
  font-size: 14px; color: #7d6f5d;
}
.mode-switch button.active { background: #fff; color: #8a5a33; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* 拍照上传 */
.photo-upload {
  border: 2px dashed #d8c9b4; border-radius: 14px; padding: 26px 16px; text-align: center;
  background: #fff; color: #9b8d7b; font-size: 14px;
}
.photo-upload .big { font-size: 44px; margin-bottom: 6px; }
.photo-upload.has-img { border-style: solid; border-color: #a06a35; padding: 10px; }
.photo-upload img { width: 100%; border-radius: 10px; }

/* 底部提交 */
.fixed-submit {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid #efe6d8; z-index: 60;
  display: flex; gap: 10px; align-items: center;
}
.fixed-submit .btn-go {
  flex: 1; border: none; border-radius: 12px; padding: 13px 0;
  background: linear-gradient(135deg, #b07a3e, #8a5a33); color: #fff;
  font-size: 16px; font-weight: 600;
}
.fixed-submit .btn-go:disabled { background: #d5c9b8; }

/* 结果页 */
.result-hero {
  margin: 12px; border-radius: 16px; padding: 24px 18px; color: #fdf6ec; text-align: center;
  background: linear-gradient(135deg, #2d2320, #6f4a26);
}
.result-hero .cname { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.result-hero .csub { font-size: 13px; opacity: .8; margin-top: 4px; }
.result-hero .tag {
  display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: 20px;
  background: rgba(255,255,255,.15); font-size: 13px;
}
.plan-block { border-left: 3px solid #a06a35; background: #fbf3e7; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.plan-block h4 { font-size: 14px; color: #8a5a33; margin-bottom: 6px; }
.plan-block p { font-size: 14px; color: #4c3d2e; margin-bottom: 4px; }
.plan-block .taboo { color: #c0392b; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #8a8378; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid #e4d9c8; border-radius: 10px; padding: 11px 12px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #a06a35; }

/* 购物车 */
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f2eadc; }
.cart-item:last-child { border-bottom: none; }
.cart-item .thumb { width: 70px; height: 70px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; }
.cart-item .info { flex: 1; }
.cart-item .name { font-size: 14px; font-weight: 600; }
.cart-item .price { color: #c0392b; font-weight: 700; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #d8c9b4; background: #fff; font-size: 16px; line-height: 1; color: #7d6f5d; }
.qty .n { min-width: 24px; text-align: center; }

/* 订单/结果卡片列表 */
.record-item { padding: 12px 0; border-bottom: 1px solid #f2eadc; }
.record-item:last-child { border-bottom: none; }
.record-item .top { display: flex; justify-content: space-between; font-size: 13px; color: #9b8d7b; }
.record-item .mid { margin: 6px 0; font-size: 15px; font-weight: 600; }
.record-item .bot { font-size: 13px; color: #5c4e40; }

/* 状态标签 */
.st { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.st-0 { background: #fff3e0; color: #e65100; }
.st-1 { background: #e3f2fd; color: #1565c0; }
.st-2 { background: #e8f5e9; color: #2e7d32; }
.st-3 { background: #ececec; color: #666; }

/* 空状态 */
.empty { text-align: center; color: #b5ad9f; padding: 40px 0; }
.empty .big { font-size: 46px; margin-bottom: 10px; }

/* 提示条 */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(45,35,32,.9); color: #fff; padding: 12px 22px; border-radius: 10px;
  font-size: 14px; z-index: 99; display: none; max-width: 78%; text-align: center;
}
.footer-info { padding: 16px; text-align: center; color: #9b8d7b; font-size: 12px; }
.footer-info .notice { background: #fbf3e7; border-radius: 8px; padding: 10px; margin-bottom: 12px; color: #7d6f5d; text-align: left; }

/* 骨架/分类 tab */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 12px 4px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs span {
  flex-shrink: 0; padding: 6px 16px; border-radius: 20px; background: #fff; border: 1.5px solid #e4d9c8;
  font-size: 13px; color: #7d6f5d;
}
.cat-tabs span.active { background: #8a5a33; color: #fff; border-color: #8a5a33; }

/* 结果报告区 */
.report-tongue { display: flex; flex-wrap: wrap; gap: 8px; }
.report-tongue .it { background: #fbf3e7; border-radius: 20px; padding: 4px 12px; font-size: 13px; color: #8a5a33; }
