/* ============================================================
 * 通用电商系统 · 全站样式表
 * ------------------------------------------------------------
 * 设计说明：
 *  1. 采用「大商城」信息密度布局（顶栏 + 搜索 + 分类导航 + 内容区）。
 *  2. 配色原创，全部通过 CSS 变量驱动：买家只需修改 :root 中的
 *     --primary / --accent 等变量即可整站换色，无需改动 HTML。
 *  3. 无任何外部字体、图标、CDN 依赖：图标使用内联 SVG 或字符。
 *  4. 移动优先：默认样式面向手机，通过 min-width 媒体查询增强 PC。
 * ============================================================ */

/* ---------- 1. 全局变量（换色只需改这里） ---------- */
:root {
  /* 品牌主色（推荐红色系，买家可自行替换） */
  --primary: #e1251b;
  --primary-dark: #c81623;
  --primary-light: #fff1f0;
  --primary-border: #ffccc7;

  /* 辅助色（积分/促销） */
  --accent: #ff6a00;
  --accent-light: #fff7e6;
  --gold: #b8860b;

  /* 功能色 */
  --success: #52a832;
  --warn: #fa8c16;
  --danger: #e1251b;
  --info: #1890ff;

  /* 文字与背景 */
  --text: #333;
  --text-sub: #666;
  --text-weak: #999;
  --text-inverse: #fff;
  --border: #eaeaea;
  --border-dark: #d9d9d9;
  --bg: #f4f4f4;
  --bg-card: #fff;
  --bg-hover: #fafafa;

  /* 圆角与阴影 */
  --radius: 6px;
  --radius-sm: 3px;
  --radius-lg: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

  /* 布局 */
  --container: 1200px;
  --topbar-h: 32px;
  --header-h: 96px;
  --nav-h: 40px;
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
.clearfix::after { content: ""; display: block; clear: both; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 12px; }
.fl { float: left; }
.fr { float: right; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-weak { color: var(--text-weak); }
.text-sub { color: var(--text-sub); }
.red { color: var(--danger); }
.hide { display: none !important; }

/* ---------- 3. 通用组件 ---------- */

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 18px; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: #fff; color: var(--text);
  font-size: 14px; line-height: 1; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { min-height: 30px; padding: 0 12px; font-size: 12px; }
.btn-lg { min-height: 46px; padding: 0 32px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { opacity: .9; color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary-light); }
.btn-plain { border-color: var(--border-dark); color: var(--text-sub); }
.btn-plain:hover { border-color: var(--text-weak); color: var(--text); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-link { border: 0; background: none; padding: 0; color: var(--primary); }

/* 卡片 / 区块 */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { margin: 16px 0; }
.section-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.section-hd h2, .section-hd h3 { font-size: 18px; font-weight: 600; }
.section-hd .more { font-size: 12px; color: var(--text-weak); }
.section-bd { padding: 16px; }

/* 面包屑 */
.crumbs { padding: 12px 0; font-size: 13px; color: var(--text-weak); }
.crumbs a { color: var(--text-sub); }
.crumbs .sep { margin: 0 8px; color: #ccc; }
.crumbs .cur { color: var(--text); }

/* 空状态 */
.empty { padding: 60px 20px; text-align: center; color: var(--text-weak); }
.empty .empty-icon { font-size: 48px; line-height: 1; margin-bottom: 12px; opacity: .5; }
.empty p { margin-bottom: 16px; }

/* 标签 */
.tag { display: inline-block; padding: 1px 6px; border-radius: var(--radius-sm); font-size: 11px; line-height: 18px; }
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-accent { background: var(--accent-light); color: var(--accent); }
.tag-weak { background: #f2f2f2; color: var(--text-weak); }

/* 分页 */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 24px 0; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-dark); border-radius: var(--radius-sm); background: #fff; font-size: 13px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { color: #ccc; background: #fafafa; }

/* Tab 切换 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs .tab { padding: 12px 16px; white-space: nowrap; color: var(--text-sub); border-bottom: 2px solid transparent; font-size: 14px; }
.tabs .tab:hover { color: var(--primary); }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs .tab .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; text-align: center; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-sub); }
.field .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); background: #fff; outline: none; transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { min-height: 80px; resize: vertical; }
.field-hint { margin-top: 6px; font-size: 12px; color: var(--text-weak); }

/* Toast 轻提示 */
#toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 9999; max-width: 80%; padding: 12px 24px; border-radius: var(--radius);
  background: rgba(0,0,0,.82); color: #fff; font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#toast.show { opacity: 1; }

/* ---------- 4. 顶部导航 ---------- */

/* 顶部工具条 */
.topbar { height: var(--topbar-h); background: #f7f7f7; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-weak); }
.topbar .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.topbar a { color: var(--text-weak); margin-left: 14px; }
.topbar a:hover { color: var(--primary); }
.topbar .tb-welcome { white-space: nowrap; }

/* 主头部：Logo + 搜索 + 快捷入口 */
.header-main { background: #fff; }
.header-main .container { min-height: var(--header-h); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo { flex: 0 0 auto; }
.logo a { display: flex; align-items: center; gap: 8px; }
.logo img { max-height: 48px; max-width: 160px; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: 1px; white-space: nowrap; }
.logo-text small { display: block; font-size: 10px; font-weight: 400; color: var(--text-weak); letter-spacing: 2px; }

/* 搜索框 */
.search-bar { flex: 1 1 320px; display: flex; height: 40px; }
.search-bar .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-color: var(--primary); }
.search-bar .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.search-hot { flex-basis: 100%; display: flex; gap: 12px; font-size: 12px; color: var(--text-weak); padding-left: 2px; }
.search-hot a:hover { color: var(--primary); }

/* 头部快捷入口 */
.header-links { flex: 0 0 auto; display: flex; gap: 18px; }
.header-links a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--text-sub); min-width: 40px; }
.header-links a:hover { color: var(--primary); }
.header-links .hi-icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* 分类导航条 */
.nav-bar { height: var(--nav-h); background: var(--primary); color: #fff; }
.nav-bar .container { height: 100%; display: flex; align-items: center; }
.nav-all { flex: 0 0 auto; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 20px; background: var(--primary-dark); font-weight: 600; }
.nav-list { display: flex; align-items: center; gap: 4px; overflow-x: auto; height: 100%; }
.nav-list a { display: inline-flex; align-items: center; height: 100%; padding: 0 16px; color: rgba(255,255,255,.95); white-space: nowrap; font-size: 14px; }
.nav-list a:hover { background: rgba(0,0,0,.12); color: #fff; }

/* ---------- 5. 首页 ---------- */

/* 轮播 */
.banner { position: relative; margin: 16px 0; overflow: hidden; border-radius: var(--radius); background: #ddd; }
.banner-track { display: flex; transition: transform .5s ease; }
.banner-slide { flex: 0 0 100%; position: relative; }
.banner-slide a { display: block; }
.banner-slide img { width: 100%; aspect-ratio: 1200 / 380; object-fit: cover; }
.banner-slide .bn-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-size: 20px; font-weight: 600;
}
.banner-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.banner-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.banner-dots i.active { background: #fff; width: 20px; border-radius: 4px; }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 48px;
  display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.3);
  color: #fff; font-size: 22px; cursor: pointer; user-select: none;
}
.banner-arrow.prev { left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.banner-arrow.next { right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.banner-empty { height: 260px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(120deg, var(--primary), var(--accent)); font-size: 22px; font-weight: 700; letter-spacing: 2px; }

/* 分类宫格 */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; background: #fff; border-radius: var(--radius); transition: transform .15s, box-shadow .15s; }
.cat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--primary); }
.cat-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.cat-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cat-item .cat-name { font-size: 13px; }

/* 商品网格与卡片 */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.product-card {
  position: relative; background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pc-thumb { position: relative; display: block; background: #fafafa; }
.pc-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.pc-badge { position: absolute; left: 8px; top: 8px; }
.pc-body { padding: 10px; }
.pc-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 40px; font-size: 13px; line-height: 20px; color: var(--text);
}
.pc-title:hover { color: var(--primary); }
.pc-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.price-cash { color: var(--danger); font-size: 18px; font-weight: 700; }
.price-cash small { font-size: 12px; font-weight: 400; }
.price-pts { color: var(--accent); font-size: 12px; }
.price-pts b { font-size: 14px; }
.pc-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--text-weak); }
.pc-add {
  border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: var(--radius-sm); padding: 3px 8px; font-size: 11px;
}
.pc-add:hover { background: var(--primary); color: #fff; }

/* ---------- 6. 分类 / 列表页 ---------- */
.filter-panel { background: #fff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; }
.filter-row .flabel { flex: 0 0 56px; color: var(--text-weak); font-size: 13px; }
.filter-row a { padding: 4px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-sub); }
.filter-row a:hover, .filter-row a.active { background: var(--primary-light); color: var(--primary); }
.sort-bar { display: flex; background: #fff; border-radius: var(--radius); padding: 0 8px; margin-bottom: 12px; overflow-x: auto; }
.sort-bar a { padding: 12px 16px; white-space: nowrap; color: var(--text-sub); font-size: 13px; border-bottom: 2px solid transparent; }
.sort-bar a:hover, .sort-bar a.active { color: var(--primary); border-bottom-color: var(--primary); }
.sort-bar .arrow { font-size: 10px; margin-left: 2px; }

/* ---------- 7. 商品详情页 ---------- */
.detail-wrap { display: grid; grid-template-columns: 1fr; gap: 20px; }
.detail-gallery .gallery-main { background: #fff; border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border: 2px solid transparent; border-radius: var(--radius-sm); cursor: pointer; }
.gallery-thumbs img.active { border-color: var(--primary); }

.detail-info h1 { font-size: 20px; line-height: 1.4; font-weight: 600; }
.detail-sub { margin-top: 8px; color: var(--text-sub); font-size: 13px; }
.price-box { margin-top: 16px; padding: 16px; background: var(--primary-light); border-radius: var(--radius); }
.price-box .pb-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-box .pb-label { color: var(--text-sub); font-size: 13px; }
.price-box .pb-cash { color: var(--danger); font-size: 30px; font-weight: 700; }
.price-box .pb-cash small { font-size: 15px; }
.price-box .pb-points { color: var(--accent); font-size: 16px; font-weight: 600; }
.price-box .pb-points small { font-size: 12px; font-weight: 400; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 20px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-sub); }
.detail-specs { margin: 14px 0; }
.spec-group { margin-bottom: 12px; }
.spec-label { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.spec-list { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-item { padding: 6px 14px; border: 1px solid var(--border-dark); border-radius: var(--radius-sm); background: #fff; font-size: 13px; }
.spec-item:hover { border-color: var(--primary); }
.spec-item.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.stock-tip { margin: 12px 0; font-size: 13px; color: var(--text-sub); }
.stock-tip .stock-num { color: var(--success); font-weight: 600; }
.stock-tip .stock-low { color: var(--warn); font-weight: 600; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.detail-actions .btn { flex: 1 1 160px; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--border-dark); border-radius: var(--radius-sm); overflow: hidden; }
.qty-box button { width: 34px; height: 36px; border: 0; background: #fafafa; font-size: 16px; }
.qty-box button:hover { background: #eee; }
.qty-box input { width: 50px; height: 36px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; outline: none; }
.detail-panel { margin-top: 20px; }
.detail-panel .panel-hd { display: flex; gap: 24px; border-bottom: 1px solid var(--border); }
.detail-panel .panel-hd span { padding: 12px 0; color: var(--text-sub); cursor: pointer; border-bottom: 2px solid transparent; }
.detail-panel .panel-hd span.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.detail-panel .panel-bd { padding: 16px 0; min-height: 120px; }
.detail-content img { max-width: 100%; height: auto; }
.param-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.param-table td { padding: 10px 12px; border: 1px solid var(--border); }
.param-table td:first-child { width: 120px; background: #fafafa; color: var(--text-sub); }
.aftersale-list { font-size: 13px; color: var(--text-sub); line-height: 2; }
.aftersale-list li { padding-left: 16px; position: relative; }
.aftersale-list li::before { content: "·"; position: absolute; left: 4px; color: var(--primary); }

/* ---------- 8. 购物车 ---------- */
.cart-list { background: #fff; border-radius: var(--radius); overflow: hidden; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.cart-check { width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 auto; }
.cart-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); flex: 0 0 auto; }
.cart-info { flex: 1 1 auto; min-width: 0; }
.cart-info .ci-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-info .ci-spec { color: var(--text-weak); font-size: 12px; margin-top: 4px; }
.cart-price { flex: 0 0 90px; text-align: right; color: var(--danger); font-weight: 600; }
.cart-price .cp-pts { display: block; color: var(--accent); font-size: 12px; font-weight: 400; }
.cart-qty { flex: 0 0 auto; }
.cart-subtotal { flex: 0 0 90px; text-align: right; color: var(--danger); font-weight: 700; }
.cart-del { flex: 0 0 auto; border: 0; background: none; color: var(--text-weak); font-size: 18px; }
.cart-del:hover { color: var(--danger); }
.cart-bar {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-top: 12px; padding: 14px 16px; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.cart-bar .cb-left { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.cart-bar .cb-total { color: var(--text-sub); }
.cart-bar .cb-total b { color: var(--danger); font-size: 20px; }

/* ---------- 9. 收银台 ---------- */
.checkout-wrap { display: grid; grid-template-columns: 1fr; gap: 16px; }
.checkout-main, .checkout-side { min-width: 0; }
.checkout-block { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.checkout-block h3 { font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.addr-card { position: relative; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.addr-card.active { border-color: var(--primary); background: var(--primary-light); }
.addr-card .ac-name { font-weight: 600; }
.addr-card .ac-phone { margin-left: 10px; color: var(--text-sub); }
.addr-card .ac-addr { margin-top: 6px; color: var(--text-sub); font-size: 13px; }
.addr-card .ac-edit { position: absolute; right: 12px; top: 12px; font-size: 12px; color: var(--primary); }
.mode-switch { display: flex; gap: 10px; }
.mode-item { flex: 1; padding: 14px; border: 1px solid var(--border-dark); border-radius: var(--radius); cursor: pointer; }
.mode-item.active { border-color: var(--primary); background: var(--primary-light); }
.mode-item input { margin-right: 6px; accent-color: var(--primary); }
.mode-item .mi-name { font-weight: 600; }
.mode-item .mi-desc { font-size: 12px; color: var(--text-weak); margin-top: 4px; }
.order-lines .order-line { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.order-lines .order-line:last-child { border-bottom: 0; }
.order-line img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }
.order-line .ol-info { flex: 1; min-width: 0; }
.order-line .ol-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order-line .ol-price { color: var(--danger); white-space: nowrap; }
.pay-summary { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.pay-summary.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }
.pay-summary.total b { color: var(--danger); font-size: 22px; }
.checkout-side .checkout-submit { position: sticky; top: 12px; }

/* ---------- 10. 登录 / 注册 ---------- */
.auth-wrap { max-width: 420px; margin: 30px auto; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px; }
.auth-card .auth-logo { text-align: center; margin-bottom: 24px; }
.auth-card .auth-logo .logo-text { font-size: 26px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth-tabs button { flex: 1; padding: 12px; border: 0; background: none; color: var(--text-sub); font-size: 16px; border-bottom: 2px solid transparent; }
.auth-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-third { margin-top: 24px; text-align: center; }
.auth-third .divider { display: flex; align-items: center; gap: 12px; color: var(--text-weak); font-size: 12px; }
.auth-third .divider::before, .auth-third .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-third .wx-btn { margin-top: 16px; width: 100%; }
.auth-tip { margin-top: 12px; font-size: 12px; color: var(--text-weak); text-align: center; }

/* ---------- 11. 会员中心 ---------- */
.user-wrap { display: grid; grid-template-columns: 1fr; gap: 16px; }
.user-side { background: #fff; border-radius: var(--radius); overflow: hidden; }
.user-card { padding: 20px; text-align: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.user-card .uc-avatar { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.25); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.user-card .uc-points { font-size: 28px; font-weight: 700; margin-top: 8px; }
.user-card .uc-label { font-size: 12px; opacity: .9; }
.user-menu a { display: flex; align-items: center; gap: 10px; padding: 13px 18px; color: var(--text-sub); border-bottom: 1px solid var(--border); }
.user-menu a:last-child { border-bottom: 0; }
.user-menu a:hover, .user-menu a.active { color: var(--primary); background: var(--primary-light); }
.user-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.user-main { min-width: 0; }
.user-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-box { padding: 16px; background: #fff; border-radius: var(--radius); text-align: center; }
.stat-box .sb-num { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-box .sb-label { font-size: 12px; color: var(--text-weak); margin-top: 4px; }
.invite-box { padding: 16px; background: linear-gradient(135deg, var(--accent-light), var(--primary-light)); border-radius: var(--radius); }
.invite-box .invite-link { display: flex; gap: 8px; margin-top: 10px; }
.invite-box .invite-link .input { flex: 1; font-size: 12px; }
.addr-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.addr-item:last-child { border-bottom: 0; }

/* ---------- 12. 订单列表 / 详情 / 成功 ---------- */
.order-card { background: #fff; border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.order-hd { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fafafa; font-size: 12px; color: var(--text-sub); }
.order-hd .order-no { font-family: monospace; }
.status-badge { font-size: 12px; font-weight: 600; }
.st-WAIT_PAY { color: var(--warn); }
.st-WAIT_SHIP { color: var(--info); }
.st-SHIPPED { color: var(--primary); }
.st-DONE { color: var(--success); }
.st-CANCELLED, .st-REFUNDED { color: var(--text-weak); }
.st-REFUNDING { color: var(--warn); }
.order-goods { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.order-goods img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.order-goods .og-info { flex: 1; min-width: 0; }
.order-goods .og-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order-goods .og-spec { color: var(--text-weak); font-size: 12px; margin-top: 4px; }
.order-goods .og-price { text-align: right; white-space: nowrap; }
.order-ft { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.order-ft .of-amount { font-size: 13px; }
.order-ft .of-amount b { color: var(--danger); font-size: 16px; }
.order-ft .of-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.timeline { padding: 10px 0; }
.timeline-item { position: relative; padding: 0 0 20px 24px; border-left: 2px solid var(--border); color: var(--text-sub); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-dark); }
.timeline-item.done { color: var(--text); }
.timeline-item.done::before { background: var(--primary); }
.timeline-item .ti-title { font-weight: 600; }
.timeline-item .ti-time { font-size: 12px; color: var(--text-weak); margin-top: 2px; }
.info-row { display: flex; padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.info-row .ir-label { flex: 0 0 88px; color: var(--text-weak); }

.success-box { max-width: 560px; margin: 40px auto; text-align: center; }
.success-icon { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 38px; }
.success-box h2 { font-size: 22px; margin-bottom: 8px; }
.success-box .sb-desc { color: var(--text-sub); margin-bottom: 20px; }
.success-box .sb-order-no { padding: 12px; background: #fafafa; border-radius: var(--radius); font-family: monospace; font-size: 16px; margin-bottom: 20px; }
.success-box .sb-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 13. 积分明细 ---------- */
.points-list { background: #fff; border-radius: var(--radius); overflow: hidden; }
.points-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.points-item:last-child { border-bottom: 0; }
.points-item .pi-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.points-item .pi-main { flex: 1; min-width: 0; }
.points-item .pi-remark { font-size: 13px; }
.points-item .pi-time { font-size: 12px; color: var(--text-weak); margin-top: 2px; }
.points-item .pi-val { font-size: 16px; font-weight: 700; white-space: nowrap; }
.pi-val.plus { color: var(--success); }
.pi-val.minus { color: var(--danger); }
.points-item .pi-balance { font-size: 12px; color: var(--text-weak); white-space: nowrap; }

/* ---------- 14. 页脚 ---------- */
.site-footer { margin-top: 30px; padding: 30px 0 40px; background: #2f3437; color: #aaa; font-size: 12px; }
.footer-service { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-service .fs-item { text-align: center; }
.footer-service .fs-title { color: #fff; font-size: 14px; margin-bottom: 4px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 20px 0; }
.footer-links a { color: #aaa; }
.footer-links a:hover { color: #fff; }
.footer-copy { text-align: center; line-height: 1.8; }

/* ---------- 15. 移动端底部导航 ---------- */
.mobile-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 54px; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
.mobile-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-sub); }
.mobile-tabbar a.active { color: var(--primary); }
.mobile-tabbar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
body.has-tabbar { padding-bottom: 60px; }

/* ---------- 16. 响应式增强（PC / 平板） ---------- */
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(6, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .detail-wrap { grid-template-columns: 420px 1fr; }
  .checkout-wrap { grid-template-columns: 1fr 340px; }
  .user-wrap { grid-template-columns: 220px 1fr; }
  .user-stat-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-service { grid-template-columns: repeat(4, 1fr); }
  .topbar .tb-welcome { display: inline; }
  .mobile-tabbar { display: none; }
  body.has-tabbar { padding-bottom: 0; }
}
@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(5, 1fr); }
  .cat-grid { grid-template-columns: repeat(8, 1fr); }
  .detail-wrap { grid-template-columns: 460px 1fr; }
}
@media (max-width: 480px) {
  .header-main .container { gap: 10px; }
  .logo-text { font-size: 18px; }
  .header-links { gap: 10px; }
  .cart-item { flex-wrap: wrap; }
  .cart-price { flex-basis: 70px; }
  .cart-subtotal { flex-basis: 70px; }
  .cart-bar .cb-left { gap: 10px; font-size: 12px; }
}

/* ---------- 17. 打印友好 ---------- */
@media print {
  .topbar, .nav-bar, .site-footer, .mobile-tabbar, .detail-actions, .order-ft .of-btns { display: none !important; }
  body { background: #fff; }
}
