/* ==========================================================================
   中贵黄金 · 门店销售系统  —  视觉样式
   ========================================================================== */

:root {
  --ink: #1b1a17;
  --ink-2: #3d3830;
  --ink-3: #6b6459;
  --muted: #948b7d;
  --line: #e8dfd1;
  --line-2: #f1eadf;
  --paper: #faf7f1;
  --paper-2: #f4eee4;
  --card: #fffdfa;
  --gold: #b08643;
  --gold-deep: #8a6428;
  --gold-soft: #f2e4cb;
  --gold-line: #dcc29a;
  --jade: #2c5b4d;
  --red: #b0402c;
  --green: #2f6b4f;
  --shadow-sm: 0 1px 2px rgba(27, 26, 23, .05);
  --shadow: 0 10px 30px -12px rgba(27, 26, 23, .18);
  --shadow-lg: 0 24px 60px -20px rgba(27, 26, 23, .3);
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --num: "Bahnschrift", "DIN Alternate", "Segoe UI", var(--sans);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 16px; height: 16px; flex: 0 0 auto; }
::selection { background: var(--gold-soft); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ddd2c1; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c9b99f; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 布局 */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 228px; flex: 0 0 228px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(176, 134, 67, .16), transparent 60%),
    linear-gradient(180deg, #201d18 0%, #17150f 100%);
  color: #e9e1d2;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #2b261d;
  z-index: 30;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(217, 185, 120, .55);
  background: radial-gradient(circle at 35% 30%, #f6e3bd, #c79c53 55%, #8a6428);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px; font-weight: 700; color: #2a1f0c;
  box-shadow: 0 0 0 3px rgba(217, 185, 120, .12), inset 0 1px 2px rgba(255, 255, 255, .5);
  flex: 0 0 auto;
}
.brand-text strong {
  display: block; font-family: var(--serif); font-size: 19px; letter-spacing: 3px;
  color: #f4ead8; font-weight: 600; line-height: 1.2;
}
.brand-text span {
  display: block; font-size: 9px; letter-spacing: 2.6px; color: #a8946e; margin-top: 3px;
}
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-group { font-size: 10px; letter-spacing: 2px; color: #7e725c; padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: #c9c0ae; font-size: 13.5px; border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.6; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #f2e9d8; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(176, 134, 67, .28), rgba(176, 134, 67, .06));
  border-color: rgba(217, 185, 120, .25);
  color: #f7edd9;
}
.nav-item.active svg { color: var(--gold-line); opacity: 1; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #e2c184, #b08643);
}
.nav-badge {
  margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: rgba(217, 185, 120, .18); color: #e8d3ab; font-variant-numeric: tabular-nums;
}
.sidebar-foot {
  margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11px; color: #857860; line-height: 1.7;
}
.sidebar-foot b { color: #c9b68f; font-weight: 500; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 66px; flex: 0 0 66px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px;
  background: rgba(250, 247, 241, .86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-family: var(--serif); font-size: 19px; letter-spacing: 1px; font-weight: 600; white-space: nowrap; }
.page-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.price-strip { display: flex; gap: 6px; }
.price-chip {
  display: flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 30px;
  padding: 5px 11px; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.price-chip i { font-style: normal; font-size: 10.5px; color: var(--muted); letter-spacing: .5px; }
.price-chip b { font-family: var(--num); font-size: 13.5px; color: var(--gold-deep); font-weight: 600; }
.price-chip b.up { color: var(--red); }
.topbar-date { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.store-chip { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.store-chip .select { height: 30px; max-width: 170px; font-size: 12px; padding: 0 24px 0 8px; }
.store-chip .select:disabled { opacity: 1; border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 500; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; color: var(--ink-2);
  transition: .15s; flex: 0 0 auto;
}
.icon-btn:hover { border-color: var(--gold-line); color: var(--gold-deep); background: #fffdf7; }
.icon-btn svg { width: 16px; height: 16px; }

.view { padding: 24px 26px 60px; flex: 1; }
.view-inner { max-width: 1560px; margin: 0 auto; }

/* ---------------------------------------------------------------- 通用 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
}
.btn:hover { border-color: var(--gold-line); color: var(--gold-deep); background: #fffdf7; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #262219, #17150f);
  border-color: #17150f; color: #f4e6c9;
  box-shadow: 0 6px 16px -8px rgba(23, 21, 15, .8);
}
.btn-primary:hover { background: linear-gradient(180deg, #332c20, #1d1a13); color: #ffeccb; border-color: #1d1a13; }
.btn-gold {
  background: linear-gradient(180deg, #d9b877, #b78b47);
  border-color: #a87c39; color: #2a1e0a; font-weight: 600;
  box-shadow: 0 8px 20px -10px rgba(176, 134, 67, .9), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-gold:hover { background: linear-gradient(180deg, #e4c689, #c09651); color: #241905; }
.btn-danger { color: var(--red); border-color: #ecd3cc; }
.btn-danger:hover { background: #fdf3f0; border-color: #d9a89b; color: #97331f; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 46px; font-size: 15px; border-radius: 11px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--ink-3); letter-spacing: .3px; }
.field .hint { font-size: 11px; color: var(--muted); }
.input, .select, .textarea {
  height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  padding: 0 11px; font-size: 13.5px; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s; color: var(--ink);
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 64px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 134, 67, .12);
}
.input::placeholder { color: #b5aa99; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23948b7d' fill='none' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px; }
.input-lg { height: 42px; font-size: 15px; }
.input-num { font-family: var(--num); font-variant-numeric: tabular-nums; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
}
.card-title { font-family: var(--serif); font-size: 15.5px; letter-spacing: .6px; font-weight: 600; }
.card-sub { font-size: 11.5px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }

.section-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.section-title { font-family: var(--serif); font-size: 22px; letter-spacing: 1px; font-weight: 600; }
.section-title em { font-style: normal; color: var(--gold-deep); }
.section-desc { font-size: 12.5px; color: var(--muted); }
.section-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.search {
  position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted); }
.search .input { padding-left: 34px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px;
  border-radius: 30px; border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; color: var(--ink-3); transition: .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--gold-line); color: var(--gold-deep); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #f4e6c9; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; line-height: 1.6;
  background: var(--paper-2); color: var(--ink-3); white-space: nowrap;
}
.badge-gold { background: var(--gold-soft); color: var(--gold-deep); }
.badge-green { background: #e8f1ea; color: var(--green); }
.badge-red { background: #fbece8; color: var(--red); }
.badge-ink { background: #edeae4; color: var(--ink-2); }
.badge-jade { background: #e6efeb; color: var(--jade); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px;
  letter-spacing: .6px; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #fdfbf7;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #fcfaf6; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--num); font-variant-numeric: tabular-nums; text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.tbl .strong { font-weight: 600; }
.tbl .muted { color: var(--muted); font-size: 12px; }
.tbl-wrap { overflow: auto; }

.money { font-family: var(--num); font-variant-numeric: tabular-nums; }
.money::before { content: "¥"; font-size: .78em; opacity: .55; margin-right: 1px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf9, #fff);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: radial-gradient(circle, rgba(217, 185, 120, .16), transparent 70%);
}
.kpi .k-label { font-size: 11.5px; color: var(--muted); letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-family: var(--num); font-size: 26px; font-weight: 600; margin-top: 5px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.kpi .k-foot { font-size: 11.5px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; align-items: center; }
.kpi .k-foot .up { color: var(--red); }
.kpi .k-foot .down { color: var(--green); }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty svg { width: 34px; height: 34px; margin: 0 auto 10px; opacity: .35; }

.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 9px 16px; font-size: 13px; color: var(--ink-3); position: relative; background: none;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--gold-deep); }
.tab.active { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }

/* ---------------------------------------------------------------- 首页 */
.home-hero {
  position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 18px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(217, 185, 120, .22), transparent 55%),
    linear-gradient(120deg, #221f19 0%, #17150f 62%, #211d15 100%);
  color: #f3ead9; padding: 26px 30px;
  display: flex; gap: 30px; align-items: center; flex-wrap: wrap;
  border: 1px solid #2c2618;
}
.home-hero::after {
  content: ""; position: absolute; right: -60px; bottom: -120px; width: 320px; height: 320px;
  border-radius: 50%; border: 1px solid rgba(217, 185, 120, .18);
  box-shadow: 0 0 0 40px rgba(217, 185, 120, .04), 0 0 0 90px rgba(217, 185, 120, .03);
}
.hero-left { position: relative; z-index: 1; min-width: 300px; flex: 1; }
.hero-kicker { font-size: 10.5px; letter-spacing: 3px; color: #b79c67; }
.hero-title { font-family: var(--serif); font-size: 26px; margin-top: 6px; letter-spacing: 1px; color: #fbf3e3; }
.hero-sub { font-size: 12.5px; color: #a99d86; margin-top: 6px; }
.hero-revenue { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }
.hero-revenue .big { font-family: var(--num); font-size: 40px; font-weight: 600; letter-spacing: -1px; color: #f6e6c4; }
.hero-revenue .unit { font-size: 12px; color: #a99d86; }
.hero-revenue .up { color: #e79a83; font-size: 12px; margin-left: 2px; }
.hero-revenue .down { color: #86b797; font-size: 12px; margin-left: 2px; }
.hero-stats { display: flex; gap: 26px; margin-top: 14px; }
.hero-stat { font-size: 12px; color: #a99d86; }
.hero-stat b { display: block; font-family: var(--num); font-size: 19px; color: #f0e2c8; font-weight: 500; margin-top: 2px; }
.hero-right { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hero-action {
  width: 92px; height: 84px; border-radius: 13px; border: 1px solid rgba(217, 185, 120, .22);
  background: rgba(255, 255, 255, .035); color: #d9c8a6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; transition: .18s;
}
.hero-action svg { width: 20px; height: 20px; color: #c8a76b; }
.hero-action:hover { background: rgba(217, 185, 120, .12); border-color: rgba(217, 185, 120, .45); color: #fff3da; transform: translateY(-2px); }

.home-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; padding: 10px 14px 0 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-track { width: 100%; height: 142px; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill {
  width: 58%; max-width: 48px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #d9b877, #b08643);
  min-height: 3px; position: relative; transition: filter .15s;
}
.bar-fill:hover { filter: brightness(1.06); }
.bar-fill.today { background: linear-gradient(180deg, #2f2a20, #1b1a17); }
.bar-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 18px;
  border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------------------------------------------------------------- 收银台 */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 408px; gap: 16px; align-items: start; }
.pos-left { min-width: 0; }
.pos-right { position: sticky; top: 82px; }

.pos-filter { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.pos-search { flex: 1; min-width: 220px; }
.pos-search .input { height: 42px; font-size: 14px; }
.pos-search .input:focus { border-color: var(--gold); }

.prod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 12px;
}
.prod-card {
  text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 15px 15px 13px; position: relative; overflow: hidden;
  transition: .16s; display: flex; flex-direction: column; gap: 4px; min-height: 138px;
}
.prod-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); opacity: 0; transition: .2s;
}
.prod-card:hover { border-color: var(--gold-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.prod-card:hover::before { opacity: 1; }
.prod-card.out { opacity: .5; cursor: not-allowed; }
.prod-card.out:hover { transform: none; box-shadow: none; border-color: var(--line); }
.prod-cat { font-size: 10.5px; color: var(--gold-deep); letter-spacing: 1px; }
.prod-name {
  font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 39px;
}
.prod-spec { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prod-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; padding-top: 8px; }
.prod-price { font-family: var(--num); font-size: 18px; font-weight: 600; color: var(--gold-deep); letter-spacing: -.3px; }
.prod-price small { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.prod-stock { font-size: 10.5px; color: var(--muted); }
.prod-stock.low { color: var(--red); }
.prod-add {
  position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: #f0dfbd; display: grid; place-items: center;
  opacity: 0; transform: scale(.8); transition: .16s;
}
.prod-card:hover .prod-add { opacity: 1; transform: scale(1); }
.prod-add svg { width: 13px; height: 13px; }

.cart {
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.cart-head {
  padding: 13px 16px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #fffdf9, #fdfaf4);
}
.cart-head h3 { font-family: var(--serif); font-size: 16px; letter-spacing: 1px; font-weight: 600; }
.cart-count { font-size: 11px; color: var(--muted); }
.cart-member {
  padding: 10px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px;
  background: #fdfbf6; cursor: pointer; transition: background .15s;
}
.cart-member:hover { background: #fbf6ec; }
.cart-member .avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-deep); font-family: var(--serif); font-size: 14px; flex: 0 0 auto;
}
.cart-member .info { flex: 1; min-width: 0; }
.cart-member .nm { font-size: 13px; font-weight: 500; }
.cart-member .meta { font-size: 11px; color: var(--muted); }
.cart-member .chev { color: var(--muted); }

.cart-items { overflow-y: auto; max-height: 38vh; min-height: 120px; }
.cart-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.cart-empty svg { width: 30px; height: 30px; margin: 0 auto 8px; opacity: .3; }
.cart-item { padding: 12px 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; }
.cart-item:last-child { border-bottom: 0; }
.ci-main { flex: 1; min-width: 0; }
.ci-name { font-size: 12.8px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-spec { font-size: 10.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.ci-break { font-size: 10px; color: #a0968a; margin-top: 2px; }
.ci-rate { display: block; font-size: 9.5px; color: #b3a99c; margin-top: 1px; }
.ci-tag { display: inline-block; font-size: 9.5px; color: #8a5a1a; background: #f7ecd8; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; font-weight: 400; }
.ci-edit { margin-top: 4px; }
.ci-side { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ci-amount { font-family: var(--num); font-size: 13px; font-weight: 600; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; height: 24px; }
.stepper button { width: 22px; height: 100%; border: 0; background: #fff; color: var(--ink-3); display: grid; place-items: center; }
.stepper button:hover { background: var(--paper-2); color: var(--ink); }
.stepper span { min-width: 26px; text-align: center; font-size: 11.5px; font-family: var(--num); border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); line-height: 22px; height: 100%; }

.cart-tools { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.mini-btn {
  font-size: 11.5px; padding: 4px 9px; border-radius: 6px; border: 1px dashed var(--line);
  background: #fff; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px;
}
.mini-btn:hover { border-color: var(--gold); color: var(--gold-deep); border-style: solid; }
.mini-btn.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-deep); border-style: solid; }

.cart-sum { padding: 13px 16px; border-top: 1px solid var(--line-2); background: #fdfbf6; }
.sum-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; color: var(--ink-3); }
.sum-row .v { font-family: var(--num); font-variant-numeric: tabular-nums; }
.sum-row.discount .v { color: var(--red); }
.sum-row.total { margin-top: 7px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink); align-items: baseline; }
.sum-row.total .v { font-family: var(--num); font-size: 27px; font-weight: 600; color: var(--gold-deep); letter-spacing: -.6px; }
.sum-row.total .v::before { content: "¥"; font-size: 14px; margin-right: 2px; opacity: .7; }
.pay-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 12px 16px 0; }
.pay-btn {
  height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font-size: 12px; color: var(--ink-3); transition: .15s;
}
.pay-btn:hover { border-color: var(--gold-line); }
.pay-btn.active { border-color: var(--ink); background: #f7f2e8; color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--ink); }
.cart-foot { padding: 12px 16px 15px; display: flex; gap: 8px; align-items: center; }
.cart-foot .btn-gold { flex: 1; height: 48px; font-size: 16px; letter-spacing: 3px; }

/* ---------------------------------------------------------------- 商品库存 */
.stat-cell { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 12px 15px; }
.stat-cell .l { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.stat-cell .v { font-family: var(--num); font-size: 19px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-cell .v small { font-size: 11px; color: var(--muted); font-weight: 400; }

.prod-cell { display: flex; align-items: center; gap: 10px; }
.prod-thumb {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center;
  font-family: var(--serif); font-size: 13px; color: var(--gold-deep);
  background: linear-gradient(145deg, #fbf3e4, #f0e2c9); border: 1px solid #ecdfc9;
}
.prod-thumb.c-钻石 { background: linear-gradient(145deg, #eef3f4, #dfe9ec); color: #4a6b74; border-color: #dbe6e9; }
.prod-thumb.c-翡翠 { background: linear-gradient(145deg, #eaf2ec, #d8e8dd); color: #2c5b4d; border-color: #d5e5da; }
.prod-thumb.c-银饰 { background: linear-gradient(145deg, #f4f5f6, #e6e9ec); color: #5c6670; border-color: #e2e6ea; }
.prod-thumb.c-铂金 { background: linear-gradient(145deg, #f2f4f5, #e4e8ea); color: #4e5d66; border-color: #dfe4e6; }
.prod-thumb.c-珍珠 { background: linear-gradient(145deg, #faf6f4, #f0e7e4); color: #8a6a63; border-color: #efe3df; }
.prod-thumb.c-18K金 { background: linear-gradient(145deg, #fbf1e6, #f2e0cb); color: #9a6a34; border-color: #efdcc4; }
.row-actions { display: flex; gap: 4px; opacity: .5; transition: .15s; }
tr:hover .row-actions { opacity: 1; }

.product-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 14px; }
.product-form .span-2 { grid-column: span 2; }
.product-form .span-3 { grid-column: span 3; }
.price-preview {
  grid-column: span 3; padding: 12px 14px; border-radius: 10px;
  background: linear-gradient(135deg, #fdf8ef, #faf3e6); border: 1px dashed var(--gold-line);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3);
}
.price-preview b { font-family: var(--num); font-size: 20px; color: var(--gold-deep); font-weight: 600; }
.price-preview .pp-item { display: flex; flex-direction: column; }
.price-preview .pp-item span { font-size: 10.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 入库 */
.purchase-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.po-table select { min-width: 190px; height: 32px; font-size: 12.5px; }
.po-table input { height: 32px; font-size: 12.5px; }
.po-rate { font-size: 11px; color: var(--muted); margin-top: 2px; }
.po-side { position: sticky; top: 82px; }
.po-total { font-family: var(--num); font-size: 32px; font-weight: 600; color: var(--gold-deep); letter-spacing: -1px; }
.po-total::before { content: "¥"; font-size: 16px; margin-right: 2px; opacity: .6; }

/* ---------------------------------------------------------------- 会员 */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.member-card {
  padding: 15px 16px; border-radius: 13px; border: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; gap: 10px; transition: .15s; cursor: pointer; position: relative; overflow: hidden;
}
.member-card:hover { border-color: var(--gold-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.member-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(176, 134, 67, .18); }
.member-ck { width: 15px; height: 15px; accent-color: var(--gold); flex: 0 0 auto; cursor: pointer; }
.member-card .mc-head { display: flex; align-items: center; gap: 10px; }
.member-card .mc-avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-size: 16px; background: var(--paper-2); color: var(--ink-2);
}
.member-card.lv-钻石会员 .mc-avatar { background: #e7eef1; color: #3f5f6b; }
.member-card.lv-金卡会员 .mc-avatar { background: var(--gold-soft); color: var(--gold-deep); }
.member-card.lv-银卡会员 .mc-avatar { background: #eef0f2; color: #5b6670; }
.member-card .mc-name { font-size: 14px; font-weight: 600; }
.member-card .mc-phone { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.member-card .mc-stats { display: flex; gap: 18px; border-top: 1px dashed var(--line); padding-top: 10px; }
.member-card .mc-stat .l { font-size: 10.5px; color: var(--muted); }
.member-card .mc-stat .v { font-family: var(--num); font-size: 14px; font-weight: 600; }
.member-detail-head {
  display: flex; gap: 14px; align-items: center; padding: 4px 0 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px;
}
.member-detail-head .big-avatar {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-deep); font-family: var(--serif); font-size: 22px;
}

/* ---------------------------------------------------------------- 订单 */
.order-items { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.order-items .oi-row { display: flex; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.order-items .oi-row:last-child { border-bottom: 0; }
.order-items .oi-row .grow { flex: 1; min-width: 0; }
.yuan { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 报表 */
.report-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range-btn { padding: 5px 12px; font-size: 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-3); }
.range-btn.active { background: var(--ink); color: #f4e6c9; border-color: var(--ink); }
.report-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.report-grid > * { min-width: 0; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; border-radius: 50%; position: relative; flex: 0 0 auto; }
.donut::after {
  content: ""; position: absolute; inset: 26px; background: var(--card); border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; text-align: center; }
.donut-center .dc-l { font-size: 9.5px; color: var(--muted); letter-spacing: .5px; }
.donut-center .dc-v { font-family: var(--num); font-size: 15px; font-weight: 600; }
.legend { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.legend-item .lg-name { flex: 1; }
.legend-item .lg-val { font-family: var(--num); color: var(--ink-3); }
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; }
.hbar .hb-label { width: 78px; color: var(--ink-3); flex: 0 0 auto; }
.hbar .hb-track { flex: 1; height: 7px; background: var(--paper-2); border-radius: 10px; overflow: hidden; display: block; }
.hbar .hb-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #d9b877, #b08643); display: block; }
.hbar .hb-val { width: 92px; text-align: right; font-family: var(--num); color: var(--ink-3); }
.rank { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.rank-row:last-child { border-bottom: 0; }
.rank-no {
  width: 20px; height: 20px; border-radius: 6px; background: var(--paper-2); color: var(--ink-3);
  font-size: 10.5px; font-family: var(--num); display: grid; place-items: center; flex: 0 0 auto;
}
.rank-row:nth-child(1) .rank-no { background: var(--gold-soft); color: var(--gold-deep); }
.rank-row:nth-child(2) .rank-no { background: #eef0f2; color: #5b6670; }
.rank-row:nth-child(3) .rank-no { background: #f5ece4; color: #8a6246; }
.rank-row .grow { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- 设置 */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-grid.masonry { grid-auto-rows: 1px; row-gap: 0; grid-auto-flow: row; }
.settings-grid.masonry > .card { margin-bottom: 18px; min-width: 0; }
.settings-drag { flex:0 0 auto; border:0; background:transparent; color:var(--muted); cursor:grab; padding:2px 5px; border-radius:5px; font-size:15px; line-height:1; letter-spacing:-2px; margin-left:auto; }
.settings-drag:hover { background:var(--line); color:var(--ink-2); }
.settings-drag:active { cursor:grabbing; }
.card.dragging { opacity:.45; }
.card.drop-before { box-shadow: 0 -3px 0 var(--gold); }
.card.drop-after { box-shadow: 0 3px 0 var(--gold); }
#audit-list .tbl-wrap { max-height: 420px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.price-inputs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.price-input { display: flex; flex-direction: column; gap: 5px; }
.price-input label { font-size: 11.5px; color: var(--ink-3); }
.price-input .input { font-family: var(--num); font-size: 16px; height: 42px; }
.employee-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.employee-row:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- 弹层 */
#modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
#modal-root.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(24, 21, 16, .42); backdrop-filter: blur(3px); animation: fade .16s ease; }
.modal {
  position: relative; margin: 5vh auto; width: min(560px, calc(100vw - 32px));
  max-height: 90vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 16px; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .9, .3, 1.1);
  overflow: hidden;
}
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal.vd-modal { width: min(1200px, calc(100vw - 28px)); }
.modal.narrow { width: min(430px, calc(100vw - 32px)); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 17px 20px 14px; border-bottom: 1px solid var(--line-2); flex: 0 0 auto; }
.modal-title { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .6px; }
.modal-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 20px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { padding: 14px 20px 17px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; justify-content: flex-end; background: #fdfbf6; flex: 0 0 auto; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }

.toasts { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1f1c16; color: #f6ecd8; font-size: 13px; padding: 10px 18px; border-radius: 30px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  animation: toastIn .2s ease; border: 1px solid #332c20;
}
.toast.ok { color: #e9f3e7; }
.toast.err { background: #4a1f17; border-color: #6b2c20; color: #ffe4dc; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- 销售凭证（纸张 241×140，OKI 可打印区 203.2×130.4） */
.voucher {
  width: var(--v-w, 203.2mm); margin: 0 auto; background: #fff; color: #000;
  border: var(--v-border, 0) solid #000;
  padding: var(--v-py, 1.8mm) var(--v-px, 2.5mm); box-sizing: border-box;
  font-family: "SimSun", "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 8.6pt; line-height: 1.3;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.v-head {
  display: grid;
  grid-template-columns: calc(var(--v-qr-top, 16mm) + 6mm) minmax(0, 1fr) calc(var(--v-qr-top, 16mm) + 6mm);
  gap: var(--v-logogap, 3mm); align-items: center;
  min-height: calc(var(--v-qr-top, 16mm) + 5mm);
}
.v-brand { display: flex; align-items: center; justify-content: flex-start; min-width: 0; }
.v-title-box { min-width: 0; text-align: center; }
.v-logo { width: var(--v-logo, 13mm); height: var(--v-logo, 13mm); object-fit: contain; display: block; }
.v-title {
  text-align: center; font-size: var(--v-title, 19pt); font-weight: 700; letter-spacing: .8pt;
  line-height: 1.28; white-space: nowrap;
}
.v-sub {
  font-size: 7.1pt; color: #222; margin-top: .7mm; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v-headqr { width: auto; text-align: center; }
.v-headqr img { width: var(--v-qr-top, 16mm); height: var(--v-qr-top, 16mm); display: block; margin: 0 auto; }
.v-headqr .cap { font-size: 5.6pt; line-height: 1.15; }
.v-headqr .site { font-size: 5pt; }
.v-meta { display: flex; justify-content: flex-start; gap: 6mm; font-size: 7.6pt; margin: 1.2mm 0 .6mm; }
.v-meta span { white-space: nowrap; }
.v-info-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.v-info-table td {
  border: .75pt solid #000; border-bottom: 0; padding: .6mm .55mm;
  font-size: 8pt; height: 6mm; vertical-align: middle; white-space: nowrap;
}
.v-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.v-table td, .v-table th {
  border: .75pt solid #000; padding: .6mm .55mm; font-size: var(--v-table-font, 8.8pt);
  vertical-align: middle; word-break: break-all; line-height: 1.28;
}
.v-table th { font-weight: 700; text-align: center; height: 6mm; background: #f2f2f2; }
.v-table .v-info td { height: 6mm; font-size: 8.2pt; }
.v-table .fill td { height: var(--v-row-h, 7.2mm); }
.v-table .c { text-align: center; }
.v-table .r { text-align: right; padding-right: 1.2mm; }
.v-table .v-total td { height: 7.4mm; font-size: 8.8pt; }
.v-table .v-adjust td { height: 5mm; font-size: 7.5pt; text-align: left; padding-right: 1.5mm; }
.v-adjust-line { display: flex; justify-content: space-between; gap: 4mm; }
.v-table .v-upper { font-weight: 700; letter-spacing: .3pt; }
.v-terms { display: flex; border: .75pt solid #000; border-top: 0; }
.v-terms-text { flex: 1; min-width: 0; padding: .6mm 1.7mm; font-size: var(--v-terms-font, 10.1pt); line-height: var(--v-terms-lh, 1.09); }
.v-terms-text p { margin: 0; }
.v-terms-text .promise { text-align: center; font-weight: 700; margin-bottom: .4mm; font-size: 8.2pt; }
.v-terms-qr {
  width: 41mm; height: 40mm; flex: 0 0 auto; align-self: flex-start;
  border-left: .75pt solid #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0; overflow: hidden;
}
.v-terms-qr img { width: 40mm; height: 40mm; object-fit: contain; display: block; }
.v-foot {
  display: flex; justify-content: space-between; gap: 3mm;
  border: .75pt solid #000; border-top: 0; padding: 1.2mm 1.7mm; font-size: 8.2pt;
}
.v-foot .pay b { font-weight: 700; text-decoration: underline; }

.voucher-stage { zoom: .9; width: 100%; }
.voucher-preview-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.voucher-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.qr-row { display: flex; gap: 24px; flex-wrap: wrap; }
.qr-slot .mini-btn { margin-top: 7px; }

/* 打印设置帮助 */
.help-steps { font-size: 13px; color: var(--ink-2); }
.help-lead { margin-bottom: 6px; color: var(--ink-3); font-size: 12.5px; line-height: 1.7; }
.help-step { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.help-no {
  width: 22px; height: 22px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep);
  font-family: var(--num); font-size: 12px; display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px;
}
.help-step b { font-size: 13.5px; }
.help-step p { margin: 4px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.75; }
.help-step code, .help-note code {
  background: var(--paper-2); padding: 1px 5px; border-radius: 4px;
  font-family: var(--num); font-size: 12px;
}
.help-step kbd {
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  padding: 0 5px; font-family: var(--num); font-size: 11px; background: #fff;
}
.help-note {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: #fdf8ef; border: 1px dashed var(--gold-line); color: var(--ink-3);
  font-size: 12px; line-height: 1.75;
}
.cat-manage-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.cat-manage-row:last-child { border-bottom: 0; }
.cat-actions { display: flex; gap: 6px; }

/* 凭证排版调整 */
.layout-editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
.le-controls { max-height: 62vh; overflow: auto; padding-right: 6px; }
.le-group { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.le-group:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.le-group-title { font-size: 11px; color: var(--muted); letter-spacing: .6px; margin-bottom: 2px; }
.le-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 3px 0; font-size: 12.5px; color: var(--ink-2); }
.le-row .le-input { display: flex; align-items: center; gap: 4px; }
.le-row input {
  width: 72px; height: 28px; border: 1px solid var(--line); border-radius: 6px;
  padding: 0 7px; font-family: var(--num); font-size: 12.5px; text-align: right; outline: none;
}
.le-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(176,134,67,.12); }
.le-row i { font-style: normal; font-size: 10.5px; color: var(--muted); width: 16px; }
.le-preview { background: #e9e4da; border-radius: 8px; padding: 10px; height: 330px; overflow: auto; }
.le-stage { zoom: .62; }
.le-meter { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.le-meter b { font-family: var(--num); color: var(--ink); }
.le-meter.over b { color: var(--red); }
.le-warn { color: var(--red); margin-left: 6px; }

.qr-slot { display: flex; align-items: center; gap: 12px; }
.qr-slot img {
  width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; padding: 3px;
}
.qr-slot .qr-meta { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 打印 */
#print-root { display: none; }

@media print {
  html, body { overflow: visible !important; height: auto !important; background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  @page { margin: 0; }
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1360px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pos { grid-template-columns: minmax(0, 1fr) 372px; }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) {
  .home-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid.masonry { grid-auto-rows: auto; row-gap: 18px; }
  .settings-grid.masonry > .card { grid-row-end: auto !important; margin-bottom: 0; }
  .purchase-grid { grid-template-columns: 1fr; }
  .po-side { position: static; }
  .price-strip .price-chip:nth-child(n+3) { display: none; }
}
@media (max-width: 1024px) {
  .sidebar { width: 76px; flex-basis: 76px; padding: 20px 9px 14px; }
  .brand { justify-content: center; padding: 0 0 18px; }
  .brand-text { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item span, .nav-item .nav-badge { display: none; }
  .nav-group { display: none; }
  .sidebar-foot { display: none; }
  .pos { grid-template-columns: 1fr; }
  .pos-right { position: static; }
  .cart-items { max-height: none; }
}
/* ---------------------------------------------------------------- 移动端底栏 / 购物车抽屉 */
.mobile-cart-bar { display: none; }
.cart-backdrop { display: none; }
.cart-collapse { display: none; }

@media (max-width: 760px) {
  .app { display: block; }
  .sidebar {
    position: fixed; inset: auto 0 0 0; width: 100%; height: 58px; flex-direction: row;
    padding: 0 4px; border-right: 0; border-top: 1px solid #2b261d; background: #17150f;
    z-index: 70;
  }
  .brand, .sidebar-foot, .nav-group { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 0; overflow: visible; }
  .nav-item {
    flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 9px;
    border: 1px solid transparent; border-radius: 8px; justify-content: center;
  }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item span { display: block; font-size: 9px; letter-spacing: 0; }
  .nav-item .nav-badge { display: none; }
  .nav-item.active::before { display: none; }
  .nav-item.active { background: rgba(176, 134, 67, .18); }
  .main { padding-bottom: 58px; min-height: 100vh; }
  .pos-left { padding-bottom: 64px; }
  .pos-right {
    position: fixed; left: 0; right: 0; bottom: 58px; top: auto; z-index: 60;
    max-height: 80vh; overflow: auto; border-radius: 16px 16px 0 0;
    transform: translateY(110%); transition: transform .26s cubic-bezier(.2, .8, .3, 1);
    box-shadow: 0 -18px 50px rgba(20, 16, 10, .28);
  }
  .pos.cart-open .pos-right { transform: none; }
  .cart-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(20, 17, 12, .45); z-index: 55;
  }
  .pos.cart-open .cart-backdrop { display: block; }
  .mobile-cart-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 58px; height: 58px; z-index: 50;
    align-items: center; gap: 10px; padding: 0 14px;
    background: linear-gradient(180deg, #221e17, #181510); color: #f4e6c9;
    border-top: 1px solid #332c20; box-shadow: 0 -8px 24px rgba(20, 16, 10, .2);
  }
  .mcb-count { font-size: 12px; color: #b7a78c; }
  .mcb-total { font-family: var(--num); font-size: 20px; font-weight: 600; color: #f0d9ab; margin-left: auto; }
  .mcb-go {
    font-size: 12.5px; padding: 7px 14px; border-radius: 20px;
    background: linear-gradient(180deg, #d9b877, #b78b47); color: #2a1e0a; font-weight: 600;
  }
  .cart-collapse { display: inline-flex; }
  .cart-items { max-height: 34vh; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-form { grid-template-columns: 1fr; }
  .product-form .span-3 { grid-column: span 1; }
  .voucher-settings { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {

  .view { padding: 16px 14px 48px; }
  .topbar { padding: 0 14px; gap: 10px; height: 58px; flex-basis: 58px; }
  .page-sub { display: none; }
  .price-strip, .topbar-date { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero { padding: 20px; }
  .hero-revenue .big { font-size: 32px; }
  .hero-right { width: 100%; justify-content: flex-start; }
  .hero-action { width: 74px; height: 70px; font-size: 11px; }
  .product-form, .form-grid { grid-template-columns: 1fr; }
  .product-form .span-2, .form-grid .span-2 { grid-column: span 1; }
  .price-preview { grid-column: span 1; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
  .tbl th, .tbl td { padding: 9px 8px; }
  .section-title { font-size: 19px; }
  .modal { margin: 3vh auto; }
}

/* ---------------------------------------------------------------- 补充组件 */
.pick-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 8px; cursor: pointer;
  transition: .14s;
}
.pick-row:hover { border-color: var(--gold-line); background: #fffdf7; }
.pick-row:last-child { margin-bottom: 0; }

.mini-select {
  height: 26px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  font-size: 11.5px; padding: 0 4px; color: var(--ink-3); cursor: pointer;
}
.mini-btn:disabled { opacity: .38; cursor: not-allowed; }

.cart-tradein {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: #f5f9f6; border-bottom: 1px solid #e2ece6; font-size: 11.5px; color: var(--jade);
}
.cart-tradein svg { width: 13px; height: 13px; flex: 0 0 auto; }
.cart-tradein b { margin-left: auto; font-family: var(--num); color: #245c46; font-size: 12.5px; }
.cart-tradein button { border: 0; background: none; color: #93ac9f; padding: 0; display: inline-flex; }
.cart-tradein button:hover { color: var(--red); }

.pay-summary { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fdfbf6; }
.ps-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); padding: 3px 0; }
.ps-row b { font-family: var(--num); font-weight: 500; }
.ps-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 9px; border-top: 1px dashed var(--line); }
.ps-total span { font-size: 13px; }
.ps-total b { font-family: var(--num); font-size: 28px; color: var(--gold-deep); font-weight: 600; letter-spacing: -.5px; }
.ck-change { text-align: right; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.ck-change b { font-family: var(--num); font-size: 18px; margin-left: 6px; }
.ck-print { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; }

.success-badge {
  width: 56px; height: 56px; border-radius: 50%; margin: 2px auto 10px;
  display: grid; place-items: center; background: linear-gradient(145deg, #eaf3ec, #d8e8dd);
  color: var(--green); border: 1px solid #cfe2d6;
}
.success-badge svg { width: 26px; height: 26px; }
.ok-center { text-align: center; font-size: 13px; color: var(--ink-3); }
.ok-center b { color: var(--gold-deep); font-family: var(--num); font-size: 15px; }

.tradein-result {
  margin-top: 16px; padding: 14px 16px; border-radius: 10px;
  background: linear-gradient(135deg, #f7faf7, #f0f7f2); border: 1px dashed #cfe0d3;
  display: flex; justify-content: space-between; align-items: baseline;
}
.tradein-result span { font-size: 12.5px; color: var(--jade); }
.tradein-result b { font-family: var(--num); font-size: 26px; color: #245c46; font-weight: 600; }

.hb-track { background: var(--paper-2); border-radius: 10px; overflow: hidden; height: 7px; }
.hb-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #d9b877, #b08643); }

.tbl input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--gold-deep); cursor: pointer; }
.tbl td .input { background: #fff; }

.po-table .select { max-width: 100%; }

/* ---------- 可视化凭证模板 ---------- */
.v-tpl { position: relative; padding: 0 !important; overflow: hidden; }
.v-tpl .vd-el { position: absolute; box-sizing: border-box; }
.v-tpl .vd-text { width: 100%; height: 100%; white-space: pre-wrap; overflow: hidden; }
.v-tpl .vd-bordered .vd-text { padding: .45mm 1.5mm; }
.v-tpl .vd-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.v-tpl .vd-fields { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.v-tpl .vd-fields td { border: .75pt solid #000; padding: .4mm .6mm; vertical-align: middle; white-space: nowrap; overflow: hidden; font-size: inherit; }
.v-tpl .vd-items { width: 100%; border-collapse: collapse; table-layout: fixed; }
.v-tpl .vd-items th, .v-tpl .vd-items td { border: .75pt solid #000; padding: .4mm .55mm; vertical-align: middle; font-size: inherit; line-height: 1.25; }
.v-tpl .vd-items th { height: 6mm; text-align: center; background: #f2f2f2; font-weight: 700; }
.v-tpl .vd-items .c { text-align: center; }
.v-tpl .vd-items .r { text-align: right; padding-right: 1.2mm; }
.v-tpl .vd-items .fill td { height: 5.8mm; }
.v-tpl .vd-items .vd-adjust td { height: 5mm; font-size: .88em; }
.v-tpl .vd-adjust span:first-child { float: left; }
.v-tpl .vd-adjust span:last-child { float: right; }
.v-tpl .vd-items .vd-total td { height: 7.4mm; font-size: 1.03em; }
.v-tpl .vd-items .upper { font-weight: 700; letter-spacing: .3pt; }
.v-tpl .vd-terms { width: 100%; height: 100%; padding: .55mm 1.6mm; overflow: hidden; }
.v-tpl .vd-terms p { margin: 0; }
.v-tpl .vd-terms .promise { text-align: center; font-weight: 700; margin-bottom: .3mm; }
.v-tpl .vd-line { width: 100%; border-top: .75pt solid #000; }

/* ---------- 可视化设计器 ---------- */
.vd-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.vd-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.vd-canvas-wrap { background: #f1ece2; border-radius: 12px; padding: 18px; overflow: auto; display: flex; justify-content: center; min-height: 480px; }
.vd-canvas {
  position: relative; flex: 0 0 auto; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  background-image: linear-gradient(rgba(0, 0, 0, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .04) 1px, transparent 1px);
  background-size: 31px 31px;
}
.vd-canvas .vd-el { position: absolute; box-sizing: border-box; outline: 1px dashed rgba(150, 110, 40, .35); cursor: move; user-select: none; }
.vd-canvas .vd-text { width: 100%; height: 100%; white-space: pre-wrap; overflow: hidden; }
.vd-canvas .vd-bordered .vd-text { padding: .45mm 1.5mm; }
.vd-canvas .vd-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vd-canvas .vd-fields { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.vd-canvas .vd-fields td { border: .75pt solid #000; padding: .4mm .6mm; vertical-align: middle; white-space: nowrap; overflow: hidden; font-size: inherit; }
.vd-canvas .vd-items { width: 100%; border-collapse: collapse; table-layout: fixed; }
.vd-canvas .vd-items th, .vd-canvas .vd-items td { border: .75pt solid #000; padding: .4mm .55mm; vertical-align: middle; font-size: inherit; line-height: 1.25; }
.vd-canvas .vd-items th { height: 6mm; text-align: center; background: #f2f2f2; font-weight: 700; }
.vd-canvas .vd-items .c { text-align: center; }
.vd-canvas .vd-items .r { text-align: right; padding-right: 1.2mm; }
.vd-canvas .vd-items .fill td { height: 5.8mm; }
.vd-canvas .vd-items .vd-adjust td { height: 5mm; font-size: .88em; }
.vd-canvas .vd-adjust span:first-child { float: left; }
.vd-canvas .vd-adjust span:last-child { float: right; }
.vd-canvas .vd-items .vd-total td { height: 7.4mm; font-size: 1.03em; }
.vd-canvas .vd-items .upper { font-weight: 700; letter-spacing: .3pt; }
.vd-canvas .vd-terms { width: 100%; height: 100%; padding: .55mm 1.6mm; overflow: hidden; }
.vd-canvas .vd-terms p { margin: 0; }
.vd-canvas .vd-terms .promise { text-align: center; font-weight: 700; margin-bottom: .3mm; }
.vd-canvas .vd-line { width: 100%; border-top: .75pt solid #000; }
.vd-canvas .vd-el:hover { outline-color: rgba(150, 110, 40, .8); }
.vd-canvas .vd-el.selected { outline: 2px solid var(--gold); z-index: 900; }
.vd-canvas.preview .vd-el { outline: 0; cursor: default; }
.vd-canvas .vd-text[contenteditable="true"], .vd-canvas .vd-fields td[contenteditable="true"], .vd-canvas .vd-items th[contenteditable="true"], .vd-canvas .vd-terms-inner[contenteditable="true"] { outline: 2px solid #2f7d5a; background: #fffdf2; cursor: text; user-select: text; }
.vd-handle { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid var(--gold); border-radius: 2px; z-index: 950; }
.vd-handle.nw { left: -5px; top: -5px; cursor: nwse-resize; }
.vd-handle.n { left: 50%; top: -5px; margin-left: -4px; cursor: ns-resize; }
.vd-handle.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.vd-handle.e { right: -5px; top: 50%; margin-top: -4px; cursor: ew-resize; }
.vd-handle.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.vd-handle.s { left: 50%; bottom: -5px; margin-left: -4px; cursor: ns-resize; }
.vd-handle.sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.vd-handle.w { left: -5px; top: 50%; margin-top: -4px; cursor: ew-resize; }
.vd-panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; min-height: 480px; }
.vd-panel-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.vd-panel-title .vd-id { font-size: 10px; color: var(--muted); font-weight: 400; }
.vd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vd-panel label { font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.vd-panel .input, .vd-panel .select { height: 32px; }
.vd-panel textarea.input { min-height: 78px; height: auto; padding: 8px; }
.vd-token-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.vd-token-list code { font-size: 10.5px; background: var(--paper-2); padding: 2px 4px; border-radius: 4px; color: var(--ink-2); }
.vd-actions { display: flex; gap: 8px; margin-top: 12px; }
.vd-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.vd-cols label { font-size: 10px; margin-bottom: 0; }
.vd-cols .input { height: 26px; padding: 0 4px; font-size: 11px; }
.vd-heads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.vd-heads label { font-size: 10px; margin-bottom: 0; min-width: 0; }
.vd-heads .input { width: 100%; min-width: 0; height: 26px; padding: 0 4px; font-size: 11px; }
.vd-colcfg { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.vd-colcfg-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 88px; gap: 4px; align-items: center; }
.vd-colcfg-row > span { font-size: 10px; color: var(--muted); }
.vd-colcfg-row .input, .vd-colcfg-row .select { height: 26px; padding: 0 4px; font-size: 11px; }
.vd-rows { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.vd-rows b { color: var(--ink); }
.vd-rows .btn { flex: 0 0 auto; }
.vd-rows .btn-sm { padding: 2px 6px; font-size: 10px; }
.vd-col-grip { position: absolute; top: 0; bottom: 0; width: 8px; margin-left: -4px; cursor: col-resize; z-index: 960; }
.vd-col-grip::before { content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 1.5px; background: rgba(176, 134, 67, .55); }
.vd-col-grip::after { content: ''; position: absolute; left: 0; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px #fff; }
.vd-col-grip:hover::before { left: 2.5px; width: 2px; background: var(--gold); }
.v-tpl .vd-items thead th, .vd-canvas .vd-items thead th { height: 6mm; line-height: 6mm; padding: 0 .55mm; }
.v-tpl .vd-items tbody td, .vd-canvas .vd-items tbody td { height: 6mm; line-height: 5.6mm; padding: 0 .55mm; }
.v-tpl .vd-items tfoot .vd-adjust td, .vd-canvas .vd-items tfoot .vd-adjust td { height: 5mm; line-height: 5mm; }
.v-tpl .vd-items tfoot .vd-total td, .vd-canvas .vd-items tfoot .vd-total td { height: 7.4mm; line-height: 7mm; }
@media (max-width: 1100px) { .vd-main { grid-template-columns: 1fr; } .vd-panel { min-height: 0; } }


.v-tpl .vd-items .fill td, .vd-canvas .vd-items .fill td { height: 6mm; line-height: 5.6mm; padding: 0 .55mm; }

/* 设计器内表格行高按画布比例缩放，避免比打印版式偏高 */
.vd-canvas .vd-items thead th { height: calc(6 * var(--vd-mm)); line-height: calc(6 * var(--vd-mm)); }
.vd-canvas .vd-items tbody td { height: calc(6 * var(--vd-mm)); line-height: calc(5.6 * var(--vd-mm)); }
.vd-canvas .vd-items .fill td { height: calc(6 * var(--vd-mm)); line-height: calc(5.6 * var(--vd-mm)); }
.vd-canvas .vd-items .vd-adjust td { height: calc(5 * var(--vd-mm)); line-height: calc(5 * var(--vd-mm)); }
.vd-canvas .vd-items .vd-total td { height: calc(7.4 * var(--vd-mm)); line-height: calc(7 * var(--vd-mm)); }

.vd-canvas .vd-items tfoot .vd-total td { height: calc(7.4 * var(--vd-mm)); line-height: calc(7 * var(--vd-mm)); }
.vd-canvas .vd-items tfoot .vd-adjust td { height: calc(5 * var(--vd-mm)); line-height: calc(5 * var(--vd-mm)); }

.vd-type { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.vd-type .select { width: 190px; height: 30px; }

.vd-canvas.marquee-mode { cursor: crosshair; }
.vd-canvas.marquee-mode .vd-el { cursor: crosshair; }
.vd-marquee { position: absolute; border: 1.5px dashed var(--gold); background: rgba(176, 134, 67, .08); z-index: 985; pointer-events: none; }
.vd-el.marquee-hit { outline: 2px dashed rgba(176, 134, 67, .65) !important; }
#vd-marquee.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.vd-nudge { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.vd-nudge .btn { font-size: 11px; padding: 5px 6px; }

.vd-field-help { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.vd-field-help summary { cursor: pointer; font-size: 11.5px; color: var(--muted); user-select: none; }
.vd-token-labels { display: grid; grid-template-columns: 1fr; gap: 5px; margin-top: 8px; max-height: 230px; overflow: auto; }
.vd-token-row { display: flex; align-items: center; gap: 8px; }
.vd-token-row code { flex: 0 0 118px; font-size: 10.5px; background: var(--paper-2); padding: 2px 4px; border-radius: 4px; color: var(--ink-2); }
.vd-token-row span { font-size: 11px; color: var(--muted); }

.v-tpl-page { break-after: page; page-break-after: always; }
.v-tpl-page:last-child { break-after: auto; page-break-after: auto; }
@media screen { .v-tpl-page + .v-tpl-page { margin-top: 14px; } }

/* 登录 / 账号 */
[hidden] { display: none !important; }
body.login-mode .app { display: none !important; }
.login-screen { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 20% 10%, #23201b 0, #15130f 55%, #0e0d0b 100%); }
.login-screen[hidden] { display: none !important; }
.login-card { width: min(390px, 100%); background: #fffdf9; border-radius: 16px; padding: 30px 28px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg,#d8b36a,#a97b2f); color: #fff; font-size: 21px; font-weight: 700; }
.login-brand strong { display: block; font-size: 19px; letter-spacing: 3px; color: var(--ink); }
.login-brand span { display: block; margin-top: 3px; font-size: 10.5px; letter-spacing: 2px; color: var(--muted); }
.login-card label { display: block; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.login-card label .input { margin-top: 6px; height: 42px; }
.login-error { min-height: 20px; font-size: 12px; color: var(--red); margin-bottom: 4px; }
.login-hint { margin-top: 16px; font-size: 11px; color: var(--muted); line-height: 1.7; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 7px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.user-chip[hidden] { display: none !important; }
.user-chip > div { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip b { font-size: 11.5px; color: var(--ink); }
.user-chip span { font-size: 9.5px; color: var(--muted); }
.user-chip .mini-btn { height: 24px; padding: 0 7px; font-size: 10.5px; }
@media (max-width: 760px) { .user-chip > div { display: none; } .login-card { padding: 24px 20px; } }

/* 可排序表头 */
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.sortable:hover { color: var(--gold-deep); }
.tbl th.sortable.sorted { color: var(--gold-deep); }
.tbl th.sortable .sort-arrow { display: inline-block; width: 12px; margin-left: 4px; font-size: 10px; color: var(--muted); }
.tbl th.sortable.sorted .sort-arrow { color: var(--gold-deep); }

/* ============================================================
   库存盘点
   ============================================================ */
.stocktake .section-head { align-items: flex-start; }
.stk-scan {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 2px solid var(--gold);
  border-radius: 14px; padding: 7px 8px 7px 14px;
  box-shadow: 0 3px 14px rgba(0,0,0,.05);
  margin-top: 4px;
}
.stk-scan-icon { display: grid; place-items: center; color: var(--gold-deep); flex: none; }
.stk-scan-icon svg { width: 21px; height: 21px; }
.stk-scan input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 17px; padding: 7px 0; color: var(--ink); font-family: inherit;
}
.stk-scan input::placeholder { color: var(--muted); font-size: 14px; }
.stk-scan .btn { flex: none; min-height: 38px; }
#stk-flash { min-height: 0; }
.stk-flash {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 13px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px;
}
.stk-flash.ok { background: #F2F8F3; border-color: #CBE3D1; color: #2E6B42; }
.stk-flash.dup { background: #FBF4E8; border-color: #E7D3B4; color: #8A5A1F; }
.stk-flash.err { background: #FBEDEC; border-color: #EBCBC7; color: var(--red-deep); }
.stk-flash.undone { background: #F4F2EE; border-color: var(--line); color: var(--ink-3); }
.stk-flash b { font-weight: 600; }
.stk-flash .grow { flex: 1; }
.stk-flash code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 5px; }
.stk-flash-undo {
  border: 1px solid currentColor; background: transparent; color: inherit;
  border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer;
}
.stk-flash-undo:hover { background: rgba(255,255,255,.7); }
.stk-stats {
  display: grid; grid-template-columns: repeat(3, 1fr) 1.25fr;
  gap: 10px; margin-top: 12px;
}
.stk-stat, .stk-progress {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.stk-stat .stk-label { font-size: 12px; color: var(--muted); }
.stk-stat .num { font-size: 26px; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.stk-stat .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stk-stat.done .num { color: var(--gold-deep); }
.stk-stat.left .num { color: var(--red-deep); }
.stk-progress .pl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.stk-progress .bar { height: 10px; background: #EDE8E0; border-radius: 6px; overflow: hidden; margin-top: 10px; }
.stk-progress .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: 6px; transition: width .25s; }
.stk-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 14px 0 10px; }
.stk-search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 0 11px;
}
.stk-search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.stk-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; padding: 9px 0; font-size: 13px; }
.stk-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.stk-modes button { border: none; background: transparent; padding: 8px 12px; font-size: 12px; color: var(--muted); cursor: pointer; }
.stk-modes button.active { background: var(--ink); color: #fff; font-weight: 600; }
.stk-table { max-height: calc(100vh - 480px); overflow: auto; }
.stk-table .tbl { min-width: 760px; }
.stk-code { font-family: var(--num); font-size: 12px; cursor: pointer; }
.stk-code:hover { color: var(--gold-deep); text-decoration: underline; }
.stk-done-row { background: #FBF9F4; }
.stk-done-row td { color: var(--ink-3); }
.stk-table tr.hl td { animation: stkPulse 1.5s ease-out; }
@keyframes stkPulse {
  0% { box-shadow: inset 0 0 0 3px var(--gold); }
  100% { box-shadow: inset 0 0 0 3px rgba(192,138,46,0); }
}
@media (max-width: 1000px) {
  .stk-stats { grid-template-columns: repeat(2, 1fr); }
  .stk-progress { grid-column: 1 / -1; }
  .stk-table { max-height: none; }
}
@media (max-width: 640px) {
  .stocktake .section-head .right { width: 100%; }
  .stk-scan { padding: 6px 6px 6px 11px; }
  .stk-scan input { font-size: 15px; }
  .stk-toolbar { align-items: stretch; }
  .stk-search { min-width: 100%; }
}

.stk-flash.scope { background: #F8F4EA; border-color: #E7D3B4; color: #7A5A1F; }
.stk-scope-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.stk-scope-tools .stk-search { flex: 1; min-width: 220px; }
.stk-scope-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.stk-scope-cats button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-3);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.stk-scope-cats button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.stk-scope-tools .stk-search input { font-size: 13px; }

.v-label-page { background: transparent !important; }
.vd-barcode { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vd-barcode svg { width: 100%; height: 100%; display: block; }

.vd-page-size { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.vd-page-size input { width: 58px; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--num); font-size: 12px; }

.vd-qr { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vd-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }

.pos-guides-btn { flex: 1; height: 44px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.guide-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.guide-pick-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.guide-pick-row:hover { border-color: var(--gold); }
.guide-pick-row .muted { margin-left: auto; font-size: 11px; }

.label-sheet .v-tpl-page { break-after: auto !important; page-break-after: auto !important; }
.label-sheet { background: transparent; }

@media (max-width: 760px) {
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 58px; min-width: 58px; }
  .nav-item span { white-space: nowrap; }
}
