:root {
  color-scheme: light;
  --ink: #152233;
  --side: #101c2c;
  --side-soft: #1a2c40;
  --jade: #0e7a62;
  --jade-dark: #0b624e;
  --gold: #a67c2d;
  --bg: #eef2f4;
  --card: #fff;
  --line: #e3eaf0;
  --text: #1b2836;
  --muted: #6b7a89;
  --danger: #b4333c;
  --warn: #9a6408;
  --ok: #0e7a62;
  --shadow: 0 10px 30px rgba(18, 36, 56, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button.person { border: 0; background: transparent; padding: 0; text-align: left; }
.product-grid .product { width: 100%; }
button { cursor: pointer; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 0.85fr; }
.login-side {
  padding: 56px; color: #f6f3ec;
  background:
    radial-gradient(500px 240px at 80% 90%, rgba(214, 176, 96, 0.35), transparent 60%),
    linear-gradient(160deg, #122033, #145246 72%, #8d7040);
  display: flex; flex-direction: column; justify-content: space-between;
}
.mark { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.12); font-family: "Palatino Linotype", "Songti SC", serif; font-size: 28px; }
.login-side h1 { font-family: "Palatino Linotype", "Songti SC", "SimSun", serif; font-size: 56px; font-weight: 600; margin: 18px 0 8px; }
.login-side p { max-width: 460px; line-height: 1.7; opacity: .88; }
.fake-card { width: min(360px, 100%); border-radius: 18px; padding: 20px; background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.18); }
.fake-card b { display: block; font-size: 28px; margin: 18px 0 6px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 0 0 6px; font-size: 28px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.links { display: flex; gap: 16px; margin-top: 18px; }
.links a { color: var(--jade); text-decoration: none; }
.shell { display: flex; min-height: 100vh; }
.side { width: 228px; flex: none; background: var(--side); color: #d5deea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 18px 12px; }
.brand .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--jade); color: white; display: grid; place-items: center; font-family: "Palatino Linotype", "Songti SC", serif; font-size: 22px; }
.brand strong { display: block; color: white; font-size: 16px; }
.brand span { color: #8ea0b5; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 8px; overflow: auto; }
.nav button, .side-user button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; color: #d5deea; border-radius: 10px; padding: 10px 12px;
}
.nav button svg, .side-user button svg { width: 18px; height: 18px; flex: none; }
.nav button.active, .nav button:hover { background: var(--side-soft); color: white; }
.nav button.active { box-shadow: inset 3px 0 0 var(--gold); }
.side-user { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.who { padding: 8px 12px 10px; }
.who b { display: block; color: white; }
.who span { color: #8ea0b5; font-size: 12px; }
.main { flex: 1; min-width: 0; }
.topbar { height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0; font-size: 18px; font-weight: 650; }
.top-search { margin-left: auto; width: min(320px, 36vw); height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; background: #f7f9fb; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.content { padding: 22px 24px 40px; }
.stat-grid, .grid-2, .grid-main { display: grid; gap: 16px; }
.stat-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.grid-2 { grid-template-columns: 1.3fr 0.7fr; }
.grid-main { grid-template-columns: 360px 1fr; align-items: start; }
.stat, .panel, .dialog, .drawer { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.stat { padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; margin-top: 8px; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; color: var(--gold); font-size: 12px; }
.panel { padding: 16px 18px 18px; }
.panel-hd, .toolbar, .dialog-hd, .pager { display: flex; align-items: center; gap: 10px; }
.panel-hd, .dialog-hd { justify-content: space-between; margin-bottom: 12px; }
.panel h3, .dialog h3 { margin: 0; font-size: 16px; }
.toolbar { flex-wrap: wrap; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field.grow { flex: 1; min-width: 180px; }
input, select, textarea {
  width: 100%; border: 1px solid #d5dee7; background: white; border-radius: 10px; padding: 9px 12px; outline: none;
}
textarea { min-height: 78px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(14,122,98,.12); }
.btn { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; background: white; }
.btn.primary { background: var(--jade); color: white; }
.btn.primary:hover { background: var(--jade-dark); }
.btn.ghost { border-color: #d5dee7; background: white; }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.warn { background: #fff6e8; color: var(--warn); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 32px; height: 32px; border: 0; background: transparent; font-size: 22px; line-height: 1; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
tr:hover td { background: #f8fbfa; }
.person { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: white; font-size: 14px; flex: none; }
.person small, .muted, .hint { color: var(--muted); }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 12px; background: #eef2f5; }
.st-ok { background: #e5f6f1; color: var(--ok); }
.st-loss { background: #fff1df; color: var(--warn); }
.st-freeze { background: #e7eef8; color: #24548f; }
.st-off { background: #eef1f4; color: #708090; }
.tag { display: inline-block; margin: 0 6px 6px 0; padding: 2px 8px; border-radius: 999px; background: #f3f6f8; color: #405062; font-size: 12px; }
.pager { justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 13px; }
.empty, .hint { padding: 8px 0; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bar { display: block; width: 10px; border-radius: 6px 6px 2px 2px; }
.bar.in { background: var(--jade); }
.bar.out { background: var(--gold); }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.legend .in { background: var(--jade); }
.legend .out { background: var(--gold); }
.dist { display: flex; flex-direction: column; gap: 10px; }
.dist-row { display: grid; grid-template-columns: 88px 1fr 24px; gap: 8px; align-items: center; font-size: 13px; }
.track { height: 8px; background: #eef2f5; border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; border-radius: 99px; }
.feed { display: flex; flex-direction: column; }
.feed-item, .attention button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 0; }
.attention h4 { margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.chips, .seg { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .scheme, .seg button, .product {
  border: 1px solid var(--line); background: white; border-radius: 12px;
}
.chip, .scheme, .seg button { padding: 8px 10px; }
.chip.on, .scheme.on, .seg button.on, .product:hover { border-color: var(--jade); background: #f3faf7; }
.scheme small, .product small, .pick small { display: block; color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product { padding: 12px; text-align: left; }
.product b { display: block; margin: 4px 0; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: 6px; }
.summary { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.summary div, .slip div { display: flex; justify-content: space-between; gap: 12px; }
.summary .pay { font-size: 20px; font-weight: 700; }
.warn-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.vip {
  border-radius: 16px; padding: 16px 18px; color: white; min-height: 148px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.vip .row { display: flex; justify-content: space-between; gap: 10px; }
.vip b { font-size: 22px; }
.mask { position: fixed; inset: 0; background: rgba(16, 28, 44, .35); z-index: 20; display: flex; justify-content: flex-end; }
.drawer { width: min(460px, 100%); height: 100%; border-radius: 0; overflow: auto; padding: 18px 18px 32px; }
#modal[hidden] { display: none !important; }
#modal { position: fixed; inset: 0; background: rgba(16, 28, 44, .45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.dialog { width: min(560px, 100%); max-height: min(86vh, 820px); overflow: auto; padding: 16px 18px 18px; }
.dialog-bd { display: flex; flex-direction: column; gap: 12px; }
.dialog-ft { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #142033; color: white; border-radius: 999px; padding: 10px 16px; box-shadow: var(--shadow); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.quick { display: flex; gap: 8px; margin: 8px 0 16px; }
@media (max-width: 1100px) {
  .stat-grid, .grid-2, .grid-main { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-side { min-height: 280px; }
}
