/* ===== 用户端 H5 样式(手机尺寸) ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --accent: #E8472B;
  --accent-soft: #FDECE9;
  --ink: #1F2329;
  --ink-2: #4E5969;
  --ink-3: #86909C;
  --line: #ECEEF1;
  --bg: #F5F6F8;
}
html { background: #E9EAEE; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink); font-size: 14px; background: var(--bg);
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  box-shadow: 0 0 24px rgba(0,0,0,.08);
  padding-bottom: 0;
}

/* 顶部搜索 */
.m-header {
  position: sticky; top: 0; z-index: 20; background: #fff;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--line);
}
.m-search {
  background: var(--bg); border-radius: 99px; padding: 8px 14px;
  color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.m-banner {
  margin: 12px 14px 0; border-radius: 10px; background: #1D2129; color: #fff;
  padding: 18px 18px; position: relative; overflow: hidden;
}
.m-banner b { font-size: 17px; display: block; margin-bottom: 6px; }
.m-banner p { font-size: 12px; color: #B6BCC7; line-height: 1.6; }
.m-banner .tag {
  position: absolute; right: 14px; top: 14px; font-size: 11px; color: #fff;
  border: 1px solid rgba(255,255,255,.35); padding: 2px 8px; border-radius: 99px;
}

/* 分类 tab */
.m-cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 14px 6px;
  scrollbar-width: none;
}
.m-cats::-webkit-scrollbar { display: none; }
.m-cats button {
  flex-shrink: 0; border: none; background: #fff; color: var(--ink-2);
  padding: 7px 14px; border-radius: 99px; font-size: 13px; cursor: pointer;
}
.m-cats button.on { background: var(--accent); color: #fff; font-weight: 500; }

/* 商品卡 */
.m-list { padding: 8px 14px 20px; }
.p-card {
  background: #fff; border-radius: 10px; margin-bottom: 12px; overflow: hidden;
  display: flex; text-decoration: none; color: inherit; border: 1px solid var(--line);
}
.p-cover {
  width: 108px; flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; padding: 10px 6px;
  min-height: 108px;
}
.p-cover .char { font-size: 30px; font-weight: 700; line-height: 1.1; }
.p-cover .cat { font-size: 11px; margin-top: 6px; opacity: .85; }
.p-info { flex: 1; padding: 12px 12px 10px; min-width: 0; }
.p-name { font-size: 14px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-shop { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.p-tags { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.p-tags span { font-size: 10px; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; }
.p-bottom { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.p-price { color: var(--accent); font-weight: 700; font-size: 17px; }
.p-price small { font-size: 11px; font-weight: 400; }
.p-price del { color: var(--ink-3); font-size: 11px; font-weight: 400; margin-left: 4px; }
.p-sales { font-size: 11px; color: var(--ink-3); }

/* 详情页 */
.d-cover { height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.d-cover .char { font-size: 56px; font-weight: 700; }
.d-cover .cat { font-size: 13px; margin-top: 8px; opacity: .85; }
.d-body { padding: 16px 14px; background: #fff; }
.d-name { font-size: 18px; font-weight: 700; line-height: 1.5; }
.d-price-row { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 4px; }
.d-price { color: var(--accent); font-size: 26px; font-weight: 800; }
.d-price small { font-size: 14px; font-weight: 500; }
.d-price-row del { color: var(--ink-3); font-size: 13px; }
.d-price-row .sales { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.d-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.d-tags span { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 4px; }
.d-sec { margin-top: 12px; background: #fff; border-radius: 10px; padding: 16px 14px; }
.d-sec h4 { font-size: 15px; margin-bottom: 10px; }
.d-sec p { font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.d-shop { display: flex; align-items: center; gap: 12px; }
.d-shop .ava {
  width: 44px; height: 44px; border-radius: 10px; color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.d-shop .n { font-weight: 600; font-size: 14px; }
.d-shop .s { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.d-attrs .row { display: flex; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.d-attrs .row:last-child { border-bottom: none; }
.d-attrs .row .k { width: 76px; color: var(--ink-3); flex-shrink: 0; }
.d-attrs .row .v { color: var(--ink-2); }

/* 底部购买栏 */
.buy-bar {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; z-index: 20;
}
.buy-bar .bb-price { flex: 1; }
.buy-bar .bb-price .p { color: var(--accent); font-size: 20px; font-weight: 800; }
.buy-bar .bb-price .p small { font-size: 12px; font-weight: 500; }
.buy-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 99px;
  padding: 11px 30px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-block; text-align: center;
}

/* 返回栏 */
.nav-bar {
  position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; height: 46px; padding: 0 8px;
}
.nav-bar .back {
  border: none; background: none; font-size: 20px; padding: 6px 10px; cursor: pointer; color: var(--ink);
  text-decoration: none;
}
.nav-bar .t { flex: 1; text-align: center; font-weight: 600; font-size: 15px; margin-right: 36px; }

/* 下单页 */
.o-sec { background: #fff; margin-top: 10px; padding: 14px; }
.o-sec:first-child { margin-top: 0; }
.o-sec h4 { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 10px; }
.o-prod { display: flex; gap: 10px; }
.o-prod .cov {
  width: 64px; height: 64px; border-radius: 8px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
}
.o-prod .n { font-size: 14px; font-weight: 600; line-height: 1.4; }
.o-prod .m { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.o-prod .pr { margin-left: auto; color: var(--accent); font-weight: 700; white-space: nowrap; }
.o-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 14px; }
.o-row .k { color: var(--ink-2); }
.o-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.o-row.total .v { color: var(--accent); font-size: 18px; font-weight: 800; }
.o-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; margin-bottom: 10px; outline: none; background: #fff;
}
.o-input:focus { border-color: var(--accent); }
.o-note { font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* 弹层 */
.m-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 30px;
}
.m-mask.show { display: flex; }
.m-modal { background: #fff; border-radius: 12px; padding: 28px 22px; text-align: center; max-width: 320px; width: 100%; }
.m-modal .ok {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.m-modal b { font-size: 16px; }
.m-modal p { font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.7; }
.m-modal .buy-btn { margin-top: 18px; padding: 9px 26px; font-size: 14px; }

.empty { text-align: center; color: var(--ink-3); padding: 60px 0; font-size: 13px; }

/* ===== 以下为用户端升级版样式(真实感) ===== */

/* 图片封面 */
.p-cover { padding: 0; position: relative; }
.p-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-cover .cat-badge {
  position: absolute; left: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; padding: 2px 8px; border-top-right-radius: 8px;
}

/* Banner 轮播 */
.carousel { position: relative; margin: 12px 14px 0; border-radius: 12px; overflow: hidden; }
.carousel .track { display: flex; transition: transform .45s ease; }
.carousel .slide { min-width: 100%; position: relative; }
.carousel .slide img { width: 100%; height: 150px; object-fit: cover; display: block; }
.carousel .slide .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.62)); color: #fff;
}
.carousel .cap b { font-size: 15px; display: block; }
.carousel .cap p { font-size: 11px; opacity: .85; margin-top: 3px; }
.carousel .dots { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 5px; }
.carousel .dots i { width: 5px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.45); transition: width .3s; }
.carousel .dots i.on { width: 14px; background: #fff; }

/* 金刚区 */
.kingkong { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 16px 14px 6px; background: #fff; margin-top: 12px; }
.kingkong a { text-decoration: none; text-align: center; color: var(--ink-2); }
.kingkong .ic {
  width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 6px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.kingkong .lb { font-size: 11px; }

/* 公告 */
.notice {
  display: flex; align-items: center; gap: 8px; background: #FFFBEB; color: #92700A;
  margin: 10px 14px 0; border-radius: 8px; padding: 8px 12px; font-size: 12px;
  overflow: hidden;
}
.notice b { flex-shrink: 0; font-size: 11px; background: #F59E0B; color: #fff; padding: 1px 6px; border-radius: 4px; }
.notice span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 列表标题 */
.sec-title { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 14px 4px; }
.sec-title b { font-size: 16px; }
.sec-title span { font-size: 12px; color: var(--ink-3); }

/* 底部 Tab 栏 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 7px 0 5px; text-decoration: none;
  color: var(--ink-3); font-size: 10px;
}
.tabbar a .ic { display: block; font-size: 20px; line-height: 1.3; font-family: -apple-system, "PingFang SC", sans-serif; font-weight: 600; }
.tabbar a.on { color: var(--accent); }
.has-tabbar { padding-bottom: 60px; }

/* 分类页 */
.cats-wrap { display: flex; min-height: calc(100vh - 60px); }
.cats-side { width: 92px; flex-shrink: 0; background: #F2F3F5; }
.cats-side button {
  display: block; width: 100%; border: none; background: none; padding: 15px 6px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; border-left: 3px solid transparent;
}
.cats-side button.on { background: #fff; color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.cats-main { flex: 1; padding: 12px; min-width: 0; }
.cats-main .p-card { margin-bottom: 10px; }
.cats-main .p-cover { width: 96px; min-height: 96px; }

/* 二级分类标签 */
.sub-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sub-tabs button {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 7px 0; border-radius: 8px; font-size: 12px; cursor: pointer;
}
.sub-tabs button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* 详情页图集 */
.d-gallery { position: relative; background: #000; }
.d-gallery img { width: 100%; height: 260px; object-fit: cover; display: block; }
.d-gallery .cat-badge {
  position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; padding: 3px 10px; border-radius: 99px;
}

/* 大纲 */
.outline-list { counter-reset: step; }
.outline-list li {
  list-style: none; position: relative; padding: 8px 0 8px 34px; font-size: 13px;
  color: var(--ink-2); line-height: 1.6; border-bottom: 1px dashed var(--line);
}
.outline-list li:last-child { border-bottom: none; }
.outline-list li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 9px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 评价 */
.review-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: none; }
.review-item .ava {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.review-item .rn { font-size: 13px; font-weight: 600; }
.review-item .stars { color: #F59E0B; font-size: 11px; margin-left: 6px; letter-spacing: 1px; }
.review-item .rd { font-size: 11px; color: var(--ink-3); margin-left: auto; }
.review-item .rc { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin-top: 5px; }

/* 看了又看 */
.rec-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.rec-scroll::-webkit-scrollbar { display: none; }
.rec-card { min-width: 120px; width: 120px; background: #fff; border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; border: 1px solid var(--line); flex-shrink: 0; }
.rec-card img { width: 100%; height: 80px; object-fit: cover; display: block; }
.rec-card .rn2 { font-size: 12px; padding: 6px 8px 2px; line-height: 1.4; height: 38px; overflow: hidden; }
.rec-card .rp { font-size: 13px; color: var(--accent); font-weight: 700; padding: 0 8px 8px; }
.rec-card .rp small { font-size: 10px; font-weight: 400; }

/* 我的页面 */
.mine-head { background: #1D2129; color: #fff; padding: 26px 16px 22px; display: flex; align-items: center; gap: 14px; }
.mine-head .ava {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.mine-head .n { font-size: 17px; font-weight: 600; }
.mine-head .s { font-size: 12px; color: #B6BCC7; margin-top: 4px; }
.mine-orders { background: #fff; margin-top: 10px; padding: 14px; }
.mine-orders h4 { font-size: 14px; margin-bottom: 12px; display: flex; justify-content: space-between; }
.mine-orders h4 span { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.mine-os { display: flex; }
.mine-os a { flex: 1; text-align: center; text-decoration: none; color: var(--ink-2); font-size: 12px; position: relative; }
.mine-os a .ic { display: block; font-size: 22px; margin-bottom: 4px; font-weight: 600; }
.mine-os a .bdg {
  position: absolute; top: -4px; right: 18px; background: var(--accent); color: #fff;
  font-size: 10px; min-width: 15px; height: 15px; border-radius: 99px; line-height: 15px; padding: 0 3px;
}
.mine-menu { background: #fff; margin-top: 10px; }
.mine-menu a {
  display: flex; align-items: center; justify-content: space-between; padding: 14px;
  font-size: 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line);
}
.mine-menu a:last-child { border-bottom: none; }
.mine-menu a span:last-child { color: var(--ink-3); font-size: 13px; }
