:root {
  --bg: #0d1526;
  --panel: #141f33;
  --panel-2: #16233c;
  --ink: #e8eef7;
  --ink-2: #9fb0c6;
  --ink-3: #6b7d97;
  --line: #223047;
  --line-soft: #1c2940;
  --brand: #2f7df6;
  --brand-2: #4d90f8;
  --brand-soft: #1c3a66;
  --gold: #f0a13a;
  --red: #f0524d;
  --green: #2fc58a;
  --amber: #f0a13a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px -18px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(900px 420px at 15% 0%, #16233c, transparent),
    radial-gradient(700px 380px at 100% 100%, #182643, transparent), var(--bg);
}
.login-card {
  width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 36px 34px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 18px; margin: 0 0 6px; letter-spacing: .5px; color: #fff; }
.login-card p.sub { margin: 0 0 26px; color: var(--ink-3); font-size: 12.5px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: #0e1728; outline: none; transition: .15s; color: var(--ink);
}
.field input:focus { border-color: var(--brand-2); background: #0e1728; box-shadow: 0 0 0 3px rgba(47, 125, 246, .15); }
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 8px;
  padding: 8px 15px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-2); background: #1b2c49; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #2466d4; border-color: #2466d4; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger { color: var(--red); border-color: #4a2730; }
.btn-danger:hover { background: #3a1f28; border-color: var(--red); }
/* 二级页面返回键 */
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.btn.btn-back { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; font-size: 13px; white-space: nowrap; color: var(--brand-2); border-color: #24437a; background: #16233c; }
.btn.btn-back:hover { background: #1c3050; border-color: var(--brand); }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
aside {
  background: #0b1322; color: #8fa3bf; padding: 0 0 20px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line-soft);
}
.brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .5px; }
.brand span { font-size: 11px; color: #5c7190; letter-spacing: 1.4px; }
nav { padding: 10px 8px; overflow: auto; flex: 1; }
nav .group {
  font-size: 11px; color: #5c7190; letter-spacing: 1.3px; padding: 14px 12px 6px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none;
}
nav .group:hover { color: #8fa3bf; }
nav .group i { font-style: normal; font-size: 13px; color: #4a5f7c; }
nav a {
  display: flex; align-items: center; gap: 9px; color: #8fa3bf; text-decoration: none;
  padding: 8px 12px; border-radius: 8px; font-size: 13.2px; cursor: pointer; transition: .12s;
}
nav a:hover { background: rgba(255, 255, 255, .05); color: #d7e2f2; }
nav a.on { background: var(--brand); color: #fff; font-weight: 500; }
nav a .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.aside-foot { padding: 12px 16px; font-size: 11.5px; color: #5c7190; border-top: 1px solid rgba(255, 255, 255, .06); }

main { padding: 20px 24px 36px; max-width: 1720px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.tb-main { min-width: 0; flex: 1; }
.topbar h2 {
  font-size: 20px; margin: 0; font-weight: 600; letter-spacing: .3px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 页面说明固定单行，超长省略，悬停看全文——避免页头被撑成多行 */
.topbar .hint {
  color: var(--ink-3); font-size: 12.5px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.who { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); flex: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; }

/* ---------- 卡片 / 表格 ---------- */
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: 1.6fr 1fr; }
.card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card.tbl-card { padding: 14px 16px 12px; }
.card h3 { font-size: 13.5px; margin: 0 0 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .3px; }
.kpi { display: flex; flex-direction: column; justify-content: center; }
.kpi .label { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font-size: 23px; font-weight: 600; letter-spacing: -.4px; margin-top: 5px; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.kpi .val small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.kpi .delta { font-size: 12px; margin-top: 4px; color: var(--ink-3); }
.up { color: var(--red); }
.down { color: var(--green); }

/* 表格：整行单行显示（不换行）· 超宽横向滚动 · 操作列吸附右侧 */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tbl-more { font-size: 11.5px; color: var(--ink-3); padding: 6px 2px 0; }
.tbl-wrap.overflowing { scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
th {
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px;
  padding: 8px 11px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #101a2d; letter-spacing: .2px;
}
td {
  padding: 8px 11px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; white-space: nowrap; height: 40px;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #16233c; }
/* 长文本列：单行省略 + 悬停显示全文（避免多行撑高行距） */
td .cl {
  display: inline-block; max-width: 132px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
td .cl.wide { max-width: 240px; }
td .cl.id { max-width: 168px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11.8px; color: var(--ink-2); }
.nil { color: var(--ink-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.ops, td.ops {
  position: sticky; right: 0; z-index: 1; background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 16px -14px rgba(0, 0, 0, .95);
}
th.ops { background: #101a2d; }
tbody tr:hover td.ops { background: #16233c; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; color: var(--ink-2); }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: 11.5px;
  background: #1c2940; color: var(--ink-2); white-space: nowrap;
}
.tag.ok { background: rgba(47, 197, 138, .16); color: var(--green); }
.tag.warn { background: rgba(240, 161, 58, .16); color: var(--amber); }
.tag.bad { background: rgba(240, 82, 77, .16); color: var(--red); }
.tag.info { background: rgba(47, 125, 246, .18); color: var(--brand-2); }
.tag.gold { background: rgba(240, 161, 58, .16); color: var(--amber); }

.toolbar { display: flex; gap: 10px 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar select,
.toolbar input[type=date] {
  height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
  background: #0e1728; outline: none; color: var(--ink); font-size: 13px;
}
.toolbar input[type=search] { width: 230px; }
.toolbar input[type=search]:focus, .toolbar select:focus, .toolbar input[type=date]:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(47, 125, 246, .12);
}
.toolbar .btn { height: 32px; display: inline-flex; align-items: center; }
.spacer { flex: 1; }

/* 筛选条：一行排布、字段等宽对齐、操作按钮靠右 */
.card.filter-card { padding: 12px 16px; margin-bottom: 12px; }
/* 筛选条：始终单行（不换行），窗口过窄时横向滚动而非折行 */
.filterbar {
  display: flex; align-items: center; gap: 10px 14px; margin: 0;
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
}
.filterbar .tb-field, .filterbar .btn { flex: none; }
.filterbar::-webkit-scrollbar { height: 5px; }
.toolbar .grow, .filterbar .grow { margin-left: auto; }
.filterbar .tb-field select { min-width: 118px; }
.filterbar .tb-field input[type=date] { min-width: 128px; }

.empty { padding: 36px; text-align: center; color: var(--ink-3); font-size: 13px; }
.muted { color: var(--ink-3); }
.note {
  background: #2a2113; border: 1px solid #3d3119; color: #d8b46a;
  padding: 11px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.7;
}
.note.ok { background: rgba(47, 197, 138, .1); border-color: rgba(47, 197, 138, .32); color: #6fe0b0; }
.note.bad { background: rgba(240, 82, 77, .1); border-color: rgba(240, 82, 77, .34); color: #ff9a96; }
.toast {
  position: fixed; right: 24px; bottom: 24px; background: #0e1728; color: #fff;
  padding: 11px 16px; border-radius: 9px; font-size: 13px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; z-index: 99; max-width: 420px;
  border: 1px solid var(--line);
}
.toast.on { opacity: 1; transform: none; }
.toast.err { background: #3a1f28; border-color: #4a2730; }

.switch { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.switch:last-child { border-bottom: 0; }
.switch .n { flex: 1; font-size: 13px; }
.switch .k { font-size: 11.5px; color: var(--ink-3); }
.toggle {
  width: 38px; height: 21px; border-radius: 100px; background: #2a3a55; position: relative;
  cursor: pointer; transition: .18s; flex: none;
}
.toggle::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.toggle.on { background: var(--brand); }
.toggle.on::after { transform: translateX(17px); }

.bar { height: 7px; border-radius: 100px; background: #1c2940; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 12px; flex-wrap: wrap; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

pre.json {
  background: #0e1728; border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  font-size: 12px; overflow: auto; max-height: 320px; color: var(--ink-2);
}

/* ---------- 弹窗 / 抽屉 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(5, 10, 20, .6); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px;
  overflow: auto;
}
.modal {
  width: min(680px, 96vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, .7); animation: pop .16s ease;
}
.modal.wide { width: min(940px, 96vw); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.modal .m-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
}
.modal .m-head b { font-size: 15px; color: #fff; }
.modal .m-x { border: 0; background: none; font-size: 17px; color: var(--ink-3); cursor: pointer; line-height: 1; padding: 4px; }
.modal .m-body { padding: 18px 20px; max-height: 70vh; overflow: auto; }
.modal .m-foot { padding: 13px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: flex-end; }

.drawer-mask { position: fixed; inset: 0; background: rgba(5, 10, 20, .55); z-index: 60; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); z-index: 61;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px -22px rgba(0, 0, 0, .6);
  animation: slide .18s ease; display: flex; flex-direction: column;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer .d-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
.drawer .d-head b { color: #fff; }
.drawer .d-body { padding: 16px 20px; overflow: auto; flex: 1; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.fi label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.fi label .req { color: var(--red); font-style: normal; margin-right: 3px; }
.fi input, .fi select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #0e1728; outline: none; transition: .15s; color: var(--ink);
}
.fi input:focus, .fi select:focus { border-color: var(--brand-2); background: #0e1728; }
.fi textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #0e1728; outline: none; transition: .15s; color: var(--ink); resize: vertical;
  font: inherit; line-height: 1.6; min-height: 56px;
}
.fi textarea:focus { border-color: var(--brand-2); background: #0e1728; }
.fi .tip { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 6px; border: 1px solid var(--line); }
.quals-list { margin-bottom: 8px; }
.quals-list .qual-row input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: #0e1728; outline: none; color: var(--ink); font: inherit; font-size: 13px;
}
.quals-list .qual-row input:focus { border-color: var(--brand-2); }

/* ---------- 标签页 / 徽标 ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; padding: 7px 13px; cursor: pointer; font-size: 13px;
  color: var(--ink-2); border-radius: 7px 7px 0 0; border-bottom: 2px solid transparent;
}
.tabs button.on { color: var(--brand-2); border-bottom-color: var(--brand-2); font-weight: 600; }
.badge {
  display: inline-block; min-width: 17px; padding: 0 5px; height: 17px; border-radius: 100px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 17px; text-align: center;
  margin-left: 6px; font-weight: 500;
}
nav a .badge { margin-left: auto; background: #e0504d; }

/* ---------- 趋势图 ---------- */
.trend-chart { width: 100%; height: 190px; }
.trend-legend { display: flex; gap: 18px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }

/* ---------- 待办卡 ---------- */
.todo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.todo {
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; cursor: pointer;
  transition: .14s; background: var(--panel-2);
}
.todo:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.todo .n { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }
.todo .n.hot { color: var(--red); }
.todo .l { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 详情列表 ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; }
.kv .k { font-size: 11.5px; color: var(--ink-3); }
.kv .v { font-size: 13.5px; font-weight: 500; margin-top: 1px; color: var(--ink); }
details.box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; background: var(--panel-2); }
details.box summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
details.box[open] summary { margin-bottom: 8px; }
.link { color: var(--brand-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.mini-input {
  width: 86px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px;
  background: #0e1728; color: var(--ink);
}
.icon-btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); border-radius: 6px; cursor: pointer;
  padding: 4px 10px; font-size: 12px;
}
.icon-btn:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* ---------- 寄售管理二级子菜单 ---------- */
.split { display: flex; gap: 14px; align-items: flex-start; }
.subnav {
  width: 196px; flex: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; position: sticky; top: 16px;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.subnav::-webkit-scrollbar { width: 4px; }
.subnav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.subnav .grp { font-size: 11px; color: var(--ink-3); padding: 10px 10px 4px; font-weight: 600; }
.subnav .grp + .grp, .subnav button + .grp { border-top: 1px dashed var(--line-soft); margin-top: 4px; }
.subnav button {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 8px 10px; font-size: 13px; color: var(--ink-2); border-radius: 7px;
}
.subnav button:hover { background: #16233c; color: var(--brand-2); }
.subnav button.on { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.subbody { flex: 1; min-width: 0; }
.subbody .card { margin-bottom: 14px; }
/* 寄售商品管理：顶部横向子 tab 栏（区别于左侧竖排二级菜单） */
.subnav-sm { width: auto; flex: none; display: flex; gap: 6px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; position: static; max-height: none; overflow: visible; margin-bottom: 12px; }
.subnav-sm button { display: inline-block; width: auto; text-align: center;
  padding: 7px 14px; font-size: 13px; color: var(--ink-2); border-radius: 7px; }
.subnav-sm button:hover { background: #16233c; color: var(--brand-2); }
.subnav-sm button.on { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.subbody-inline .card { margin-bottom: 14px; }
.subbody-inline .card:last-child { margin-bottom: 0; }
.kv2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 18px; }
.pill-note { font-size: 12px; color: var(--ink-3); }

/* ---------- 通用输入控件 ---------- */
input.in, .in input { background: #0e1728; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 6px 9px; }
input.in:focus { border-color: var(--brand-2); outline: none; }

/* 滚动条统一 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a3a55; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 面包屑（对齐目标设计稿：管理后台 / 分组 / 页面） ---------- */
.crumb { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.crumb i { font-style: normal; color: #4a5f7c; margin: 0 5px; }
.crumb b { color: var(--brand-2); font-weight: 500; }

/* ---------- 筛选字段标签 ---------- */
.tb-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* ---------- 操作列链接式按钮 ---------- */
.ops { white-space: nowrap; }
.op-link {
  border: 0; background: none; cursor: pointer; padding: 2px 3px;
  color: var(--brand-2); font-size: 12.2px;
}
.op-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.op-link.danger { color: var(--red); }
.op-link + .op-link { margin-left: 3px; }

/* ---------- 空态 ---------- */
.empty { padding: 36px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty-img { display: grid; place-items: center; gap: 8px; padding: 18px 0; }
.empty-img .ico { font-size: 34px; opacity: .45; filter: grayscale(.4); }
.empty-img p { margin: 0; }

/* ---------- 分页器 ---------- */
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 2px 2px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap;
}
.pager-total { color: var(--ink-3); }
.pager select, .pager input {
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: #0e1728; color: var(--ink); outline: none; font-size: 12.5px;
}
.pager input[type=number] { width: 52px; text-align: center; }
.pg-btn {
  min-width: 27px; height: 27px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2); color: var(--ink-2); cursor: pointer; font-size: 12.5px;
}
.pg-btn:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand-2); }
.pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.pg-btn.num.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg-dots { color: var(--ink-3); padding: 0 2px; }
.pager-jump input { margin: 0 4px; }

/* ===== 分板块科目卡片 / 区块标题条（资金台账等数据集复用） ===== */
.sect-head {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 14px; padding-left: 10px;
  border-left: 3px solid var(--brand);
}
.sect-head b { font-size: 16px; color: var(--ink); }
.sect-head span { font-size: 12.5px; color: var(--ink-3); }
.ds-card { display: flex; flex-direction: column; gap: 2px; }
.ds-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px solid var(--line-soft);
}
.ds-card-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.ds-card-count {
  font-size: 11.5px; padding: 2px 9px; border-radius: 11px;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap;
}
.ds-card-body { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.ds-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--ink-2);
}
.ds-row b { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ds-card-foot { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-soft); font-size: 11.5px; color: var(--ink-3); }

/* ===== 响应式：窄屏下卡片自动降列，避免挤压换行 ===== */
@media (max-width: 1360px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g2 { grid-template-columns: 1.35fr 1fr; }
  .todo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 180px 1fr; }
  .g4, .g3, .g2 { grid-template-columns: repeat(2, 1fr); }
  .todo-grid { grid-template-columns: repeat(2, 1fr); }
  main { padding: 16px 16px 28px; }
}

/* 中等屏幕：筛选字段收窄，保证筛选条单行不溢出 */
@media (max-width: 1560px) {
  .filterbar { gap: 8px 10px; }
  .filterbar .tb-field input[type=search] { width: 176px; }
  .filterbar .tb-field select { min-width: 100px; }
  .filterbar .tb-field input[type=date] { min-width: 112px; }
}

/* ---------- 角色与数据范围（方案 4.1 / 4.2） ---------- */
.who-role { font-weight: 600; color: var(--ink); }
.who-scope {
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
  background: rgba(255, 255, 255, .06); color: var(--ink-3); border: 1px solid var(--line-soft);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.who-scope.is-scoped { background: rgba(240, 161, 58, .14); color: #f0c78a; border-color: rgba(240, 161, 58, .38); }
.who-scope.is-ro { background: rgba(77, 144, 248, .16); color: #a8c4ff; border-color: rgba(77, 144, 248, .4); }

/* 数据集页顶部的范围收敛提示条 */
.scope-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 14px; border-radius: 10px;
  background: rgba(240, 161, 58, .1); border: 1px solid rgba(240, 161, 58, .3);
  color: #f0c78a; font-size: 12.5px;
}
.scope-bar b { color: #ffd79a; }
.scope-bar span { font-weight: 600; color: var(--ink); }
.scope-bar em { font-style: normal; color: var(--ink-3); }

/* ---------- 侧栏折叠（L-T 布局：左侧导航可收为图标轨道） ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  display: none; width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  place-items: center; letter-spacing: 0;
}
nav a { position: relative; }
nav a .ico { display: none; }
.shell.nav-folded { grid-template-columns: 64px 1fr; }
.nav-folded .brand { justify-content: center; padding: 16px 0 14px; }
.nav-folded .brand .logo { display: grid; }
.nav-folded .brand-txt { display: none; }
.nav-folded nav { padding: 8px 6px; }
.nav-folded nav .group { display: none; }
.nav-folded nav a { justify-content: center; padding: 6px 0; gap: 0; width: 100%; }
.nav-folded nav a .dot, .nav-folded nav a .t { display: none; }
.nav-folded nav a .ico {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255, 255, 255, .05); color: #a8bcd6; font-size: 12.5px;
}
.nav-folded nav a:hover .ico { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-folded nav a.on .ico { background: rgba(255, 255, 255, .22); color: #fff; }
.nav-folded nav a .badge { position: absolute; top: 1px; right: 3px; margin: 0; transform: scale(.82); }
.nav-folded .aside-foot { display: none; }
.btn-fold { padding: 5px 10px; font-size: 13px; line-height: 1.2; }

/* ---------- 图表容器 / 卡片头部 ---------- */
.chart-box { width: 100%; height: 232px; min-width: 0; }
.chart-miss { display: grid; place-items: center; height: 100%; color: var(--ink-3); font-size: 12.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.alert-counts { display: flex; gap: 8px; align-items: center; }
.alert-counts .tag { font-variant-numeric: tabular-nums; }

/* ---------- 现货商品编辑：富文本 + 轮播图 + 榜单卡片 ---------- */
/* 富文本编辑器 */
.rt-editor { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #0e1728; }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); background: #0b1322; }
.rt-toolbar button { min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid transparent; background: none; color: var(--ink-2); font-size: 13px; cursor: pointer; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; }
.rt-toolbar button:hover { background: rgba(255,255,255,.08); color: #fff; }
.rt-toolbar button.on { background: var(--brand); color: #fff; }
.rt-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 3px 4px; }
.rt-area { min-height: 160px; padding: 12px 14px; font-size: 13.5px; line-height: 1.7; color: var(--ink); outline: none; overflow-y: auto; }
.rt-area:empty::before { content: attr(data-ph); color: var(--ink-3); }
.rt-count { text-align: right; font-size: 11.5px; color: var(--ink-3); padding: 4px 10px 8px; border-top: 1px solid var(--line-soft); }
/* 轮播图上传 */
.upload-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-box { width: 92px; height: 92px; border: 1px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); cursor: pointer; font-size: 11px; background: #0b1322; position: relative; overflow: hidden; }
.upload-box:hover { border-color: var(--brand-2); color: var(--brand-2); }
.upload-box img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.upload-box .del { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.upload-box:hover .del { display: flex; }
.upload-box .cover-badge { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(47,125,246,.85); color: #fff; font-size: 10px; text-align: center; padding: 1px 0; z-index: 2; }
/* 行情榜单卡片 */
.rank-card { border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
.rank-card .rk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rank-card .rk-head b { font-size: 14px; }
.rank-card .rk-head span { font-size: 11.5px; color: var(--ink-3); }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.rank-item:last-child { border-bottom: 0; }
.rank-item .rk-no { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.06); color: var(--ink-2); }
.rank-item .rk-no.n1 { background: #e0342c; color: #fff; }
.rank-item .rk-no.n2 { background: #e0712c; color: #fff; }
.rank-item .rk-no.n3 { background: #c9a12c; color: #fff; }
.rank-item .rk-name { flex: 1; font-size: 13px; }
.rank-item .rk-name .code { display: block; font-size: 11px; color: var(--ink-3); }
.rank-item .rk-val { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.rank-item .rk-val .sub { font-size: 11px; color: var(--ink-3); }
/* 行情详情面板 */
.quote-big { display: flex; align-items: baseline; gap: 12px; }
.quote-big .price { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quote-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px; margin-top: 10px; font-size: 12.5px; }
.quote-fields .qf { display: flex; justify-content: space-between; }
.quote-fields .qf span { color: var(--ink-3); }

/* toggle 开关（等级体系启用等） */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .tg { position: absolute; inset: 0; background: #2a3a55; border-radius: 11px; transition: .2s; cursor: pointer; }
.toggle .tg::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + .tg { background: var(--brand); }
.toggle input:checked + .tg::before { transform: translateX(18px); }

/* K线/趋势图默认模式 */
.chart-mode-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer; background: var(--panel); transition: border-color .15s, background .15s; }
.chart-mode-card input { margin-top: 3px; }
.chart-mode-card .cm-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.chart-mode-card .cm-desc { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.chart-mode-card.on { border-color: var(--brand); background: rgba(37, 99, 235, .08); }
.chart-mode-card.on .cm-title { color: var(--brand); }

/* 挂牌企业详情 */
.ent-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; margin-top: 14px; }
.ent-info-grid .ei { display: flex; flex-direction: column; gap: 4px; }
.ent-info-grid .ei span { font-size: 11.5px; color: var(--ink-3); }
.ent-info-grid .ei b { font-size: 13px; font-weight: 600; }

/* ================= 商城管理专用版面 ================= */
.m-section { font-size: 13.5px; font-weight: 700; color: var(--ink-1); padding: 4px 0 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.fee-priority { background: var(--ink-2, #f1f5f9); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.7; color: var(--ink-2, #475569); }
.fee-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; font-size: 13px; }
.fee-row > span:first-child { min-width: 110px; color: var(--ink-1); }
.fee-row input[type=number] { width: 120px; }
.zone-names { font-size: 11px; color: var(--ink-3); margin-top: 2px; max-width: 220px; }
.zone-sub { font-size: 11px; color: var(--ink-3); }
.chk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 12px; }
