/* ============================================================
 * style.css — 优选商城 共享样式
 * 设计：浅色现代零售风，移动优先，响应式，注重可访问性
 * ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --brand: #ff4d4f;
  --brand-dark: #e63a3c;
  --brand-soft: #fff1f0;
  --ink: #1f2329;
  --ink-2: #4e5969;
  --ink-3: #86909c;
  --line: #eceef1;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #00b42a;
  --header-bg: rgba(255, 255, 255, 0.92);
  --footer-bg: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(20, 30, 50, 0.08);
  --shadow-sm: 0 2px 10px rgba(20, 30, 50, 0.06);
  --maxw: 1200px;
}

/* 深色模式 */
:root[data-theme="dark"] {
  --brand: #ff6b6b;
  --brand-dark: #ff5252;
  --brand-soft: #3a2326;
  --ink: #e8eaed;
  --ink-2: #aab1bd;
  --ink-3: #7b8494;
  --line: #2a2f3a;
  --bg: #0f1115;
  --card: #1a1d24;
  --ok: #3ddc5e;
  --header-bg: rgba(20, 22, 28, 0.92);
  --footer-bg: #13151a;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* 通用容器 */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* 区块标题 */
.section { padding: 36px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.section-head h2 { font-size: 22px; margin: 0; }
.section-head .more { color: var(--ink-3); font-size: 14px; }
.section-head .more:hover { color: var(--brand); }

/* ---------- 页头 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 18px;
}
.logo { font-size: 20px; font-weight: 800; white-space: nowrap; color: var(--brand); }
.main-nav { display: flex; gap: 18px; }
.main-nav a { color: var(--ink-2); font-weight: 600; padding: 4px 2px; position: relative; }
.main-nav a:hover { color: var(--brand); }
.main-nav a.active { color: var(--brand); }
.main-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 3px;
  background: var(--brand); border-radius: 3px;
}
.search-box {
  flex: 1; max-width: 420px; display: flex; align-items: center; position: relative;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 14px;
}
.search-box:focus-within { border-color: var(--brand); background: #fff; }
.search-box input { flex: 1; border: 0; background: transparent; outline: none; padding: 8px 6px; font-size: 14px; }
.search-box button { border: 0; background: var(--brand); color: #fff; border-radius: 999px; width: 34px; height: 34px; }
.cart-link { position: relative; font-size: 22px; line-height: 1; padding: 4px; }
.cart-badge {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; display: none; align-items: center; justify-content: center;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 15px; font-weight: 600; transition: .15s ease;
  background: var(--bg); color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.btn-ghost:hover { background: #ffe3e0; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255, 77, 79, 0.35); outline-offset: 2px;
}

/* ---------- 商品卡片网格 ---------- */
.product-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .18s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: transparent; }
.card-media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--bg); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-tag {
  position: absolute; left: 10px; top: 10px; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.card.is-trademark { border: 1px solid #ffd97a; box-shadow: 0 4px 12px rgba(212, 155, 0, 0.08); }
.card.is-trademark .card-tag.tm-card-tag {
  background: linear-gradient(135deg, #b88500, #d49b00); top: 44px;
  font-weight: 600; letter-spacing: 0.5px;
}
.card-tm-sub {
  font-size: 12px; color: #8b5a00; margin: 4px 0 6px;
  background: #fff8e6; padding: 3px 8px; border-radius: 6px; display: inline-block;
  align-self: flex-start;
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title {
  font-size: 15px; font-weight: 600; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 44px;
}
.card-title:hover { color: var(--brand); }
.card-meta { font-size: 12px; color: var(--ink-3); }
.card-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price-now { color: var(--brand); font-size: 18px; font-weight: 800; }
.price-old { color: var(--ink-3); font-size: 13px; text-decoration: line-through; }
.card-actions { display: flex; gap: 8px; }
.card-actions .btn { flex: 1; }

/* 星级 */
.stars { color: #faad14; letter-spacing: 1px; font-size: 13px; }
.star-num { color: var(--ink-3); margin-left: 4px; }

/* ---------- 首页 Hero ---------- */
.hero {
  margin-top: 16px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(120deg, #ff7a45 0%, #ff4d4f 60%, #d6336c 100%);
  color: #fff; padding: 48px 40px; position: relative;
}
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 12px; }
.hero p { font-size: 16px; opacity: .92; margin: 0 0 22px; max-width: 560px; }
.hero .btn { background: #fff; color: var(--brand-dark); }
.hero .btn:hover { background: #fff7f6; }
.hero-deco { position: absolute; right: -20px; top: -20px; font-size: 180px; opacity: .18; transform: rotate(-12deg); }

/* 分类入口 */
.cat-grid {
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.cat-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 12px; text-align: center; transition: .18s ease; display: block;
}
.cat-item:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); border-color: var(--brand-soft); }
.cat-emoji { font-size: 34px; }
.cat-name { margin-top: 8px; font-weight: 600; font-size: 14px; }

/* ---------- 商品列表页 ---------- */
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.filter-bar {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: sticky; top: 84px;
}
.filter-bar h3 { margin: 0 0 12px; font-size: 15px; }
.filter-cats li a {
  display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px;
}
.filter-cats li a:hover { background: var(--bg); color: var(--brand); }
.filter-cats li a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.filter-cats li a .count { color: var(--ink-3); font-size: 12px; }

.shop-main .toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar .result-count { color: var(--ink-2); font-size: 14px; }
.toolbar .result-count b { color: var(--brand); }
.sort-select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; background: var(--card);
}
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--ink-3); background: var(--card);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty-state .emoji { font-size: 48px; }

/* ---------- 商品详情页 ---------- */
.detail-layout { display: grid; grid-template-columns: 440px 1fr; gap: 36px; align-items: start; }
.gallery .main-img {
  background: var(--bg); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1;
}
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumbs button {
  width: 70px; height: 70px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg);
  overflow: hidden; padding: 0;
}
.thumbs button.active { border-color: var(--brand); }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }

.detail-info .breadcrumb { color: var(--ink-3); font-size: 13px; margin-bottom: 10px; }
.detail-info h1 { font-size: 26px; margin: 0 0 12px; line-height: 1.35; }

/* 商标详情条：注册号+尼斯分类，买家详情页专用 */
.tm-meta-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 0 12px; padding: 10px 14px;
  background: linear-gradient(135deg, #fff8e6, #fff3cc);
  border: 1px solid #ffd97a; border-radius: 10px;
  font-size: 13px;
}
.tm-meta-tag {
  padding: 4px 10px; border-radius: 8px;
  background: linear-gradient(135deg, #b88500, #d49b00); color: #fff;
  font-weight: 700; letter-spacing: 0.5px;
}
.tm-meta-item {
  background: rgba(255,255,255,0.6); padding: 4px 10px; border-radius: 8px;
  color: #6a4400;
}
.tm-meta-item b { color: #8b5a00; margin-right: 4px; }
.detail-rating { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.price-box {
  background: var(--brand-soft); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.price-box .now { color: var(--brand); font-size: 30px; font-weight: 800; }
.price-box .old { color: var(--ink-3); text-decoration: line-through; margin-left: 10px; }
.price-box .save { margin-left: 10px; color: var(--brand); font-size: 13px; font-weight: 700; }
.detail-meta { display: flex; gap: 20px; color: var(--ink-2); font-size: 13px; margin-bottom: 18px; flex-wrap: wrap; }
.detail-meta b { color: var(--ink); }

.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.qty-row .label { font-size: 14px; color: var(--ink-2); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--bg); font-size: 18px; }
.stepper button:hover { background: #ffe3e0; color: var(--brand); }
.stepper input { width: 56px; height: 38px; border: 0; text-align: center; font-size: 15px; outline: none; }

.detail-actions { display: flex; gap: 12px; margin-bottom: 24px; }
.detail-actions .btn { flex: 1; }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec-table th { color: var(--ink-3); font-weight: 600; width: 120px; background: var(--bg); }
.detail-desc { margin-top: 20px; color: var(--ink-2); }
.detail-desc h3 { font-size: 16px; margin: 0 0 8px; }

/* ---------- 详情页：核心卖点 ---------- */
.hl-wrap { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.hl-head { font-size: 15px; margin: 0 0 12px; color: var(--ink); }
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hl-item { display: flex; gap: 10px; align-items: flex-start; }
.hl-icon {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 15px;
  background: var(--bg); border: 1px solid var(--line);
}
.hl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hl-body b { font-size: 14px; color: var(--ink); font-weight: 600; }
.hl-body span { font-size: 13px; color: var(--ink-3); line-height: 1.55; }

/* 服务承诺条 */
.promise-row {
  list-style: none; margin: 18px 0 0; padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 18px;
}
.promise-row li { font-size: 13px; color: var(--ink-3); }

/* ---------- 详情页：全宽图文详情 Tab ---------- */
.detail-tabs-wrap { margin-top: 40px; }
.detail-tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }
.dtab {
  flex: 0 0 auto; appearance: none; background: none; border: 0;
  padding: 12px 22px; font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--ink-3); font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .18s ease, border-color .18s ease;
}
.dtab:hover { color: var(--ink); }
.dtab.active { color: var(--brand); border-bottom-color: var(--brand); }
.dtab:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; border-radius: 6px; }

.detail-pane { padding: 24px 0 4px; }
.ds-lead {
  margin: 0 0 22px; font-size: 15px; line-height: 1.75; color: var(--ink-2);
  padding: 14px 16px; background: var(--bg); border-radius: var(--radius);
  border-left: 3px solid var(--brand);
}
.ds-fallback { color: var(--ink-3); font-size: 14px; }

/* 图文段落：图标块 + 文案，奇偶行左右交替形成图文穿插的阅读节奏 */
.ds-block {
  display: grid; grid-template-columns: 120px 1fr; gap: 24px;
  align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line);
}
.ds-block:last-child { border-bottom: 0; }
.ds-block.alt { grid-template-columns: 1fr 120px; }
.ds-block.alt .ds-figure { order: 2; }
.ds-block.alt .ds-text { order: 1; }
.ds-figure {
  width: 120px; height: 120px; border-radius: var(--radius);
  display: grid; place-items: center; font-size: 46px;
  background: linear-gradient(135deg, var(--bg), var(--card));
  border: 1px solid var(--line);
}
.ds-text h4 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.ds-text p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--ink-2); }

@media (max-width: 720px) {
  .ds-block, .ds-block.alt { grid-template-columns: 1fr; gap: 14px; }
  .ds-block.alt .ds-figure { order: 0; }
  .ds-block.alt .ds-text { order: 0; }
  .ds-figure { width: 84px; height: 84px; font-size: 34px; }
  .dtab { padding: 11px 16px; font-size: 14px; }
}

/* ---------- 购物车 ---------- */
.cart-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-row {
  display: grid; grid-template-columns: 90px 1fr 110px 130px 120px 40px; gap: 16px; align-items: center;
  padding: 16px; border-bottom: 1px solid var(--line);
}
.cart-row.head { background: var(--bg); font-size: 13px; color: var(--ink-3); font-weight: 600; }
.cart-row .thumb { width: 90px; height: 90px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.cart-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .name { font-weight: 600; }
.cart-row .name a:hover { color: var(--brand); }
.cart-row .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.cart-row .price { color: var(--brand); font-weight: 700; }
.cart-row .line-total { font-weight: 800; color: var(--ink); }
.cart-row .remove { border: 0; background: transparent; color: var(--ink-3); font-size: 20px; }
.cart-row .remove:hover { color: var(--brand); }

.cart-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-top: 16px; flex-wrap: wrap;
}
.cart-footer .total { font-size: 15px; color: var(--ink-2); }
.cart-footer .total b { color: var(--brand); font-size: 24px; margin-left: 6px; }

/* ---------- 结算 / 表单 ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { margin: 0 0 16px; font-size: 17px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .req { color: var(--brand); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px;
  font-size: 15px; font-family: inherit; background: var(--card); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }
.field .err { color: var(--brand); font-size: 12px; margin-top: 4px; display: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--brand); }
.field.invalid .err { display: block; }

/* ---------- 登录/注册弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 17, 21, 0.55); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.modal-mask.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.auth-modal {
  position: relative; display: flex; width: min(880px, 100%); max-height: calc(100dvh - 40px);
  background: var(--card); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  transform: translateY(14px) scale(.98); transition: transform .24s ease;
}
.modal-mask.is-open .auth-modal { transform: translateY(0) scale(1); }

.auth-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.auth-close:hover { background: rgba(255, 255, 255, .26); }

/* 左侧品牌区 */
.auth-aside {
  flex: 0 0 40%; padding: 40px 34px; color: #fff;
  background: linear-gradient(155deg, #ff6b6b 0%, #ff4d4f 55%, #e63a3c 100%);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-brand { font-size: 20px; font-weight: 800; margin-bottom: 26px; }
.auth-aside-title { font-size: 26px; font-weight: 800; margin: 0 0 12px; }
.auth-aside-sub { font-size: 14px; line-height: 1.7; opacity: .92; margin: 0 0 24px; }
.auth-aside-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-aside-list li { font-size: 14px; opacity: .95; }

/* 右侧表单区 */
.auth-main { flex: 1; padding: 34px 36px; overflow-y: auto; }
.auth-tabs { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; margin-bottom: 22px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; color: var(--ink-2);
  font-size: 15px; font-weight: 700; padding: 10px 0; border-radius: 9px; cursor: pointer; transition: all .18s ease;
}
.auth-tab.is-active { background: var(--card); color: var(--brand); box-shadow: var(--shadow-sm); }

.auth-heading { font-size: 20px; font-weight: 800; margin: 0 0 20px; color: var(--ink); }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.input-eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer;
  font-size: 17px; opacity: .7; line-height: 1;
}
.input-eye:hover { opacity: 1; }

.auth-extra[hidden] { display: none; }
.auth-strength { margin: -6px 0 14px; }
.strength-bar { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.strength-bar span { display: block; height: 100%; width: 8%; border-radius: 999px; background: var(--brand); transition: width .2s ease, background .2s ease; }
.strength-bar span.s-weak { background: #f53f3f; }
.strength-bar span.s-mid { background: #ff9a2e; }
.strength-bar span.s-good { background: #21a366; }
.strength-bar span.s-strong { background: var(--ok); }
.strength-label { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.strength-label.s-weak { color: #f53f3f; }
.strength-label.s-mid { color: #d97706; }
.strength-label.s-good { color: #21a366; }
.strength-label.s-strong { color: var(--ok); }

.auth-error {
  display: none; background: var(--brand-soft); color: var(--brand-dark);
  border: 1px solid rgba(255, 77, 79, .25); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}
.auth-error:not(:empty) { display: block; }

.auth-submit { position: relative; margin-top: 6px; min-height: 46px; }
.auth-submit.is-loading .auth-submit-label { visibility: hidden; }
.auth-spinner {
  display: none; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
  margin: -9px 0 0 -9px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff;
  border-radius: 50%; animation: auth-spin .7s linear infinite;
}
.auth-submit.is-loading .auth-spinner { display: block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-foot { text-align: center; font-size: 14px; color: var(--ink-2); margin: 16px 0 0; }
.auth-foot a { color: var(--brand); font-weight: 700; }

@media (max-width: 680px) {
  .auth-aside { display: none; }
  .auth-main { padding: 28px 22px; }
  .auth-modal { border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-mask, .auth-modal, .strength-bar span, .auth-tab { transition: none; }
  .auth-spinner { animation-duration: 1.2s; }
}

.summary-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-item img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.summary-item .s-name { font-size: 14px; font-weight: 600; }
.summary-item .s-sub { font-size: 12px; color: var(--ink-3); }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.summary-total .t { font-size: 15px; }
.summary-total b { color: var(--brand); font-size: 24px; }

/* ---------- 成功页 ---------- */
.success-box { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 24px; }
.success-icon { font-size: 64px; }
.success-box h1 { margin: 12px 0 6px; font-size: 26px; }
.success-box .order-id { color: var(--ink-3); }
.success-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--line); margin-top: 48px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 36px 16px 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { margin: 0 0 12px; font-size: 15px; }
.footer-col p, .footer-col a, .footer-col span { display: block; color: var(--ink-3); font-size: 14px; margin-bottom: 8px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { text-align: center; color: var(--ink-3); font-size: 13px; padding: 16px; border-top: 1px solid var(--line); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: rgba(31, 35, 41, 0.92); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s ease; z-index: 999;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .detail-layout { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .filter-bar { position: static; }
}
@media (max-width: 720px) {
  .main-nav { display: none; }
  .header-inner { gap: 10px; }
  .hero { padding: 32px 22px; }
  .hero-deco { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 70px 1fr; grid-auto-rows: auto; row-gap: 8px; }
  .cart-row .price, .cart-row .line-total, .cart-row .remove, .cart-row.head { display: none; }
  .cart-row .qty-cell { grid-column: 1 / -1; }
}

/* ---------- 收藏按钮 ---------- */
.card-fav {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.85); color: #ff4d4f;
  font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); transition: .15s ease; z-index: 2;
}
.card-fav:hover { transform: scale(1.08); }
.card-fav.on { background: #ff4d4f; color: #fff; }
:root[data-theme="dark"] .card-fav { background: rgba(0, 0, 0, 0.5); }

/* ---------- 页头图标（收藏 / 主题） ---------- */
.icon-link { position: relative; font-size: 20px; line-height: 1; padding: 4px 2px; color: var(--ink-2); }
.icon-link:hover { color: var(--brand); }
.fav-badge {
  position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px;
  background: #ff4d4f; color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
}
.icon-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 50%;
  width: 36px; height: 36px; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 搜索联想 ---------- */
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 360px; overflow-y: auto;
}
.search-suggest[hidden] { display: none; }
.search-suggest .suggest-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.search-suggest .suggest-item:last-child { border-bottom: 0; }
.search-suggest .suggest-item:hover { background: var(--bg); }
.search-suggest .suggest-item img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.search-suggest .si-name { flex: 1; font-size: 14px; color: var(--ink); }
.search-suggest .si-price { color: var(--brand); font-weight: 700; font-size: 13px; }

/* ---------- 优惠券 ---------- */
.coupon-box { display: flex; gap: 8px; margin-bottom: 6px; }
.coupon-box input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  font-size: 14px; background: var(--card); color: var(--ink);
}
.coupon-hint { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.5; }

/* ---------- 订单状态徽章 ---------- */
.order-status {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
}
.order-status.st-pending   { background: #fff7e6; color: #d48806; border-color: #ffd591; }
.order-status.st-shipped   { background: #e6f4ff; color: #1677ff; border-color: #91caff; }
.order-status.st-completed { background: #f6ffed; color: #389e0d; border-color: #b7eb8f; }
.order-status.st-cancelled { background: #fff1f0; color: #cf1322; border-color: #ffccc7; }
.order-status.st-unpaid    { background: #fff0f6; color: #c41d7f; border-color: #ffadd2; }
:root[data-theme="dark"] .order-status.st-pending   { background: #4d3800; color: #ffd591; }
:root[data-theme="dark"] .order-status.st-shipped   { background: #112a46; color: #91caff; }
:root[data-theme="dark"] .order-status.st-completed { background: #162312; color: #b7eb8f; }
:root[data-theme="dark"] .order-status.st-cancelled { background: #3a0d0d; color: #ffccc7; }
:root[data-theme="dark"] .order-status.st-unpaid    { background: #3a0d2a; color: #ffadd2; }

/* ---------- 支付弹窗 / 支付徽标 ---------- */
.pay-modal { max-width: 380px; }
.pay-order-no { color: var(--ink-3); font-size: 13px; margin: -4px 0 14px; }
.pay-amount { font-size: 15px; color: var(--ink-2); margin-bottom: 16px; }
.pay-amount b { font-size: 24px; color: var(--ink); margin-left: 6px; }
.pay-methods { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pay-method {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); cursor: pointer; font-size: 15px;
  transition: border-color .12s ease, background .12s ease;
}
.pay-method:hover { border-color: var(--brand); }
.pay-method.active { border-color: var(--brand); background: var(--brand-soft); }
.pay-method-icon { font-size: 20px; }
.pay-notice { font-size: 12px; color: var(--ink-3); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin: 0 0 14px; }
.pay-modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.pay-modal .modal-actions .btn { flex: 1; }
.pay-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-left: 8px; }
.pay-badge.pay-unpaid { background: #fff0f6; color: #c41d7f; border: 1px solid #ffadd2; }
.pay-badge.pay-paid { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
:root[data-theme="dark"] .pay-badge.pay-unpaid { background: #3a0d2a; color: #ffadd2; }
:root[data-theme="dark"] .pay-badge.pay-paid { background: #162312; color: #b7eb8f; }
.ship-lock { font-size: 14px; color: var(--warn, #d48806); background: var(--brand-soft); border: 1px solid #ffd591; border-radius: 10px; padding: 10px 12px; }
:root[data-theme="dark"] .ship-lock { border-color: #4d3800; }

/* ---------- 我的订单页 ---------- */
/* 状态筛选 Tab */
.om-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
}
.om-tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer;
  transition: all .15s ease;
}
.om-tab:hover { border-color: var(--brand); color: var(--brand); }
.om-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.om-tab-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--bg); color: var(--ink-3); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.om-tab.is-active .om-tab-count { background: rgba(255, 255, 255, .25); color: #fff; }

/* 订单列表 */
.om-list { display: flex; flex-direction: column; gap: 16px; }
.om-order { padding: 0; overflow: hidden; }
.om-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.om-shop { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.om-shop-ico { font-size: 18px; }
.om-no { font-weight: 400; font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.om-time { padding: 8px 18px 0; font-size: 12px; color: var(--ink-3); }

/* 商品列表 */
.om-items { padding: 6px 18px; }
.om-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px;
  text-decoration: none; color: var(--ink); transition: background .12s ease;
}
.om-item:hover { background: var(--brand-soft); }
.om-item + .om-item { border-top: 1px solid var(--line); }
.om-thumb {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.om-info { flex: 1; min-width: 0; }
.om-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-meta { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.om-price { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }

/* 底部：合计 + 操作 */
.om-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px dashed var(--line);
}
.om-sum { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.om-sum .sum-line.discount { color: var(--ok); }
.om-sum .sum-line.total { font-size: 15px; }
.om-sum .sum-line.total b { color: var(--brand); font-size: 17px; }
.om-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 物流弹窗 */
#om-logistics-mask { display: none; }
#om-logistics-mask.is-open { display: flex; align-items: center; justify-content: center; padding: 20px; }
.log-modal { width: min(440px, 100%); max-height: 80vh; overflow: auto; padding: 0; }
.log-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card);
}
.log-modal-head h3 { margin: 0; font-size: 16px; }
.log-close { border: 0; background: var(--bg); width: 32px; height: 32px; border-radius: 8px; font-size: 20px; cursor: pointer; color: var(--ink-2); }
.log-close:hover { background: var(--brand-soft); color: var(--brand); }
.log-modal-body { padding: 18px; }
.log-empty { padding: 18px; text-align: center; color: var(--ink-3); background: var(--bg); border-radius: 10px; }
.log-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.log-node { position: relative; padding: 0 0 18px 22px; }
.log-node::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: -4px; width: 2px; background: var(--line);
}
.log-node:last-child::before { display: none; }
.log-dot {
  position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--line); border: 2px solid var(--card);
}
.log-node.is-latest .log-dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.log-text { font-size: 14px; color: var(--ink); line-height: 1.5; }
.log-node.is-latest .log-text { font-weight: 700; }
.log-loc { color: var(--ink-3); font-weight: 400; font-size: 12px; }
.log-time { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 移动端 */
@media (max-width: 560px) {
  .om-head { flex-wrap: wrap; }
  .om-foot { flex-direction: column; align-items: stretch; }
  .om-actions { justify-content: flex-end; }
  .om-sum { justify-content: flex-start; }
}

/* ---------- 管理后台 ---------- */
.admin-tabs { display: flex; gap: 8px; margin: 8px 0 18px; }
.tab-btn {
  padding: 8px 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; font-size: 14px; cursor: pointer;
}
.tab-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.admin-panel { margin-bottom: 24px; }
.page-title { font-size: 26px; margin: 6px 0 4px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-form .field { margin-bottom: 12px; }
.product-form label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.product-form input, .product-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px;
  background: var(--card); color: var(--ink); font-family: inherit;
}
.product-form .form-actions { display: flex; gap: 8px; margin-top: 6px; }
.danger { color: #cf1322; border-color: #ffccc7; }
.danger:hover { background: #fff1f0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-table td.c-emoji { font-size: 18px; }
.admin-table td.c-price { color: var(--brand); font-weight: 600; }
.admin-table td.c-num { text-align: right; }
.admin-table td.c-actions { white-space: nowrap; }
.admin-table td.c-code { white-space: nowrap; }
.admin-table td.c-code .code-chip {
  display: inline-block; padding: 2px 8px;
  background: var(--brand-soft); color: var(--brand);
  border-radius: 4px; font-size: 12px; font-family: ui-monospace, Menlo, monospace;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.admin-table td.c-code .code-empty { color: var(--ink-3); font-size: 12px; }

/* 商标徽章：行内小标签 + 名称前的角标 */
.tm-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff4d6, #ffe4a8);
  color: #8b5a00;
  letter-spacing: 0.5px;
  vertical-align: middle;
  white-space: nowrap;
}

/* 分类快捷 chip 行 */
.cat-chip-row {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 16px 0;
  flex-wrap: wrap;
}
.cat-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: var(--chip-bg, #f4f5f7);
  color: var(--ink-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-chip:hover { border-color: var(--brand, #ff5a5f); color: var(--brand, #ff5a5f); }
.cat-chip.is-selected {
  background: var(--brand, #ff5a5f); color: #fff; border-color: var(--brand, #ff5a5f);
}
.cat-chip em { font-style: normal; opacity: 0.6; margin-left: 2px; font-size: 11px; }
.cat-chip.tm-chip.is-selected {
  background: linear-gradient(135deg, #b88500, #d49b00); border-color: transparent; color: #fff;
}
.cat-chip.tm-chip:not(.is-selected):hover { background: #fff4d6; }

/* 批量操作工具栏 */
.batch-bar {
  display: flex; gap: 10px; align-items: center;
  margin: 12px 16px 0;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0f7ff, #e8f1fe);
  border: 1px dashed #6aa8ff;
  border-radius: 10px;
  font-size: 13px;
}
.batch-bar[hidden] { display: none; }
.batch-check { font-weight: 600; }
.batch-check input { margin-right: 4px; transform: translateY(2px); }
.batch-bar select { min-width: 110px; }
.batch-bar #batch-count { color: var(--brand, #ff5a5f); margin: 0 2px; font-size: 15px; }

/* 复选框列 */
.admin-table th.c-check, .admin-table td.c-check { width: 36px; text-align: center; }
.admin-table td.c-check input { cursor: pointer; transform: scale(1.1); }

/* 商标专用字段区域 */
.tm-fields {
  margin-top: 12px; padding: 12px 14px;
  background: linear-gradient(135deg, #fff8e6, #fff3cc);
  border: 1px dashed #d49b00; border-radius: 10px;
}
.tm-fields[hidden] { display: none; }
.tm-fields-head {
  font-size: 13px; font-weight: 600; color: #8b5a00;
  margin-bottom: 8px;
}
.admin-table .empty { text-align: center; color: var(--ink-3); padding: 24px; }
/* 类目管理：色相预览小色块 */
.hue-chip {
  display: inline-block; width: 14px; height: 14px; border-radius: 4px;
  margin-right: 8px; vertical-align: -2px; border: 1px solid var(--line);
}
/* 禁用态按钮（如：类目下仍有商品时不可删除） */
.admin-table .btn[disabled] { opacity: .45; cursor: not-allowed; }
.order-row { padding: 14px 16px; margin-bottom: 12px; }
.order-row-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-row-head .order-no { font-weight: 600; }
.order-row-head .order-user { color: var(--ink-2); font-size: 13px; }
.order-row-head .order-amt { margin-left: auto; color: var(--brand); font-weight: 700; }
.order-row-items { margin: 8px 0; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.order-row-actions { display: flex; gap: 8px; }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { border-bottom: 8px solid var(--bg); }
  .admin-table td { border: 0; padding: 6px 0; }
}

/* ============================================================
 * 管理后台：侧边栏 + 顶栏 + 数据看板（现代电商后台形态）
 * ============================================================ */
.admin-shell { display: flex; min-height: 100dvh; background: var(--bg); }
.admin-sidebar {
  width: 232px; flex: 0 0 232px;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; z-index: 20;
}
.admin-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line);
}
.admin-brand-logo { font-size: 24px; line-height: 1; }
.admin-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.admin-brand-name { font-weight: 700; font-size: 16px; color: var(--ink); }
.admin-brand-tag { font-size: 12px; color: var(--ink-3); }
.admin-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; user-select: none;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-ico { font-size: 16px; width: 20px; text-align: center; flex: 0 0 20px; }
.nav-label { flex: 1; }
.admin-side-foot { padding: 10px; border-top: 1px solid var(--line); }
.admin-side-foot .nav-item { color: var(--ink-3); }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; background: var(--header-bg, var(--card));
  border-bottom: 1px solid var(--line);
}
.admin-menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; font-size: 18px; cursor: pointer; color: var(--ink);
}
.admin-page-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--ink); }
.admin-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.admin-user { font-size: 14px; color: var(--ink-2); }
.admin-content { flex: 1; padding: 22px; overflow: auto; }
.admin-backdrop { display: none; }

/* 数据看板 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.stat-ico {
  font-size: 24px; width: 52px; height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); border-radius: 12px;
}
.stat-body { min-width: 0; }
.stat-label { font-size: 13px; color: var(--ink-3); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.stat-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.stat-card.is-clickable { cursor: pointer; position: relative; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.stat-card.is-clickable:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card.is-clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stat-go { margin-left: auto; align-self: center; color: var(--brand); font-size: 13px; font-weight: 600; white-space: nowrap; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-trend .trend-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 6px; }
.trend-bar-fill {
  width: 100%; max-width: 34px;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  border-radius: 6px 6px 0 0; min-height: 4px;
}
.trend-bar-label { font-size: 11px; color: var(--ink-3); }

.dash-status .status-list { display: flex; flex-direction: column; gap: 12px; }
.status-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.status-dot.st-pending { background: #faad14; }
.status-dot.st-shipped { background: #1677ff; }
.status-dot.st-completed { background: var(--ok); }
.status-dot.st-cancelled { background: #ff4d4f; }
.status-dot.st-unpaid { background: #eb2f96; }
.status-name { color: var(--ink-2); }
.status-num { margin-left: auto; font-weight: 700; color: var(--ink); }
.status-item.is-clickable { cursor: pointer; padding: 6px 8px; margin: -6px -8px; border-radius: 8px; transition: background .12s ease; }
.status-item.is-clickable:hover { background: var(--brand-soft); }
.status-item.is-clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.status-go { margin-left: 8px; color: var(--brand); font-size: 13px; font-weight: 600; white-space: nowrap; }

.dash-actions .quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.qa {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.qa:hover { border-color: var(--brand); color: var(--brand); }
.muted { color: var(--ink-3); font-size: 12px; }

/* 顶部加载/错误态 */
.loading { padding: 40px; text-align: center; color: var(--ink-3); }

/* 响应式：窄屏时侧边栏变为抽屉 */
@media (max-width: 980px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-menu-toggle { display: inline-flex; }
  .admin-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
  .admin-backdrop:not([hidden]) { display: block; }
  .admin-content { padding: 16px; }
}
@media (max-width: 520px) {
  .stat-cards { grid-template-columns: 1fr; }
}

/* ============================================================
 * 后台：订单详情弹窗 + 物流时间线（复用 .modal-mask 遮罩）
 * ============================================================ */
.admin-dialog {
  position: relative; width: min(720px, 100%); max-height: calc(100dvh - 40px);
  background: var(--card); border-radius: 16px; overflow: hidden auto;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  transform: translateY(14px) scale(.98); transition: transform .24s ease;
}
.modal-mask.is-open .admin-dialog { transform: translateY(0) scale(1); }
.admin-dialog-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--bg); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer;
}
.admin-dialog-close:hover { background: var(--line); color: var(--ink); }
.admin-dialog-body { padding: 22px 24px 26px; }

.od-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.od-no { font-size: 18px; font-weight: 700; color: var(--ink); }
.od-track {
  margin: 6px 0 14px; padding: 8px 12px; font-size: 14px;
  background: var(--brand-soft); color: var(--brand); border-radius: 10px;
}
/* 管理员订单详情用的快递行：信息 + 一键查询跳转并排 */
.od-track-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 6px 0 14px; padding: 8px 12px;
  background: var(--brand-soft); color: var(--brand);
  border-radius: 10px; font-size: 14px;
}
.od-track-row .od-track-info { flex: 1 1 auto; min-width: 0; }
.od-section { margin-top: 18px; }
.od-h { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* 订单页：快递卡片（手动同步物流 / 一键查快递） */
.od-track-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--brand-soft) 0%, rgba(0,0,0,0) 100%);
  border: 1px solid var(--brand-soft);
  border-radius: 12px;
  margin-bottom: 14px;
}
.od-track-icon { font-size: 28px; line-height: 1; flex: 0 0 auto; }
.od-track-main { flex: 1 1 auto; min-width: 0; }
.od-track-line1 { font-size: 15px; font-weight: 600; color: var(--ink); }
.od-track-line1 b { color: var(--brand); margin-right: 4px; }
.od-track-line2 { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.od-track-card .btn { flex: 0 0 auto; }
.od-track-nolink { font-size: 12px; color: var(--ink-3); flex: 0 0 auto; }

.od-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; }
.od-field { display: flex; flex-direction: column; gap: 3px; }
.od-label { font-size: 12px; color: var(--ink-3); }
.od-value { font-size: 14px; color: var(--ink); word-break: break-all; }
.od-field-strong .od-value { font-weight: 700; color: var(--brand); font-size: 16px; }

.od-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.od-table th, .od-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.od-table th { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.od-emoji { width: 34px; font-size: 20px; }
.od-num { text-align: right; white-space: nowrap; }

/* 物流时间线 */
.log-timeline { list-style: none; margin: 0; padding: 4px 0 4px 4px; }
.log-item { position: relative; padding: 0 0 16px 20px; }
.log-item::before {
  content: ''; position: absolute; left: 4px; top: 18px; bottom: -2px; width: 2px; background: var(--line);
}
.log-item:last-child::before { display: none; }
.log-dot {
  position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.log-main { font-size: 14px; color: var(--ink); }
.log-text { line-height: 1.5; }
.log-loc { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.log-time { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.log-empty { padding: 14px; color: var(--ink-3); font-size: 13px; background: var(--bg); border-radius: 10px; }

/* 发货 / 添加物流表单 */
.ship-form { margin-top: 14px; }
.sf-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.sf-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sf-input { flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: var(--card); color: var(--ink); }
.sf-input:focus, .la-loc:focus, .la-text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.log-add { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.la-loc { width: 160px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: var(--card); color: var(--ink); }
.la-text { flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: var(--card); color: var(--ink); }

.od-ctrl { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.order-track { font-size: 13px; color: var(--ink-2); background: var(--bg); padding: 2px 8px; border-radius: 8px; }
.panel-tip { margin: 0; font-size: 12px; color: var(--ink-3); }

@media (max-width: 560px) {
  .od-grid { grid-template-columns: 1fr; }
  .admin-dialog-body { padding: 18px 16px 22px; }
}

/* 列表工具栏：标题旁的搜索框 */
.panel-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-input {
  padding: 8px 12px; min-width: 200px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
.search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 分段筛选 */
.seg-filter { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 4px; }
.seg-btn {
  padding: 6px 14px; font-size: 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-2); cursor: pointer; transition: all .15s ease;
}
.seg-btn:hover { border-color: var(--brand); color: var(--brand); }
.seg-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* 库存预警徽标 */
.st-danger { color: #fff; background: #e5484d; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.st-warn { color: #b45309; background: #fef3c7; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }

/* ============================================================
   商品管理：列表单元格 / 状态药丸 / 筛选下拉
   ============================================================ */
.table-wrap { overflow-x: auto; }

.admin-table td.c-prod { min-width: 220px; }
.prod-cell { display: flex; align-items: center; gap: 12px; }
.prod-thumb {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--bg); border: 1px solid var(--line);
}
.prod-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prod-name { font-weight: 600; color: var(--ink); max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-cat { font-size: 12px; color: var(--ink-3); }

.admin-table td.c-status { white-space: nowrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.is-active { color: #1a7f37; background: #e6f4ea; }
.status-pill.is-inactive { color: #6b7280; background: #eef0f2; }
.status-pill.is-pending { color: #b54708; background: #fef3c7; }
.status-pill.is-out { color: #cf222e; background: #fde8e8; }

/* 列表筛选下拉（分类 / 状态） */
.filter-select {
  padding: 8px 28px 8px 12px; font-size: 13px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink); cursor: pointer; -webkit-appearance: none; appearance: none;
}
.filter-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 表单提示文字（抽屉内） */
.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }

/* ============================================================
   新增 / 编辑商品：右侧抽屉
   ============================================================ */
.admin-drawer-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
  opacity: 0; visibility: hidden; transition: opacity .25s ease; z-index: 60;
}
.admin-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh;
  width: 460px; max-width: 92vw;
  background: var(--card); box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  z-index: 61; display: flex; flex-direction: column;
}
/* 商品抽屉专用：拓宽到 880px 以承载两栏（主表单 + 实时预览） */
.admin-drawer.wide { width: 880px; max-width: 96vw; }
.admin-drawer.is-open { transform: translateX(0); }
.admin-drawer-mask.is-open { opacity: 1; visibility: visible; }

/* 标题区 + 面包屑 */
.drawer-title-wrap h3 { margin: 0; font-size: 18px; color: var(--ink); font-weight: 700; }
.drawer-title-wrap .bc {
  margin-top: 6px; font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
.drawer-title-wrap .bc a { color: var(--ink-3); text-decoration: none; }
.drawer-title-wrap .bc a:hover { color: var(--brand); }
.drawer-title-wrap .bc-sep { opacity: .5; }
.drawer-title-wrap .bc-current { color: var(--brand); font-weight: 600; }

/* 主体两栏布局 */
.drawer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 0;
  flex: 1 1 auto; overflow: hidden;
}
.drawer-main {
  padding: 18px 22px; overflow-y: auto;
  scrollbar-width: thin;
}
.drawer-side {
  border-left: 1px solid var(--line);
  padding: 18px 16px; background: var(--bg-soft, #fafbfc);
  overflow-y: auto;
}

.drawer-form { display: flex; flex-direction: column; height: 100%; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.drawer-head h3 { margin: 0; font-size: 17px; color: var(--ink); }
.drawer-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--bg);
  font-size: 22px; line-height: 1; color: var(--ink-2); cursor: pointer;
}
.drawer-close:hover { background: var(--line); color: var(--ink); }

.drawer-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.drawer-section:last-child { border-bottom: 0; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700;
}
.section-title { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: .02em; }
.section-hint { font-size: 12px; color: var(--ink-3); margin-left: auto; }
/* 兼容旧调用（无 step 编号的 section） */
.section-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 14px; letter-spacing: .02em; }
.section-hint + .section-title { margin-bottom: 14px; }

.field-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.required { color: #e63946; font-weight: 700; margin-right: 2px; }
.counter { float: right; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.counter.warn { color: #e63946; }
.muted { color: var(--ink-3); font-weight: 400; font-size: 12px; }

/* 三栏布局 */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* 抽屉内所有表单控件统一样式（含不在 .field 包裹内的 emoji 输入框） */
.drawer-body input, .drawer-body textarea, .drawer-body select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; background: var(--card); color: var(--ink);
  font-family: inherit;
}
.drawer-body input:focus, .drawer-body textarea:focus, .drawer-body select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}

/* 媒体区：Emoji 预览 + 选择器 */
.media-row { display: flex; gap: 16px; align-items: flex-start; }
.emoji-preview {
  flex: 0 0 72px; width: 72px; height: 72px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: var(--bg); border: 1px solid var(--line);
}
.media-main { flex: 1 1 auto; min-width: 0; }
.emoji-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.emoji-pick {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 20px; cursor: pointer; transition: all .12s ease;
}
.emoji-pick:hover { border-color: var(--brand); background: var(--brand-soft); }

/* Emoji 行（新版在「商品图片」section 内） */
.emoji-row { display: flex; align-items: center; gap: 12px; }
.emoji-row .emoji-preview { width: 56px; height: 56px; font-size: 32px; border-radius: 12px; flex: 0 0 56px; }
.emoji-row #pd-emoji { flex: 1; }

/* 主图网格（5 列） */
.image-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.image-slot {
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px;
  background: var(--card); display: flex; flex-direction: column; gap: 6px;
  transition: all .15s ease;
}
.image-slot.has-img { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.img-preview {
  aspect-ratio: 1 / 1; border-radius: 8px; background: var(--bg-soft, #fafbfc);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-empty {
  color: var(--ink-3); font-size: 11px; padding: 4px;
  text-align: center; line-height: 1.3;
}
.image-slot .img-url {
  padding: 6px 8px; font-size: 11px; border-radius: 6px;
}

/* 右侧实时预览卡 */
.preview-title {
  font-size: 12px; color: var(--ink-3); margin-bottom: 10px;
  font-weight: 600; letter-spacing: .02em;
}
.preview-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.preview-img {
  aspect-ratio: 1 / 1; background: var(--bg-soft, #fafbfc);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.preview-img img { width: 100%; height: 100%; object-fit: cover; }
.preview-img-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0f1f5 0%, #e9eaef 100%);
}
.preview-info { padding: 10px 12px; }
.preview-name {
  font-size: 13px; color: var(--ink); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 36px;
}
.preview-price {
  margin-top: 6px; font-size: 18px; font-weight: 700; color: var(--brand);
}
.preview-meta {
  margin-top: 4px; font-size: 11px; color: var(--ink-3);
}
.preview-tm {
  margin-top: 6px; padding: 3px 8px; font-size: 11px;
  background: linear-gradient(135deg, #fff7d6, #ffe9a0); color: #8a6d00;
  border-radius: 6px; display: inline-block;
}
.preview-foot {
  margin-top: 10px; font-size: 11px; color: var(--ink-3); text-align: center;
  padding: 8px; border-top: 1px dashed var(--line);
}

/* 底部操作栏 */
.drawer-foot {
  flex: 0 0 auto; display: flex; justify-content: space-between; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--line); background: var(--card);
}
.drawer-foot-left { display: flex; align-items: center; }
.drawer-foot-right { display: flex; gap: 10px; }
.drawer-foot-hint { font-size: 12px; color: var(--ink-3); }
.drawer-foot-hint .required { font-size: 14px; }

/* 通用空状态（弹窗内） */
.od-empty, .pd-empty { color: var(--ink-3); font-size: 13px; padding: 4px 0; }

/* 商品详情弹窗 */
.pd-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.pd-thumb {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  background: var(--bg); border: 1px solid var(--line);
}
.pd-head-meta { min-width: 0; }
.pd-name { font-size: 19px; font-weight: 700; color: var(--ink); }
.pd-sub { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pd-cat { font-size: 13px; color: var(--ink-2); }
.pd-id { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.pd-tag {
  display: inline-block; margin: 0 6px 4px 0; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; background: var(--brand-soft); color: var(--brand);
}
.pd-desc { font-size: 14px; color: var(--ink); line-height: 1.7; }

.pd-hl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pd-hl { display: flex; gap: 10px; align-items: flex-start; }
.pd-hl-icon { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pd-hl-text { display: flex; flex-direction: column; gap: 2px; }
.pd-hl-text b { font-size: 14px; color: var(--ink); font-weight: 600; }
.pd-hl-desc { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.pd-block { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.pd-block:last-child { border-bottom: 0; }
.pd-block-h { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.pd-block-p { font-size: 13px; color: var(--ink-2); line-height: 1.7; }

@media (max-width: 560px) {
  .panel-tools { flex-wrap: wrap; }
  .filter-select { flex: 1 1 40%; }
  .admin-drawer { width: 100vw; max-width: 100vw; }
}

/* ===== 收货地址簿（管理页 + 结算页共用） ===== */
.addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.addr-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--card);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.addr-card.is-default { border-color: var(--brand); }
.addr-card.selectable { cursor: pointer; }
.addr-card.selectable:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.addr-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; background: var(--bg); }
.addr-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.addr-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addr-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.addr-phone { color: var(--ink-2); font-size: 14px; }
.addr-tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.addr-tag.default { background: var(--brand); color: #fff; }
.addr-line { margin-top: 6px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.addr-ops { margin-top: 10px; display: flex; gap: 14px; }
.addr-check { margin-top: 8px; color: var(--brand); font-weight: 600; font-size: 14px; }
.addr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.addr-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.addr-add-wrap { margin-top: 18px; }
.addr-empty { color: var(--ink-2); margin-bottom: 10px; }
.addr-form-panel { margin-top: 16px; border-style: dashed; }
.ck { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin: 8px 0 12px; cursor: pointer; }
.link { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 14px; padding: 0; }
.link.danger { color: #e5484d; }
.link:hover { text-decoration: underline; }

/* 省市区三级联动选择器 */
.region-selects { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.region-sel { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 14px; }
.region-sel:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.region-sel:disabled { background: var(--bg); color: var(--ink-2); cursor: not-allowed; }
@media (max-width: 540px) { .region-selects { grid-template-columns: 1fr; } }

/* 修改密码弹窗 */
.cp-modal { max-width: 380px; width: calc(100% - 40px); position: relative; }
.cp-modal .auth-heading { margin-bottom: 16px; }
.cp-modal .field { margin-bottom: 12px; }

/* ============================================================
 * 评价 / 退款 相关样式
 * ============================================================ */

/* 订单状态徽标：待评价 / 退款审核中 / 已退款 */
.order-status.st-reviewing { background: #fffbe6; color: #d48806; border-color: #ffe58f; }
.order-status.st-refunding { background: #fff1e6; color: #d4380d; border-color: #ffbb96; }
.order-status.st-refunded  { background: #f0f5ff; color: #2f54eb; border-color: #adc6ff; }
:root[data-theme="dark"] .order-status.st-reviewing { background: #4d3800; color: #ffe58f; }
:root[data-theme="dark"] .order-status.st-refunding { background: #3a1407; color: #ffbb96; }
:root[data-theme="dark"] .order-status.st-refunded  { background: #0e1f3a; color: #adc6ff; }

/* 我的订单页：退款审核中提示 */
.om-refund-note { font-size: 13px; color: var(--ink-2); background: #fff7e6; border: 1px dashed #ffd591;
  border-radius: 10px; padding: 8px 12px; text-align: right; }
:root[data-theme="dark"] .om-refund-note { background: #3a2a00; border-color: #6b5118; color: #ffd591; }

/* 评价弹窗 */
.rv-modal { max-width: 460px; width: calc(100% - 40px); }
.rv-tip { font-size: 13px; color: var(--ink-2); margin: -6px 0 14px; }
.rv-list { display: flex; flex-direction: column; gap: 14px; max-height: 50vh; overflow: auto; }
.rv-item { display: flex; gap: 12px; align-items: flex-start; }
.rv-thumb { flex: 0 0 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; }
.rv-body { flex: 1; min-width: 0; }
.rv-name { font-weight: 600; color: var(--ink); margin-bottom: 6px; font-size: 14px; }
.rv-stars { display: inline-flex; gap: 2px; margin-bottom: 6px; }
.rv-star { background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1; color: #d9d9d9; padding: 0 1px; transition: color .12s; }
.rv-star.on { color: #faad14; }
.rv-star:hover { color: #ffc53d; }
.rv-text { width: 100%; min-height: 52px; resize: vertical; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13px; color: var(--ink); background: var(--card); }
.rv-text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rv-images-input { width: 100%; min-height: 40px; resize: vertical; border: 1px dashed var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 12px; color: var(--ink-2); background: var(--bg); margin-top: 6px; }
.rv-images-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 商品详情页：用户评价里的晒图与追评 */
.rv-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rv-img { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: block; }
.rv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-append { margin-top: 8px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.rv-append-label { display: inline-block; font-weight: 600; color: var(--brand); margin-right: 8px; }
.rv-append-time { display: block; color: var(--ink-3); font-size: 12px; margin-top: 4px; }

/* 退款申请弹窗 */
.refund-modal { max-width: 420px; width: calc(100% - 40px); }
.rf-reason { width: 100%; min-height: 90px; resize: vertical; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--card); margin-top: 6px; }
.rf-reason:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 商品详情页：用户评价 */
.rv-summary { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); margin-bottom: 16px; }
.rv-summary b { color: var(--ink); font-size: 18px; }
.rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.rv-list-item { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.rv-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.rv-list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rv-list-user { font-weight: 600; color: var(--ink); font-size: 14px; }
.rv-list-time { color: var(--ink-3); font-size: 12px; margin-left: auto; }
.rv-list-text { color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.rv-empty, .rv-load { color: var(--ink-3); font-size: 14px; padding: 12px 0; text-align: center; }

/* 后台：退款处理区 */
.refund-box { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.refund-reason { color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.refund-actions { display: flex; gap: 10px; }
.refund-done { color: var(--ok); background: var(--ok-soft, #f6ffed); }

/* 已支付徽标（后台）增加已退款态 */
.pay-badge.pay-refunded { background: #f0f5ff; color: #2f54eb; border: 1px solid #adc6ff; padding: 2px 8px; border-radius: 999px; font-size: 12px; margin-left: 8px; }

/* ============ 我的订单页：搜索栏 + 分页 ============ */
.om-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.om-search { flex: 1 1 280px; display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); overflow: hidden; }
.om-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.om-search-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  padding: 10px 16px; font: inherit; font-size: 14px; color: var(--ink); }
.om-search-btn { border: none; background: transparent; cursor: pointer; font-size: 16px; padding: 0 16px; color: var(--ink-2); }
.om-search-btn:hover { color: var(--brand); }

.om-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.om-pager-info { color: var(--ink-2); font-size: 13px; margin-right: 4px; }
.om-page-btn { min-width: 36px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: all .12s; }
.om-page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.om-page-btn.is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.om-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.om-page-ellipsis { color: var(--ink-3); padding: 0 2px; }
.om-page-jump { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; margin-left: 6px; }
.om-page-input { width: 56px; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--card); text-align: center; }
.om-page-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* 订单号改为可点击链接 */
.om-no { color: var(--ink-2); font-size: 13px; text-decoration: none; }
.om-no:hover { color: var(--brand); text-decoration: underline; }
.om-no::before { content: ''; }

/* ============ 订单详情页 ============ */
.od-crumbs { margin-bottom: 14px; }
.od-crumbs a { color: var(--ink-2); font-size: 14px; text-decoration: none; }
.od-crumbs a:hover { color: var(--brand); }
.od-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.od-head { padding: 20px; }
.od-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.od-no { font-size: 15px; color: var(--ink-2); }
.od-no b { color: var(--ink); font-weight: 600; }
.od-time { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* 状态进度条 */
.od-steps { display: flex; align-items: center; margin-top: 20px; }
.od-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; text-align: center; }
.od-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 12px; color: var(--ink-3); }
.od-step-label { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.od-step.is-done .od-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.od-step.is-done .od-step-label { color: var(--brand); }
.od-step.is-active .od-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.od-step.is-active .od-step-label { color: var(--ink); font-weight: 600; }
.od-step-line { flex: 1 1 auto; height: 2px; background: var(--line); margin: 0 6px 18px; }
.od-step-line.is-done { background: var(--brand); }

/* 状态横幅 */
.od-banner { margin-top: 16px; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.od-banner-warn { background: #fff7e6; color: #d48806; border: 1px solid #ffd591; }
.od-banner-info { background: #f0f5ff; color: #2f54eb; border: 1px solid #adc6ff; }
.od-banner-muted { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
:root[data-theme="dark"] .od-banner-warn { background: #3a2a00; border-color: #6b5118; color: #ffd591; }
:root[data-theme="dark"] .od-banner-info { background: #112a46; border-color: #1d4ed8; color: #91caff; }
:root[data-theme="dark"] .od-banner-muted { background: #1a1a1a; }

.od-section { padding: 20px; }
.od-section h3 { margin: 0 0 16px; font-size: 17px; }

/* 商品清单 */
.od-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.od-item:last-of-type { border-bottom: none; }
.od-thumb { width: 64px; height: 64px; border-radius: 10px; flex: 0 0 64px; object-fit: cover; }
.od-item-body { flex: 1; min-width: 0; }
.od-item-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.od-item-sub { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.od-item-price { font-weight: 600; color: var(--ink); font-size: 15px; white-space: nowrap; }

/* 金额明细 */
.od-amount { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.od-amount-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.od-amount-line.discount b { color: var(--brand); }
.od-amount-line.total { font-size: 16px; color: var(--ink); }
.od-amount-line.total b { color: var(--brand); font-size: 18px; }

/* 收货信息 */
.od-addr-line { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.od-addr-line span { color: var(--ink-2); font-weight: 400; margin-left: 8px; }
.od-addr-detail { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.od-addr-note { color: var(--ink-3); }

/* 退款信息 */
.od-refund-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.od-refund-row b { color: var(--ink); font-weight: 600; text-align: right; }

/* 操作按钮与底部链接 */
.od-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.od-actions .btn { flex: 0 0 auto; }
.od-foot-links { display: flex; gap: 12px; justify-content: center; padding-bottom: 8px; }

/* ============ 聚水潭 ERP 对接面板 ============ */
.jst-settings .panel-head { align-items: center; gap: 10px; }
.jst-form .form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.jst-hint { font-size: 12px; color: var(--ink-3); max-width: 620px; line-height: 1.5; }
.jst-pill {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.jst-p-pending { background: #fff7e6; color: #d48806; border: 1px solid #ffe58f; }
.jst-p-synced  { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.jst-p-failed  { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.jst-p-skipped { background: #fafafa; color: #8c8c8c; border: 1px solid #d9d9d9; }
.c-oid { font-family: var(--mono, ui-monospace, monospace); font-size: 13px; }
.c-err { color: #cf1322; font-size: 12px; max-width: 260px; word-break: break-all; }
.c-time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.panel-tip { font-size: 12px; color: var(--ink-3); margin: 10px 2px 0; line-height: 1.5; }

/* 开关（启用对接） */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 44px; height: 24px; border-radius: 999px; background: var(--line, #d9d9d9);
  transition: background .2s ease; position: relative;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease;
}
.switch input:checked + .switch-track { background: var(--brand, #2f7cf6); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }

/* ============ 订单详情：商家编码展示 ============ */
/* admin 后台订单详情表格里商品名 + 编码小标签 */
.od-name { font-weight: 600; color: var(--ink-1); }
.od-meta { margin-top: 4px; font-size: 12px; color: var(--ink-3, #999); display: flex; align-items: center; gap: 6px; }
.od-meta .code-chip,
.od-code-chip {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  background: #fff5e6; color: #d48806; border: 1px solid #ffe1ad;
  font-family: var(--mono, ui-monospace, monospace); font-size: 11px;
  letter-spacing: .5px; line-height: 1.6;
}
/* 买家端订单详情：商品缩略图右侧多一段 meta */
.od-item-meta { margin-top: 2px; }

/* ============ 用户管理：余额色彩 + 调整余额弹窗 ============ */
/* 正数余额 / 充值 / 退款回补用红（电商「涨/正」语义），负数 / 扣减用绿（此处仅颜色区分正负） */
.bal-pos { color: #cf1322; font-weight: 600; }
.bal-neg { color: #389e0d; font-weight: 600; }
.adjust-cur { font-size: 14px; color: var(--ink-2); margin: 4px 0 14px; }
.adjust-cur b { font-size: 16px; color: var(--ink-1); }
.adjust-form .field { margin-bottom: 14px; }
.adjust-form .field-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.adjust-form input { width: 100%; padding: 9px 12px; border: 1px solid var(--line, #d9d9d9); border-radius: 8px; font-size: 14px; background: var(--surface, #fff); color: var(--ink-1); }
.adjust-form input:focus { outline: none; border-color: var(--brand, #2f7cf6); box-shadow: 0 0 0 3px rgba(47,124,246,.12); }
