@font-face { font-family: "Noto Serif SC"; src: url("fonts/noto-serif-sc-700.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
/* 业务管理台：左侧导航 + 内容区；窄屏导航变顶部横向滚动 */
:root {
  --bg: #F3F1EC; --surface: #FBFAF7; --surface-2: #ECE9E1; --fg: #16211C; --muted: #6F766F; --line: #E2DFD6; --line-strong: #CFCBC0;
  --accent: #1E3A31; --accent-2: #2F5D4B; --accent-fg: #F6F3EC; --accent-soft: #E3EAE4; --gold: #B3914F; --gold-2: #DEC48C; --gold-soft: #F1E8D3;
  --danger: #A3402F; --danger-soft: #F3DDD8; --ok: #3C7A5A; --bar: #2F5D4B;
  --shadow: 0 18px 40px -24px rgba(22,33,28,.4);
  --font-display: "Noto Serif SC", "Songti SC", "STSong", serif; --font-body: "Noto Sans SC", "PingFang SC", system-ui, sans-serif; --font-mono: "JetBrains Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0F1513; --surface: #161D1A; --surface-2: #1F2824; --fg: #EDE9DF; --muted: #8E958E; --line: #27312C; --line-strong: #34403A;
  --accent: #DEC48C; --accent-2: #7FB69A; --accent-fg: #0F1513; --accent-soft: #223129; --gold: #DEC48C; --gold-2: #F0DDB0; --gold-soft: #2E2A1E;
  --danger: #E08A78; --danger-soft: #3A2320; --ok: #7FB69A; --bar: #7FB69A; --shadow: 0 18px 40px -24px rgba(0,0,0,.9); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0F1513; --surface: #161D1A; --surface-2: #1F2824; --fg: #EDE9DF; --muted: #8E958E; --line: #27312C; --line-strong: #34403A;
  --accent: #DEC48C; --accent-2: #7FB69A; --accent-fg: #0F1513; --accent-soft: #223129; --gold: #DEC48C; --gold-2: #F0DDB0; --gold-soft: #2E2A1E;
  --danger: #E08A78; --danger-soft: #3A2320; --ok: #7FB69A; --bar: #7FB69A; --shadow: 0 18px 40px -24px rgba(0,0,0,.9); color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-block: 0 32px; }
button, input, select, textarea { font: inherit; color: inherit; } button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; } [hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; } img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; } .mono { font-family: var(--font-mono); font-size: 12px; }
.top { display: flex; align-items: center; gap: 12px; padding-block: 16px; max-width: 1280px; margin: 0 auto; }
.top img { width: 38px; height: 38px; border-radius: 11px; }
.top strong { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .14em; display: block; line-height: 1.1; }
.top small { font-size: 10.5px; color: var(--muted); letter-spacing: .18em; }
.sp { flex: 1; }
.wrap { max-width: 1280px; margin: 0 auto; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .wrap { grid-template-columns: 196px minmax(0, 1fr); align-items: start; } .nav { position: sticky; top: 16px; flex-direction: column; } }
.nav { display: flex; gap: 2px; overflow-x: auto; background: var(--surface); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.nav button { border: 0; background: none; color: var(--muted); padding: 11px 14px; border-radius: 10px; text-align: left; white-space: nowrap; font-size: 14px; letter-spacing: .04em; }
.nav button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.panel { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; min-width: 0; display: grid; gap: 18px; align-content: start; }
.panel > *, .grid > * { min-width: 0; }
.ph { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ph h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: .08em; }
.ph h3 { font-family: var(--font-display); font-size: 16px; letter-spacing: .06em; }
.hint { color: var(--muted); font-size: 12.5px; }
.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-size: 13.5px; font-weight: 500; letter-spacing: .04em; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-fg); } .btn.ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--fg); } .btn.danger { background: var(--danger-soft); color: var(--danger); } .btn.gold { background: transparent; border: 1px solid var(--gold); color: var(--fg); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; } .btn:disabled { opacity: .45; cursor: not-allowed; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="tel"], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); padding: 8px 11px; font-size: 13.5px; color: var(--fg); }
input[type="color"] { width: 100%; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
textarea { resize: vertical; min-height: 64px; line-height: 1.5; } input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
.label { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; display: block; margin-bottom: 5px; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 760px) { .g3, .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2 { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: 11.5px; letter-spacing: .08em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; } td.act { white-space: nowrap; text-align: right; }
td .sub { display: block; font-size: 11.5px; color: var(--muted); }
.nw { white-space: nowrap; }
table.wide { min-width: 700px; }
table.wide td.act { position: sticky; right: 0; background: var(--surface); box-shadow: -10px 0 10px -10px rgba(0,0,0,.12); }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); display: inline-block; vertical-align: middle; background-size: cover; background-position: center; }
.thumb { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; display: inline-block; }
.pill.on { border-color: var(--accent-2); color: var(--accent-2); } .pill.off { border-color: var(--danger); color: var(--danger); } .pill.warn { border-color: var(--gold); color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; border-radius: 14px; background: var(--bg); display: grid; gap: 2px; }
.tile b { font-family: var(--font-display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile span { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; color: var(--muted); font-size: 13.5px; white-space: nowrap; position: relative; }
.tabs button[aria-pressed="true"] { color: var(--fg); font-weight: 500; }
.tabs button[aria-pressed="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 130px; }
.bar-cell { display: grid; grid-template-columns: minmax(40px, 1fr) auto; gap: 10px; align-items: center; min-width: 150px; }
.bar-track { height: 8px; }
.bar-track i { display: block; height: 100%; min-width: 2px; background: var(--bar); border-radius: 0 4px 4px 0; }
.daybars { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 8px; border-bottom: 1px solid var(--line-strong); position: relative; }
.daybars button { flex: 1 1 0; min-width: 4px; max-width: 42px; height: 100%; border: 0; padding: 0; background: none; display: flex; align-items: flex-end; }
.daybars button i { display: block; width: 100%; min-height: 2px; background: var(--bar); border-radius: 4px 4px 0 0; }
.daybars button:hover i, .daybars button:focus-visible i { background: var(--gold); }
.chart-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 6px; }
.tip { position: fixed; z-index: 40; background: var(--fg); color: var(--bg); font-size: 12px; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pkg-card { border-radius: 14px; overflow: hidden; background: var(--bg); display: grid; position: relative; }
.pkg-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.pkg-card .b { padding: 12px 14px 14px; display: grid; gap: 6px; }
.pkg-card .b b { font-weight: 600; font-size: 15px; }
.pkg-card .b small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pkg-card .row { display: flex; gap: 8px; align-items: center; }
.pkg-card .ck { position: absolute; left: 10px; top: 10px; width: 18px; height: 18px; accent-color: var(--accent-2); }
dialog { border: 0; border-radius: 18px; background: var(--surface); color: var(--fg); padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow); }
dialog.sm { width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(22,33,28,.55); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-family: var(--font-display); font-size: 18px; letter-spacing: .06em; flex: 1; }
.dlg-body { padding: 16px 22px; display: grid; gap: 14px; overflow: auto; max-height: calc(100vh - 190px); }
.dlg-foot { padding: 12px 22px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); padding: 4px 8px; }
.img-pick { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.img-pick .pv { aspect-ratio: 16/10; border-radius: 10px; background: var(--surface-2); object-fit: cover; width: 100%; }
.img-pick .pv[hidden] { display: block; visibility: hidden; }
input[type="checkbox"] { accent-color: var(--accent-2); }
.item-edit { display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.item-edit .it { display: grid; grid-template-columns: 28px minmax(0, 1fr) 80px 28px; gap: 8px; align-items: center; font-size: 13px; }
.item-edit input { padding: 5px 8px; text-align: right; }
.expr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.expr-chips button { border: 1px solid var(--line-strong); background: var(--bg); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; }
.expr-chips button.var { border-color: var(--gold); }
.readable { padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; line-height: 1.7; }
.param-table input, .param-table select { padding: 5px 8px; }
.test-box { padding: 14px; border-radius: 12px; background: var(--gold-soft); display: grid; gap: 10px; }
.err-text { color: var(--danger); font-size: 12.5px; min-height: 18px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; } .check input { accent-color: var(--accent-2); }
.login-card { max-width: 380px; margin: 12vh auto 0; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 30px 28px; display: grid; gap: 14px; }
.login-card h1 { font-family: var(--font-display); font-size: 22px; letter-spacing: .08em; }
.stat-chip { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: 12px; color: var(--muted); }
.stat-chip b { font-size: 16px; color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(10px); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 13.5px; opacity: 0; transition: .2s; pointer-events: none; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  table.wide td.act { position: static; box-shadow: none; }
}
