:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #17212b;
  --muted: #667381;
  --line: #dfe5ea;
  --brand: #126e82;
  --brand-soft: #e7f3f5;
  --good: #237a57;
  --good-soft: #e9f6ef;
  --warn: #a25c13;
  --warn-soft: #fff3df;
  --bad: #b13b3b;
  --bad-soft: #fcecec;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 10%, #dbeef1, transparent 32%), var(--bg); }
.login-card { width: min(900px, 100%); min-height: 510px; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 24px 80px rgba(23, 33, 43, .1); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 46px; background: #173c46; color: #fff; }
.login-intro h1 { max-width: 420px; margin: 0; font-size: 48px; line-height: 1.1; letter-spacing: -.04em; }
.login-intro p { max-width: 420px; margin: 20px 0 0; color: #d6e7ea; line-height: 1.8; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #173c46; background: #fff; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 52px; }
.login-form h2 { margin: 0 0 8px; font-size: 29px; }
.login-form > p { margin: 0 0 28px; color: var(--muted); }
.field { display: grid; gap: 8px; margin-bottom: 17px; }
.field span { color: var(--muted); font-size: 13px; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; outline: none; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 110, 130, .12); }
.technical { font-family: Consolas, monospace; direction: ltr; unicode-bidi: plaintext; }
.form-error { min-height: 22px; margin: 0; color: var(--bad); font-size: 12px; }
.button { min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: var(--surface); }
.button.primary { color: #fff; background: var(--brand); }
.button.secondary { border-color: var(--line); }
.button.danger { color: var(--bad); border-color: #edcaca; background: #fffafa; }
.button.quiet { color: var(--muted); background: transparent; }
.button.small { min-height: 31px; padding: 5px 10px; font-size: 12px; }
.button.wide { width: 100%; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; color: #e8f2f4; background: #173c46; }
.sidebar .brand { padding: 0 10px 25px; }
.nav { display: grid; gap: 5px; margin-top: 16px; }
.nav button { width: 100%; padding: 11px 13px; border: 0; border-radius: 9px; color: #bfd2d7; text-align: left; background: transparent; }
.nav button:hover, .nav button.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-bottom { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar-user { display: grid; gap: 5px; margin-bottom: 14px; }
.sidebar-user small { color: #a8c0c6; }
.main { min-width: 0; padding: 38px clamp(28px, 4vw, 58px) 70px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.page-head h1 { margin: 7px 0 0; font-size: 34px; letter-spacing: -.04em; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-bottom: 25px; }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 11px; font-size: 30px; }
.panel { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 20px; }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: var(--surface-soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .actions { flex-wrap: nowrap; }
.chip { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 99px; color: var(--muted); background: #eef1f3; font-size: 11px; white-space: nowrap; }
.chip.good { color: var(--good); background: var(--good-soft); }
.chip.warn { color: var(--warn); background: var(--warn-soft); }
.chip.bad { color: var(--bad); background: var(--bad-soft); }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 13px; }
.card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card h3 { margin: 0 0 7px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 28px; background: rgba(9, 20, 25, .5); }
.modal { width: min(720px, 100%); max-height: calc(100vh - 56px); overflow: auto; border-radius: 16px; background: var(--surface); box-shadow: 0 30px 100px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 23px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head button { border: 0; color: var(--muted); background: transparent; font-size: 22px; }
.modal-body { padding: 23px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 17px 23px; border-top: 1px solid var(--line); }
.notice { padding: 12px 14px; margin-bottom: 16px; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 12px; line-height: 1.6; }
.notice.bad { color: var(--bad); background: var(--bad-soft); }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: 420px; padding: 13px 17px; border-radius: 10px; color: #fff; background: #173c46; box-shadow: 0 12px 35px rgba(0,0,0,.2); font-size: 13px; }
.progress { min-width: 120px; }
.progress-line { height: 6px; overflow: hidden; border-radius: 99px; background: #e8ecef; }
.progress-line i { display: block; height: 100%; background: var(--brand); }
.progress small { display: block; margin-top: 5px; color: var(--muted); }
@media (max-width: 850px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-bottom { display: none; }
  .login-card { grid-template-columns: 1fr; }
  .login-intro { min-height: 260px; }
  .grid-two { grid-template-columns: 1fr; }
}

/* Compact operations console: keep high-frequency work above the fold. */
.login-page { padding: 16px; }
.login-card { width: min(760px, 100%); min-height: 430px; border-radius: 16px; }
.login-intro { padding: 32px; }
.login-intro h1 { font-size: 37px; }
.login-intro p { margin-top: 14px; line-height: 1.6; }
.login-form { padding: 34px; }
.login-form h2 { font-size: 25px; }
.login-form > p { margin-bottom: 22px; }

.shell { grid-template-columns: 196px minmax(0, 1fr); }
.sidebar { padding: 18px 12px; }
.sidebar .brand { padding: 0 8px 18px; }
.nav { gap: 2px; margin-top: 8px; }
.nav button { padding: 9px 10px; font-size: 12px; }
.sidebar-bottom { padding: 14px 8px 0; }
.main { padding: 26px clamp(20px, 3vw, 38px) 48px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 28px; }
.page-head p { margin-top: 6px; font-size: 13px; }
.actions { gap: 6px; }
.stats { gap: 8px; margin-bottom: 18px; }
.stat { padding: 14px; border-radius: 10px; }
.stat strong { margin-top: 8px; font-size: 25px; }
.panel { margin-bottom: 12px; border-radius: 10px; }
.panel-head { padding: 13px 16px; }
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 16px; }
.empty { padding: 38px 16px; }
table { font-size: 12px; }
th, td { padding: 10px 12px; }
.cards { gap: 9px; }
.card { padding: 14px; border-radius: 10px; }
.card h3 { margin-bottom: 5px; font-size: 15px; }
.card-meta { gap: 5px; margin-top: 12px; }
.card-actions { gap: 5px; margin-top: 12px; padding-top: 11px; }
.modal-backdrop { padding: 16px; }
.modal { border-radius: 12px; }
.modal-head { padding: 15px 18px; }
.modal-body { padding: 18px; }
.modal-foot { padding: 13px 18px; }
.notice { margin-bottom: 12px; }
.login-card.compact-login { display: block; width: min(400px, 100%); min-height: 0; }
.login-compact-head { display: flex; align-items: center; gap: 10px; padding: 24px 26px 0; }
.login-compact-head > div { display: grid; gap: 3px; }
.login-compact-head strong { font-size: 15px; }
.login-compact-head small { color: var(--muted); font-size: 11px; }
.compact-login .brand-mark { color: #fff; background: var(--brand); }
.compact-login .login-form { padding: 24px 26px 28px; }
.compact-login .login-form h2 { margin-bottom: 6px; }
