:root {
  --blue: #0033a0;
  --blue-deep: #00246f;
  --blue-soft: #edf3ff;
  --orange: #e36a1c;
  --orange-soft: #fff2e8;
  --ink: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e5eaf2;
  --soft: #f5f7fb;
  --white: #fff;
  --green: #079455;
  --red: #d92d20;
  --sidebar-w: 238px;
  --shadow: 0 10px 30px rgba(22, 44, 86, .07);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(0,51,160,.16); outline-offset: 1px; }
img { display: block; }

.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 24px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark {
  width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue); color: #fff; font-size: 17px; font-weight: 900;
  box-shadow: 0 7px 18px rgba(0,51,160,.2);
}
.brand-name { font-size: 16px; font-weight: 900; letter-spacing: .2px; }
.brand-sub { margin-top: 2px; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: 1.2px; }
.workspace {
  margin: 22px 4px 16px; padding: 10px 10px; border: 1px solid var(--line); border-radius: 11px;
  display: flex; align-items: center; gap: 8px; background: #fbfcff;
}
.workspace-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #e9f8f1; }
.workspace b { display: block; font-size: 10px; }
.workspace small { display: block; color: var(--faint); font-size: 8px; margin-top: 2px; }
.workspace-chevron { margin-left: auto; color: var(--faint); font-size: 12px; }

.main-nav { display: grid; gap: 3px; overflow-y: auto; padding: 2px 2px 12px; }
.nav-group-label { margin: 13px 10px 5px; color: #a3adbd; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.nav-item {
  width: 100%; border: 0; background: transparent; border-radius: 9px;
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  color: #5b6678; text-align: left; transition: .18s ease;
}
.nav-item:hover { background: #f6f8fc; color: var(--ink); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; color: currentColor; }
.nav-icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { font-size: 10px; }
.nav-badge { margin-left: auto; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: #fff0e7; color: #c05617; display: grid; place-items: center; font-size: 8px; font-weight: 800; }
.nav-item.active .nav-badge { background: #fff; }

.sidebar-bottom { margin-top: auto; }
.sidebar-help { margin: 8px 4px 12px; padding: 10px; border-radius: 10px; background: #f8f9fc; display: flex; gap: 8px; align-items: flex-start; }
.help-icon { width: 23px; height: 23px; border-radius: 7px; background: #fff; color: var(--blue); border: 1px solid #e4eaf6; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.sidebar-help b { display: block; font-size: 9px; }
.sidebar-help small { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; line-height: 1.45; }
.user-card { border-top: 1px solid var(--line); padding: 13px 6px 2px; display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.user-card b { display: block; font-size: 9px; }
.user-card small { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; }
.user-more { margin-left: auto; color: var(--faint); font-size: 13px; }

.main { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 62px; padding: 0 26px;
  background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; backdrop-filter: blur(14px);
}
.crumb { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 9px; }
.crumb i { font-style: normal; color: #c4ccd8; }
.crumb b { color: var(--ink); font-size: 10px; }
.topbar-right { display: flex; align-items: center; gap: 13px; }
.global-search { height: 34px; width: 260px; border-radius: 9px; background: #f6f8fb; border: 1px solid #edf0f5; display: flex; align-items: center; gap: 7px; padding: 0 10px; }
.search-ico { color: var(--faint); font-size: 15px; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 9px; color: var(--ink); }
.global-search input::placeholder { color: var(--faint); }
.global-search kbd { color: #aeb7c4; font-family: inherit; font-size: 7px; border: 1px solid #e2e7ef; background: #fff; border-radius: 4px; padding: 2px 4px; }
.icon-button { position: relative; width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.bell-ico { font-size: 15px; transform: rotate(-18deg); }
.notice-dot { position: absolute; right: 7px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); border: 1px solid #fff; }
.top-date { padding-left: 13px; border-left: 1px solid var(--line); text-align: right; }
.top-date span { display: block; color: var(--faint); font-size: 7px; }
.top-date b { display: block; margin-top: 2px; font-size: 9px; }

.content { padding: 24px 26px 42px; max-width: 1660px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: 23px; letter-spacing: -.5px; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 13px;
  background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 9px; font-weight: 700; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e5; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 7px 16px rgba(0,51,160,.16); }
.btn.primary:hover { background: var(--blue-deep); }
.btn.soft { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.btn.orange { background: var(--orange-soft); border-color: transparent; color: #a95416; }
.btn.small { height: 27px; padding: 0 9px; font-size: 8px; }
.btn.danger { background: #fef3f2; border-color: transparent; color: var(--red); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 17px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -24px; bottom: -32px; width: 90px; height: 90px; border-radius: 50%; background: var(--blue-soft); opacity: .6; }
.metric-label { color: var(--muted); font-size: 9px; }
.metric-value { margin-top: 8px; font-size: 26px; line-height: 1; font-weight: 900; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.metric-value small { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0; margin-left: 3px; }
.metric-foot { margin-top: 9px; display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 8px; }
.metric-up { color: var(--green); font-weight: 800; }
.metric-down { color: var(--red); font-weight: 800; }
.metric-icon { position: absolute; right: 15px; top: 15px; width: 29px; height: 29px; border-radius: 9px; background: #f1f5ff; color: var(--blue); display: grid; place-items: center; font-size: 13px; font-weight: 800; z-index: 2; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 8px rgba(24,45,85,.02); }
.panel-head { padding: 14px 16px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid #f0f3f8; }
.panel-title { font-size: 11px; font-weight: 900; }
.panel-sub { margin-top: 3px; color: var(--faint); font-size: 8px; }
.panel-body { padding: 15px 16px; }
.panel-link { border: 0; background: transparent; color: var(--blue); font-size: 8px; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .8fr); gap: 14px; margin-bottom: 14px; }
.dashboard-grid.lower { grid-template-columns: minmax(0, 1.25fr) minmax(330px, .9fr); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; background: #fafbfd; color: #7c8799; font-size: 8px; font-weight: 800; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid #f1f3f7; color: var(--ink); font-size: 9px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcff; }
.table-product { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.table-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #f6f8fb; padding: 3px; border: 1px solid #eef1f6; }
.table-thumb.cover { object-fit: cover; padding: 0; }
.table-product b { display: block; font-size: 9px; }
.table-product small { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; }
.row-sub { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; }
.money { font-weight: 800; font-variant-numeric: tabular-nums; }
.money.orange { color: var(--orange); }
.status { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 5px; font-size: 7px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status.blue { background: var(--blue-soft); color: var(--blue); }
.status.orange { background: var(--orange-soft); color: #b15112; }
.status.green { background: #eaf8f1; color: var(--green); }
.status.red { background: #fef3f2; color: var(--red); }
.status.gray { background: #f3f5f9; color: #667085; }
.table-actions { display: flex; gap: 5px; white-space: nowrap; }
.text-link { border: 0; background: transparent; padding: 0; color: var(--blue); font-size: 8px; font-weight: 700; }
.text-link.orange { color: #b15112; }
.text-link.danger { color: var(--red); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 11px 15px; border-top: 1px solid #f0f3f8; color: var(--faint); font-size: 8px; }
.page-buttons { display: flex; gap: 4px; }
.page-btn { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); font-size: 8px; display: grid; place-items: center; }
.page-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Dashboard */
.chart-toolbar { display: flex; align-items: center; gap: 5px; }
.seg { display: inline-flex; background: #f5f7fb; border-radius: 7px; padding: 2px; }
.seg button { border: 0; background: transparent; border-radius: 5px; padding: 4px 8px; color: var(--faint); font-size: 7px; }
.seg button.active { background: #fff; color: var(--blue); font-weight: 800; box-shadow: 0 2px 6px rgba(31,52,94,.08); }
.chart { height: 185px; display: flex; align-items: flex-end; gap: 10px; padding: 16px 4px 2px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar-wrap { width: 100%; height: 138px; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: min(28px, 70%); border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #2c5bc7, #0033a0); position: relative; transition: .25s ease; }
.chart-bar:hover { filter: brightness(1.1); }
.chart-bar.orange { background: linear-gradient(180deg, #f08a45, #e36a1c); }
.chart-col span { color: var(--faint); font-size: 7px; }
.chart-legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 7px; }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend-dot.blue { background: var(--blue); }
.legend-dot.orange { background: var(--orange); }
.donut-wrap { padding: 13px 16px 18px; display: flex; align-items: center; gap: 22px; }
.donut {
  width: 122px; height: 122px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--blue) 0 42%, #e36a1c 42% 67%, #95a8cb 67% 84%, #e5eaf2 84% 100%);
  position: relative;
}
.donut::after { content: ""; position: absolute; inset: 21px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center b { font-size: 19px; line-height: 1; }
.donut-center span { margin-top: 4px; color: var(--faint); font-size: 7px; }
.donut-legend { display: grid; gap: 10px; flex: 1; }
.donut-row { display: flex; align-items: center; gap: 7px; font-size: 8px; color: var(--muted); }
.donut-row i { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.donut-row strong { margin-left: auto; color: var(--ink); font-size: 9px; }
.task-list { display: grid; gap: 1px; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #f1f3f7; }
.task-item:first-child { border-top: 0; padding-top: 2px; }
.task-icon { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 900; }
.task-icon.orange { background: var(--orange-soft); color: var(--orange); }
.task-icon.green { background: #eaf8f1; color: var(--green); }
.task-main { flex: 1; min-width: 0; }
.task-main b { display: block; font-size: 9px; }
.task-main small { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; }
.task-count { color: var(--ink); font-size: 15px; font-weight: 900; }
.mini-list { display: grid; gap: 0; }
.mini-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid #f1f3f7; }
.mini-row:first-child { border-top: 0; padding-top: 0; }
.mini-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.mini-name { flex: 1; min-width: 0; }
.mini-name b { display: block; font-size: 8px; }
.mini-name small { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; }
.mini-value { font-size: 9px; font-weight: 800; }
.low-stock { color: var(--red); }

/* Toolbar and filters */
.toolbar { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.field { height: 33px; border: 1px solid var(--line); border-radius: 7px; background: #fff; display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--muted); }
.field input, .field select { border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 8px; min-width: 0; }
.field.search { width: 230px; }
.field.search input { width: 100%; }
.field select { cursor: pointer; }
.field-label { color: var(--faint); font-size: 8px; white-space: nowrap; }
.toolbar-spacer { flex: 1; }
.filter-chip { height: 27px; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 0 9px; color: var(--muted); font-size: 8px; }
.filter-chip.active { background: var(--blue-soft); border-color: #dce6ff; color: var(--blue); font-weight: 800; }

.tabs { display: flex; align-items: center; gap: 18px; padding: 0 15px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 14px 14px 0 0; }
.tab { border: 0; background: transparent; padding: 13px 0 11px; color: var(--muted); font-size: 9px; position: relative; }
.tab.active { color: var(--blue); font-weight: 800; }
.tab.active::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 17px; height: 2px; border-radius: 2px; background: var(--blue); transform: translateX(-50%); }
.tab-badge { margin-left: 4px; padding: 1px 4px; border-radius: 6px; background: var(--orange-soft); color: #a95416; font-size: 7px; }
.panel-tabs { border-radius: 14px 14px 0 0; }
.panel-tabs + .panel-body { padding-top: 0; }

/* Product detail drawer and modal */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(11, 23, 45, .36); display: flex; justify-content: flex-end; animation: fadeIn .18s ease; }
.drawer {
  width: 760px; max-width: calc(100vw - 70px); height: 100%; background: #fff; box-shadow: -18px 0 50px rgba(14,30,60,.15);
  display: flex; flex-direction: column; animation: slideLeft .24s ease;
}
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-kicker { color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.drawer-head h2 { margin: 5px 0 0; font-size: 18px; }
.drawer-sub { margin-top: 5px; color: var(--muted); font-size: 9px; }
.drawer-close { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 17px; display: grid; place-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 19px 22px 28px; background: #fbfcfe; }
.drawer-foot { padding: 13px 22px; border-top: 1px solid var(--line); background: #fff; display: flex; justify-content: flex-end; gap: 8px; }
.form-section { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.form-section-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.form-section-title { font-size: 11px; font-weight: 900; }
.form-section-sub { margin-top: 3px; color: var(--faint); font-size: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { color: var(--muted); font-size: 8px; }
.form-label em { color: var(--red); font-style: normal; }
.input, .select { height: 35px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: #fff; color: var(--ink); font-size: 9px; outline: 0; }
.input:focus, .select:focus { border-color: #b8c9f4; box-shadow: 0 0 0 3px rgba(0,51,160,.07); }
textarea.input { height: 72px; padding-top: 9px; resize: vertical; }
.upload-box { min-height: 112px; border: 1px dashed #cbd7ef; border-radius: 10px; background: #f8faff; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); font-size: 8px; }
.upload-box b { color: var(--blue); font-size: 9px; margin-bottom: 5px; }
.upload-icon { width: 31px; height: 31px; border-radius: 9px; background: #fff; color: var(--blue); display: grid; place-items: center; font-size: 15px; margin-bottom: 6px; border: 1px solid #e6edfb; }
.sku-editor { width: 100%; border-collapse: collapse; }
.sku-editor th { padding: 8px 7px; font-size: 7px; }
.sku-editor td { padding: 7px 5px; }
.sku-editor .input { height: 28px; padding: 0 7px; font-size: 8px; }
.sku-editor .input.narrow { width: 68px; }
.sku-editor .sku-name-input { width: 100%; min-width: 90px; }
.sku-editor .row-del { color: var(--red); border: 0; background: transparent; font-size: 8px; }
.help-text { color: var(--faint); font-size: 7px; line-height: 1.55; }

.modal-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(11,23,45,.38); display: grid; place-items: center; padding: 30px; animation: fadeIn .18s ease; }
.modal { width: 540px; max-width: 100%; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(14,30,60,.18); overflow: hidden; animation: popIn .22s ease; }
.modal-head { padding: 17px 19px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.modal-body { padding: 18px 19px; }
.modal-foot { padding: 13px 19px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 17px; }
.step { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 8px; }
.step b { width: 17px; height: 17px; border-radius: 50%; background: #f1f4f9; color: var(--faint); display: grid; place-items: center; font-size: 8px; }
.step.active { color: var(--blue); font-weight: 800; }
.step.active b { background: var(--blue); color: #fff; }
.step-line { flex: 1; height: 1px; background: var(--line); }
.dropzone { border: 1px dashed #bfcff1; border-radius: 11px; background: #f8faff; min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.dropzone .upload-icon { width: 42px; height: 42px; font-size: 19px; }
.dropzone b { font-size: 11px; }
.dropzone span { margin-top: 5px; color: var(--faint); font-size: 8px; }
.dropzone .btn { margin-top: 13px; }
.import-note { margin-top: 12px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); padding: 10px 11px; font-size: 8px; line-height: 1.6; }
.import-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.import-stat { background: #f8f9fc; border-radius: 9px; padding: 10px; text-align: center; }
.import-stat b { display: block; font-size: 17px; }
.import-stat span { display: block; margin-top: 3px; color: var(--faint); font-size: 7px; }

/* Order drawer */
.order-status-banner { border-radius: 11px; padding: 14px; background: linear-gradient(110deg, #eff4ff, #f9fbff); border: 1px solid #e1e9fb; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.order-status-banner b { display: block; font-size: 15px; color: var(--blue); }
.order-status-banner span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.order-steps { display: flex; align-items: flex-start; gap: 0; margin: 13px 0 3px; }
.order-step { flex: 1; position: relative; text-align: center; }
.order-step::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: #e5eaf2; }
.order-step:first-child::before { left: 50%; }
.order-step:last-child::before { right: 50%; }
.order-step i { position: relative; z-index: 2; width: 14px; height: 14px; border-radius: 50%; background: #e5eaf2; display: block; margin: 0 auto 6px; border: 3px solid #fff; box-shadow: 0 0 0 1px #e5eaf2; }
.order-step.done i { background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.order-step span { color: var(--faint); font-size: 7px; }
.order-step.done span { color: var(--blue); font-weight: 800; }
.order-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.info-pair { padding: 9px 10px; background: #fafbfd; border-radius: 8px; }
.info-pair span { display: block; color: var(--faint); font-size: 7px; }
.info-pair b { display: block; margin-top: 4px; font-size: 9px; }
.log-list { display: grid; gap: 8px; }
.log-item { display: flex; gap: 8px; font-size: 8px; color: var(--muted); }
.log-item i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); margin-top: 4px; flex-shrink: 0; }
.log-item b { color: var(--ink); }

/* Permission */
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px; }
.role-card.active { border-color: #bfcff4; box-shadow: 0 0 0 3px rgba(0,51,160,.05); }
.role-icon { width: 31px; height: 31px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 11px; font-weight: 900; margin-bottom: 10px; }
.role-card:nth-child(2) .role-icon { background: #f0f9f5; color: var(--green); }
.role-card:nth-child(3) .role-icon { background: var(--orange-soft); color: var(--orange); }
.role-card:nth-child(4) .role-icon { background: #f4f3ff; color: #6941c6; }
.role-card b { font-size: 11px; }
.role-card p { margin: 5px 0 11px; color: var(--faint); font-size: 8px; line-height: 1.5; }
.role-users { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 8px; }
.avatar-stack { display: flex; }
.avatar-stack span { width: 19px; height: 19px; border-radius: 50%; background: #dbe7ff; color: var(--blue); border: 2px solid #fff; display: grid; place-items: center; font-size: 6px; margin-left: -4px; }
.avatar-stack span:first-child { margin-left: 0; }
.switch { width: 30px; height: 17px; border-radius: 10px; background: #d7dee9; position: relative; border: 0; }
.switch::after { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .2s ease; }
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(13px); }
.permission-table td:first-child { font-weight: 700; }
.permission-check { color: var(--green); font-weight: 900; }
.permission-dash { color: #c2cad6; }

/* Member and finance */
.member-cell { display: flex; align-items: center; gap: 9px; min-width: 160px; }
.member-avatar-table { width: 30px; height: 30px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 9px; font-weight: 900; }
.member-cell b { display: block; font-size: 9px; }
.member-cell small { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; }
.finance-summary { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.finance-highlight { background: linear-gradient(120deg, #00246f, #0033a0 64%, #2857c9); color: #fff; border-radius: 14px; padding: 18px; position: relative; overflow: hidden; }
.finance-highlight::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgba(255,255,255,.13); right: -58px; top: -70px; }
.finance-highlight span { color: rgba(255,255,255,.68); font-size: 8px; }
.finance-highlight b { display: block; margin-top: 8px; font-size: 27px; line-height: 1; font-weight: 900; }
.finance-highlight small { display: block; margin-top: 10px; color: rgba(255,255,255,.64); font-size: 7px; }
.finance-mini { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.finance-mini span { color: var(--muted); font-size: 8px; }
.finance-mini b { display: block; margin-top: 8px; font-size: 22px; line-height: 1; }
.finance-mini small { display: block; margin-top: 9px; color: var(--faint); font-size: 7px; }

/* Toast and animations */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 14px); background: rgba(12,22,42,.93); color: #fff; border-radius: 20px; padding: 10px 17px; font-size: 10px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 120; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .dashboard-grid.lower { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { width: 72px; padding: 18px 8px; }
  .brand { justify-content: center; }
  .brand > div:last-child, .workspace > div, .workspace-chevron, .sidebar-help, .user-card > div:not(.user-avatar), .user-more, .nav-group-label, .nav-label, .nav-badge { display: none; }
  .workspace { justify-content: center; padding: 8px; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-bottom { display: flex; justify-content: center; }
  .main { margin-left: 72px; width: calc(100% - 72px); }
  .topbar { padding: 0 16px; }
  .global-search { display: none; }
  .content { padding: 18px 16px 36px; }
  .finance-summary { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .drawer { max-width: 100vw; }
}

/* =========================================================
   桌面端可读字号规范
   正文 13–14px / 表格 13px / 辅助信息 11–12px
   ========================================================= */
:root {
  --sidebar-w: 260px;
}

body { font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font-size: 13px; }

.brand-mark { width: 42px; height: 42px; font-size: 19px; }
.brand-name { font-size: 18px; }
.brand-sub { font-size: 10px; letter-spacing: 1px; }
.workspace { padding: 11px 12px; }
.workspace b { font-size: 13px; }
.workspace small { font-size: 11px; }
.workspace-chevron { font-size: 14px; }
.nav-group-label { margin: 16px 10px 6px; font-size: 11px; letter-spacing: .8px; }
.main-nav { gap: 4px; }
.nav-item { padding: 10px 11px; gap: 11px; }
.nav-icon { width: 20px; height: 20px; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-label { font-size: 14px; }
.nav-badge { min-width: 21px; height: 21px; padding: 0 6px; font-size: 11px; }
.sidebar-help b { font-size: 12px; }
.sidebar-help small { font-size: 11px; line-height: 1.5; }
.help-icon { width: 27px; height: 27px; font-size: 13px; }
.user-avatar { width: 34px; height: 34px; font-size: 13px; }
.user-card b { font-size: 12px; }
.user-card small { font-size: 11px; }
.user-more { font-size: 16px; }

.topbar { height: 68px; padding: 0 30px; }
.crumb { font-size: 12px; gap: 9px; }
.crumb b { font-size: 13px; }
.topbar-right { gap: 14px; }
.global-search { height: 39px; width: 320px; padding: 0 12px; }
.global-search input { font-size: 13px; }
.global-search kbd { font-size: 11px; padding: 2px 6px; }
.search-ico { font-size: 17px; }
.icon-button { width: 38px; height: 38px; }
.bell-ico { font-size: 17px; }
.top-date span { font-size: 11px; }
.top-date b { font-size: 13px; }

.content { padding: 28px 30px 48px; }
.page-heading { margin-bottom: 22px; }
.page-heading h1 { font-size: 28px; letter-spacing: -.6px; }
.page-heading p { margin-top: 7px; font-size: 14px; }
.btn { height: 38px; padding: 0 16px; font-size: 13px; border-radius: 9px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 12px; }

.metric-grid { gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 18px 19px; }
.metric-label { font-size: 13px; }
.metric-value { margin-top: 9px; font-size: 30px; }
.metric-value small { font-size: 13px; }
.metric-foot { margin-top: 10px; font-size: 11px; }
.metric-icon { width: 34px; height: 34px; font-size: 15px; }

.panel-head { padding: 17px 19px 14px; }
.panel-title { font-size: 16px; }
.panel-sub { margin-top: 4px; font-size: 12px; }
.panel-body { padding: 18px 19px; }
.panel-link { font-size: 12px; }

th { padding: 12px 13px; font-size: 12px; }
td { padding: 13px; font-size: 13px; }
.table-product { gap: 11px; min-width: 200px; }
.table-thumb { width: 42px; height: 42px; border-radius: 9px; }
.table-product b { font-size: 13px; }
.table-product small { margin-top: 3px; font-size: 11px; }
.row-sub { margin-top: 3px; font-size: 11px; }
.status { gap: 5px; padding: 5px 9px; font-size: 11px; border-radius: 6px; }
.status::before { width: 5px; height: 5px; }
.table-actions { gap: 8px; }
.text-link { font-size: 12px; }
.pagination { padding: 13px 17px; font-size: 12px; }
.page-buttons { gap: 5px; }
.page-btn { width: 30px; height: 30px; font-size: 12px; border-radius: 6px; }

.seg button { padding: 5px 10px; font-size: 11px; }
.chart { height: 205px; padding-top: 18px; }
.chart-bar-wrap { height: 150px; }
.chart-col span { font-size: 11px; }
.chart-legend { font-size: 11px; }
.donut-center b { font-size: 22px; }
.donut-center span { font-size: 11px; }
.donut-row { font-size: 12px; }
.donut-row strong { font-size: 13px; }
.task-item { padding: 13px 0; }
.task-icon { width: 34px; height: 34px; font-size: 13px; }
.task-main b { font-size: 13px; }
.task-main small { margin-top: 3px; font-size: 11px; }
.task-count { font-size: 18px; }
.mini-row { padding: 11px 0; }
.mini-name b { font-size: 12px; }
.mini-name small { margin-top: 3px; font-size: 11px; }
.mini-value { font-size: 12px; }

.toolbar { padding: 14px 15px; gap: 10px; }
.field { height: 38px; padding: 0 12px; }
.field input, .field select { font-size: 13px; }
.field.search { width: 270px; }
.field-label { font-size: 12px; }
.filter-chip { height: 32px; padding: 0 12px; font-size: 12px; }
.tabs { gap: 22px; padding: 0 18px; }
.tab { padding: 15px 0 13px; font-size: 14px; }
.tab-badge { padding: 2px 6px; font-size: 10px; }

.drawer { width: 860px; }
.drawer-head { padding: 20px 24px; }
.drawer-kicker { font-size: 10px; }
.drawer-head h2 { margin-top: 6px; font-size: 22px; }
.drawer-sub { font-size: 13px; }
.drawer-close { width: 34px; height: 34px; font-size: 20px; }
.drawer-body { padding: 20px 24px 30px; }
.drawer-foot { padding: 15px 24px; }
.form-section { padding: 18px; margin-bottom: 14px; }
.form-section-title { font-size: 15px; }
.form-section-sub { margin-top: 4px; font-size: 12px; }
.form-label { font-size: 12px; }
.form-group { gap: 7px; }
.input, .select { height: 40px; padding: 0 12px; font-size: 13px; }
textarea.input { height: 88px; padding-top: 10px; }
.upload-box { font-size: 12px; }
.upload-box b { font-size: 13px; }
.sku-editor th { padding: 9px 7px; font-size: 11px; }
.sku-editor td { padding: 8px 5px; }
.sku-editor .input { height: 34px; padding: 0 8px; font-size: 11px; }
.sku-editor .input.narrow { width: 78px; }
.sku-editor .sku-name-input { min-width: 105px; }
.sku-editor .row-del { font-size: 11px; }
.help-text { font-size: 11px; }

.modal-head { padding: 19px 21px; }
.modal-head h2 { font-size: 20px; }
.modal-head p { margin-top: 5px; font-size: 12px; }
.modal-body { padding: 20px 21px; }
.modal-foot { padding: 15px 21px; }
.step { font-size: 12px; }
.step b { width: 21px; height: 21px; font-size: 11px; }
.dropzone b { font-size: 15px; }
.dropzone span { font-size: 12px; }
.import-note { padding: 12px 13px; font-size: 12px; }
.import-stat b { font-size: 20px; }
.import-stat span { font-size: 11px; }

.order-status-banner { padding: 16px; }
.order-status-banner b { font-size: 18px; }
.order-status-banner span { font-size: 12px; }
.order-step i { width: 17px; height: 17px; top: 1px; }
.order-step::before { top: 9px; }
.order-step span { font-size: 12px; }
.info-pair { padding: 11px 12px; }
.info-pair span { font-size: 11px; }
.info-pair b { margin-top: 5px; font-size: 13px; }
.log-item { font-size: 12px; gap: 9px; }
.log-item i { margin-top: 6px; }

.role-card { padding: 17px; }
.role-icon { width: 36px; height: 36px; font-size: 13px; }
.role-card b { font-size: 15px; }
.role-card p { font-size: 12px; }
.role-users { font-size: 12px; }
.avatar-stack span { width: 23px; height: 23px; font-size: 9px; }
.permission-table td { font-size: 13px; }
.switch { width: 36px; height: 20px; }
.switch::after { width: 16px; height: 16px; }
.switch.on::after { transform: translateX(16px); }

.member-avatar-table { width: 36px; height: 36px; font-size: 12px; }
.member-cell b { font-size: 13px; }
.member-cell small { font-size: 11px; }
.finance-highlight { padding: 20px; }
.finance-highlight span { font-size: 12px; }
.finance-highlight b { font-size: 32px; }
.finance-highlight small { font-size: 11px; }
.finance-mini { padding: 18px; }
.finance-mini span { font-size: 12px; }
.finance-mini b { font-size: 26px; }
.finance-mini small { font-size: 11px; }

.toast { padding: 12px 20px; font-size: 13px; }

@media (max-width: 1180px) {
  :root { --sidebar-w: 238px; }
  .global-search { width: 250px; }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 72px; }
  .page-heading h1 { font-size: 24px; }
}

/* 侧栏在 1080p 下尽量完整展示，较矮屏幕自动滚动 */
.main-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav-group-label { margin: 12px 10px 4px; }
.nav-item { padding: 9px 11px; }
.sidebar-bottom { margin-top: 8px; flex-shrink: 0; }
.sidebar-help { margin: 6px 4px 8px; padding: 9px 10px; }
.user-card { padding-top: 10px; }

/* 商品编辑抽屉给尺寸与价格字段更充足的宽度 */
.drawer { width: 980px; }
.upload-box b, .upload-box span { display: block; }
.sku-editor .sku-name-input { min-width: 122px; }
.sku-editor .input.narrow { width: 92px; }
@media (max-width: 1180px) {
  .drawer { width: calc(100vw - 80px); }
}

/* 放大后的 SKU 表格保留更多字段宽度 */
.drawer { width: 1000px; }
.sku-editor .input.narrow { width: 100px; }

/* 1366×768 等矮屏：保持字号，不显示帮助卡，压缩侧栏间距 */
@media (max-height: 820px) {
  .workspace { margin: 12px 4px 10px; padding: 8px 10px; }
  .nav-group-label { margin: 8px 10px 2px; }
  .nav-item { padding: 7px 11px; }
  .sidebar-help { display: none; }
  .user-card { padding-top: 9px; }
  .content { padding-top: 22px; }
}

@media (max-height: 820px) {
  .brand { padding-top: 2px; }
  .workspace { margin: 8px 4px; padding: 7px 9px; }
  .nav-group-label { margin: 6px 10px 1px; font-size: 10px; }
  .nav-item { padding: 5px 11px; }
}

/* 登录页与权限矩阵 */
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f5f8ff, #edf3ff);
}

.login-card {
  width: 420px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand b { display: block; font-size: 18px; }
.login-brand span { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; letter-spacing: 1px; }
.login-kicker { margin-top: 28px; color: var(--blue); font-size: 10px; font-weight: 800; }
.login-card h1 { margin: 8px 0 6px; font-size: 26px; }
.login-card p { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin-top: 14px; color: var(--muted); font-size: 11px; }
.login-card input { display: block; width: 100%; height: 40px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; }
.login-error { min-height: 18px; margin-top: 10px; color: var(--red); font-size: 11px; }
.login-submit { width: 100%; margin-top: 8px; height: 40px; }
.login-accounts { display: grid; gap: 7px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-accounts span { color: var(--faint); font-size: 10px; }
.login-accounts button { border: 0; background: #f7f9fd; border-radius: 7px; padding: 8px; color: var(--muted); font-size: 10px; text-align: left; }
.perm-check { width: 16px; height: 16px; accent-color: var(--blue); }

/* =========================================================
   商品管理后台增强
   ========================================================= */
.product-overview .metric-card { min-height: 112px; }
.product-toolbar .field.search { width: 340px; }
.filter-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px;
  padding: 0 5px; border-radius: 9px; background: #f1f4f9; color: var(--faint); font-size: 10px;
}
.filter-chip.active .filter-count { background: #fff; color: var(--blue); }
.low-stock-chip.active { border-color: #ffd3cc; background: #fff2ef; color: var(--red); }
.low-stock-chip.active .filter-count { color: var(--red); }
.panel-head-note { color: var(--faint); font-size: 12px; white-space: nowrap; }
.product-table { table-layout: fixed; }
.product-table .table-product { min-width: 0; }
.product-cell-main { min-width: 0; }
.product-cell small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-cell b { max-width: 205px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-chips { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px; margin-top: 5px; overflow: hidden; }
.mini-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
  background: #f4f7fc; color: #5f6b7a; font-size: 10px; white-space: nowrap;
}
.mini-chip.more { background: var(--blue-soft); color: var(--blue); }
.product-category-tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-right: 5px;
  border-radius: 4px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 500;
}
.product-table th:nth-child(1), .product-table td:nth-child(1) { width: 36%; }
.product-table th:nth-child(2), .product-table td:nth-child(2) { width: 12%; }
.product-table th:nth-child(3), .product-table td:nth-child(3) { width: 14%; }
.product-table th:nth-child(4), .product-table td:nth-child(4) { width: 14%; }
.product-table th:nth-child(5), .product-table td:nth-child(5) { width: 12%; }
.product-table th:nth-child(6), .product-table td:nth-child(6) { width: 12%; }
.product-table td:nth-child(2), .product-table td:nth-child(3), .product-table td:nth-child(4), .product-table td:nth-child(5), .product-table td:nth-child(6) { white-space: nowrap; }
.product-table .money { white-space: nowrap; }
.product-status-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.product-list-panel .pagination { border-top: 0; }

.product-drawer { width: min(1180px, calc(100vw - 70px)); }
.drawer-title-block { min-width: 0; }
.drawer-title-line { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.drawer-title-line h2 { margin: 0 !important; }
.drawer-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.drawer-stat {
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(135deg, #fff, #f8faff);
}
.drawer-stat span { display: block; color: var(--muted); font-size: 11px; }
.drawer-stat b { display: block; margin-top: 5px; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.drawer-stat b small { margin-left: 3px; color: var(--faint); font-size: 11px; font-weight: 500; }
.drawer-stat.warning { border-color: #ffd6d1; background: linear-gradient(135deg, #fff, #fff5f3); }
.drawer-stat.warning b { color: var(--red); }

.product-image-field {
  display: flex; align-items: center; gap: 16px; padding: 13px; border: 1px dashed #cbd7ef;
  border-radius: 10px; background: #f8faff;
}
.product-image-preview {
  width: 82px; height: 82px; flex-shrink: 0; border: 1px solid #e5eaf5; border-radius: 9px;
  background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--faint); font-size: 11px;
}
.product-image-preview img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.product-image-meta { display: grid; gap: 5px; min-width: 0; }
.product-image-meta b { font-size: 13px; color: var(--ink); }
.product-image-meta span { color: var(--faint); font-size: 11px; }
.product-image-meta input[type="file"] { max-width: 360px; color: var(--muted); font-size: 12px; }
.product-image-status { color: var(--faint); font-size: 11px; line-height: 1.5; }
.product-image-status.uploading { color: var(--blue); }
.product-image-status.success { color: var(--green); }
.product-image-status.error { color: var(--red); }
.product-image-field.is-uploading { border-style: solid; border-color: #9db7ed; background: #f4f8ff; }
.product-image-field.is-uploading .product-image-preview { opacity: .65; }
.sku-editor-wrap { border: 1px solid var(--line); border-radius: 10px; }
.sku-editor-wrap .sku-editor th:first-child { border-radius: 9px 0 0 0; }
.sku-editor-wrap .sku-editor th:last-child { border-radius: 0 9px 0 0; }
.form-tip { margin-top: 10px; color: var(--faint); font-size: 11px; line-height: 1.6; }
.product-drawer .form-section-head { align-items: center; }

@media (max-width: 980px) {
  .drawer-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-toolbar .field.search { width: 100%; }
}








/* 产品型号图：用于小程序详情页点击规格后联动主图 */
.sku-image-control { display: flex; align-items: center; gap: 7px; min-width: 118px; cursor: pointer; }
.sku-image-preview {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  overflow: hidden; border: 1px solid #e5eaf5; border-radius: 8px;
  background: #fff; color: var(--faint); font-size: 10px; white-space: nowrap;
}
.sku-image-preview img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.sku-image-upload {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 9px; border: 1px solid #cbd7ef; border-radius: 7px;
  background: #f8faff; color: var(--primary); font-size: 11px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
}
.sku-image-control:hover .sku-image-upload { background: #eef4ff; border-color: #a9c2f5; }
.sku-image-control > input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

/* 商品编辑表单必须限制在抽屉高度内，否则产品型号表格会掉出可视区且无法滚动 */
.product-drawer > form { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.product-drawer .drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* 商品管理：三级会员价格展示 */
.product-table th:nth-child(1), .product-table td:nth-child(1) { width: 33%; }
.product-table th:nth-child(2), .product-table td:nth-child(2) { width: 10%; }
.product-table th:nth-child(3), .product-table td:nth-child(3) { width: 13%; }
.product-table th:nth-child(4), .product-table td:nth-child(4) { width: 20%; }
.product-table th:nth-child(5), .product-table td:nth-child(5) { width: 12%; }
.product-table th:nth-child(6), .product-table td:nth-child(6) { width: 12%; }
.member-price-stack { display: grid; gap: 3px; min-width: 146px; }
.member-price-line { display: flex; align-items: baseline; gap: 6px; line-height: 1.35; white-space: nowrap; }
.member-price-role { width: 28px; color: var(--muted); font-size: 10px; }
.member-price-line .money { font-size: 12px; font-variant-numeric: tabular-nums; }
.member-price-line small { color: var(--faint); font-size: 9px; }
.price-rule-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  margin-bottom: 10px; padding: 10px 12px; border: 1px solid #dce6ff;
  border-radius: 9px; background: #f5f8ff; color: var(--muted); font-size: 11px;
}
.price-rule-strip span { white-space: nowrap; }
.price-rule-strip b { color: var(--blue); font-weight: 800; }
.price-rule-strip .price-rule-note { margin-left: auto; color: var(--faint); }
.sku-editor { min-width: 1240px; }
.sku-editor .sku-sale-input { border-color: #b9c9e8; background: #f8faff; font-weight: 700; color: var(--ink); }
.sku-member-price {
  display: inline-flex; align-items: center; justify-content: flex-end; min-width: 84px;
  height: 34px; padding: 0 8px; border: 1px solid #e5eaf2; border-radius: 7px;
  background: #fafbfd; color: var(--orange); font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sku-member-price .muted { color: var(--faint); font-weight: 400; }
@media (max-width: 980px) {
  .price-rule-strip .price-rule-note { width: 100%; margin-left: 0; }
}

/* 13 列表格在 1366 宽度下完整展示，避免钻石会员价被横向裁切 */
.sku-editor { min-width: 1110px; }
.sku-editor .input.narrow { width: 84px; }
.sku-editor .sku-name-input { min-width: 96px; }
.sku-editor .sku-sale-input { width: 92px; }
.sku-editor .sku-member-price { min-width: 74px; padding: 0 6px; }
.sku-image-control { min-width: 92px; gap: 5px; }
.sku-image-preview { width: 34px; height: 34px; flex-basis: 34px; }
.sku-image-upload { height: 28px; padding: 0 7px; font-size: 10px; }

/* 紧凑列宽：确保普通/金卡/钻石三档价格在常见桌面宽度内完整可见 */
.sku-editor { min-width: 1040px; }
.sku-editor th, .sku-editor td { padding-left: 3px; padding-right: 3px; }
.sku-editor .input.narrow { width: 78px; }
.sku-editor .sku-name-input { min-width: 88px; }
.sku-editor .sku-sale-input { width: 86px; }
.sku-editor .sku-member-price { min-width: 68px; padding: 0 5px; }
.sku-image-control { min-width: 82px; gap: 4px; }
.sku-image-preview { width: 30px; height: 30px; flex-basis: 30px; }
.sku-image-upload { height: 26px; padding: 0 5px; font-size: 9px; }

/* 桌面端商品抽屉加宽，保证 13 列价格表完整、可读 */
.product-drawer { width: min(1480px, calc(100vw - 20px)); }
.sku-editor { min-width: 1140px; }
.sku-editor th, .sku-editor td { padding-left: 3px; padding-right: 3px; }
.sku-editor .input.narrow { width: 88px; }
.sku-editor .sku-name-input { min-width: 98px; }
.sku-editor .sku-sale-input { width: 92px; }
.sku-editor .sku-member-price { min-width: 74px; padding: 0 5px; }
.sku-editor .row-del { min-width: 30px; white-space: nowrap; }
.sku-image-control { min-width: 88px; gap: 4px; }
.sku-image-preview { width: 32px; height: 32px; flex-basis: 32px; }
.sku-image-upload { height: 27px; padding: 0 5px; font-size: 9px; }

/* 最终列宽：适配 1270px 常见桌面视口，13 列无需横向滚动 */
.sku-editor { min-width: 1090px; }
.sku-editor .input.narrow { width: 84px; }
.sku-editor .sku-name-input { min-width: 92px; }
.sku-editor .sku-sale-input { width: 88px; }
.sku-editor .sku-member-price { min-width: 70px; padding: 0 4px; }
.sku-editor .row-del { min-width: 26px; }
.sku-image-control { min-width: 84px; }
.sku-image-upload { padding: 0 4px; }

/* 为三档价格表再释放少量横向空间 */
.product-drawer .form-section { padding-left: 14px; padding-right: 14px; }

/* 图片悬停放大预览 */
.image-hover-zoom {
  position: fixed; z-index: 140; width: 260px; height: 260px; padding: 12px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: 0 18px 48px rgba(15, 32, 64, .18);
  display: grid; place-items: center; pointer-events: none;
  opacity: 0; visibility: hidden; transform: scale(.96);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

/* =========================================================
   首页广告管理
   ========================================================= */
.banner-table th:nth-child(1), .banner-table td:nth-child(1) { width: 190px; }
.banner-table th:nth-child(2), .banner-table td:nth-child(2) { width: 72px; }
.banner-table th:nth-child(5), .banner-table td:nth-child(5) { width: 120px; }
.banner-table th:nth-child(6), .banner-table td:nth-child(6) { width: 92px; }
.banner-table th:nth-child(7), .banner-table td:nth-child(7) { min-width: 230px; }

.banner-list-preview {
  position: relative; width: 176px; aspect-ratio: 2.5 / 1; border-radius: 10px;
  overflow: hidden; color: #fff; border: 1px solid rgba(0, 27, 92, .1);
  box-shadow: 0 4px 12px rgba(15, 34, 67, .08);
}
.banner-list-preview.tone-green { background: linear-gradient(135deg,#0033A0 0%,#1B4FD1 74%,#3568E6 100%); }
.banner-list-preview.tone-gold { background: linear-gradient(135deg,#B94B12 0%,#E36A1C 68%,#F08A45 100%); }
.banner-list-preview.tone-ink { background: linear-gradient(135deg,#001B5C 0%,#123A8F 100%); }
.banner-list-preview.tone-blue { background: linear-gradient(135deg,#00246F 0%,#2459C9 100%); }
.banner-list-preview.tone-orange { background: linear-gradient(135deg,#B94B12 0%,#F08A45 100%); }
.banner-list-preview.tone-deep { background: linear-gradient(135deg,#00143D 0%,#0C2C66 100%); }
.banner-list-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .48; }
.banner-list-copy { position: absolute; inset: 0; z-index: 1; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(90deg, rgba(0,16,55,.42), transparent 82%); }
.banner-list-copy small { display: block; font-size: 8px; letter-spacing: .4px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-list-copy b { display: -webkit-box; margin-top: 3px; font-size: 12px; line-height: 1.25; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.banner-no-image { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; opacity: .75; }
.banner-sort-no { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: #f1f5fc; color: var(--blue); font-size: 13px; }
.text-link:disabled { opacity: .3; cursor: not-allowed; }

.banner-modal { width: min(760px, calc(100vw - 44px)); }
.banner-image-field {
  display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px dashed #bdcbea;
  border-radius: 12px; background: linear-gradient(135deg, #f8faff, #fff);
}
.banner-image-preview {
  width: 300px; max-width: 46%; aspect-ratio: 2.5 / 1; flex-shrink: 0; display: grid; place-items: center;
  overflow: hidden; border-radius: 9px; border: 1px solid #dfe6f3; background: #eef3fc;
  color: var(--faint); text-align: center; font-size: 11px; line-height: 1.55;
}
.banner-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-image-meta { display: grid; gap: 7px; min-width: 0; }
.banner-image-meta b { color: var(--ink); font-size: 13px; }
.banner-image-meta b em { color: var(--red); font-style: normal; }
.banner-image-meta > span { color: var(--faint); font-size: 11px; line-height: 1.45; }
.banner-image-meta input[type="file"] { max-width: 360px; color: var(--muted); font-size: 12px; }
.banner-image-field.is-uploading { border-style: solid; border-color: #91ace3; background: #f4f8ff; }
.banner-image-field.is-uploading .banner-image-preview { opacity: .62; }
.banner-upload-note { display: flex; flex-direction: column; gap: 6px; }
.banner-upload-note b { color: var(--ink); font-size: 13px; }
.banner-upload-note span { color: var(--muted); line-height: 1.6; }
.banner-form-note { margin: 0; line-height: 1.65; }

@media (max-width: 760px) {
  .banner-image-field { align-items: stretch; flex-direction: column; }
  .banner-image-preview { width: 100%; max-width: none; }
}
.image-hover-zoom.show { opacity: 1; visibility: visible; transform: scale(1); }
.image-hover-zoom img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
