:root {
  --brand: #1f5fd6;
  --brand-dark: #17479f;
  --brand-soft: #eaf1ff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --ink: #16202e;
  --ink-2: #48566b;
  --ink-3: #7a8798;
  --line: #e6eaf1;
  --bg: #f5f7fb;
  --card: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(22, 32, 46, .06);
  --shadow: 0 8px 24px rgba(22, 32, 46, .08);
  --shadow-lg: 0 18px 48px rgba(22, 32, 46, .16);
  --sidebar: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff;
}
.login-side {
  position: relative; padding: 56px; color: #fff; overflow: hidden;
  background: linear-gradient(150deg, #12326e 0%, #1f5fd6 55%, #2f7bf0 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-side::after {
  content: ""; position: absolute; inset: auto -120px -180px auto; width: 520px; height: 520px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.login-side::before {
  content: ""; position: absolute; inset: -140px auto auto -100px; width: 360px; height: 360px;
  border-radius: 50%; background: rgba(255,255,255,.06);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.login-brand .logo {
  width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; backdrop-filter: blur(4px);
}
.login-hero { position: relative; z-index: 1; max-width: 460px; }
.login-hero h1 { font-size: 34px; line-height: 1.3; margin: 0 0 16px; font-weight: 650; letter-spacing: -.5px; }
.login-hero p { margin: 0 0 26px; color: rgba(255,255,255,.82); line-height: 1.9; font-size: 14.5px; }
.login-points { display: grid; gap: 12px; }
.login-points div { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.9); font-size: 13.5px; }
.login-points .dot { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.login-foot { font-size: 12.5px; color: rgba(255,255,255,.6); position: relative; z-index: 1; }
.login-main { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.3px; }
.login-card .sub { color: var(--ink-3); margin-bottom: 28px; font-size: 13.5px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,95,214,.12); }
.input::placeholder { color: #a9b4c4; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); cursor: pointer; transition: all .15s; white-space: nowrap; font-weight: 500;
}
.btn:hover { border-color: #cdd7e6; color: var(--ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eef2f8; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-danger { color: var(--danger); border-color: #f3d3d3; background: #fff7f7; }
.btn-danger:hover { background: #feecec; border-color: #eab6b6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.login-hint { margin-top: 22px; padding: 12px 14px; border-radius: 10px; background: #f6f9ff; border: 1px solid #e2ecff; color: var(--ink-2); font-size: 12.5px; line-height: 1.8; }
.login-hint b { color: var(--brand); }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: #0f1c33; color: #c7d2e4;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30;
}
.sb-brand { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 18px; color: #fff; font-weight: 600; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sb-brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1f5fd6); display: grid; place-items: center; }
.sb-brand small { display: block; font-size: 10.5px; color: #7f90ab; font-weight: 400; letter-spacing: .6px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 10px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
.sb-nav::-webkit-scrollbar { width: 8px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 4px; }
.sb-group { margin: 10px 8px 4px; font-size: 11.5px; color: #eaf1fd; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; opacity: .92; }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: #c7d2e4; cursor: pointer; font-size: 13px; margin-bottom: 1px; transition: background .15s, color .15s;
}
.sb-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-item.active { background: linear-gradient(90deg, rgba(59,130,246,.32), rgba(59,130,246,.14)); color: #fff; }
.sb-item.active .ic { color: #7fb2ff; }
.sb-item .badge-dot { margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px; padding: 1px 6px; border-radius: 9px; }
.sb-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11.5px; color: #6d7f9c; }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.tb-title { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.tb-crumb { color: var(--ink-3); font-size: 12.5px; }
.tb-spacer { flex: 1; }
.tb-search { position: relative; }
.tb-search .input { width: 232px; padding-left: 34px; background: #f4f7fc; border-color: transparent; }
.tb-search svg { position: absolute; left: 11px; top: 9px; color: var(--ink-3); }
.tb-action { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; position: relative; }
.tb-action:hover { background: #eef2f8; }
.tb-action .dot { position: absolute; top: 6px; right: 7px; min-width: 15px; height: 15px; padding: 0 3px; background: var(--danger); color: #fff; font-size: 9.5px; border-radius: 8px; display: grid; place-items: center; }
.tb-user { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 10px; cursor: pointer; }
.tb-user:hover { background: #eef2f8; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #4f8cf7, #1f5fd6); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.tb-user .meta { line-height: 1.35; }
.tb-user .meta b { font-size: 13px; font-weight: 600; display: block; }
.tb-user .meta span { font-size: 11.5px; color: var(--ink-3); }
.tb-menu {
  position: absolute; right: 24px; top: 58px; width: 180px; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; box-shadow: var(--shadow); padding: 6px; z-index: 40;
}
.tb-menu div { padding: 9px 11px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.tb-menu div:hover { background: #f2f6fd; color: var(--ink); }

.content { padding: 22px 24px 40px; flex: 1; }

/* ---------- 多标签页栏（紧凑 + 右键菜单） ---------- */
.tabbar {
  display: flex; align-items: center; gap: 3px; padding: 4px 8px 0;
  background: #eef2f9; border-bottom: 1px solid var(--line);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex: none;
  scroll-behavior: smooth;
}
.tabbar::-webkit-scrollbar { height: 0; }
.tabbar .tab {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 8px;
  background: #dde5f2; border: 1px solid #cdd8e8; border-bottom: none;
  border-radius: 6px 6px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; user-select: none; transition: background .15s, color .15s;
  flex: 0 0 auto; max-width: 10em;
}
.tabbar .tab:hover { background: #e9eefb; color: var(--ink); }
.tabbar .tab.active { background: #fff; color: var(--brand); font-weight: 600; border-color: var(--line); }
.tabbar .tab .t-name { overflow: hidden; text-overflow: ellipsis; }
.tabbar .tab .t-close {
  display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 3px;
  color: var(--ink-3); font-size: 0; opacity: 0; transition: opacity .15s; flex: none;
}
.tabbar .tab:hover .t-close, .tabbar .tab.active .t-close { opacity: 1; }
.tabbar .tab .t-close:hover { background: rgba(239,68,68,.14); color: var(--danger); }
.tabbar .tab .t-close .ic { width: 10px; height: 10px; }
/* 标签右键菜单 */
.tab-menu {
  position: fixed; z-index: 9999; min-width: 132px; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 26px rgba(20, 38, 70, .16); font-size: 12.5px; color: var(--ink-2);
}
.tm-item {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 6px; cursor: pointer;
}
.tm-item:hover { background: var(--brand-soft); color: var(--brand); }
.tm-item .ic { width: 12px; height: 12px; }
.tm-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.page-head p { margin: 5px 0 0; color: var(--ink-3); font-size: 13px; }
.page-head .spacer { flex: 1; }

/* ---------- 卡片 / 栅格 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }

.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.kpi .kic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .kic.ok { background: #e8f7ee; color: var(--ok); }
.kpi .kic.warn { background: #fdf3e6; color: var(--warn); }
.kpi .kic.danger { background: #fdecec; color: var(--danger); }
.kpi .kv { font-size: 24px; font-weight: 650; letter-spacing: -.6px; line-height: 1.25; }
.kpi .kl { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.kpi .kd { font-size: 12px; margin-top: 6px; color: var(--ok); }
.kpi .kd.down { color: var(--danger); }

/* ---------- 表格 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; padding: 8px 11px; }
.toolbar .grow { flex: 1; }
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th {
  text-align: left; font-weight: 600; color: var(--ink-3); background: #fafbfe;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px;
}
table.tb td { padding: 12px 14px; border-bottom: 1px solid #f0f3f8; color: var(--ink-2); vertical-align: middle; }
table.tb tbody tr:hover td { background: #f8fafe; }
table.tb td .strong { color: var(--ink); font-weight: 550; }
table.tb .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--ink-2); }
table.tb .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb .ops { display: flex; gap: 6px; }
table.tb .ops a { color: var(--brand); cursor: pointer; font-size: 13px; }
table.tb .ops a.danger { color: var(--danger); }
table.tb .ops a:hover { text-decoration: underline; }
/* 通用行内操作链接（卡片/列表场景） */
.op-link { color: var(--brand); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.op-link:hover { text-decoration: underline; }
.op-danger, .op-link.op-danger { color: var(--danger); }
.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 10px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 13px 18px; color: var(--ink-3); font-size: 12.5px; }
.pager .spacer { flex: 1; }
.pager button { min-width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 12px; background: #eef2f8; color: var(--ink-2); white-space: nowrap; }
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.ok { background: #e8f7ee; color: #12783a; }
.tag.warn { background: #fdf3e6; color: #a15c04; }
.tag.danger { background: #fdecec; color: #b91c1c; }
.tag.info { background: var(--brand-soft); color: var(--brand-dark); }
.tag.plain { background: #f2f4f8; color: var(--ink-3); }
.tag.plain::before { display: none; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .48); display: grid; place-items: center; z-index: 100; padding: 24px; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal.wide { max-width: 760px; }
.modal.slim { max-width: 420px; }
@keyframes pop { from { transform: translateY(10px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .spacer { flex: 1; }
.modal-head .x { cursor: pointer; color: var(--ink-3); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
.modal-head .x:hover { background: #f1f4f9; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.req::after { content: " *"; color: var(--danger); }

.detail-rows { display: grid; gap: 0; }
.drow { display: flex; padding: 10px 0; border-bottom: 1px dashed #eef1f6; font-size: 13.5px; }
.drow .k { width: 108px; color: var(--ink-3); flex: none; }
.drow .v { color: var(--ink); flex: 1; }

.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast {
  padding: 10px 18px; border-radius: 10px; background: #16202e; color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow); animation: slide .2s ease;
}
@keyframes slide { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.err { background: #b91c1c; }
.toast.ok { background: #12783a; }

/* ---------- 图表 ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 10px 4px 0; }
.chart-bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bars .pair { display: flex; gap: 4px; align-items: flex-end; height: 100%; }
.chart-bars .bar { width: 12px; border-radius: 4px 4px 2px 2px; background: var(--brand); transition: height .4s ease; min-height: 2px; }
.chart-bars .bar.out { background: #9ec1f7; }
.chart-bars .lbl { font-size: 11.5px; color: var(--ink-3); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

.rank { display: grid; gap: 12px; }
.rank-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.rank-row .idx { width: 20px; height: 20px; border-radius: 6px; background: #f0f4fb; color: var(--ink-3); display: grid; place-items: center; font-size: 11.5px; }
.rank-row:nth-child(1) .idx { background: #fff1e6; color: #c2410c; }
.rank-row:nth-child(2) .idx { background: #eef2f8; color: #475569; }
.rank-row:nth-child(3) .idx { background: #fdf6e3; color: #92400e; }
.rank-row .rmeta { min-width: 0; }
.rank-row .rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rbar { height: 5px; border-radius: 3px; background: #eef2f8; margin-top: 5px; overflow: hidden; }
.rank-row .rbar i { display: block; height: 100%; background: linear-gradient(90deg, #4f8cf7, #1f5fd6); }
.rank-row .rval { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.list-plain { display: grid; gap: 1px; }
.list-plain .row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px dashed #eef1f6; font-size: 13px; }
.list-plain .row:last-child { border-bottom: 0; }
.list-plain .row .t { color: var(--ink-3); font-size: 12px; margin-left: auto; }

.item-editor { display: grid; gap: 8px; }
.item-row { display: grid; grid-template-columns: 1.6fr .7fr .8fr 32px; gap: 8px; align-items: center; }
.item-row .del { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.item-row .del:hover { color: var(--danger); border-color: #f0c9c9; background: #fff7f7; }

/* 物料选择器：输入关键词过滤下拉（物料多时纯 select 没法用） */
.item-row .mat-pick { position: relative; min-width: 0; }
.mat-pick .mat-q { width: 100%; padding-right: 30px; }
.mat-pick::after {
  content: ''; position: absolute; right: 10px; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.mat-pop {
  position: absolute; z-index: 2600; top: calc(100% + 4px); left: 0; min-width: 280px; max-height: 240px;
  overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16); padding: 6px;
}
.mat-opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.mat-opt:hover { background: #f4f7fc; }
.mat-opt .mo-code { color: var(--brand); font-family: var(--mono, monospace); flex: none; }
.mat-opt .mo-name { color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-opt .mo-spec { color: var(--ink-3); font-size: 12px; flex: none; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-none { padding: 10px; color: var(--ink-3); font-size: 12.5px; text-align: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; }
.tab { padding: 12px 14px; cursor: pointer; color: var(--ink-3); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 550; }

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; width: 232px; }
  .main { margin-left: 0; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .tb-search { display: none; }
  .content { padding: 16px; }
}
.menu-btn { display: none; }
@media (max-width: 900px) { .menu-btn { display: grid; } }

/* ---------- 图片上传 / 画廊 ---------- */
.img-uploader { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.iu-list { display: flex; flex-wrap: wrap; gap: 8px; }
.iu-item { position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f4f7fc; }
.iu-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iu-del {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: rgba(17, 24, 39, .62); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0;
}
.iu-del .ic { width: 11px; height: 11px; }
.iu-add {
  width: 76px; height: 76px; border: 1px dashed #c3cfe2; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-3); font-size: 12px; cursor: pointer; text-align: center; line-height: 1.4; background: #fafcff;
}
.iu-add:hover { border-color: var(--brand); color: var(--brand); }
.iu-add { flex-direction: column; gap: 2px; }
.iu-add .ic { width: 14px; height: 14px; display: block; }
.iu-plus { color: inherit; display: block; }
.iu-tip { flex-basis: 100%; color: var(--ink-3); font-size: 12px; }
.img-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.img-gallery a { display: block; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.img-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 登录验证码 / 记住密码 ---------- */
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row .input { flex: 1; }
.captcha-img {
  width: 120px; height: 40px; flex: none; cursor: pointer; object-fit: cover;
  border: 1px solid var(--line); border-radius: 8px; background: #f4f7fc;
}
.login-tip { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.login-remember {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); margin: 2px 0 14px; user-select: none;
}

/* ---------- 工具栏控件统一高度（UI-03/UI-04） ---------- */
.toolbar { row-gap: 8px; }
/* 高度固定后垂直内边距必须归零：文本框/下拉由浏览器在内容盒内垂直居中。
   若保留 padding:8px，34px 高度里内容盒只剩 16px，中文行高约 20px，文字底部会被裁掉。 */
.toolbar .input, .toolbar .select {
  height: 34px; box-sizing: border-box; padding-top: 0; padding-bottom: 0;
}
.toolbar .btn, .toolbar .btn-sm {
  height: 34px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px;
  padding-top: 0; padding-bottom: 0;
}
.page-head .btn { height: 36px; display: inline-flex; align-items: center; }

/* ---------- 日期框（文本框 + 自绘日历） ---------- */
.date-field { position: relative; display: inline-flex; align-items: center; flex: 0 1 auto; }
.date-field > .date-input {
  min-width: 130px; padding-right: 30px; cursor: pointer;
  /* 只读文本框：点击交给自绘面板，避免软键盘与手输非法日期 */
}
.date-field > .date-input::placeholder { color: var(--ink-3); opacity: 1; }
.date-field .cal-ic {
  position: absolute; right: 9px; width: 15px; height: 15px;
  color: var(--ink-3); pointer-events: none;
}
.date-field:hover .cal-ic { color: var(--ink-2); }

.cal-pop {
  position: fixed; z-index: 3000; width: 244px; box-sizing: border-box;
  padding: 10px 12px 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(22, 32, 46, .16);
  font-size: 13px; color: var(--ink);
  user-select: none;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { font-weight: 600; font-size: 13.5px; }
.cal-nav {
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); font-size: 16px; line-height: 1;
}
.cal-nav:hover { background: var(--bg); color: var(--brand); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; color: var(--ink-3); font-size: 12px; padding: 4px 0; }
.cal-day {
  text-align: center; padding: 5px 0; border-radius: 6px;
  cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums;
}
.cal-day:hover { background: var(--brand-soft); color: var(--brand); }
.cal-day.out { color: var(--ink-3); opacity: .5; }
/* 早于 data-min 的日期：禁选（如期望到货日期不得早于今天） */
.cal-day.dis { color: #c3ccd8; opacity: .55; cursor: not-allowed; }
.cal-day.dis:hover { background: none; color: #c3ccd8; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--brand); }
.cal-day.sel { background: var(--brand); color: #fff; }
.cal-day.sel:hover { background: var(--brand-dark); color: #fff; }
.cal-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
}
.cal-foot a { color: var(--brand); cursor: pointer; font-size: 12.5px; }
.cal-foot a:hover { text-decoration: underline; }

/* ---------- 表格勾选列 ---------- */
table.tb th.col-check, table.tb td.col-check { width: 34px; padding-right: 0; text-align: center; }
table.tb .row-check, table.tb .check-all { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }

/* ---------- 登录密码可见切换 ---------- */
.pwd-wrap { position: relative; display: flex; }
.pwd-wrap .input { flex: 1; padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 15px;
  color: var(--ink-3); padding: 4px; line-height: 1;
}
.pwd-eye:hover { color: var(--brand); }
