﻿:root {
  --main: #e0526e;
  --main-dark: #c33f5b;
  --bg: #f5f6f8;
  --card: #fff;
  --line: #e4e6eb;
  --text: #2b2f36;
  --muted: #9096a0;
  --green: #2e9e5b;
  --orange: #e8912d;
  --red: #d6453d;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
/* 椤舵爮 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, #e0526e, #d9607a); color: #fff;
  padding: 0 20px; height: 52px;
}
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar .links { display: flex; align-items: center; gap: 6px; }
.topbar a { color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 6px; }
.topbar a:hover { background: rgba(255,255,255,.18); }
.topbar a.on { background: rgba(255,255,255,.28); font-weight: 600; }
.topbar .who { margin-left: 10px; opacity: .9; }
.topbar .logout { opacity: .9; }
.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 20px; margin: 6px 0 16px; }
h3 { margin: 22px 0 8px; }
/* 宸ュ叿鏍?*/
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.toolbar.bottom { margin-top: 16px; }
input, select {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
  font-size: 14px; background: #fff; outline: none;
}
input:focus, select:focus { border-color: var(--main); }
input[type="search"] { min-width: 220px; }
/* 鎸夐挳 */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 8px 14px; cursor: pointer; font-size: 14px; text-decoration: none; color: var(--text);
  display: inline-block;
}
.btn:hover { border-color: var(--main); color: var(--main); }
.btn.primary { background: var(--main); border-color: var(--main); color: #fff; }
.btn.primary:hover { background: var(--main-dark); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.ok-btn { color: var(--green); border-color: var(--green); }
.btn.block { display: block; width: 100%; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
/* 缁熻鍗＄墖 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; margin: 14px 0; }
.card { background: #fff; border-radius: 10px; padding: 12px 16px; border: 1px solid var(--line); }
.card b { display: block; font-size: 24px; margin-top: 4px; }
.card.low b { color: var(--red); }
.card.warn b { color: var(--orange); }
.card.ok b { color: var(--green); }
/* 琛ㄦ牸 */
.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; }
.grid th { background: #fafbfc; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.grid th.num, .grid td.num { text-align: right; padding-right: 12px; }
.grid td.num { font-variant-numeric: tabular-nums; }

/* 合计：表内合计行（跟随当前筛选） */
.grid tfoot td {
  background: #f6f8fb;
  border-top: 2px solid var(--line);
  border-bottom: none;
  font-weight: 700;
  white-space: nowrap;
}
.grid tfoot td.num { text-align: right; padding-right: 12px; }
.ftcount { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 6px; }

/* 合计：页面最底部的合计块（系列单独合计 + 全部合计） */
.totalbox {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 16px;
}
.tbrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 26px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.tbrow:last-child { border-bottom: none; }
.tbrow.series {
  background: #fff8ec;
  margin: 0 -16px;
  padding: 13px 16px;
  border-bottom: 1px solid #f2e4c6;
}
/* 「当前筛选合计」：只要开了任意筛选（尺码 / 只看上新 / 只看有图 / 隐藏空 / 搜索 / 系列）就出现 */
.tbrow.filter {
  background: #eef4ff;
  margin: 0 -16px;
  padding: 13px 16px;
  border-bottom: 1px solid #d9e4fb;
}
.tblabel { min-width: 168px; font-weight: 700; color: #1f2937; }
.tbitem { font-size: 13px; color: #5b6472; }
.tbitem b {
  margin-left: 5px;
  font-size: 17px;
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.tbrow.all .tbitem b { color: var(--main); }
@media (max-width: 700px) {
  .tblabel { min-width: 0; width: 100%; }
}
.grid .num input { width: 84px; text-align: right; }
.grid input { width: 100%; min-width: 90px; border: 1px solid transparent; background: transparent; }
.grid input:focus { background: #fff; border-color: var(--main); }
.grid tr.st-low { background: #fef3f2; }
.grid tr.st-warn { background: #fff8ef; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.badge.b-low, .badge.st-low { background: #fbe3e1; color: var(--red); }
.badge.b-warn { background: #fdeed7; color: var(--orange); }
.badge.b-ok, .badge.st-ok { background: #e3f4ea; color: var(--green); }
.badge.b-na, .badge.st-na { background: #eee; color: var(--muted); }
.badge.b-out, .badge.st-out { background: #eef2f7; color: #64748b; }
.grid tr.st-out { color: #94a3b8; }
/* 琛ㄥ崟 */
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.inline-form input { flex: 1; min-width: 130px; }
label { display: inline-flex; align-items: center; gap: 6px; }
/* 鐧诲綍 */
.login-card {
  max-width: 380px; margin: 9vh auto; background: #fff; border-radius: 14px;
  padding: 32px; box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
.login-card h1 { font-size: 19px; text-align: center; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label { flex-direction: column; align-items: stretch; font-size: 13px; color: var(--muted); }
.login-card input { padding: 10px 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 14px; }
/* tabs */
.tabs { display: flex; gap: 6px; margin: 14px 0; }
.tab { border: 1px solid var(--line); background: #fff; padding: 8px 18px; border-radius: 8px; cursor: pointer; }
.tab.on { background: var(--main); border-color: var(--main); color: #fff; }
.tabpane { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.hidden { display: none; }
.stock-up { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.stock-up span { width: 120px; }
.detail { margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.flash { background: #fff4d6; border: 1px solid #f0dc9c; color: #8a6d1a; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.ok-text { color: var(--green); }
.err-text { color: var(--red); }

/* ---------- 鐢诲唽搴撳瓨 ---------- */
.toolbar .chk { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.toolbar .chk input { width: auto; }

/* 尺码 / 上新·翻单 两个筛选下拉已并入下面的「系列多选下拉」那套 .multi 样式
   （原来是 .sizebar/.sizebtn 4 个分开的按钮 + .newonly/.reorderonly 两个开关，
    2026-10-18 按用户要求统一成下拉，旧样式已删） */

/* 系列多选下拉 */
.multi { position: relative; display: inline-block; }
.multi-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 8px 10px; font-size: 14px; color: var(--text); cursor: pointer;
}
.multi-btn:hover { border-color: var(--main); color: var(--main); }
.multi-btn.on { border-color: var(--main); color: var(--main); font-weight: 600; }
.multi-btn .caret { font-style: normal; font-size: 10px; opacity: .6; }
.multi-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 168px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 7px;
}
.multi-pop.hidden { display: none; }
.multi-ops { display: flex; gap: 6px; padding-bottom: 7px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.multi-op {
  flex: 1; font-size: 12.5px; padding: 5px 0; cursor: pointer;
  border: 1px solid var(--line); background: #f8fafc; border-radius: 6px; color: var(--muted);
}
.multi-op:hover { background: #eff6ff; border-color: var(--main); color: var(--main); }
.multi-list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; }
.multi-item {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  padding: 7px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.multi-item:hover { background: #f1f5f9; }
.multi-item input { width: auto; margin: 0; }
/* 系列右侧备注：靠右、弱化 */
.multi-note {
  margin-left: auto; padding-left: 14px;
  font-style: normal; font-size: 12.5px; color: var(--muted);
}
.grid.catalog td.imgcell { padding: 6px 10px; }
.grid.catalog .thumb {
  width: 92px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; display: block;
}
.grid.catalog .thumb:hover { border-color: var(--main); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.grid.catalog .noimg {
  display: inline-flex; width: 92px; height: 60px; align-items: center; justify-content: center;
  background: #f1f5f9; color: #94a3b8; font-size: 12px; border-radius: 6px;
}
.grid.catalog td.model { font-weight: 600; white-space: nowrap; }

/* 公司库存分级（代理商看档位，管理员看数字）—— 由 order.js 的 hqTag/hqText 产出。
   档位给颜色是为了扫一眼就能分出该不该补；<36 那档给的是具体数字，保持中性不着色。 */
.hqlvl { font-weight: 600; letter-spacing: .3px; }
.hqlvl.ok { color: #16a34a; }        /* 充足 */
.hqlvl.mid { color: #d97706; }       /* 少量 */
.hqlvl.low { color: #dc2626; }       /* 不足 */
.hqlvl.exact { color: inherit; font-weight: 500; font-variant-numeric: tabular-nums; }
/* 「上新」标：出现在型号文字左侧 */
.grid.catalog .newtag {
  display: inline-block; margin-right: 6px; padding: 2px 7px;
  border-radius: 4px; background: #ef4444; color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  letter-spacing: .5px; vertical-align: 1px;
}
/* 「翻单」标：同样在型号文字左侧，紧挨着「上新」。
   用玫红与「上新」的正红区分开，鼠标停上去看这次进了多少支。 */
.grid.catalog .reordertag {
  display: inline-block; margin-right: 6px; padding: 2px 7px;
  border-radius: 4px; background: #e11d48; color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  letter-spacing: .5px; vertical-align: 1px; cursor: help;
}
/* 鎺掑簭琛ㄥご */
.grid th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.grid th.sortable:hover { color: var(--main); }
.grid th.sortable .arrow { font-size: 11px; margin-left: 3px; color: #cbd5e1; }
.grid th.sortable .arrow.on { color: var(--main); }
.grid .sub { margin: 4px 0; box-shadow: none; border: 1px solid var(--line); }
.grid .sub th, .grid .sub td { padding: 5px 9px; font-size: 13px; }
.grid tr.detailrow td { background: #f8fafc; }
.btn.tiny { padding: 2px 8px; font-size: 12px; }
.lightbox {
  position: fixed; inset: 0; background: rgba(15,23,42,.82); z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.lightbox.hidden { display: none; }
/* 涓嬪崟鏍?*/
.grid.sub input.obox {
  width: 70px; padding: 4px 6px; text-align: right;
  border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
}
.grid.sub input.obox:focus { outline: none; border-color: var(--main); }
.orderBar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  margin-top: 12px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 -2px 16px rgba(0,0,0,.10);
}
.orderBar #orderInfo { flex: 1; font-weight: 600; }
.orderBar.hidden { display: none; }
/* 「补货单」页的待提交区 */
.pendbox {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 22px;
}
.pendhead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pendhead h2 { margin: 0; font-size: 17px; }
.pendagent { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.pendmsg {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-weight: 600;
}
.pendmsg.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.pendmsg.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.pendmsg.hidden { display: none; }
.pendsum { margin-top: 12px; font-size: 15px; }
.pendsum b { color: var(--main); font-size: 17px; }
.pendsum.muted { color: var(--muted); font-size: 14px; font-weight: 400; }
#pendList { margin-top: 12px; }
/* 清单表格：补货单页和「查看补货单」弹窗共用同一份（order.js 的 pendingTableHtml），
   所以选择器挂在表格自己身上，别挂在某个容器 id 上 */
.grid.pend .pname { color: var(--muted); font-size: 12px; word-break: break-all; }
.grid.pend input.pendbox-in { width: 72px; padding: 4px 6px; text-align: right;
  border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.grid.pend input.pendbox-in:focus { outline: none; border-color: var(--main); }
.pendacts { margin-top: 14px; display: flex; gap: 10px; }
.pendacts.hidden { display: none; }
/* 「查看补货单」弹窗（画册/畅销款共用，DOM 由 order.js 懒创建） */
.cartmodal { position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center; }
.cartmodal.hidden { display: none; }
.cartmask { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.cartpanel {
  position: relative; z-index: 1;
  width: min(1080px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.carthead { display: flex; align-items: center; justify-content: space-between; }
.carthead h2 { margin: 0; font-size: 17px; }
.cartclose { border: none; background: none; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--muted); padding: 0 4px; }
.cartclose:hover { color: var(--main); }
.cartlist { overflow: auto; margin-top: 12px; flex: 1 1 auto; }
/* 「已提交」的多选合并 */
.mergebar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.mergebar.hidden { display: none; }
.mergebar .muted { flex: 1; }
.grid.hist th.chk, .grid.hist td.chk { width: 34px; text-align: center; padding-left: 10px; }
.grid.hist th.chk input, .grid.hist td.chk input {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--main); }
.grid.hist td.pnote { color: var(--muted); font-size: 12px; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mergetag { margin-left: 8px; padding: 1px 6px; border-radius: 6px; font-size: 11px;
  background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
/* 琛ヨ揣鍗曟搷浣滄寜閽?*/
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 4px; }
.row-actions .btn:last-child { margin-right: 0; }
.detail-btns { margin-top: 14px; display: flex; gap: 10px; }
/* 鍚屾杩涘害鏉?*/
.progress { height: 16px; background: #eef0f4; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); margin-top: 12px; }
.progress.hidden { display: none; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--main), #7aa2ff); transition: width .4s ease; }
#syncProg { margin-top: 6px; font-size: 13px; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 0 10px; font-size: 13px; white-space: nowrap; }
/* 灯箱：左边放大图，右边该型号的明细与下单 */
.lightbox { padding: 18px; }
.lb-wrap {
  display: flex; align-items: stretch; gap: 14px;
  width: 100%; height: 100%; max-width: 1440px;
}
.lb-imgbox {
  position: relative;
  flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.lb-noimg {
  color: rgba(255,255,255,.75); font-size: 15px; letter-spacing: 2px;
}
/* 灯箱翻页：两个按钮并排，一起贴在图片区右下角 */
.lb-navs {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
}
.lb-nav {
  padding: 9px 16px; border: none; border-radius: 999px;
  background: rgba(15,23,42,.62); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background .15s ease;
}
.lb-nav:hover { background: var(--main); }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.lb-side {
  flex: 0 0 480px; max-width: 44vw;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.lb-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.lb-head b { font-size: 15px; }
.lb-body { flex: 1 1 auto; overflow: auto; padding: 10px 12px; }
.lb-body .grid.sub { width: 100%; margin: 0; }
.lb-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #fafbfc; border-top: 1px solid var(--line);
}
.lb-foot #lbOrderInfo { flex: 1; font-size: 13px; font-weight: 600; }
.lightbox .lightbox-close {
  position: absolute; top: 14px; right: 20px; z-index: 2;
  width: 34px; height: 34px; line-height: 34px; text-align: center;
  background: rgba(15,23,42,.55); border-radius: 50%;
  color: #fff; font-size: 24px; cursor: pointer; user-select: none;
}
@media (max-width: 1000px) {
  .lightbox { padding: 10px; }
  .lb-wrap { flex-direction: column; }
  .lightbox img { max-height: 38vh; }
  .lb-side { flex: 0 0 auto; max-width: none; max-height: 55vh; }
}

/* 鐢诲唽椤碉細鏁版嵁鍚屾鐘舵€佹潯 */
.syncbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  margin: 10px 0 2px; padding: 9px 14px; font-size: 13px;
  background: #f1f7f2; border: 1px solid #cfe6d5; border-radius: 8px;
}
.syncbar.hidden { display: none; }
.syncbar .syncitem b { font-weight: 600; }
.syncbar .synctag {
  display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 9px;
  font-size: 12px; line-height: 1.6;
}
.syncbar .synctag.good { background: #d8efdd; color: #1f7a37; }
.syncbar .synctag.bad { background: #fde2c8; color: #a8540c; }
.syncbar .synctip { font-size: 12px; }
.syncbar.stale { background: #fff4d6; border-color: #f0dc9c; }
.syncbar .synchint { flex-basis: 100%; color: #8a6d1a; margin-top: 2px; }
.syncbar.stale .synchint { color: #a8540c; }


.grid.catalog th.num, .grid.catalog td.num { min-width: 90px; text-align: right; padding-right: 14px; }




.grid.catalog th.num, .grid.catalog td.num { min-width: 95px; text-align: right; padding-right: 22px; }

/* 数字列表头：排序箭头脱离文字流（放进右侧内边距里），
   避免箭头把表头文字顶开，保证表头文字与下方数字右对齐一致 */
.grid.catalog th.num.sortable { position: relative; }
.grid.catalog th.num.sortable .arrow {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
}

/* 空状态（画册页与畅销款页共用） */
.empty { text-align: center; color: var(--muted); padding: 26px 14px; }

/* ---------- 畅销款页 ---------- */
.bsctl {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
}
.ctlrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctlrow + .ctlrow { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.bsctl .lbl { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bsctl .btns { display: flex; flex-wrap: wrap; gap: 6px; }
.bsctl .btns button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 7px 11px; font-size: 13px; color: var(--muted); cursor: pointer;
  white-space: nowrap;
}
.bsctl .btns button:hover { border-color: var(--main); color: var(--main); }
.bsctl .btns button.on {
  border-color: var(--main); color: var(--main); font-weight: 600;
  background: color-mix(in srgb, var(--main) 8%, #fff);
}
.bsctl .btns .cnt {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: #eceff4; color: var(--muted); font-size: 12px; font-weight: 600;
  line-height: 1.6; font-variant-numeric: tabular-nums; vertical-align: 1px;
}
.bsctl .btns button:hover:not(.on) .cnt { background: #e2e7ee; }
.bsctl .btns button.on .cnt {
  background: color-mix(in srgb, var(--main) 18%, #fff); color: var(--main-dark);
}
.bsctl .sel { font-size: 13px; padding: 6px 8px; }
.bsctl .chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); cursor: pointer; }
.bsctl .chk input { width: auto; }
/* 右侧「重新分析」按钮的状态行：跟按钮同行、不换行、不要 .hint 那个 14px 上边距 */
.bsctl .bsstat { margin: 0 0 0 8px; white-space: nowrap; font-size: 12.5px; }

.legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline;
  padding: 8px 12px; margin-bottom: 10px; font-size: 13px;
  background: color-mix(in srgb, var(--main) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--main) 18%, #fff);
  border-radius: 8px; color: var(--text);
}
.legend .hint { color: var(--muted); font-size: 12.5px; }

/* 排名表 */
.grid.rank { table-layout: fixed; }
.grid.rank .rk { font-weight: 700; color: #b9bfc9; font-variant-numeric: tabular-nums; }
.grid.rank .mdl { font-family: Consolas, Menlo, monospace; font-size: 13px; font-weight: 600; white-space: nowrap; }
.grid.rank .stg {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  background: #f1f3f6; color: var(--muted); font-size: 12px;
}
.grid.rank .sc {
  display: inline-block; padding: 2px 9px; border-radius: 7px;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px;
}
.grid.rank .sc.gA { background: #e2f3e8; color: #1f7a37; }
.grid.rank .sc.gB { background: #eef1f5; color: #4a5462; }
.grid.rank .sc.gC { background: #fdf0dc; color: #a8540c; }
.grid.rank .sc.gD { background: #fde3e1; color: #b02f29; }
.grid.rank .up { color: var(--green); }
.grid.rank .down { color: var(--red); }
.grid.rank .strong { font-weight: 600; color: var(--text); }
.grid.rank .smalltag {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px;
  background: #fdf0dc; border: 1px solid #f3d6ab; color: #a8540c; font-size: 11px;
}
.grid.rank .err { text-align: center; color: var(--red); padding: 24px; }

.bsf {
  margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: right;
}

/* ---------- 畅销款页：画册样式 + 排名 ---------- */
/* 居中（名次列 / 系列列）。模板里一直写着 class="center"，早先漏了没定义；
   .grid td 的 text-align:left 优先级更高，所以要连 .grid 一起写才压得住 */
.center { text-align: center; }
.grid th.center, .grid td.center { text-align: center; }

/* 固定列宽（表头 style 里给了宽度），同时去掉画册给数字列加的 min-width，
   免得「颜色数」这种窄列被 95px 顶开把整行挤变形 */
.grid.rank.catalog th.num,
.grid.rank.catalog td.num { min-width: 0; }
.grid.rank.catalog td.model { font-size: 13.5px; }

/* 灯箱标题下那一块：畅销款的效率指标（解释它凭什么排这个名次） */
.lb-metrics {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  margin: 8px 0 6px; padding: 8px 10px;
  background: color-mix(in srgb, var(--main) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--main) 16%, #fff);
  border-radius: 8px; font-size: 12.5px; color: var(--text);
}
.lb-metrics span { white-space: nowrap; }
.lb-metrics b { font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700; }
.lb-metrics i { font-style: normal; color: var(--muted); font-size: 12px; }
.lb-metrics .hint { flex-basis: 100%; color: var(--muted); font-size: 12px; white-space: normal; }
.lb-metrics .sc { padding: 1px 8px; border-radius: 6px; }
.lb-metrics .sc.gA { background: #e2f3e8; color: #1f7a37; }
.lb-metrics .sc.gB { background: #eef1f5; color: #4a5462; }
.lb-metrics .sc.gC { background: #fdf0dc; color: #a8540c; }
.lb-metrics .sc.gD { background: #fde3e1; color: #b02f29; }


