:root {
  --blue: #0052d9;
  --blue-h: #366ef4;
  --blue-bg: #f2f3ff;
  --green: #2ba471;
  --green-bg: #e3f9e9;
  --amber: #e37318;
  --amber-bg: #fff1e9;
  --red: #d54941;
  --red-bg: #fff0ed;
  --page: #f3f3f3;
  --card: #ffffff;
  --surface: #ffffff;
  --topbar: #ffffff;
  --line: #e8e8e8;
  --line-soft: #f0f0f0;
  --line-strong: #c9c9c9;
  --th: #f7f8fa;
  --sum: #fafbfc;
  --hover: #f5f5f5;
  --track: #eef1f6;
  --badge: #f3f3f3;
  --t1: #1a1a1a;
  --t2: #4b4b4b;
  --t3: #8a8a8a;
  --shadow: 0 1px 10px rgba(0, 0, 0, .05), 0 4px 5px rgba(0, 0, 0, .05);
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --fs: 13px;
  --pad: 18px;
}

/* 深色主题：只覆盖令牌，不改结构 —— 这样所有页面自动跟着变 */
:root[data-theme='dark'] {
  --blue: #4582e6;
  --blue-h: #5e94ea;
  --blue-bg: #1b2a43;
  --green: #3aa87a;
  --green-bg: #17301f;
  --amber: #e08a3c;
  --amber-bg: #33231a;
  --red: #e05c53;
  --red-bg: #341c1a;
  --page: #181818;
  --card: #242424;
  --surface: #242424;
  --topbar: #1f1f1f;
  --line: #333333;
  --line-soft: #2c2c2c;
  --line-strong: #464646;
  --th: #262626;
  --sum: #282828;
  --hover: #2b2b2b;
  --track: #2e2e2e;
  --badge: #2e2e2e;
  --t1: #e8e8e8;
  --t2: #b5b5b5;
  --t3: #8a8a8a;
  --shadow: 0 1px 10px rgba(0, 0, 0, .35), 0 4px 5px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--t1);
  font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  height: 56px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-size: 15px; font-weight: 500; white-space: nowrap; }
.brand i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); margin-right: 8px; vertical-align: middle;
}
.meta { font-size: 12px; color: var(--t3); white-space: nowrap; }
.tabs { display: flex; gap: 4px; margin-left: auto; }

.tabs button {
  white-space: nowrap;
  border: none;
  background: transparent;
  color: var(--t2);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.tabs button:hover { background: var(--hover); }
.tabs button.on { background: var(--blue-bg); color: var(--blue); font-weight: 500; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 24px 60px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; }
.kpi .lb { font-size: 12px; color: var(--t3); }
.kpi .vl { font-family: var(--mono); font-size: 24px; font-weight: 500; margin-top: 2px; letter-spacing: -.5px; }
.kpi .vl small { font-size: 13px; font-weight: 400; color: var(--t3); margin-left: 2px; }
.kpi .sb { font-size: 11px; color: var(--t3); margin-top: 2px; }
.kpi.bad .vl { color: var(--red); }
.kpi.warn .vl { color: var(--amber); }
.kpi.ok .vl { color: var(--green); }

section { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 16px 18px; margin-bottom: 12px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.sec-h h2 { font-size: 14px; font-weight: 500; margin: 0; }
.sec-h span { font-size: 11px; color: var(--t3); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.wf { display: flex; height: 30px; border-radius: 4px; overflow: hidden; font-size: 11px; }
.wf div { display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; white-space: nowrap; }

.lg { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--t2); }
.lg i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  background: var(--th); color: var(--t2); font-weight: 400; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--hover); }
td.n, th.n { text-align: right; font-family: var(--mono); }
tr.click { cursor: pointer; }
tr.sum td { font-weight: 500; background: var(--sum); }
tr.mute td { color: var(--t3); }

.bar { height: 8px; background: var(--track); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 8px; background: var(--blue); border-radius: 2px; }

.lights { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.light { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.light b { font-weight: 500; min-width: 108px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--green); }
.dot.warn { background: var(--amber); }
.dot.bad { background: var(--red); }
.light span { color: var(--t3); font-size: 11.5px; }

.card3 { border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; background: var(--card); }
.card3 .hd { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--t3); }
.card3 .hh { font-family: var(--mono); font-size: 20px; font-weight: 500; margin: 4px 0 6px; }
.card3 ul { margin: 0; padding-left: 0; list-style: none; font-size: 11.5px; color: var(--t2); }
.card3 li { padding: 2px 0; }

.cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 130px; }
.col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.col i { display: block; background: var(--blue); border-radius: 2px 2px 0 0; min-height: 2px; }
.col em { font-style: normal; font-size: 9.5px; color: var(--t3); text-align: center; margin-top: 4px; display: block; }
.col.hi i { background: var(--red); }

.badge { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 3px; background: var(--badge); color: var(--t2); margin-left: 4px; }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.ok { background: var(--green-bg); color: var(--green); }

.note { font-size: 11.5px; color: var(--t3); margin-top: 10px; line-height: 1.7; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.pill b { font-family: var(--mono); font-weight: 500; }

.sim { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sim input {
  width: 140px; padding: 7px 10px; font-family: var(--mono); font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; outline: none;
}
.sim input:focus { border-color: var(--blue); }
.sim select, .sim button {
  padding: 7px 12px; font-family: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer;
}
.sim button { background: var(--blue); color: #fff; border-color: var(--blue); }
.sim button:hover { background: var(--blue-h); }

.empty { padding: 24px; text-align: center; color: var(--t3); font-size: 12px; }

/* ---------------------------------------------------------------- 增删改 */
.btn {
  padding: 6px 14px; font-family: inherit; font-size: 12.5px; color: var(--t1);
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: var(--hover); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--blue-h); border-color: var(--blue-h); }

.lk {
  border: none; background: none; color: var(--blue); font-family: inherit;
  font-size: 12px; cursor: pointer; padding: 2px 5px; border-radius: 4px;
}
.lk:hover { background: var(--blue-bg); }
.lk.danger { color: var(--red); }
.lk.danger:hover { background: var(--red-bg); }
td.op, th.op { text-align: right; white-space: nowrap; }
tr[data-act="edit"], tr[data-act="editloan"] { cursor: pointer; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.fi {
  padding: 6px 10px; font-family: inherit; font-size: 12.5px; color: var(--t1);
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); outline: none;
}
.fi:focus { border-color: var(--blue); }
input.fi { min-width: 210px; }
.filters .hint { font-size: 11px; color: var(--t3); margin-left: auto; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button {
  border: none; background: var(--surface); font-family: inherit; font-size: 12.5px;
  padding: 6px 12px; cursor: pointer; color: var(--t2);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--blue-bg); color: var(--blue); font-weight: 500; }

.tw { max-height: 520px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
table.rt thead th { position: sticky; top: 0; z-index: 1; background: var(--th); }
table.rt td { padding: 7px 10px; }
.tfoot {
  display: flex; align-items: center; gap: 12px; margin-top: 10px;
  font-size: 12px; color: var(--t2);
}
.tfoot .btn { margin-left: auto; }
td.mono, .montd { font-family: var(--mono); font-size: 12px; }
.sub { font-size: 11px; color: var(--t3); line-height: 1.4; }

.card3.link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.card3.link:hover { border-color: #c8d8f5; box-shadow: 0 2px 10px rgba(0, 82, 217, .07); }
.card3 .go { margin-left: auto; font-size: 11px; color: var(--blue); opacity: 0; transition: opacity .15s; }
.card3.link:hover .go { opacity: 1; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .34); display: none;
  align-items: flex-start; justify-content: center; z-index: 100; padding: 56px 16px;
  overflow: auto;
}
.modal.show { display: flex; }
.dlg {
  background: var(--card); border-radius: 9px; width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .18); overflow: hidden;
}
.dlg-h {
  display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.dlg-h h3 { margin: 0; font-size: 14px; font-weight: 500; }
.dlg-h .x {
  margin-left: auto; border: none; background: none; font-size: 20px; line-height: 1;
  color: var(--t3); cursor: pointer; padding: 0 4px;
}
.dlg-h .x:hover { color: var(--t1); }
.dlg-b { padding: 16px 18px; max-height: 62vh; overflow: auto; }
.dlg-f {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--sum);
}

.frow { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.frow > label:first-child {
  width: 78px; flex: none; font-size: 12.5px; color: var(--t2); text-align: right;
}
.frow > span { flex: 1; min-width: 0; display: flex; }
.frow > span > select, .frow > span > input { flex: 1; min-width: 0; }
.frow input[type="text"], .frow input[type="number"], .frow input[type="date"],
.frow input[type="month"], .frow select, .frow input:not([type]) {
  flex: 1; min-width: 0; padding: 7px 10px; font-family: inherit; font-size: 13px;
  color: var(--t1); border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  outline: none;
}
.frow input:focus, .frow select:focus { border-color: var(--blue); }
.frow .tip { font-size: 11px; color: var(--t3); flex: 1; line-height: 1.5; }
.frow .cb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--t2); }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 12px);
  background: #1a1a1a; color: #fff; font-size: 12.5px; padding: 9px 18px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #1f7a55; }
.toast.bad { background: #b8382f; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid3, .lights { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .tabs { margin-left: 0; width: 100%; overflow-x: auto; }
  main { padding: 14px; }
  .kpis { grid-template-columns: 1fr; }
  .cols { height: 100px; }
  .frow { flex-wrap: wrap; }
  .frow > label:first-child { width: 100%; text-align: left; }
  input.fi { min-width: 0; flex: 1; }
}

/* ================================================================ 「我的」页 */
.me { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: start; }
.me-nav {
  background: var(--card); border-radius: 9px; padding: 6px;
  box-shadow: var(--shadow); position: sticky; top: 72px;
}
.me-nav button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  color: var(--t2); font-size: 12.5px; font-family: inherit; padding: 9px 12px;
  border-radius: 6px; cursor: pointer; margin-bottom: 1px;
}
.me-nav button:hover { background: var(--hover); }
.me-nav button.on { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.me-nav .sep { height: 1px; background: var(--line-soft); margin: 6px 8px; }

.me > div { min-width: 0; }
.me-card {
  background: var(--card); border-radius: 9px; box-shadow: var(--shadow);
  padding: var(--pad); margin-bottom: 14px;
}
.me-card:last-child { margin-bottom: 0; }
.me-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.me-h h2 { margin: 0; font-size: 14px; font-weight: 500; }
.me-h .sp { margin-left: auto; display: flex; gap: 8px; }
.me-note { font-size: 11.5px; color: var(--t3); line-height: 1.7; }

.me-hero { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  font-weight: 500; flex: none; line-height: 1; overflow: hidden; white-space: nowrap;
  padding-bottom: 1px;
}
.me-hero .who b { display: block; font-size: 15px; font-weight: 500; }
.me-hero .who span { font-size: 12px; color: var(--t3); }

.row-set { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.row-set:last-child { border-bottom: none; padding-bottom: 0; }
.row-set .lb { flex: 1; min-width: 0; }
.row-set .lb b { display: block; font-weight: 400; font-size: 12.5px; color: var(--t1); }
.row-set .lb span { font-size: 11.5px; color: var(--t3); }
.row-set .ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.row-set .ctl input[type="text"], .row-set .ctl input[type="number"],
.row-set .ctl input[type="date"], .row-set .ctl select {
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  color: var(--t1); font-family: inherit; font-size: 12.5px; padding: 6px 9px; outline: none;
}
.row-set .ctl input:focus, .row-set .ctl select:focus { border-color: var(--blue); }

.sw {
  width: 38px; height: 22px; border-radius: 11px; background: var(--track);
  position: relative; cursor: pointer; border: none; flex: none; padding: 0;
  transition: background .18s;
}
.sw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s;
}
.sw.on { background: var(--blue); }
.sw.on::after { transform: translateX(16px); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button {
  border: none; background: var(--surface); color: var(--t2); font-family: inherit;
  font-size: 12px; padding: 6px 12px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--blue-bg); color: var(--blue); font-weight: 500; }

.code {
  position: relative; background: #1c1c1c; color: #d6d6d6; border-radius: 6px;
  padding: 13px 15px; font-family: var(--mono); font-size: 11.5px; line-height: 1.75;
  overflow: auto; white-space: pre; border: 1px solid #2c2c2c;
  max-width: 100%;
}
.code .cp {
  position: absolute; top: 7px; right: 7px; font-size: 11px; padding: 3px 9px;
  border-radius: 4px; background: #333; color: #ddd; border: 1px solid #444; cursor: pointer;
}
.code .cp:hover { background: #444; }

.tool { padding: 9px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: baseline; }
.tool:last-child { border-bottom: none; }
.tool .nm { font-family: var(--mono); font-size: 11.5px; color: var(--blue); flex: none; min-width: 158px; }
.tool .ds { font-size: 12px; color: var(--t2); flex: 1; }
.tool .tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; flex: none; }
.tool .tag.w { background: var(--amber-bg); color: var(--amber); }
.tool .tag.r { background: var(--badge); color: var(--t3); }

.mstat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mstat div { background: var(--sum); border-radius: 6px; padding: 10px 12px; }
.mstat b { display: block; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mstat span { font-size: 11px; color: var(--t3); }

.log-line { font-family: var(--mono); font-size: 11px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); display: flex; gap: 10px; }
.log-line .t { color: var(--t3); flex: none; }
.log-line .n { color: var(--blue); flex: none; min-width: 150px; }
.log-line .r { color: var(--t2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line.bad .n { color: var(--red); }

.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.kv { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.kv b { font-weight: 400; color: var(--t3); flex: none; min-width: 84px; }
.kv span { color: var(--t1); word-break: break-all; }

.changelog { font-size: 12px; color: var(--t2); line-height: 1.9; }
.changelog b { color: var(--t1); font-weight: 500; }

@media (max-width: 1120px) {
  .meta { display: none; }
  .tabs button { padding: 7px 10px; }
}

@media (max-width: 900px) {
  .me { grid-template-columns: 1fr; }
  .me-nav { position: static; display: flex; overflow-x: auto; gap: 2px; }
  .me-nav button { white-space: nowrap; width: auto; }
  .me-nav .sep { display: none; }
  .mstat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; }
}

/* 深色下代码块要更暗一档，否则和卡片糊在一起 */
:root[data-theme='dark'] .code { background: #131313; border-color: #3a3a3a; }
:root[data-theme='dark'] .code .cp { background: #3a3a3a; border-color: #4a4a4a; }

/* ================================================================
   V3 专业设计层 —— 腾讯 TDesign 取向
   原则：中性灰底 + 白卡 + 一处品牌色；层级靠留白和字重，不靠描边。
   本层只覆盖外观，不改任何 DOM 契约与业务类名。
   ================================================================ */
:root {
  --brand-soft: #e8f0ff;
  --hero-a: #f4f7ff;
  --hero-b: #eaf1ff;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 4px 14px rgba(16, 24, 40, .04);
  --card-shadow-hover: 0 2px 6px rgba(16, 24, 40, .06), 0 10px 24px rgba(16, 24, 40, .08);
  --radius: 8px;
}
:root[data-theme='dark'] {
  --brand-soft: #1b2a43;
  --hero-a: #1d2740;
  --hero-b: #1a2336;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --card-shadow-hover: 0 6px 20px rgba(0, 0, 0, .4);
}

/* ---- 顶栏：品牌识别 ---- */
.topbar {
  height: 60px; padding: 0 28px; gap: 22px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: .2px;
}
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #0052d9, #3b82f6);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 82, 217, .25);
}
.brand .vtag {
  font-size: 10px; font-weight: 500; color: var(--blue);
  background: var(--brand-soft); border-radius: 4px; padding: 1px 6px;
}
.brand i { display: none; }
.top-right {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--t3);
}
.top-right .status { display: inline-flex; align-items: center; gap: 6px; }
.top-right .status i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.top-right .who {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.tabs { margin-left: 0; gap: 2px; }
.tabs button {
  padding: 8px 13px; font-size: 12.5px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--t2);
  transition: background .16s, color .16s;
}
.tabs button svg { width: 15px; height: 15px; opacity: .75; }
.tabs button:hover { background: var(--hover); }
.tabs button.on { background: var(--brand-soft); color: var(--blue); font-weight: 600; }
.tabs button.on svg { opacity: 1; }

main { max-width: 1280px; padding: 26px 28px 72px; }

/* ---- 页头：每个页面都有的标题带 ---- */
.page-head {
  display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.page-head .ttl { min-width: 0; }
.page-head h1 {
  margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.3px;
  line-height: 1.3; color: var(--t1);
}
.page-head p {
  margin: 4px 0 0; font-size: 12.5px; color: var(--t3); line-height: 1.5;
}
.page-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  padding: 5px 10px; border-radius: 5px; background: var(--sum);
  color: var(--t2); border: 1px solid var(--line-soft); white-space: nowrap;
}
.chip b { font-family: var(--mono); font-weight: 500; color: var(--t1); }

/* ---- 首页 Hero：一个视觉焦点 ---- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(110deg, var(--hero-a), var(--hero-b));
  border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 24px; margin-bottom: 16px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px; align-items: center;
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -70px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 82, 217, .07), transparent 68%);
  pointer-events: none;
}
.hero .main .lb { font-size: 12px; color: var(--t2); display: flex; align-items: center; gap: 7px; }
.hero .main .amt {
  font-family: var(--mono); font-size: 40px; font-weight: 600;
  line-height: 1.15; letter-spacing: -1.5px; margin: 6px 0 2px; color: var(--t1);
}
.hero .main .amt small { font-size: 17px; font-weight: 400; letter-spacing: 0; color: var(--t3); }
.hero .main .desc { font-size: 12px; color: var(--t3); }
.hero .side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; z-index: 1; }
.hero .side > div {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 12px; min-width: 0;
}
.hero .side span { display: block; font-size: 11px; color: var(--t3); white-space: nowrap; }
.hero .side b {
  display: block; font-family: var(--mono); font-size: 17px; font-weight: 600;
  margin-top: 3px; white-space: nowrap;
}
.hero .side b.warn { color: var(--amber); }
.hero .side b.ok { color: var(--green); }

/* ---- KPI 卡：色条 + 图标 + 数值层级 ---- */
.kpis { gap: 14px; margin-bottom: 16px; }
.kpi {
  position: relative; overflow: hidden; padding: 15px 17px 16px;
  border-radius: var(--radius); box-shadow: var(--card-shadow);
  transition: transform .18s, box-shadow .18s;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: var(--blue); opacity: .85;
}
.kpi:nth-child(2)::before { background: #7b9fe0; }
.kpi:nth-child(3)::before { background: var(--green); }
.kpi:nth-child(4)::before { background: var(--amber); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.kpi .lb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t2); }
.kpi .lb svg { width: 14px; height: 14px; color: var(--blue); opacity: .8; }
.kpi .vl { font-size: 25px; letter-spacing: -.8px; margin-top: 8px; color: var(--t1); }
.kpi .sb { margin-top: 5px; font-size: 11px; }

/* ---- 卡片与分区标题 ---- */
section {
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px;
  box-shadow: var(--card-shadow);
}
.sec-h { align-items: center; gap: 9px; margin-bottom: 14px; }
.sec-h .ic {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  background: var(--brand-soft); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
}
.sec-h .ic svg { width: 14px; height: 14px; }
.sec-h h2 { font-size: 13.5px; font-weight: 600; }
.sec-h span { font-size: 11px; margin-left: auto; }

/* ---- 瀑布图：分块 + 圆角 ---- */
.wf { height: 34px; border-radius: 6px; gap: 2px; background: var(--track); padding: 2px; }
.wf div { border-radius: 3px; font-size: 10.5px; font-weight: 500; letter-spacing: .2px; }
.lg { gap: 16px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-soft); }
.lg i { width: 9px; height: 9px; border-radius: 3px; }

/* ---- 表格：专业数据表格 ---- */
table { font-size: 12.5px; }
th {
  background: var(--th); color: var(--t2); font-weight: 500;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
}
td { padding: 9px 12px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover); }
td.n, th.n { font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 4px; }
.bar i { height: 7px; border-radius: 4px; }

/* ---- 摘要卡 ---- */
.card3 { border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--card-shadow); }
.card3 .hd { font-size: 11.5px; }
.card3 .hh { font-size: 23px; margin: 6px 0 8px; }
.card3 .dot { margin-right: 2px; }

/* ---- 柱状图 ---- */
.cols { height: 132px; gap: 7px; }
.col i { border-radius: 3px 3px 0 0; }
.col em { font-size: 9.5px; }

/* ---- 按钮 / 徽标 / 提示 ---- */
.btn { border-radius: 6px; font-weight: 500; transition: all .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.btn.primary:hover { box-shadow: 0 3px 10px rgba(0, 82, 217, .25); }
.badge { border-radius: 4px; font-weight: 500; }
.note { font-size: 11.5px; line-height: 1.75; }
.pill { border-radius: 6px; }

/* ---- 我的页：设置卡也用同一套阴影 ---- */
.me-nav, .me-card { box-shadow: var(--card-shadow); border-radius: var(--radius); }
.me-card { padding: 18px 20px; }
.me-h h2 { font-size: 13.5px; font-weight: 600; }
.me-nav button { font-size: 12.5px; padding: 9px 12px; }
.avatar { box-shadow: 0 3px 12px rgba(0, 82, 217, .22); }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .hero .side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head .right { margin-left: 0; }
  .hero .side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero .main .amt { font-size: 32px; }
}

/* ================================================================
   V4 应用外壳 —— 登录页 + 左侧边栏（常规管理后台布局）
   ================================================================ */

/* ------------------------------------------------ 登录页 */
.login-page {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  background: var(--page);
}
.login-page[hidden], #shell[hidden] { display: none !important; }

.login-visual {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #0a47b8 0%, #0052d9 48%, #2b6fe0 100%);
  color: #fff; padding: 42px 56px;
  display: flex; flex-direction: column;
}
.login-visual::before {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  right: -220px; top: -220px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%);
}
.login-visual::after {
  content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  left: -180px; bottom: -240px; border: 1px solid rgba(255,255,255,.12);
}
.lv-brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 600; z-index: 1; }
.lv-brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.28);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
}
.lv-brand .vtag {
  font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 4px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.22);
}
.lv-main { margin: auto 0; z-index: 1; max-width: 520px; }
.lv-main h1 { font-size: 42px; line-height: 1.28; font-weight: 600; margin: 0 0 16px; letter-spacing: -.5px; }
.lv-main > p { font-size: 14px; color: rgba(255,255,255,.78); margin: 0 0 44px; }
.lv-feats { display: flex; flex-direction: column; gap: 22px; }
.lv-feats > div { display: flex; gap: 13px; align-items: flex-start; }
.lv-feats svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: rgba(255,255,255,.9); }
.lv-feats b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.lv-feats span { font-size: 12px; color: rgba(255,255,255,.7); }
.lv-foot { font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: 1.2px; z-index: 1; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--page); }
.login-box { width: 100%; max-width: 380px; }
.login-head { margin-bottom: 30px; }
.login-head h2 { font-size: 25px; font-weight: 600; margin: 0 0 6px; color: var(--t1); }
.login-head p { font-size: 13px; color: var(--t3); margin: 0; }
.only-mobile { display: none; }
#loginForm label:not(.cb) {
  display: block; font-size: 12.5px; color: var(--t2); margin: 16px 0 7px; font-weight: 500;
}
#loginForm input[type='text'], #loginForm input[type='password'] {
  width: 100%; height: 42px; padding: 0 13px; font-size: 13.5px; font-family: inherit;
  color: var(--t1); background: var(--surface); border: 1px solid var(--line);
  border-radius: 7px; outline: none; transition: border-color .16s, box-shadow .16s;
}
#loginForm input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--brand-soft); }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 0; }
.login-row .cb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--t2); cursor: pointer; }
.no-reg { font-size: 11px; color: var(--t3); background: var(--badge); padding: 2px 8px; border-radius: 4px; }
.login-err { min-height: 18px; margin-top: 12px; font-size: 12px; color: var(--red); }
.login-btn {
  width: 100%; height: 42px; margin-top: 2px; border: none; border-radius: 7px;
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 600;
  font-family: inherit; letter-spacing: 4px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 82, 217, .25); transition: background .16s, transform .16s;
}
.login-btn:hover { background: var(--blue-h); transform: translateY(-1px); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-tip {
  margin-top: 26px; padding: 12px 14px; border-radius: 7px;
  background: var(--brand-soft); color: var(--t2); font-size: 11.5px; line-height: 1.8;
}
.login-tip b { color: var(--blue); font-family: var(--mono); }
.login-copy { margin-top: 22px; text-align: center; font-size: 11px; color: var(--t3); }

/* ------------------------------------------------ 侧边栏 */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 20;
  background: var(--topbar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 0 12px;
}
.side-brand {
  height: 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; flex: none;
}
.side-brand .logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #0052d9, #3b82f6); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,82,217,.25);
}
.side-brand b { display: block; font-size: 13px; font-weight: 600; color: var(--t1); line-height: 1.3; }
.side-brand small { display: block; font-size: 9px; color: var(--t3); letter-spacing: .9px; }
.side-label {
  font-size: 10px; color: var(--t3); padding: 10px 12px 6px;
  letter-spacing: .8px; font-weight: 500; flex: none;
}
.sidebar .tabs { display: block; margin: 0; }
.sidebar .tabs button {
  display: flex; width: 100%; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 2px; font-size: 13px;
  border-radius: 6px; color: var(--t2); background: transparent;
  text-align: left; transition: background .15s, color .15s;
}
.sidebar .tabs button svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.sidebar .tabs button:hover { background: var(--hover); }
.sidebar .tabs button.on {
  background: var(--brand-soft); color: var(--blue); font-weight: 600;
}
.sidebar .tabs button.on svg { opacity: 1; }
.side-foot {
  margin-top: auto; padding: 12px 8px 16px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 8px; flex: none;
}
.side-user { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.avatar-mini {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft);
  color: var(--blue); display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex: none;
}
.side-user div { min-width: 0; }
.side-user b { display: block; font-size: 12px; font-weight: 500; color: var(--t1); white-space: nowrap; }
.side-user small { display: block; font-size: 10.5px; color: var(--t3); }
.logout {
  width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: transparent; color: var(--t3); cursor: pointer;
}
.logout svg { width: 16px; height: 16px; }
.logout:hover { background: var(--red-bg); color: var(--red); }

.main-wrap { margin-left: 232px; min-width: 0; }
.main-wrap .topbar {
  height: 56px; padding: 0 28px; gap: 16px;
  display: flex; align-items: center; background: var(--topbar);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.crumb { font-size: 12px; color: var(--t3); white-space: nowrap; }
.crumb b { color: var(--t1); font-weight: 500; }
.main-wrap .meta { margin-left: auto; }
.main-wrap .top-right { margin-left: 0; }

/* ------------------------------------------------ 响应式 */
@media (max-width: 1100px) {
  .sidebar { width: 68px; padding: 0 8px; }
  .side-brand { padding: 0; justify-content: center; }
  .side-brand > div, .side-label { display: none; }
  .sidebar .tabs button { justify-content: center; padding: 11px 0; font-size: 0; }
  .sidebar .tabs button svg { width: 19px; height: 19px; }
  .side-foot { justify-content: center; padding: 10px 0 14px; }
  .side-user div, .side-user .avatar-mini { display: none; }
  .main-wrap { margin-left: 68px; }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .only-mobile { display: inline-flex; }
}

/* 修正：固定层必须严格锁在视口内，否则底部会露出一条背景 */
.login-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.login-visual { height: 100%; }

/* 收敛：去掉 KPI 顶部装饰色条，只留白卡与数字 */
.kpi::before { display: none; }
.kpi { padding-top: 16px; }
.kpi .vl { font-size: 23px; margin-top: 6px; }
.page-head { margin-bottom: 16px; padding-bottom: 12px; }
.page-head h1 { font-size: 20px; }

/* V2.4：登录页左侧改为 1920×1080 淡色图片铺地，文字转深色 */
.login-visual {
  background: linear-gradient(90deg, rgba(255,255,255,.34), rgba(255,255,255,.58)),
              url('login-bg.png') center center / cover no-repeat;
  color: var(--t1);
}
.login-visual::before, .login-visual::after { display: none; }
.lv-brand { color: var(--t1); }
.lv-brand .logo {
  background: var(--blue); color: #fff; border: none;
  box-shadow: 0 2px 10px rgba(0, 82, 217, .28);
}
.lv-brand .vtag { background: rgba(255,255,255,.6); border-color: rgba(0,0,0,.08); color: var(--blue); }
.lv-main h1 { color: var(--t1); }
.lv-main > p { color: var(--t2); }
.lv-foot { color: var(--t3); }

/* V2.5：整页一张图铺满，取消左右分屏（去掉竖直接缝与底部圆角） */
.login-page {
  display: block;
  background: linear-gradient(90deg, rgba(255,255,255,.24), rgba(255,255,255,.46)),
              url('login-bg.png') center center / cover no-repeat;
}
.login-visual {
  position: absolute; left: 0; top: 0; bottom: 0; width: 52%;
  background: transparent; border-radius: 0; padding: 42px 56px;
}
.login-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: 48%;
  background: transparent; border-radius: 0;
  display: flex; align-items: center; justify-content: center; padding: 36px;
}
.login-box {
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 10px; padding: 32px 30px;
  box-shadow: 0 12px 40px rgba(16,24,40,.10);
}
@media (max-width: 900px) {
  .login-visual { display: none; }
  .login-panel { position: relative; width: 100%; height: 100%; }
  .login-box { max-width: 380px; }
}

/* 小窗口下压紧卡片，避免顶部被裁 */
.login-panel { padding: 20px 30px; }
.login-box { padding: 22px 26px; }
.login-head { margin-bottom: 20px; }
.login-head h2 { font-size: 22px; }
#loginForm label:not(.cb) { margin: 12px 0 5px; }
.login-row { margin-top: 14px; }
.login-tip { margin-top: 18px; padding: 10px 12px; }
.login-copy { margin-top: 14px; }

/* 根因：.login-visual / .login-panel 是 <section>，被全局 section 样式加了
   1px 边框（竖缝）、圆角（底部两个缺口）和 margin-bottom:12px（底部灰条） */
.login-visual, .login-panel {
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
}

/* ================================================================
   V2.6 排版系统 —— 统一字体 / 字号阶梯 / 字重 / 行距
   ================================================================ */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-num: 'Bahnschrift', 'DIN Alternate', 'Segoe UI', var(--font-sans);
  --lh-tight: 1.34;
  --lh-body: 1.65;
}
body {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: var(--lh-body);
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased;
}

/* 页面主标题：24 / 600 / 1.3 / 微负字距 */
.page-head { padding-bottom: 14px; margin-bottom: 18px; }
.page-head h1 {
  font-size: 24px; font-weight: 600; line-height: 1.3;
  letter-spacing: -.4px; color: var(--t1);
}
/* 区块标题：15 / 600 */
.sec-h { margin-bottom: 14px; }
.sec-h h2 {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  letter-spacing: -.1px; color: var(--t1);
}
.sec-h span { font-size: 11.5px; line-height: 1.5; }

/* 表格：表头 12.5/500 带字距，正文 13/1.55 */
th {
  font-size: 12.5px; font-weight: 500; letter-spacing: .3px;
  line-height: 1.5; color: var(--t2); padding: 10px 12px;
}
td { font-size: 13px; line-height: 1.55; padding: 10px 12px; }
td.n, th.n { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* KPI：数字 26/600 等宽 */
.kpi { padding: 16px 18px 17px; }
.kpi .lb { font-size: 12.5px; line-height: 1.5; letter-spacing: .2px; }
.kpi .vl {
  font-family: var(--font-num); font-size: 26px; font-weight: 600;
  letter-spacing: -.6px; line-height: 1.25; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.kpi .vl small { font-size: 13px; font-weight: 400; letter-spacing: 0; }
.kpi .sb { font-size: 11.5px; line-height: 1.55; margin-top: 6px; }

/* 登录页排版 */
.lv-brand { font-size: 15px; font-weight: 600; letter-spacing: .3px; line-height: 1.5; }
.lv-main h1 {
  font-size: 40px; font-weight: 600; line-height: 1.34;
  letter-spacing: -1px; margin-bottom: 14px;
}
.lv-main > p { font-size: 13.5px; line-height: 1.75; letter-spacing: .2px; }
.lv-foot { font-size: 10.5px; letter-spacing: 1.1px; line-height: 1.6; }
.login-head h2 { font-size: 24px; font-weight: 600; letter-spacing: -.3px; line-height: 1.35; }
.login-head p { font-size: 12.5px; line-height: 1.6; }
#loginForm label:not(.cb) { font-size: 12.5px; font-weight: 500; letter-spacing: .2px; line-height: 1.5; }
#loginForm input[type='text'], #loginForm input[type='password'] { font-size: 13.5px; letter-spacing: .2px; }
.login-btn { font-size: 14px; font-weight: 600; letter-spacing: 5px; }
.login-tip { font-size: 11.5px; line-height: 1.8; }
.login-copy { font-size: 11px; letter-spacing: .2px; }

/* 侧栏与面包屑 */
.sidebar .tabs button { font-size: 13px; letter-spacing: .2px; line-height: 1.5; }
.side-brand b { font-size: 13.5px; letter-spacing: .2px; }
.crumb { font-size: 12.5px; letter-spacing: .2px; }
.note, .me-note { font-size: 11.5px; line-height: 1.7; }

/* 收窄侧栏：上面的基础字号规则写在响应式块之后，会覆盖 font-size:0；
   这里在它之后再锁一次，保证 1100px 以下只显示图标且图标居中不裁切。 */
@media (max-width: 1100px) {
  .sidebar .tabs button { font-size: 0; letter-spacing: 0; }
}

/* ================================================================
   UNSLOP · 账本式精修层（克制 / 精确 / 可核对）
   九轮：间距 → 颜色 → 图标 → 文案 → 字体 → 布局 → 细节 → 视觉 → 动效
   只改外观，不动功能；不覆盖已修好的 880 窄屏侧栏规则。
   ================================================================ */
:root {
  /* 单一 graphite 灰阶，带一点冷味（账本/核对台的世界） */
  --page: #fafafa;
  --card: #ffffff;
  --surface: #ffffff;
  --topbar: #ffffff;
  --th: #fafafa;
  --sum: #f7f7f8;
  --hover: #f5f5f6;
  --track: #eeeeef;
  --badge: #f4f4f5;
  --line: rgba(23, 23, 23, .09);
  --line-soft: rgba(23, 23, 23, .06);
  --line-strong: rgba(23, 23, 23, .16);
  --t1: #171717;
  --t2: #525252;
  --t3: #737373;
  /* 语义色压低饱和，退回灰阶体系 */
  --green: #16a34a; --green-bg: #eef8f1;
  --amber: #a16207; --amber-bg: #fbf5e8;
  --red: #b42318;   --red-bg: #fdf0ee;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --radius: 12px;
}
:root[data-theme='dark'] {
  --page: #141415;
  --card: #19191b;
  --surface: #19191b;
  --topbar: #141415;
  --th: #1d1d1f;
  --sum: #202023;
  --hover: #232325;
  --track: #2a2a2d;
  --badge: #262628;
  --line: rgba(237, 237, 237, .09);
  --line-soft: rgba(237, 237, 237, .06);
  --line-strong: rgba(237, 237, 237, .16);
  --t1: #ededed;
  --t2: #a1a1a6;
  --t3: #85858b;
  --green: #4cc38a; --green-bg: #16261f;
  --amber: #c99a4a; --amber-bg: #2a2317;
  --red: #e5484d;   --red-bg: #2e1b1a;
  --shadow: none;
}

/* 1) 间距：4px 网格，同类同尺寸 */
main { padding: 24px 28px 64px; }
section { padding: 20px 24px; margin-bottom: 16px; }
.kpi { padding: 16px 20px 18px; }
.card3 { padding: 18px 20px; }
th { padding: 8px 12px; letter-spacing: 0; }
td { padding: 8px 12px; }
.me-card { padding: 20px 24px; }
.page-head { margin-bottom: 20px; padding-bottom: 12px; }

/* 2) 颜色：品牌蓝只留在选中/主按钮/结余；其余中性 */
.kpi:nth-child(2)::before, .kpi:nth-child(3)::before, .kpi:nth-child(4)::before {
  background: var(--line-strong);
}
.sec-h .ic { background: transparent; color: var(--t3); }
.badge { font-weight: 400; }
.badge.warn { color: var(--amber); }
.badge.bad { color: var(--red); }
.badge.ok { color: var(--green); }

/* 3) 图标：统一线性、文字色、同尺寸 */
.sec-h .ic svg, .tabs button svg { width: 16px; height: 16px; stroke-width: 1.6; color: inherit; }
.tabs button svg { color: var(--t3); }
.tabs button.on svg { color: var(--blue); }

/* 4) 文案见 index.html / app.js：标语为事实陈述，无标点 */

/* 5) 字体：字重 400/500，数字等宽统一 */
body { font-weight: 400; }
.page-head h1 { font-size: 28px; font-weight: 500; letter-spacing: -.3px; }
.sec-h h2 { font-weight: 500; }
.kpi .vl { font-weight: 500; font-size: 28px; letter-spacing: -.4px; }
.card3 .hh { font-weight: 500; }
.login-head h2 { font-weight: 500; }
.lv-main h1 { font-size: 36px; font-weight: 400; letter-spacing: -.8px; }

/* 6) 布局：KPI 节奏（主卡加重，不做跨列避免孤行），图表放大 */
.kpi:first-child { border-left: 2px solid var(--blue); }
.kpi:first-child .vl { font-size: 32px; }
.wf { height: 32px; gap: 0; background: var(--track); padding: 0; }
.wf div { border-radius: 0; }
.wf div:first-child { border-radius: 4px 0 0 4px; }
.wf div:last-child { border-radius: 0 4px 4px 0; }
.cols { height: 160px; }

/* 7) 细节：嵌套圆角、账本细横线、数字右对齐 */
.kpi .vl {
  position: relative; padding-bottom: 8px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.kpi .sb { margin-top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.bar { border-radius: 2px; }
.bar i { border-radius: 2px; }
.btn, .fi, .seg, .pill { border-radius: 8px; }
section, .me-card, .card3 { border-radius: var(--radius); }

/* 8) 视觉：登录页保留用户指定的淡色图，只压低标语区的花哨感 */
.lv-main h1 { color: var(--t1); }

/* 9) 动效：去 hover 抬升/缩放，只留颜色过渡 */
.kpi:hover, .btn:hover, .card3.link:hover { transform: none; }
.kpi { transition: border-color .15s, background-color .15s; }
.btn { transition: background-color .15s, border-color .15s; }
.btn:hover { box-shadow: none; }
.login-btn:hover { transform: none; }

/* 最后一轮：logo 去渐变（技能铁律：渐变 tile 是 AI 味）
   红/黄/绿状态点是数据质量红绿灯的语义色，保留，不作为装饰处理 */
.side-brand .logo, .lv-brand .logo {
  background: var(--blue);
  box-shadow: none;
}
.login-btn { box-shadow: none; }

/* MCP 页：配置里的长路径改为容器内换行，避免撑出横向滚动、
   也避免代码块被裁切导致「页面变大」的错觉。功能不变，复制出来仍是完整 JSON。 */
.code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* MCP 工具/日志改为只读弹窗展示，页面高度恒定，不再用文档流折叠 */

/* 局部滚动：滚动条只在主内容区，侧栏与顶栏固定不动 */
html, body { height: 100%; overflow: hidden; }
#shell { height: 100vh; height: 100dvh; overflow: hidden; }
.main-wrap { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.main-wrap .topbar { flex: none; }
main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* 卡片头对齐：标题固定在基线，副文案与按钮不再挤同一行造成错位 */
.me-h { align-items: flex-start; }
.me-h h2 { flex: none; line-height: 30px; }
.me-h .sp { align-items: center; min-height: 30px; }
.me-h .sp .btn { flex: none; }






/* Unslop 行高校正：同类同尺寸，靠统一的控件高度与间距自然对齐，
   不锁死行高、不裁切内容 —— 内容全部可见，页面不抖动。 */
.row-set { padding: 12px 0; align-items: center; }
.row-set .lb b, .row-set .lb span { line-height: 20px; }
.row-set .ctl { align-items: center; }
.row-set .ctl select, .row-set .ctl input[type="text"],
.row-set .ctl input[type="number"], .row-set .ctl input[type="date"] {
  height: 32px; line-height: 30px; padding: 0 10px; box-sizing: border-box;
}
/* 开关统一 32px 高，与输入框同一基线 */
.row-set .ctl .sw { height: 32px; }
/* 工具行：描述保持单行省略，但行高自然，不硬锁 */
.tool { align-items: center; padding: 10px 0; }
.tool .ds { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 每组最后一行不再去掉下边距，否则它比上面行矮 12px；保持一致 */
.row-set:last-child { padding-bottom: 12px; border-bottom: none; }

/* 管理后台：主内容区填满侧栏之外的全部宽度，不做居中窄栏
   （max-width + margin:auto 在宽屏下会把内容推到中间，左侧留大片空白） */
.main-wrap main { max-width: none; margin: 0; width: auto; }
