/* ============ 设计令牌 ============ */
:root {
  --brand: #ff5a1f;
  --brand-dark: #e84612;
  --brand-soft: #fff1ea;
  --accent: #ffb020;
  --ink: #1d2129;
  --ink-2: #4e5969;
  --ink-3: #86909c;
  --line: #e8eaee;
  --bg: #f6f7f9;
  --card: #ffffff;
  --success: #00b42a;
  --warn: #ff7d00;
  --danger: #f53f3f;
  --info: #2f6bff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(29, 33, 41, .06);
  --shadow-lg: 0 12px 32px rgba(29, 33, 41, .12);
  --header-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.price { color: var(--brand); font-weight: 700; }
.price small { font-size: 12px; font-weight: 500; }
.strike { color: var(--ink-3); text-decoration: line-through; font-size: 12px; font-weight: 400; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ============ 顶部条 ============ */
.topbar { background: #21252b; color: #c9cdd4; font-size: 12px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 34px; gap: 12px; }
.topbar a { color: #c9cdd4; }
.topbar a:hover { color: #fff; }
.topbar-links { display: flex; gap: 18px; align-items: center; }
.topbar-links .dot { width: 1px; height: 12px; background: #3a3f47; }

/* ============ 头部 ============ */
.header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.header .container { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.5px; white-space: nowrap; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-size: 18px;
  box-shadow: 0 4px 12px rgba(255, 90, 31, .28);
}
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: 2px; }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1.5px solid transparent; border-radius: 999px; padding: 0 6px 0 16px; height: 42px; transition: .2s; }
.search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; }
.search button { border: 0; background: var(--brand); color: #fff; height: 32px; padding: 0 18px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.search button:hover { background: var(--brand-dark); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.cart-badge { position: absolute; top: 2px; left: 22px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }

/* ============ 分类导航 ============ */
.navbar { background: var(--card); border-bottom: 1px solid var(--line); }
.navbar .container { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.navbar .container::-webkit-scrollbar { display: none; }
.nav-item { padding: 12px 16px; font-size: 14px; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid transparent; cursor: pointer; }
.nav-item:hover, .nav-item.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* ============ 首页横幅 ============ */
.hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; padding: 20px 0 4px; }
.hero-main {
  position: relative; border-radius: 18px; overflow: hidden; padding: 38px 40px; color: #fff; min-height: 268px;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .22), transparent 45%), linear-gradient(120deg, #2b2f36, #4a3026 55%, #a3461a);
}
.hero-main::after { content: "🛍️"; position: absolute; right: 34px; bottom: 18px; font-size: 118px; opacity: .28; transform: rotate(-8deg); }
.hero-tag { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(4px); padding: 5px 12px; border-radius: 999px; font-size: 12px; margin-bottom: 16px; }
.hero-main h1 { font-size: 38px; line-height: 1.2; letter-spacing: -1px; margin-bottom: 10px; }
.hero-main h1 em { font-style: normal; color: #ffcf8f; }
.hero-main p { color: #e7e2dd; margin: 0 0 22px; max-width: 460px; font-size: 14px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.hero-card { border-radius: 18px; padding: 22px 24px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; }
.hero-card.brand { background: linear-gradient(135deg, #fff6ef, #ffe9dc); }
.hero-card h3 { font-size: 17px; margin-bottom: 6px; }
.hero-card p { color: var(--ink-2); font-size: 13px; margin: 0 0 12px; }

/* 优惠券条 */
.coupon-strip { display: flex; gap: 12px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.coupon-strip::-webkit-scrollbar { display: none; }
.coupon-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px dashed #ffc3a8; border-radius: 12px; padding: 10px 18px 10px 14px; cursor: pointer;
}
.coupon-chip:hover { border-color: var(--brand); background: #fffaf7; }
.coupon-amount { font-size: 24px; font-weight: 800; color: var(--brand); line-height: 1; }
.coupon-amount small { font-size: 12px; font-weight: 600; }
.coupon-chip .c-name { font-size: 13px; font-weight: 600; }
.coupon-chip .c-cond { font-size: 11px; color: var(--ink-3); }
.coupon-chip .c-btn { font-size: 12px; color: var(--brand); font-weight: 600; }

/* ============ 通用区块 ============ */
.section { padding: 34px 0 6px; }
.section-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: 23px; letter-spacing: -.4px; }
.section-head p { margin: 0 0 3px; color: var(--ink-3); font-size: 13px; }
.section-head .more { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.section-head .more:hover { color: var(--brand); }

/* ============ 商品卡 ============ */
.grid-products { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.product-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: .22s; display: flex; flex-direction: column; cursor: pointer; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-thumb { position: relative; aspect-ratio: 1/1; overflow: hidden; }
.emoji-img {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 56px;
  background: linear-gradient(135deg, var(--g1, #fff1ea), var(--g2, #ffe3d3));
}
.emoji-img.sm { font-size: 26px; border-radius: 8px; }
.emoji-img.xs { font-size: 18px; border-radius: 6px; }
.emoji-img.lg { font-size: 96px; }
.product-thumb .tag-corner { position: absolute; left: 10px; top: 10px; background: rgba(255, 90, 31, .95); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.product-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-title { font-size: 14px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.product-sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-meta { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.product-shop { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; max-width: fit-content; }

/* ============ 店铺卡 ============ */
.grid-shops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.shop-card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; transition: .2s; cursor: pointer; }
.shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.shop-logo { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 14px; font-size: 26px; }
.shop-card h4 { font-size: 15px; margin-bottom: 2px; }
.shop-card p { margin: 0; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }

/* ============ 按钮 / 表单 ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .18s; background: var(--bg); color: var(--ink); white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-danger { background: #fff1f0; color: var(--danger); border-color: #ffd6d4; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: 0;
  background: #fff; transition: .18s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.textarea { min-height: 88px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ 标签 ============ */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.tag-brand { background: var(--brand-soft); color: var(--brand-dark); }
.tag-success { background: #e8ffea; color: #009a29; }
.tag-warn { background: #fff7e8; color: #d25f00; }
.tag-danger { background: #fff1f0; color: #cb2634; }
.tag-info { background: #eef3ff; color: #1d4ed8; }
.tag-gray { background: #f2f3f5; color: var(--ink-3); }

/* ============ 空状态 / 加载 ============ */
.empty { text-align: center; padding: 64px 20px; color: var(--ink-3); }
.empty .empty-icon { font-size: 46px; margin-bottom: 10px; opacity: .7; }
.empty p { margin: 4px 0 16px; }
.loading { text-align: center; padding: 48px; color: var(--ink-3); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #f2f3f5 25%, #e9ebef 37%, #f2f3f5 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============ 商品列表页 ============ */
.page-title { display: flex; align-items: center; gap: 12px; padding: 24px 0 16px; }
.page-title h1 { font-size: 24px; }
.filter-bar { background: var(--card); border-radius: var(--radius); padding: 6px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.filter-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.filter-row:last-child { border-bottom: 0; }
.filter-row .label { color: var(--ink-3); font-size: 12px; width: 52px; }
.filter-link { font-size: 13px; padding: 3px 10px; border-radius: 6px; color: var(--ink-2); cursor: pointer; }
.filter-link:hover { color: var(--brand); }
.filter-link.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* ============ 商品详情 ============ */
.detail-wrap { display: grid; grid-template-columns: 460px 1fr; gap: 26px; padding: 22px 0; }
.detail-gallery { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); height: fit-content; }
.detail-main-img { border-radius: 12px; overflow: hidden; aspect-ratio: 1/1; }
.detail-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.detail-thumb { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.detail-thumb.active { border-color: var(--brand); }
.detail-info { background: var(--card); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.detail-info h1 { font-size: 24px; line-height: 1.4; }
.detail-sub { color: var(--ink-3); margin: 8px 0 16px; }
.price-box { background: linear-gradient(100deg, #fff6f0, #fff); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.price-box .now { font-size: 34px; color: var(--brand); font-weight: 800; letter-spacing: -.5px; }
.price-box .row { display: flex; align-items: baseline; gap: 10px; }
.detail-row { display: flex; gap: 12px; padding: 8px 0; font-size: 13px; color: var(--ink-2); }
.detail-row .k { color: var(--ink-3); width: 70px; flex: 0 0 70px; }
.detail-row .v { flex: 1; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty-box button { width: 34px; height: 34px; border: 0; background: #fff; cursor: pointer; font-size: 16px; color: var(--ink-2); }
.qty-box button:hover { background: var(--bg); }
.qty-box input { width: 48px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 34px; outline: 0; }
.detail-actions { display: flex; gap: 12px; margin-top: 20px; }

/* 评价 */
.review-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; font-size: 14px; color: var(--brand-dark); font-weight: 600; flex: 0 0 32px; }
.stars { color: #ffb020; font-size: 13px; letter-spacing: 1px; }
.review-reply { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* ============ 购物车 ============ */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; padding: 22px 0 40px; align-items: start; }
.cart-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.cart-group-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.cart-item { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item:last-child { border-bottom: 0; }
.cart-item .thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; flex: 0 0 84px; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .title { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item .meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.cart-item .right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.checkbox { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; flex: 0 0 18px; }
.summary-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: sticky; top: 84px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); padding: 6px 0; }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px; font-size: 15px; color: var(--ink); }
.summary-row.total strong { font-size: 24px; color: var(--brand); }

/* ============ 结算 ============ */
.checkout-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.checkout-card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.addr-option { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; margin-bottom: 10px; display: flex; gap: 12px; align-items: flex-start; }
.addr-option.active { border-color: var(--brand); background: #fffaf7; }
.addr-option .name { font-weight: 600; }
.addr-option .detail { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.checkout-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.checkout-item:last-child { border-bottom: 0; }
.checkout-item .thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; flex: 0 0 56px; }

/* ============ 订单 ============ */
.tabs { display: flex; gap: 4px; background: var(--card); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 16px; border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.order-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.order-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.order-head .shop { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.order-head .status { margin-left: auto; }
.order-item { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.order-item .thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; flex: 0 0 72px; }
.order-foot { padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-foot .amount { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.order-foot .amount strong { font-size: 20px; color: var(--brand); }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 18px 0; }
.timeline-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); border: 2px solid #fff; }
.timeline-item.done::before { background: var(--brand); }
.timeline-item .t { font-weight: 600; font-size: 13px; }
.timeline-item .d { font-size: 12px; color: var(--ink-3); }

/* ============ 优惠券页 ============ */
.coupon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.coupon-card { position: relative; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: flex; }
.coupon-card .left { width: 112px; background: linear-gradient(160deg, #fff3ec, #ffe1d2); display: grid; place-items: center; color: var(--brand-dark); flex: 0 0 112px; position: relative; }
.coupon-card .left::after { content: ""; position: absolute; right: -6px; top: 0; bottom: 0; width: 12px; background: radial-gradient(circle at 6px 6px, transparent 5px, #fff 5.5px) 0 0/12px 14px; }
.coupon-card .left .v { font-size: 28px; font-weight: 800; line-height: 1; }
.coupon-card .body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.coupon-card .body h4 { font-size: 14px; }
.coupon-card .body .cond { font-size: 12px; color: var(--ink-3); }
.coupon-card .body .time { font-size: 11px; color: var(--ink-3); margin-top: auto; }
.coupon-card .claim { align-self: center; margin-right: 14px; }
.coupon-card.used { opacity: .6; }

/* ============ 客服 ============ */
.support-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; padding: 22px 0 40px; height: calc(100vh - 190px); min-height: 520px; }
.ticket-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
.ticket-item { padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ticket-item:hover { background: #fafbfc; }
.ticket-item.active { background: var(--brand-soft); }
.ticket-item h4 { font-size: 13.5px; margin-bottom: 4px; }
.ticket-item p { margin: 0; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow: auto; padding: 18px; background: #fafbfc; }
.msg { display: flex; gap: 10px; margin-bottom: 16px; }
.msg .bubble { max-width: 70%; padding: 10px 14px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-size: 13.5px; }
.msg .time { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--brand); color: #fff; }
.msg.mine .time { text-align: right; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; min-height: 44px; max-height: 110px; }

/* ============ 账户 ============ */
.account-grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 22px 0 40px; align-items: start; }
.account-nav { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.account-nav a { display: flex; align-items: center; gap: 10px; padding: 13px 18px; font-size: 14px; color: var(--ink-2); border-left: 3px solid transparent; }
.account-nav a:hover { background: #fafbfc; }
.account-nav a.active { color: var(--brand); background: var(--brand-soft); border-color: var(--brand); font-weight: 600; }
.account-body { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }

/* ============ 页脚 ============ */
.footer { margin-top: 46px; background: #21252b; color: #9aa0a9; padding: 34px 0 26px; font-size: 13px; }
.footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid #32373f; }
.footer h5 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.footer a:hover { color: #fff; }
.footer .bottom { padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; }

/* ============ 弹层 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(17, 20, 24, .48); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0, 0, 0, .24); animation: pop .2s; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: .6; } }
.modal.wide { max-width: 640px; }
.modal-head { padding: 18px 22px 10px; display: flex; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-head .close { margin-left: auto; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--ink-3); line-height: 1; }
.modal-body { padding: 6px 22px 18px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.toast-wrap { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(29, 33, 41, .92); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .22s; max-width: 80vw; }
.toast.success { background: #007a1f; }
.toast.error { background: #b82525; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }

/* ============ 登录页 ============ */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-side { position: relative; padding: 56px; color: #fff; background: linear-gradient(140deg, #23272e 0%, #4a3026 55%, #b8481a 100%); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-side::after { content: "🛒"; position: absolute; right: -30px; bottom: 40px; font-size: 220px; opacity: .14; transform: rotate(-12deg); }
.auth-side h1 { font-size: 38px; line-height: 1.25; letter-spacing: -1px; margin-bottom: 14px; }
.auth-side p { color: #e5ded9; max-width: 420px; }
.auth-side .points { display: grid; gap: 12px; margin-top: 28px; font-size: 14px; color: #f0ebe7; }
.auth-side .points span::before { content: "✓"; color: #ffcf8f; margin-right: 8px; font-weight: 700; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { margin-bottom: 26px; }
.auth-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.auth-tab { padding-bottom: 12px; font-size: 15px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 600; }
.auth-tab.active { color: var(--ink); border-color: var(--brand); }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-row .btn { flex: 0 0 auto; }
.demo-hint { background: #fff9e8; border: 1px dashed #ffd591; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #8a5b00; margin-bottom: 14px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.auth-switch a { color: var(--brand); font-weight: 600; }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .grid-products { grid-template-columns: repeat(4, 1fr); }
  .grid-shops { grid-template-columns: repeat(3, 1fr); }
  .coupon-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .detail-wrap { grid-template-columns: 400px 1fr; }
  .cart-layout { grid-template-columns: 1fr 300px; }
  .support-layout { grid-template-columns: 300px 1fr; }
}
@media (max-width: 860px) {
  .header .container { gap: 14px; }
  .logo small { display: none; }
  .header-actions .txt { display: none; }
  .grid-products { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .grid-shops { grid-template-columns: repeat(2, 1fr); }
  .detail-wrap { grid-template-columns: 1fr; }
  .detail-gallery { position: static; }
  .cart-layout, .account-grid, .support-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .support-layout { height: auto; }
  .chat-panel { min-height: 480px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .topbar-links a.opt { display: none; }
}
@media (max-width: 620px) {
  .container { padding: 0 14px; }
  .header { position: static; }
  .header .container { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hero-main { padding: 26px 22px; min-height: 230px; }
  .hero-main h1 { font-size: 27px; }
  .hero-main::after { font-size: 84px; right: 16px; }
  .hero-side { grid-template-columns: 1fr; }
  .grid-products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-shops { grid-template-columns: 1fr; }
  .coupon-grid { grid-template-columns: 1fr; }
  .product-body { padding: 10px; }
  .product-title { font-size: 13px; min-height: 38px; }
  .detail-info { padding: 18px; }
  .detail-info h1 { font-size: 20px; }
  .price-box .now { font-size: 28px; }
  .page-title { padding: 16px 0 12px; }
  .page-title h1 { font-size: 20px; }
  .cart-item { padding: 12px; gap: 10px; }
  .cart-item .thumb { width: 68px; height: 68px; flex-basis: 68px; }
  .cart-item .right { gap: 6px; }
  .order-item { padding: 12px; gap: 10px; }
  .order-item .thumb { width: 60px; height: 60px; flex-basis: 60px; }
  .modal { max-height: 92vh; }
  .footer .cols { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============ 商品主图放大 ============ */
.detail-gallery { position: relative; }
.detail-main-img { position: relative; cursor: crosshair; }
.zoom-media { width: 100%; height: 100%; }
.zoom-lens {
  position: absolute; left: 0; top: 0; width: 150px; height: 150px; display: none;
  border: 1.5px solid rgba(255, 90, 31, .9); background: rgba(255, 90, 31, .12);
  border-radius: 6px; pointer-events: none;
}
.detail-main-img:hover .zoom-lens { display: block; }
.zoom-panel {
  position: absolute; left: calc(100% + 18px); top: 14px; width: 360px; height: 360px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; display: none; z-index: 30;
}
.zoom-panel.show { display: block; }
.zoom-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.zoom-inner .emoji-img, .zoom-inner img { width: 100%; height: 100%; }
.zoom-tip {
  position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--ink-3);
  background: rgba(255, 255, 255, .88); padding: 2px 8px; border-radius: 6px;
}
/* 中等宽度：放大面板落在图片内右侧，避免溢出屏幕 */
@media (max-width: 1080px) {
  .zoom-panel {
    left: auto; right: 10px; top: 10px; width: 46%; height: 46%;
    border-radius: 10px; box-shadow: 0 8px 24px rgba(29, 33, 41, .18);
  }
  .zoom-tip { font-size: 10px; right: 6px; bottom: 5px; }
}
/* 触摸设备无悬停能力，关闭放大 */
@media (hover: none) {
  .zoom-panel, .zoom-lens { display: none !important; }
  .detail-main-img { cursor: pointer; }
}

/* ============ 分销中心 ============ */
.dist-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.dist-kpi { background: linear-gradient(135deg, #fffaf7, #fff); border: 1px solid #ffe7d9; border-radius: 12px; padding: 14px 16px; }
.dist-kpi .k { font-size: 12px; color: var(--ink-3); }
.dist-kpi .v { font-size: 22px; font-weight: 800; margin-top: 4px; }
.dist-kpi .v small { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.dist-invite {
  background: linear-gradient(120deg, #fff4ec, #fff); border: 1px dashed #ffc3a8;
  border-radius: 12px; padding: 16px 18px; display: flex; align-items: center;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.dist-invite .code { font-size: 22px; font-weight: 800; letter-spacing: 2px; color: var(--brand); }
.dist-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.dist-panel h3 { font-size: 15px; margin-bottom: 10px; }
.dist-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.dist-row:last-child { border-bottom: 0; }
.dist-row .name { font-weight: 600; }
.dist-row .right { margin-left: auto; text-align: right; }
.dist-empty { color: var(--ink-3); font-size: 13px; padding: 10px 0; }
@media (max-width: 720px) { .dist-kpis { grid-template-columns: 1fr 1fr; } }