/* =========================================================
 * hzshop H5 · 样式（法式实验室美学 · 规划 3.9）
 * 亚麻象牙底 / 暖墨文字 / 古铜点缀 / 衬线标题
 * 细线 + 留白分隔，圆角 ≤4px，无彩色堆砌
 * =======================================================*/
:root {
  --bg: #FAF6EF;            /* 亚麻象牙 · 页面底 */
  --surface: #FFFDF9;       /* 暖白 · 卡片/栏 */
  --ink: #211D18;           /* 暖墨 · 主文字 */
  --ink-2: #6F6659;         /* 次要文字 */
  --ink-3: #A79C8B;         /* 弱化文字 */
  --line: #E7DFD2;          /* 暖调细线 */
  --line-strong: #C9BBA4;   /* 输入框描边 */
  --fill: #F1EAE0;          /* 浅填充（输入框/图占位） */
  --accent: #9C6D3F;        /* 古铜 · 点缀 */
  --accent-deep: #7E5630;   /* 深古铜 · 价格/选中 */
  --danger: #A63A2E;        /* 错误/驳回 */
  --serif: Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg);
  font-size: 16px; line-height: 1.7;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
a { color: var(--ink); text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 0.5px solid var(--line-strong); border-radius: 4px;
  padding: 10px 12px; width: 100%; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
textarea { resize: vertical; min-height: 96px; }
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; }

/* ---------- 布局 ---------- */
.page { padding: 53px 0 92px; } /* 53 = 顶栏48 + 呼吸5 */
.inner { padding: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hairline { border-bottom: 0.5px solid var(--line); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }

/* ---------- 文字层级 ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.04em; }
.sec-title {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  letter-spacing: 0.06em; margin: 28px 16px 12px;
}
.muted { color: var(--ink-3); } .gray { color: var(--ink-2); }
.small { font-size: 14px; } .tiny { font-size: 12px; }
.red { color: var(--danger); } /* 仅错误/驳回文字 */
.price { font-family: Georgia, serif; font-size: 24px; font-weight: 600; color: var(--accent-deep); }
.price-sm { font-family: Georgia, serif; font-size: 18px; font-weight: 600; color: var(--accent-deep); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- 链接 / 按钮 ---------- */
.link { text-decoration: underline; cursor: pointer; color: var(--ink); font-size: 14px; }
.link.gray { color: var(--ink-2); }
.btn {
  display: block; width: 100%; background: var(--ink); color: var(--bg);
  text-align: center; padding: 13px 0; border-radius: 4px; font-size: 16px;
  letter-spacing: 0.1em; border: none; cursor: pointer;
}
.btn[disabled] { background: var(--line-strong); cursor: default; }
.btn-o {
  display: block; width: 100%; background: transparent; color: var(--ink);
  border: 0.5px solid var(--ink); text-align: center; padding: 12px 0;
  border-radius: 4px; font-size: 16px; letter-spacing: 0.06em; cursor: pointer;
}
.btn-row { display: flex; gap: 10px; }
.btn-row .btn, .btn-row .btn-o { flex: 1; }

/* ---------- 固定顶栏（左 主页/返回 · 中 标题 · 右 搜索） ---------- */
.topbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: 48px; z-index: 20;
  display: flex; align-items: center; padding: 0 16px;
  background: var(--surface); border-bottom: 0.5px solid var(--line);
}
.tb-title {
  flex: 1; text-align: center; font-family: var(--serif);
  font-size: 16px; font-weight: 600; letter-spacing: 0.08em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-side { min-width: 52px; font-size: 15px; color: var(--ink); cursor: pointer; }
.tb-right { text-align: right; }
.tb-ico { width: 20px; height: 20px; vertical-align: -4px; }

/* ---------- 京华老宋体字标（SVG，fill=currentColor） ---------- */
.brand-title { padding: 20px 16px 4px; }
.brand-title svg { height: 34px; width: auto; display: block; }
.tabbar .wm svg { height: 17px; width: auto; display: inline-block; vertical-align: -3px; }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex;
  background: var(--surface); border-top: 0.5px solid var(--line); z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; text-align: center; padding: 13px 0 11px; font-size: 14px; letter-spacing: 0.12em; color: var(--ink-2); cursor: pointer; border-top: 2px solid transparent; }
.tabbar a.on { color: var(--accent-deep); font-weight: 600; border-top-color: var(--accent); }

/* ---------- 搜索 ---------- */
.search-row { display: flex; gap: 8px; padding: 12px 16px; }
.search-row input { flex: 1; background: var(--fill); border-color: transparent; }
.search-row input:focus { border-color: var(--ink); background: var(--surface); }
.search-row .btn-s {
  flex: 0 0 auto; background: var(--ink); color: var(--bg); border-radius: 4px;
  padding: 0 18px; font-size: 15px; letter-spacing: 0.08em; border: none; cursor: pointer;
}

/* ---------- 轮播（scroll-snap） ---------- */
.slider-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.slider-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; }
.slide img, .slide video { width: 100%; object-fit: cover; background: var(--fill); }
.slide.banner img { aspect-ratio: 2 / 1; }
.slide.media img, .slide.media video { aspect-ratio: 1 / 1; }
.slider-idx { text-align: center; color: var(--ink-3); font-size: 12px; padding: 6px 0; }

/* ---------- 分类横排 ---------- */
.cat-scroll {
  display: flex; gap: 22px; overflow-x: auto; padding: 12px 16px;
  border-bottom: 0.5px solid var(--line); white-space: nowrap;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-scroll a { color: var(--ink-2); cursor: pointer; padding-bottom: 2px; font-size: 15px; }
.cat-scroll a.on { color: var(--accent-deep); font-weight: 600; border-bottom: 1px solid var(--accent); }

/* ---------- 列表页：左侧竖向大分类（电商经典布局） ---------- */
.list-body { display: flex; align-items: flex-start; }
.cat-side {
  flex: 0 0 88px; position: sticky; top: 53px;
  min-height: calc(100vh - 53px);
  border-right: 0.5px solid var(--line); background: var(--surface);
}
.cat-side a {
  display: block; padding: 14px 6px; font-size: 14px; color: var(--ink-2);
  text-align: center; cursor: pointer; border-left: 2px solid transparent;
}
.cat-side a.on { color: var(--accent-deep); font-weight: 600; border-left-color: var(--accent); }
.list-main { flex: 1; min-width: 0; }

/* ---------- 商品卡片 / 列表 ---------- */
.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5px; background: var(--line); }
.prod-cell { background: var(--surface); padding: 0 0 16px; cursor: pointer; }
.prod-cell img.cover { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--fill); }
.prod-cell .pt { padding: 10px 12px 4px; font-size: 15px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-cell .pp { padding: 0 12px; font-family: Georgia, serif; font-size: 18px; font-weight: 600; color: var(--accent-deep); }
.prod-cell .ps { padding: 0 12px; font-size: 12px; color: var(--ink-3); }

.li { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 0.5px solid var(--line); cursor: pointer; }
.li img.thumb { width: 84px; height: 84px; object-fit: cover; background: var(--fill); flex: 0 0 auto; }
.li .lt { font-size: 15px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 文章卡片 ---------- */
.art { padding: 16px; border-bottom: 0.5px solid var(--line); cursor: pointer; }
.art img.cover { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--fill); margin-bottom: 10px; }
.art .at { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.5; letter-spacing: 0.03em; }
.art .ae { color: var(--ink-2); font-size: 14px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- markdown 正文 ---------- */
.md { line-height: 1.8; word-break: break-word; }
.md p { margin: 0 0 14px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 20px 0 10px; line-height: 1.5; }
.md h1 { font-size: 24px; } .md h2 { font-size: 21px; } .md h3 { font-size: 18px; }
.md h4, .md h5, .md h6 { font-size: 16px; }
.md img { width: 100%; margin: 8px 0; }
.md ul, .md ol { margin: 0 0 14px 1.4em; }
.md code { background: var(--fill); padding: 1px 5px; border-radius: 4px; font-size: 14px; }
.md a { text-decoration: underline; }
.md .md-h { display: inline-block; font-size: 18px; }

/* ---------- 底部弹层（SKU） ---------- */
.mask { position: fixed; inset: 0; background: rgba(33,29,24,.4); z-index: 30; }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--surface); z-index: 31;
  border-top: 0.5px solid var(--line); padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 78vh; overflow-y: auto;
}
.sku-opt {
  display: inline-block; border: 0.5px solid var(--line-strong); border-radius: 4px;
  padding: 8px 14px; margin: 0 8px 8px 0; cursor: pointer; font-size: 14px;
}
.sku-opt.on { border-color: var(--accent); color: var(--accent-deep); font-weight: 600; }
.sku-opt.off { color: var(--line-strong); border-color: var(--line); }
.qty-ctl { display: inline-flex; align-items: center; border: 0.5px solid var(--line-strong); border-radius: 4px; }
.qty-ctl button { width: 36px; height: 34px; font-size: 18px; color: var(--ink); }
.qty-ctl span { min-width: 40px; text-align: center; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 15px; }

/* ---------- 空态 / 加载 ---------- */
.empty { text-align: center; color: var(--ink-3); padding: 60px 0 40px; }
.loading { text-align: center; color: var(--ink-3); padding: 40px 0; }
.more { display: block; text-align: center; padding: 16px; color: var(--ink-2); font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%);
  max-width: 78%; background: var(--ink); color: var(--bg); font-size: 14px;
  padding: 10px 18px; border-radius: 4px; z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.toast.show { opacity: 1; }

/* ---------- 我的 / 列表项 ---------- */
.menu { border-top: 0.5px solid var(--line); }
.menu a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 16px; border-bottom: 0.5px solid var(--line); cursor: pointer; font-size: 16px;
}
.menu a .sub { color: var(--ink-3); font-size: 13px; }

.avatar-block {
  width: 64px; height: 64px; border-radius: 4px; color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; overflow: hidden; flex: 0 0 auto;
}
.avatar-block img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 核销码 ---------- */
.verify-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 32px; font-weight: 600; letter-spacing: 2px; text-align: center; padding: 10px 0;
}
.verify-qr { width: 200px; height: 200px; margin: 8px auto; background: var(--fill); }

/* ---------- 时间线 ---------- */
.timeline { padding: 4px 0; }
.timeline .ti { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.timeline .ti .tt { color: var(--ink-3); font-size: 13px; }

/* ---------- 上传图预览 ---------- */
.up-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.up-list .up { width: 72px; }
.up-list .up img { width: 72px; height: 72px; object-fit: cover; background: var(--fill); }
.up-list .up .rm { font-size: 12px; color: var(--ink-2); text-decoration: underline; text-align: center; margin-top: 2px; }

/* ---------- 分销 ---------- */
.stat-row { display: flex; padding: 18px 0; }
.stat-row .st { flex: 1; text-align: center; }
.stat-row .st .v { font-size: 24px; font-weight: 600; }
.stat-row .st .k { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* 分销销售手册区分隔 */
.manual-box { border-top: 0.5px solid var(--line); margin-top: 20px; padding-top: 8px; }
