/* =========================================================
   织序轻库存 · 视觉系统
   温暖纸张底色 / 墨色 / 玫瑰陶土强调色
   ========================================================= */
:root {
  --bg: #f5f1ea;
  --bg-deep: #efe9e0;
  --surface: #fffdf9;
  --surface-soft: #fbf7f1;
  --surface-muted: #f3ede5;
  --ink: #26211c;
  --ink-soft: #443b33;
  --muted: #7f7469;
  --muted-light: #a1968a;
  --line: #e8dfd4;
  --line-strong: #d8cbbc;
  --accent: #a65545;
  --accent-deep: #864235;
  --accent-soft: #f2dfd8;
  --accent-mist: #fbf0eb;
  --sage: #58705d;
  --sage-soft: #e7eee7;
  --amber: #a97633;
  --amber-soft: #f7ebd8;
  --danger: #b0433a;
  --danger-soft: #f8e3df;
  --blue: #48687e;
  --blue-soft: #e6eef3;
  --shadow-sm: 0 1px 2px rgba(48, 38, 29, .04), 0 6px 18px rgba(48, 38, 29, .035);
  --shadow: 0 12px 36px rgba(48, 38, 29, .08), 0 2px 8px rgba(48, 38, 29, .04);
  --shadow-lg: 0 28px 70px rgba(38, 30, 23, .2), 0 8px 24px rgba(38, 30, 23, .08);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar-w: 238px;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(166, 85, 69, .055), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(88, 112, 93, .045), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
::selection { background: var(--accent-soft); color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: #cdbfae transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d3c6b7; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* =========================================================
   框架
   ========================================================= */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 252, 247, .82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--ink);
  color: #f7efe5;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 5px 14px rgba(38, 33, 28, .18);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-family: var(--serif); font-size: 21px; letter-spacing: .08em; font-weight: 700; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .16em; margin-top: 2px; }
.workspace-chip {
  margin: 0 8px 18px;
  padding: 8px 10px;
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  background: rgba(255, 253, 249, .7);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #6f8b6f; box-shadow: 0 0 0 3px rgba(111, 139, 111, .12); }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding: 0 2px 8px; flex: 1; }
.nav-label { padding: 14px 10px 6px; font-size: 10px; letter-spacing: .18em; color: var(--muted-light); font-weight: 700; }
.nav-label:first-child { padding-top: 0; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  min-height: 41px;
  padding: 9px 10px;
  border-radius: 11px;
  color: #5e544b;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .16s, color .16s, transform .16s;
}
.nav a:hover { background: rgba(243, 237, 229, .8); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: -2px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 4px; background: var(--accent);
}
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; color: #8d8175; }
.nav a.active .nav-icon { color: var(--accent); }
.nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700;
}
.nav-badge[hidden] { display: none; }

.sidebar-note {
  margin: 8px 2px 12px;
  padding: 13px;
  border: 1px solid #ead5c8;
  border-radius: 14px;
  background: linear-gradient(145deg, #fdf5ef, #faeee7);
  color: var(--accent-deep);
}
.sidebar-note[hidden] { display: none; }
.sidebar-note-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.sidebar-note-head .icon { width: 15px; height: 15px; }
.sidebar-note p { font-size: 11.5px; color: #8c6457; margin: 5px 0 8px; }
.sidebar-note b { font-size: 15px; }
.sidebar-note a { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.sidebar-note a .icon { width: 13px; height: 13px; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.operator-card {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border: 0; border-radius: 12px; background: transparent; text-align: left;
}
.operator-card:hover { background: var(--surface-muted); }
.operator-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.operator-copy strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operator-copy small { color: var(--muted); font-size: 10.5px; }
.operator-card > .icon { margin-left: auto; width: 15px; height: 15px; color: var(--muted-light); }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 33px; height: 33px; border-radius: 50%;
  background: var(--ink); color: #f8efe3;
  font-family: var(--serif); font-size: 15px; font-weight: 700;
}
.avatar.small { width: 25px; height: 25px; font-size: 12px; }

.main-shell { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: 94px;
  padding: 17px 30px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(245, 241, 234, .8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232, 223, 212, .7);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-heading { min-width: 0; }
.page-eyebrow { font-size: 10px; letter-spacing: .16em; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.page-heading h1 { font-family: var(--serif); font-size: 27px; line-height: 1.3; font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-heading p { color: var(--muted); font-size: 11.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 9px; flex: none; }
.today-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 253, 249, .68);
  color: var(--muted); font-size: 11.5px;
}
.today-chip .icon { width: 14px; height: 14px; }
.icon-btn {
  width: 35px; height: 35px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink-soft);
  transition: border-color .15s, background .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-soft); transform: translateY(-1px); }
.icon-btn .icon { width: 16px; height: 16px; }
.operator-pill {
  display: flex; align-items: center; gap: 8px;
  height: 35px; padding: 0 12px 0 5px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 12px; font-weight: 600;
}
.operator-pill:hover { border-color: var(--line-strong); }
.mobile-menu { display: none; }
.sidebar-scrim { display: none; }

.view { max-width: 1480px; margin: 0 auto; padding: 26px 30px 64px; }

/* =========================================================
   通用组件
   ========================================================= */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .01em; }
.view-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.view-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: transform .14s, background .14s, border-color .14s, box-shadow .14s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--ink); color: #fbf4e9; box-shadow: 0 4px 12px rgba(38, 33, 28, .13); }
.btn-primary:hover { background: #3a322b; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(166, 85, 69, .18); }
.btn-accent:hover { background: var(--accent-deep); }
.btn-secondary { border-color: var(--line); background: var(--surface); }
.btn-secondary:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-muted); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f3d4cf; }
.btn-sm { height: 31px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; }
.btn-sm .icon { width: 13px; height: 13px; }
.btn-lg { height: 43px; padding: 0 20px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-spinner {
  width: 12px; height: 12px; flex: none;
  border: 1.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.order-result {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 13px; margin-bottom: 7px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
}
.order-result:hover { border-color: var(--line-strong); background: var(--surface-soft); transform: translateY(-1px); }
.order-result strong { display: block; font-size: 11.5px; font-family: var(--mono); }
.order-result small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.order-result-right { text-align: right; flex: none; }
.order-result-right b { display: block; font-size: 11.5px; }
.order-result-right span { color: var(--muted); font-size: 9.5px; }
.form-notice b { font-weight: 700; }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 0; border: 0; background: transparent;
  color: var(--accent); font-size: 11.5px; font-weight: 600;
}
.link-btn:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.link-btn .icon { width: 13px; height: 13px; }
.btn-group { display: flex; gap: 6px; align-items: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px 0; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.card-title .icon { width: 16px; height: 16px; color: var(--accent); }
.card-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.card-body { padding: 18px 20px 20px; }
.card-link { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 11.5px; }
.card-link:hover { color: var(--accent); }
.card-link .icon { width: 13px; height: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 23px; padding: 0 8px; border-radius: 7px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--sage); background: var(--sage-soft); }
.badge-warning { color: var(--amber); background: var(--amber-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-accent { color: var(--accent); background: var(--accent-soft); }
.badge-neutral { color: var(--muted); background: var(--surface-muted); }
.badge-blue { color: var(--blue); background: var(--blue-soft); }

.muted { color: var(--muted); }
.faint { color: var(--muted-light); }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.money-lg { font-size: 15px; }
.pos { color: var(--sage); }
.neg { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }

/* =========================================================
   仪表盘
   ========================================================= */
.dash-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  min-height: 148px; padding: 26px 30px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(105deg, #29241f 0%, #362e27 55%, #41342a 100%);
  color: #f8efe4;
  box-shadow: 0 18px 45px rgba(38, 31, 24, .14);
}
.dash-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.022) 22px 23px),
    radial-gradient(500px 260px at 85% 20%, rgba(200, 150, 124, .18), transparent 68%);
  pointer-events: none;
}
.dash-hero::after {
  content: "织"; position: absolute; right: 29%; bottom: -46px;
  font-family: var(--serif); font-size: 180px; color: rgba(255,255,255,.032);
  line-height: 1; pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 650px; min-width: 0; }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: #cbb7a4; font-size: 10.5px; letter-spacing: .18em; font-weight: 600; }
.hero-kicker .line { width: 26px; height: 1px; background: #b9927a; }
.hero-copy h2 { font-family: var(--serif); font-size: 27px; font-weight: 500; line-height: 1.35; margin: 8px 0 7px; letter-spacing: .02em; overflow-wrap: break-word; }
.hero-copy p { color: #c8b8a8; font-size: 12px; }
.hero-copy b { color: #f0c9b2; font-weight: 700; }
.hero-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(96px, 1fr)); gap: 8px; flex: none; min-width: 0; }
.hero-btn {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 13px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  background: rgba(255,255,255,.075); color: #f5eadd;
  font-size: 11.5px; font-weight: 600;
  backdrop-filter: blur(4px);
  transition: background .15s, transform .15s;
}
.hero-btn:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.hero-btn .icon { width: 15px; height: 15px; color: #dfb99f; }
.hero-btn.primary { background: var(--accent); border-color: var(--accent); }
.hero-btn.primary .icon { color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.stat-card {
  position: relative; overflow: hidden;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-card::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 72px; height: 72px; border-radius: 50%; background: var(--accent-mist); opacity: .55; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.stat-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-mist); color: var(--accent); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-icon.sage { background: var(--sage-soft); color: var(--sage); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-value { position: relative; z-index: 1; margin-top: 8px; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 3px; }
.stat-meta { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--muted); font-size: 10.5px; flex-wrap: wrap; }
.stat-meta .up { color: var(--sage); font-weight: 700; }
.stat-meta .down { color: var(--danger); font-weight: 700; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 14px; margin-top: 14px; }
.dash-grid-2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }

.chart-card { min-height: 300px; }
.chart-wrap { padding: 18px 20px 16px; }
.bar-chart { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 185px; padding: 6px 2px 25px; }
.chart-gridlines { position: absolute; inset: 4px 0 25px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-gridlines span { display: block; border-top: 1px dashed #ede5db; font-size: 0; }
.bar-col { position: relative; z-index: 1; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar {
  width: min(34px, 72%); min-height: 3px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #b86a58, #a65545);
  opacity: .88; transition: opacity .15s, transform .15s;
  transform-origin: bottom;
}
.bar.zero { background: #e8ded3; opacity: 1; }
.bar-col:hover .bar { opacity: 1; transform: scaleX(1.08); }
.bar-label { position: absolute; bottom: -21px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--muted-light); white-space: nowrap; }
.bar-tip { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); opacity: 0; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 5px; font-size: 9.5px; pointer-events: none; transition: opacity .15s; white-space: nowrap; }
.bar-col:hover .bar-tip { opacity: 1; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; color: var(--muted); font-size: 10.5px; }

.channel-layout { display: flex; align-items: center; gap: 22px; padding: 14px 20px 20px; }
.donut { position: relative; width: 136px; height: 136px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent) 0 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.02); }
.donut::after { content: ""; position: absolute; inset: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 17px; letter-spacing: -.02em; }
.donut-center small { color: var(--muted); font-size: 9.5px; }
.channel-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.legend-name { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-pct { width: 34px; text-align: right; color: var(--muted-light); font-size: 10px; }

.low-list { display: flex; flex-direction: column; gap: 0; padding: 4px 20px 12px; }
.low-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0e8de; }
.low-item:last-child { border-bottom: 0; }
.low-thumb { width: 37px; height: 37px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-mist); color: var(--accent); font-family: var(--serif); font-size: 16px; }
.low-main { min-width: 0; flex: 1; }
.low-main strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.low-main small { color: var(--muted); font-size: 10px; }
.low-stock { text-align: right; flex: none; }
.low-stock b { font-size: 14px; color: var(--danger); }
.low-stock small { display: block; color: var(--muted-light); font-size: 9.5px; }
.low-bar { height: 3px; border-radius: 2px; background: #f0e4dc; margin-top: 7px; overflow: hidden; }
.low-bar span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }

.timeline { padding: 8px 20px 16px; }
.timeline-item { display: flex; gap: 11px; padding: 9px 0; position: relative; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 33px; bottom: -3px; width: 1px; background: var(--line); }
.timeline-dot { width: 27px; height: 27px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-muted); color: var(--muted); z-index: 1; }
.timeline-dot .icon { width: 13px; height: 13px; }
.timeline-dot.in { background: var(--sage-soft); color: var(--sage); }
.timeline-dot.out { background: var(--accent-soft); color: var(--accent); }
.timeline-dot.adjust { background: var(--amber-soft); color: var(--amber); }
.timeline-main { min-width: 0; flex: 1; }
.timeline-main strong { display: block; font-size: 11.5px; font-weight: 600; }
.timeline-main small { display: block; color: var(--muted); font-size: 10px; }
.timeline-qty { font-size: 12px; font-weight: 700; white-space: nowrap; }

.top-style-list { padding: 6px 20px 16px; }
.top-style-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1e9e0; }
.top-style-row:last-child { border-bottom: 0; }
.rank { width: 21px; height: 21px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--surface-muted); font-size: 10px; font-weight: 700; color: var(--muted); }
.top-style-row:first-child .rank { background: var(--ink); color: #fff; }
.top-style-main { min-width: 0; flex: 1; }
.top-style-main strong { font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-style-main small { color: var(--muted); font-size: 10px; }
.top-style-num { text-align: right; font-size: 11.5px; }
.top-style-num b { display: block; }
.top-style-num small { color: var(--muted); font-size: 9.5px; }

/* =========================================================
   筛选 & 表格
   ========================================================= */
.filter-card { padding: 14px 16px; margin-bottom: 14px; display: flex; align-items: flex-end; gap: 11px; flex-wrap: wrap; }
.filter-card .field { min-width: 150px; margin: 0; }
.filter-card .field.grow { flex: 1; min-width: 210px; }
.filter-card .filter-actions { display: flex; gap: 7px; margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field > label, .field-label { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.field > label .req { color: var(--accent); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fffefa; color: var(--ink);
  font-size: 12.5px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: #c9b9a7; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(166, 85, 69, .11); background: #fff; }
.input::placeholder, .textarea::placeholder { color: #b3a79a; }
.select { appearance: none; padding-right: 29px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f7469' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input[type="date"] { padding-right: 7px; }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.input.sm { height: 32px; font-size: 11.5px; }
.input.error, .select.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(176, 67, 58, .08); }
.search-field { position: relative; }
.search-field .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-light); }
.search-field .input { padding-left: 33px; }
.checkline { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.checkline input { width: 15px; height: 15px; accent-color: var(--accent); }

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.table-head h3 { font-size: 13px; font-weight: 700; }
.table-head p { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 10px 13px; text-align: left; white-space: nowrap;
  background: #fbf8f3; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
}
.data-table td { padding: 12px 13px; border-bottom: 1px solid #f1e9e0; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #fdfaf5; }
.data-table .num, .data-table th.num { text-align: right; }
.data-table .center, .data-table th.center { text-align: center; }
.data-table .row-actions { display: flex; align-items: center; gap: 9px; justify-content: flex-end; white-space: nowrap; }
.data-table .link-btn { font-size: 11px; }
.cell-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cell-main strong { font-size: 12px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.cell-main small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.cell-main.mono strong { font-family: var(--mono); font-size: 11px; letter-spacing: -.02em; }
.style-cell { display: flex; align-items: center; gap: 9px; }
.style-dot { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-mist); color: var(--accent); font-family: var(--serif); font-size: 14px; }
.stock-cell { display: flex; flex-direction: column; gap: 4px; min-width: 83px; }
.stock-cell .stock-line { display: flex; align-items: baseline; gap: 4px; }
.stock-cell .stock-line b { font-size: 14px; }
.stock-cell .stock-line small { font-size: 9.5px; color: var(--muted); }
.mini-bar { width: 76px; height: 3px; border-radius: 3px; background: #eee4d9; overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 3px; background: var(--sage); }
.mini-bar span.warn { background: var(--amber); }
.mini-bar span.danger { background: var(--danger); }
.progress { width: 92px; height: 5px; border-radius: 9px; background: #efe6dc; overflow: hidden; display: inline-block; vertical-align: middle; }
.progress span { display: block; height: 100%; border-radius: 9px; background: var(--sage); }
.progress span.partial { background: var(--amber); }
.progress span.empty { background: var(--line-strong); }
.progress-text { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin-top: 3px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 17px; border-top: 1px solid var(--line); background: #fdfbf7; }
.table-footer .total-text { color: var(--muted); font-size: 11px; }
.pager { display: flex; align-items: center; gap: 5px; }
.page-btn { min-width: 29px; height: 29px; padding: 0 8px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 11px; }
.page-btn:hover:not([disabled]) { border-color: var(--line-strong); color: var(--ink); }
.page-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn[disabled] { opacity: .38; cursor: not-allowed; }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.summary-item { padding: 15px 17px; display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.summary-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-muted); color: var(--muted); flex: none; }
.summary-icon .icon { width: 16px; height: 16px; }
.summary-icon.accent { background: var(--accent-mist); color: var(--accent); }
.summary-icon.sage { background: var(--sage-soft); color: var(--sage); }
.summary-icon.amber { background: var(--amber-soft); color: var(--amber); }
.summary-copy strong { display: block; font-size: 18px; line-height: 1.3; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.summary-copy small { display: block; color: var(--muted); font-size: 10px; }

/* =========================================================
   空状态 / 加载
   ========================================================= */
.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-muted); color: var(--muted-light); }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-state h3 { color: var(--ink); font-family: var(--serif); font-size: 17px; margin-bottom: 4px; }
.empty-state p { font-size: 11.5px; max-width: 360px; margin: 0 auto 13px; }
.empty-actions { display: flex; justify-content: center; gap: 7px; }
.page-loading { min-height: 460px; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 14px; }
.loading-mark { width: 50px; height: 50px; margin: 0 auto; border-radius: 15px; display: grid; place-items: center; background: var(--ink); color: #f3e8da; font-family: var(--serif); font-size: 23px; animation: pulse 1.6s ease-in-out infinite; }
.page-loading p { font-size: 11.5px; letter-spacing: .06em; }
@keyframes pulse { 0%, 100% { opacity: .6; transform: scale(.97); } 50% { opacity: 1; transform: scale(1); } }
.skeleton { border-radius: 7px; background: linear-gradient(90deg, #f0e9e0 25%, #f8f3ed 50%, #f0e9e0 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.error-state { padding: 60px 20px; text-align: center; }
.error-state h2 { font-family: var(--serif); font-size: 22px; margin: 12px 0 5px; }
.error-state p { color: var(--muted); font-size: 12px; margin-bottom: 16px; }

/* =========================================================
   弹窗 & 表单
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: rgba(34, 28, 23, .46);
  backdrop-filter: blur(5px);
  animation: fadeIn .18s ease-out;
}
.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 19px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.modal.modal-sm { width: min(460px, 100%); }
.modal.modal-lg { width: min(860px, 100%); }
.modal.modal-xl { width: min(1080px, 100%); }
.modal.modal-full { width: min(1260px, 100%); }
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf9, #fdfaf5);
}
.modal-title { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.35; letter-spacing: .01em; }
.modal-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.modal-close { width: 31px; height: 31px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.modal-close:hover { background: var(--surface-muted); color: var(--ink); }
.modal-close .icon { width: 15px; height: 15px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-body.flush { padding: 0; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--line); background: #fdfbf7; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-footer .left { margin-right: auto; color: var(--muted); font-size: 10.5px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-section { margin-bottom: 18px; }
.form-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.form-section-head h4 { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.form-section-head .hint { color: var(--muted-light); font-size: 10px; }
.form-help { color: var(--muted-light); font-size: 10px; line-height: 1.45; }
.form-error { color: var(--danger); font-size: 10.5px; margin-top: 3px; }
.form-notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 9px; background: var(--accent-mist); color: #7f4d40; font-size: 10.5px; line-height: 1.5; }
.form-notice .icon { width: 14px; height: 14px; margin-top: 1px; }
.form-notice.warn { background: var(--amber-soft); color: #805b27; }
.form-notice.danger { background: var(--danger-soft); color: var(--danger); }

.line-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.line-table th { padding: 7px 7px; text-align: left; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.line-table td { padding: 6px 5px; border-bottom: 1px solid #f3ece3; vertical-align: top; }
.line-table tbody tr:last-child td { border-bottom: 0; }
.line-table .input, .line-table .select { height: 34px; font-size: 11.5px; }
.line-table .line-style { min-width: 190px; }
.line-table .line-qty { width: 72px; }
.line-table .line-price { width: 94px; }
.line-table .line-amount { width: 88px; text-align: right; padding-top: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line-table .line-del { width: 29px; padding-top: 7px; text-align: right; }
.line-del button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted-light); }
.line-del button:hover { background: var(--danger-soft); color: var(--danger); }
.line-del .icon { width: 13px; height: 13px; }
.line-stock { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.line-stock.low { color: var(--danger); }
.line-add { margin-top: 8px; }
.line-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 11px; border: 1px dashed var(--line-strong); border-radius: 9px; }
.line-summary { display: flex; justify-content: flex-end; gap: 26px; padding: 14px 4px 0; margin-top: 8px; border-top: 1px dashed var(--line-strong); }
.line-summary > div { text-align: right; }
.line-summary span { display: block; color: var(--muted); font-size: 9.5px; }
.line-summary b { font-size: 16px; font-variant-numeric: tabular-nums; }
.line-summary b.accent { color: var(--accent); }

.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.detail-hero h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.detail-hero p { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.detail-kv { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.detail-kv span { display: block; color: var(--muted); font-size: 9px; }
.detail-kv strong { display: block; font-size: 12px; margin-top: 2px; word-break: break-word; }
.detail-kv strong.big { font-size: 17px; font-variant-numeric: tabular-nums; }
.detail-block { margin-top: 17px; }
.detail-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.detail-block-head h4 { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.detail-table th { text-align: left; color: var(--muted); font-size: 9px; padding: 6px 8px; border-bottom: 1px solid var(--line); font-weight: 700; }
.detail-table td { padding: 8px; border-bottom: 1px solid #f4ede4; vertical-align: top; }
.detail-table tbody tr:last-child td { border-bottom: 0; }
.detail-table .num { text-align: right; }
.detail-note { color: var(--muted); font-size: 10.5px; background: var(--surface-soft); border-radius: 9px; padding: 9px 11px; margin-top: 12px; white-space: pre-wrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; margin: 16px 0; }
.kpi { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.kpi span { display: block; font-size: 9.5px; color: var(--muted); }
.kpi strong { display: block; margin-top: 3px; font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 9px; color: var(--muted-light); }

.tabbar { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0 14px; overflow-x: auto; }
.tab-btn { position: relative; padding: 9px 12px; border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tab-panel[hidden] { display: none; }

.detail-hero-style { display: flex; align-items: center; gap: 15px; }
.style-big-mark { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--ink); color: #f7ebdc; font-family: var(--serif); font-size: 24px; flex: none; }
.matrices { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 6px; background: var(--surface-muted); color: var(--muted); font-size: 9.5px; }

/* 通知 */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  min-width: 230px; max-width: min(380px, calc(100vw - 32px));
  padding: 11px 14px;
  display: flex; align-items: flex-start; gap: 9px;
  border-radius: 11px;
  background: var(--ink); color: #fbf4e9;
  box-shadow: 0 12px 35px rgba(38, 30, 23, .22);
  font-size: 11.5px; line-height: 1.5;
  pointer-events: auto;
  animation: toastIn .22s cubic-bezier(.2,.8,.2,1);
}
.toast .icon { width: 15px; height: 15px; margin-top: 1px; color: #d2b49f; flex: none; }
.toast.success .icon { color: #a8c7a5; }
.toast.error .icon { color: #e5a39a; }
.toast.warning .icon { color: #e9c489; }
.toast.leaving { animation: toastOut .18s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* 确认框 */
.confirm-body { color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.confirm-body .form-notice { margin-top: 10px; }

/* 渠道与导入 */
.channel-add { padding: 14px; }
.channel-add-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.channel-add-form .field { margin-bottom: 0; }
.channel-add-form .grow { flex: 1; min-width: 180px; }
.channel-add-form .btn { margin-bottom: 1px; }
.color-input { padding: 4px; cursor: pointer; }
.channel-list { display: flex; flex-direction: column; gap: 7px; }
.channel-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface);
}
.channel-color { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(38, 33, 28, .04); }
.channel-main { flex: 1; min-width: 0; }
.channel-main strong { display: block; font-size: 12px; }
.channel-main small { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; }
.file-drop {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 50px; padding: 9px 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px;
  background: var(--surface-soft);
}
.file-drop .faint { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.import-table { font-size: 11px; }
.import-table td { vertical-align: top; }
.import-item { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-soft); margin-bottom: 3px; }
.import-issues { color: var(--danger); font-size: 9.5px; line-height: 1.45; margin-top: 4px; max-width: 260px; }
.import-issues:empty { display: none; }

/* 供应商 */
.supplier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }.supplier-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .15s, box-shadow .15s; }
.supplier-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.supplier-top { display: flex; align-items: flex-start; gap: 11px; }
.supplier-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: var(--sage-soft); color: var(--sage); font-family: var(--serif); font-size: 17px; flex: none; }
.supplier-name { min-width: 0; flex: 1; }
.supplier-name strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supplier-name small { color: var(--muted); font-size: 10px; }
.supplier-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.supplier-stats div { text-align: center; }
.supplier-stats b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.supplier-stats span { font-size: 9px; color: var(--muted); }
.supplier-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* 日志 */
.log-action { display: inline-flex; align-items: center; gap: 4px; }
.log-detail { max-width: 460px; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
pre.json-view { margin: 0; padding: 14px; border-radius: 10px; background: #f7f2eb; border: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }

/* 打印 */
@media print {
  .sidebar, .topbar, .view-actions, .filter-card, .table-footer, .row-actions, .toast-root, .modal-footer, .modal-close { display: none !important; }
  body.modal-open .app-shell { display: none !important; }
  body.modal-open .modal-backdrop { display: flex !important; }
  .main-shell { margin-left: 0; }
  .view { padding: 0; max-width: none; }
  .modal-backdrop { position: static; background: none; backdrop-filter: none; padding: 0; }
  .modal { box-shadow: none; border: 0; max-height: none; width: 100%; }
  .modal-body { overflow: visible; }
  body { background: #fff; }
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-2 { grid-template-columns: 1fr; }
  .supplier-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(34, 28, 23, .4); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .main-shell { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { padding: 15px 22px 13px; }
  .view { padding: 22px 22px 56px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 80px; align-items: flex-start; padding: 14px 16px 12px; }
  .page-heading h1 { font-size: 21px; white-space: normal; }
  .page-heading p { display: none; }
  .today-chip, #refresh-btn, .operator-pill span:last-child { display: none; }
  .operator-pill { padding-right: 5px; }
  .view { padding: 18px 14px 46px; }
  .dash-hero { flex-direction: column; align-items: stretch; padding: 22px; min-height: auto; }
  .hero-copy h2 { font-size: 22px; }
  .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-btn { padding: 0 10px; justify-content: center; font-size: 11px; }
  .hero-btn .icon { width: 14px; height: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 21px; }
  .channel-layout { flex-direction: column; align-items: stretch; gap: 14px; }
  .donut { margin: 0 auto; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .supplier-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-item { padding: 12px; }
  .summary-copy strong { font-size: 16px; }
  .filter-card { align-items: stretch; }
  .filter-card .field { flex: 1 1 135px; min-width: 0; }
  .filter-card .filter-actions { margin-left: 0; width: 100%; }
  .filter-card .filter-actions .btn { flex: 1; }
  .channel-add-form .field, .channel-add-form .grow { flex: 1 1 100%; width: 100%; }
  .channel-add-form .btn { width: 100%; }
  .file-drop { align-items: flex-start; }
  .channel-row { flex-wrap: wrap; }
  .channel-main { flex-basis: 55%; }
  .view-head { align-items: flex-start; }
  .view-head h2 { font-size: 19px; }
  .table-head { padding: 13px 14px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal.modal-sm, .modal.modal-lg, .modal.modal-xl, .modal.modal-full { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-header { padding: 17px 17px 13px; }
  .modal-body { padding: 16px 17px; }
  .modal-footer { padding: 12px 17px; }
  .line-table .line-style { min-width: 145px; }
  .line-summary { gap: 15px; }
  .line-summary b { font-size: 14px; }
  .detail-hero { flex-direction: column; }
  .toast-root { right: 14px; bottom: 14px; left: 14px; align-items: stretch; }
  .toast { max-width: none; min-width: 0; }
  .tab-btn { padding: 8px 9px; font-size: 10.5px; }
}
@media (max-width: 430px) {
  .hero-actions { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .supplier-stats { gap: 2px; }
  .summary-strip { grid-template-columns: 1fr; }
}

/* =========================================================
   样衣 / 仓库货主 / 图片上传 / 打印入口
   ========================================================= */
.nav-badge-warn { background: var(--amber); color: #fff; }
.tag-sage { background: var(--sage-soft); color: var(--sage); }
.location-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.location-tags .tag { white-space: nowrap; }
.checkbox-line { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; cursor: pointer; }
.checkbox-line input { accent-color: var(--accent); width: 14px; height: 14px; }

.image-picker { display: flex; align-items: center; gap: 13px; padding: 11px; border: 1px dashed var(--line-strong); border-radius: 13px; background: var(--surface-soft); }
.image-preview { width: 74px; height: 74px; flex: none; border-radius: 11px; overflow: hidden; background: var(--surface-muted); display: grid; place-items: center; color: var(--muted-light); font-size: 10px; cursor: pointer; border: 1px solid var(--line); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-picker-body { min-width: 0; }
.image-picker-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.image-picker .form-help { margin-top: 6px; font-size: 10px; color: var(--muted); line-height: 1.5; }
.image-picker.compact { padding: 0; border: 0; background: transparent; gap: 0; }
.image-picker.compact .image-preview { width: 42px; height: 42px; border-radius: 8px; }
.image-picker.compact .image-picker-body { display: none; }

.sample-alert { margin-top: 15px; border: 1px solid #e8c9a0; border-radius: var(--radius); padding: 14px 17px; background: linear-gradient(120deg, #fdf4e6, #fffaf3 65%); }
.sample-alert-head { display: flex; align-items: center; gap: 12px; }
.sample-alert-head > div { min-width: 0; flex: 1; }
.sample-alert-head strong { display: block; font-size: 13px; }
.sample-alert-head small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.sample-alert-head .btn { flex: none; }
.sample-alert-icon { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: #f3dfc3; color: var(--amber); }
.sample-alert-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.sample-alert-item { display: flex; align-items: center; gap: 8px; padding: 5px 9px 5px 5px; border-radius: 10px; background: rgba(255,255,255,.8); border: 1px solid #f0e0c8; font-size: 10.5px; color: var(--ink-soft); }
.sample-alert-item:hover { border-color: var(--amber); }
.sample-alert-item b { font-weight: 600; }
.sample-mini-thumb { width: 30px; height: 30px; border-radius: 7px; overflow: hidden; background: var(--surface-muted); display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; }
.sample-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sample-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sample-thumb { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; background: var(--surface-muted); display: grid; place-items: center; color: var(--muted); font-size: 14px; flex: none; border: 1px solid var(--line); }
.sample-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sample-thumb.small { width: 34px; height: 34px; border-radius: 8px; }
.row-warn td { background: #fff8ec; }
.row-warn:hover td { background: #fff3df; }

.sample-detail { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: start; }
.sample-detail-image { width: 190px; height: 226px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-muted); }
.sample-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted-light); font-size: 10px; }
.sample-detail-info { min-width: 0; }

.style-big-mark { overflow: hidden; }
.style-big-mark img { width: 100%; height: 100%; object-fit: cover; }

.print-actions { display: flex; align-items: center; gap: 4px; margin-right: auto; flex-wrap: wrap; }
.purchase-line-table .line-sku { min-width: 92px; }
.purchase-line-table .image-picker.compact .image-preview { cursor: pointer; }

@media (max-width: 760px) {
  .sample-alert-head { align-items: flex-start; flex-wrap: wrap; }
  .sample-alert-head .btn { width: 100%; }
  .sample-detail { grid-template-columns: 1fr; }
  .sample-detail-image { width: 100%; height: 220px; }
  .image-picker { align-items: flex-start; }
  .print-actions { width: 100%; }
}

.recycle-snapshot { max-width: 380px; color: var(--muted); font-size: 10px; line-height: 1.6; }

.product-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-cell .sample-thumb { width: 46px; height: 46px; border-radius: 11px; }
.supplier-line-table select { min-width: 150px; }
.supplier-line-table .input { min-width: 90px; }
.supplier-line-table th, .supplier-line-table td { padding: 6px 7px; }

body { font-size: var(--font-size, 14px); }
.color-input { height: 42px; padding: 4px; cursor: pointer; }

.sub-tabs { display: flex; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.sub-tab { padding: 8px 16px; border-radius: 10px 10px 0 0; color: var(--muted); font-size: 12px; border: 1px solid transparent; border-bottom: 0; }
.sub-tab:hover { color: var(--ink); background: var(--surface-soft); }
.sub-tab.active { color: var(--accent); background: var(--surface); border-color: var(--line); font-weight: 600; }

.import-options { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-soft); }
.import-options .checkbox-line { margin: 0; font-size: 11px; }

.purchase-line-table th:nth-child(2) { width: 300px; }
.line-product-cell { min-width: 300px; position: relative; }
.product-combobox { position: relative; }
.line-style-search { padding-right: 30px !important; }
.combobox-menu { position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; right: 0; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; }
.combobox-hint { padding: 6px 10px 8px; color: var(--muted); font-size: 10px; border-bottom: 1px solid var(--line); margin-bottom: 3px; }
.combobox-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.combobox-option:hover, .combobox-option.active { background: var(--accent-mist); }
.combobox-option .combobox-main { font-size: 12px; color: var(--ink); line-height: 1.4; }
.combobox-option .combobox-main b { color: var(--accent-deep); font-family: var(--mono); }
.combobox-option small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.combobox-option .tag { margin-left: 4px; }
.combobox-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 11px; }
.combobox-meta { margin-top: 5px; font-size: 10px; color: var(--muted); line-height: 1.4; min-height: 15px; }

.combobox-menu.drop-up { top: auto; bottom: calc(100% + 5px); }

.supplier-qr-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 10px; }
.supplier-qr-row img { width: 38px; height: 38px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.supplier-qr-large { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.supplier-qr-large img { width: 160px; height: 160px; object-fit: contain; }
.supplier-qr-large small { color: var(--muted); font-size: 10px; }

.image-picker { transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; outline: none; }
.image-picker:focus-visible, .image-picker.dragging { border-color: var(--accent); background: var(--accent-mist); box-shadow: 0 0 0 3px rgba(166, 85, 69, .12); }
.image-preview { cursor: pointer; }
.image-picker.compact { position: relative; overflow: visible; }
.image-picker.compact .image-picker-body { display: block; position: absolute; right: -3px; bottom: -3px; padding: 0; }
.image-picker.compact .image-picker-body .form-help { display: none; }
.image-picker.compact .image-picker-body .btn { min-height: 16px; padding: 1px 4px; font-size: 8px; line-height: 1.2; border-radius: 5px; }
.image-picker.compact .image-picker-body [data-image-clear] { display: none; }

.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.permission-grid .checkbox-line { margin: 0; font-size: 11px; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 460px; }
.permission-tags .tag { font-size: 9px; }
@media (max-width: 900px) { .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.search-field { position: relative; }
.search-assist { position: absolute; z-index: 90; top: calc(100% + 5px); left: 0; right: 0; min-width: 240px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; }
.search-assist button { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.search-assist button:hover { background: var(--accent-mist); }
.search-assist b { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-assist small { flex: none; color: var(--muted); font-size: 9px; }

.nav a[hidden], .nav [data-owner-only][hidden] { display: none !important; }

/* 返回按钮：所有二级页面固定显示在标题左侧 */
.back-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 36px; padding: 0 11px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink-soft);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.back-btn:hover { background: var(--accent-mist); border-color: var(--accent); color: var(--accent); }
.back-btn .icon { width: 15px; height: 15px; }
.back-btn[hidden] { display: none !important; }

/* 手机端：放大正文和触控目标，减少首屏干扰，突出库存/单号/金额 */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { min-height: 68px; padding: 10px 12px; align-items: center; gap: 8px; }
  .topbar-left { gap: 7px; flex: 1; min-width: 0; }
  .page-heading { flex: 1; min-width: 0; }
  .page-eyebrow { font-size: 9px; letter-spacing: .1em; }
  .page-heading h1 { font-size: 22px; line-height: 1.25; }
  .back-btn { height: 42px; padding: 0 10px; font-size: 13px; border-radius: 11px; }
  .back-btn .icon { width: 17px; height: 17px; }
  .mobile-menu { width: 42px; height: 42px; }
  .view { padding: 14px 12px 64px; }
  .view-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .view-head h2 { font-size: 22px; }
  .view-head p { font-size: 12px; line-height: 1.55; }
  .view-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .view-actions .btn { width: 100%; min-height: 44px; padding: 0 10px; font-size: 13px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .icon-btn { width: 42px; height: 42px; }
  .input, .select { min-height: 44px; font-size: 16px; }
  .textarea { min-height: 88px; font-size: 16px; }
  .filter-card { padding: 12px; gap: 10px; }
  .filter-card .field { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .filter-card .field.grow { flex-basis: 100%; }
  .filter-card .filter-actions { width: 100%; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .summary-item { padding: 13px; gap: 9px; }
  .summary-copy strong { font-size: 22px; line-height: 1.2; }
  .summary-copy small { font-size: 10.5px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .card { border-radius: 14px; }
  .table-head { padding: 12px 13px; }
  .table-head h3 { font-size: 14px; }
  .data-table { font-size: 13px; }
  .data-table th { padding: 9px 10px; font-size: 11.5px; }
  .data-table td { padding: 11px 10px; }
  .cell-main strong { font-size: 14px; white-space: normal; }
  .cell-main small { font-size: 11px; line-height: 1.45; }
  .data-table .link-btn { font-size: 12px; }
  .row-actions { gap: 4px; }
  .row-actions .icon-btn { width: 36px; height: 36px; }
  .table-scroll { -webkit-overflow-scrolling: touch; }
  .modal-backdrop { padding: 0; }
  .modal, .modal.modal-sm, .modal.modal-lg, .modal.modal-xl, .modal.modal-full { max-height: 96vh; border-radius: 18px 18px 0 0; }
  .modal-header { padding: 15px 14px 12px; }
  .modal-title { font-size: 19px; }
  .modal-body { padding: 14px; max-height: calc(96vh - 132px); }
  .modal-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); }
  .modal-footer .btn { width: 100%; min-height: 44px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .detail-kv { padding: 10px 11px; }
  .detail-kv span { font-size: 9px; }
  .detail-kv strong { font-size: 12px; }
  .kpi { padding: 12px; }
  .kpi strong { font-size: 20px; }
  .line-table { font-size: 12px; }
  .line-table th { padding: 8px 7px; font-size: 10px; }
  .line-table td { padding: 8px 6px; }
  .line-table .input { min-width: 66px; padding: 0 7px; }
  .line-summary { gap: 12px; }
  .line-summary b { font-size: 15px; }
  .form-section { padding: 12px; }
  .form-section-head h4 { font-size: 14px; }
  .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-btn { min-height: 44px; font-size: 12px; }
}
@media (max-width: 340px) {
  .back-btn span { display: none; }
  .back-btn { padding: 0 9px; }
  .page-heading h1 { font-size: 20px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .modal-close { width: 42px; height: 42px; border-radius: 11px; }
  .modal-close .icon { width: 18px; height: 18px; }
}

@media (max-width: 760px) {
  .data-table .mobile-hide { display: none !important; }
}

/* 手机库存卡片：优先显示款号、可用库存、次品和操作 */
.mobile-stock-card { display: none; }
@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .mobile-stock-card { display: block; padding: 13px 12px; border-bottom: 1px solid var(--line); }
  .mobile-stock-card:last-child { border-bottom: 0; }
  .mobile-stock-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .mobile-stock-main .cell-main { flex: 1; }
  .mobile-stock-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 11px 0 10px; padding: 9px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
  .mobile-stock-nums > div { display: flex; flex-direction: column; gap: 1px; }
  .mobile-stock-nums b { font-size: 17px; line-height: 1.2; font-weight: 700; }
  .mobile-stock-nums b.neg { color: var(--danger); }
  .mobile-stock-nums b.amber { color: var(--amber); }
  .mobile-stock-nums span { font-size: 9.5px; color: var(--muted); }
  .mobile-stock-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .mobile-stock-actions .btn { width: 100%; padding: 0 6px; font-size: 11px; }
}
