:root {
  --bg: #F4F6FB;
  --panel: #FFFFFF;
  --ink: #101828;
  --ink2: #475467;
  --muted: #8A94A6;
  --line: #E7EBF3;
  --line2: #F0F3F8;
  --brand: #1F5BFF;
  --brand-600: #1948D8;
  --brand-soft: #EEF3FF;
  --ok: #0E9F6E;
  --ok-soft: #E7F8F1;
  --warn: #D97706;
  --warn-soft: #FFF5E5;
  --bad: #E5484D;
  --bad-soft: #FDEDEE;
  --vio: #7C3AED;
  --vio-soft: #F4EFFF;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 12px 32px -14px rgba(16, 24, 40, .18), 0 1px 2px rgba(16, 24, 40, .04);
  --r: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D7DDE9; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #C2CAD9; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局 ---------------- */
.shell { display: flex; min-height: 100vh; }

.side {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 238px;
  background: #FCFDFF;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2C6BFF 0%, #1846D8 100%);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -6px rgba(31, 91, 255, .7);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .3px; }
.brand-text span { font-size: 9.5px; color: var(--muted); letter-spacing: 1.4px; }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-group { padding: 14px 10px 6px; font-size: 11px; color: #A6AFC0; letter-spacing: .8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px; border-radius: 9px;
  color: var(--ink2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; position: relative; transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; opacity: .78; flex: none; }
.nav-item:hover { background: #F2F5FC; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--bad-soft); color: var(--bad);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}

.side-foot { border-top: 1px solid var(--line2); padding: 12px 8px 2px; }
.env-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: #6B7891; background: #F2F5FB;
  border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px;
}
.env-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 119, 6, .12); }
.env-tag.live { color: #0E9F6E; background: #EAF8F1; border-color: #CFEEDF; }
.env-tag.live i { background: var(--ok); box-shadow: 0 0 0 3px rgba(14, 159, 110, .14); }
.side-meta { font-size: 10.5px; color: #B0B8C7; margin-top: 10px; }

.content { margin-left: 238px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 62px; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(244, 246, 251, .86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.crumbs .sep { color: #C9D1DE; }
.top-right { display: flex; align-items: center; gap: 18px; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.user { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #E9EEFA;
  color: var(--brand); display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.user div { display: flex; flex-direction: column; line-height: 1.3; }
.user strong { font-size: 12.5px; font-weight: 600; }
.user small { font-size: 10.5px; color: var(--muted); }

.view { padding: 22px 28px 48px; max-width: 1440px; width: 100%; }

/* ---------------- 通用 ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #D3DAE8; color: var(--ink); background: #FAFBFE; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(31, 91, 255, .3); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #EDF1F9; color: var(--ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.danger { color: var(--bad); border-color: #F6D5D7; background: #fff; }
.btn.danger:hover { background: var(--bad-soft); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 14px; height: 14px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.1px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); }

.grid { display: grid; gap: 14px; }
.grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); margin-top: 14px; }
.grid-half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 14px; }
.mt14 { margin-top: 14px; }

/* KPI */
.kpi { padding: 16px 18px 14px; position: relative; overflow: hidden; }
.kpi-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.kpi-value {
  margin: 9px 0 6px; font-size: 26px; font-weight: 660; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 4px;
}
.kpi-value .unit { font-size: 14px; font-weight: 500; color: var(--muted); margin-right: 1px; }
.kpi-value .unit.tight { margin-left: -3px; }
.kpi-foot { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px;
  border-radius: 5px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.chip.up { color: var(--bad); background: var(--bad-soft); }
.chip.down { color: var(--ok); background: var(--ok-soft); }
.chip.flat { color: var(--muted); background: #F0F2F7; }

/* 图表 */
.chart-wrap { padding: 8px 10px 14px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 18px 18px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink2); }
.legend-item i { width: 8px; height: 8px; border-radius: 3px; }
.legend-item b { margin-left: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-item span { color: var(--muted); font-size: 11.5px; }

.donut-box { display: flex; align-items: center; gap: 6px; padding: 14px 18px 6px; }
.donut { flex: none; }
.donut-center { font-size: 11px; fill: var(--muted); }
.donut-total { font-size: 17px; font-weight: 660; fill: var(--ink); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted);
  padding: 10px 14px; background: #FAFBFE; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: .2px;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #FAFBFF; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tr.clickable { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.2px; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.paid { color: var(--ok); background: var(--ok-soft); }
.pill.pending { color: var(--warn); background: var(--warn-soft); }
.pill.closed { color: #7B8798; background: #F0F2F7; }
.pill.refunded { color: var(--vio); background: var(--vio-soft); }
.pill.failed { color: var(--bad); background: var(--bad-soft); }
.pill.plain::before { display: none; }

.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 6px; background: #F4F6FB; border: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink2);
}
.tag.wx { color: #0A9B55; background: #EAF8F0; border-color: #D3EFE1; }
.tag.ali { color: #1677FF; background: #EBF3FF; border-color: #D6E6FF; }
.tag.up { color: #C2410C; background: #FFF1E9; border-color: #FBDCCB; }
.tag.ecny { color: #B42318; background: #FDECEA; border-color: #F8D3CF; }
.tag.psn { color: #7C3AED; background: #F4EFFF; border-color: #E4D8FF; }

/* 工具条 */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.field { display: flex; align-items: center; gap: 6px; }
select, input[type="text"], input[type="number"], input[type="password"], textarea {
  height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
  font-size: 12.5px; color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
select { padding-right: 26px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238A94A6' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
input:focus, select:focus, textarea:focus { border-color: #9FB8FF; box-shadow: 0 0 0 3px rgba(31, 91, 255, .1); }
input::placeholder { color: #AEB7C6; }
.search { position: relative; }
.search input { width: 210px; padding-left: 30px; }
.search svg { position: absolute; left: 9px; top: 9px; width: 14px; height: 14px; color: var(--muted); }
.spacer { flex: 1; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 12px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pg {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink2); font-size: 12px; cursor: pointer;
}
.pg:hover { border-color: #D3DAE8; }
.pg.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pg[disabled] { opacity: .45; pointer-events: none; }

/* 通道卡 */
.ch-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ch-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ch-top { display: flex; align-items: center; gap: 12px; }
.ch-logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.ch-logo.wx { background: #E9F9F1; color: #0A9B55; }
.ch-logo.ali { background: #EAF2FF; color: #1677FF; }
.ch-logo.up { background: #FFF1E9; color: #C2410C; }
.ch-logo.ecny { background: #FDECEA; color: #B42318; }
.ch-logo.psn { background: #F4EFFF; color: #7C3AED; }
.ch-name { font-size: 14.5px; font-weight: 600; }
.ch-sub { font-size: 11.5px; color: var(--muted); }
.ch-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-top: 4px; }
.ch-metric span { font-size: 11.5px; color: var(--muted); display: block; }
.ch-metric b { font-size: 16px; font-weight: 620; font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 4px; background: #EEF1F7; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4A82FF, #1F5BFF); }
.ch-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line2); padding-top: 12px; }

/* 开关 */
.switch { width: 38px; height: 22px; border-radius: 20px; background: #DDE3EE; position: relative; cursor: pointer; transition: background .18s; border: none; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.2); transition: transform .18s; }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(16px); }

/* 收款码 */
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.code-card { padding: 14px; display: flex; gap: 14px; align-items: center; }
.code-thumb {
  width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; padding: 6px; flex: none; display: grid; place-items: center;
}
.code-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.code-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.code-sub { display: flex; gap: 8px; align-items: center; font-size: 11.5px; }
.code-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }

.drop {
  border: 1.5px dashed #D6DEEC; border-radius: 12px; padding: 18px;
  text-align: center; cursor: pointer; background: #FAFBFF;
  display: grid; place-items: center; min-height: 168px;
  transition: border-color .15s, background .15s;
}
.drop:hover { border-color: #9FB8FF; background: #F5F8FF; }
.drop svg { color: #9AA6BA; }
.drop img { max-width: 176px; max-height: 176px; object-fit: contain; border-radius: 8px; }


/* 待确认收款 */
.pending-card { margin-bottom: 14px; border-color: #FCE0B8; background: linear-gradient(180deg, #FFFDF8, #FFFFFF 90px); }
.pending-card .card-head { padding-bottom: 10px; }
.pending-card .pill.pending { margin-left: 4px; }
.pending-list { padding: 0 8px 10px; }
.pending-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px; border-radius: 11px;
}
.pending-row + .pending-row { border-top: 1px solid #F5F0E6; }
.pending-row:hover { background: #FFFCF6; }
.pr-left { min-width: 132px; }
.pr-amount { font-size: 19px; font-weight: 650; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.pr-remark { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pr-remark b { color: var(--ink); font-size: 12.5px; letter-spacing: 1px; }
.pr-mid { flex: 1; min-width: 0; font-size: 13px; }
.pr-right { display: flex; align-items: center; gap: 8px; flex: none; }
.pr-left-time { font-size: 11.5px; color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.warn-tag { color: #B45309; background: #FFF7E8; border-color: #FBE3B6; height: 20px; font-size: 10.5px; }
.claim-tag { color: #B42318; background: #FDECEA; border-color: #F8D3CF; height: 20px; font-size: 10.5px; font-weight: 600; }
.pending-row.claimed { background: #FFF9F8; }
.pending-row.claimed .pr-amount { color: #B42318; }
.warn-text { color: #B45309; }

.remark-chip {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px;
  background: #F3F6FC; color: #6B7891; font-size: 10.5px; letter-spacing: .5px;
}
.confirm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 11px; background: #F8FAFF; border: 1px solid #E6EDFF;
}
.nav-badge.hot { background: #FFF1E6; color: #C2410C; }

@media (max-width: 820px) {
  .pending-row { flex-wrap: wrap; gap: 10px; }
  .pr-mid { min-width: 140px; }
}


/* 收款码跳转链接 */
.code-link { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tag.jump-on { color: #0E9F6E; background: #EAF8F1; border-color: #CFEEDF; }
.jump-set {
  background: none; border: 0; padding: 0; color: #1F5BFF; font-size: 11px;
  cursor: pointer; font-family: inherit;
}
.jump-set:hover { text-decoration: underline; }

/* 空态 / 骨架 */
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, #F1F4FA 25%, #F7F9FD 37%, #F1F4FA 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 登录 */
.login-wrap {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 20% 0%, #E8EFFF 0%, #F4F6FB 45%, #F4F6FB 100%);
}
.login-card { width: 372px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 34px 32px 28px; box-shadow: 0 24px 60px -28px rgba(16, 24, 40, .3); }
.login-card .brand { padding: 0 0 22px; }
.login-card h2 { font-size: 19px; margin: 0 0 6px; }
.login-card p { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; }
.login-card label { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 6px; }
.login-card input { width: 100%; height: 40px; }
.login-card .btn { width: 100%; height: 40px; margin-top: 16px; font-size: 13.5px; }
.login-hint { margin-top: 14px; font-size: 11.5px; color: var(--muted); text-align: center; }
.login-err { color: var(--bad); font-size: 12px; margin-top: 10px; min-height: 17px; }

/* 抽屉 */
.scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, .32); opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 60; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 486px; max-width: 94vw;
  background: #fff; border-left: 1px solid var(--line); z-index: 70;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  display: flex; flex-direction: column; box-shadow: -20px 0 50px -30px rgba(16, 24, 40, .4);
}
.drawer.on { transform: none; }
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.dr-head h3 { margin: 0 0 3px; font-size: 15px; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 20px 26px; }
.dr-foot { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 8px; justify-content: flex-end; background: #FCFDFF; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: #F0F3F9; color: var(--ink); }

.amount-hero { padding: 18px; border-radius: 12px; background: linear-gradient(135deg, #F5F8FF, #FAFBFF); border: 1px solid #E6EDFF; }
.amount-hero .lbl { font-size: 11.5px; color: var(--muted); }
.amount-hero .val { font-size: 30px; font-weight: 680; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 9px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }

.timeline { margin: 0; padding: 0; list-style: none; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 20px; font-size: 12.5px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #CBD3E1; border: 2px solid #fff; box-shadow: 0 0 0 1px #DDE3EE; }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 13px; bottom: -1px; width: 1px; background: #E7EBF3; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.on::before { background: var(--brand); box-shadow: 0 0 0 1px #B9CCFF; }
.timeline b { font-weight: 600; }
.timeline span { color: var(--muted); font-size: 11.5px; display: block; }

.sec-title { font-size: 12px; font-weight: 600; color: var(--ink2); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line2); }

.log-item { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; font-size: 12px; }
.log-item .li-top { display: flex; align-items: center; gap: 8px; }
.log-item pre { margin: 8px 0 0; padding: 8px 10px; background: #FAFBFE; border-radius: 7px; font-family: var(--mono); font-size: 11px; color: var(--ink2); white-space: pre-wrap; word-break: break-all; max-height: 120px; overflow: auto; }

/* 弹窗 */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(16, 24, 40, .3); padding: 20px; }
.modal { width: 468px; max-width: 100%; background: #fff; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(16, 24, 40, .45); overflow: hidden; }
.modal-head { padding: 18px 20px 4px; display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-body { padding: 14px 20px 8px; display: flex; flex-direction: column; gap: 13px; }
.modal-body label { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 5px; }
.modal-body input, .modal-body select { width: 100%; height: 36px; }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: #101828; color: #fff; padding: 9px 16px; border-radius: 9px; font-size: 12.5px;
  opacity: 0; pointer-events: none; transition: all .22s; z-index: 100;
  box-shadow: 0 10px 30px -10px rgba(16, 24, 40, .5);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #B42318; }

/* 文档 */
.docs { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; }
.docs-nav { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a { font-size: 12.5px; color: var(--ink2); padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.docs-nav a:hover { background: #EDF1F9; }
.docs-nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.docs-body { min-width: 0; }
.docs-body h2 { font-size: 17px; margin: 0 0 10px; }
.docs-body h3 { font-size: 14px; margin: 24px 0 8px; }
.docs-body p, .docs-body li { font-size: 13px; color: var(--ink2); }
.code {
  position: relative; background: #0F1729; color: #D6E2FF; border-radius: 10px;
  padding: 14px 16px; overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7;
  margin: 10px 0; white-space: pre; tab-size: 4;
}
.code .k { color: #7FB0FF; }
.code .s { color: #9EE6B8; }
.code .c { color: #6B7A99; }
.copy-btn { position: absolute; top: 8px; right: 8px; height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid #2A3550; background: #17213A; color: #9FB0D0; font-size: 11px; cursor: pointer; }
.copy-btn:hover { color: #fff; border-color: #3B4A6B; }
.param-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0 4px; }
.param-tbl th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 7px 10px; background: #FAFBFE; border-bottom: 1px solid var(--line); }
.param-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.param-tbl td:first-child { font-family: var(--mono); font-size: 11.5px; color: var(--brand-600); }
.param-tbl .req { color: var(--bad); font-size: 10.5px; }
.callout { border-left: 3px solid var(--brand); background: var(--brand-soft); padding: 11px 14px; border-radius: 0 9px 9px 0; font-size: 12.5px; color: #23407F; margin: 12px 0; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); color: #7A4B0A; }

@media (max-width: 1180px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-half, .ch-list { grid-template-columns: minmax(0, 1fr); }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { display: none; }
}
@media (max-width: 820px) {
  .side { transform: translateX(-100%); transition: transform .2s; }
  .content { margin-left: 0; }
  .view, .topbar { padding-left: 16px; padding-right: 16px; }
  .clock, .user div { display: none; }
}
