:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #1e2540;
  background: #f5f6fa;
  --bg: #f5f6fa;
  --surface: #fff;
  --ink: #1e2540;
  --muted: #606981;
  --border: #e5e8f1;
  --indigo: #4a48b8;
  --indigo-dark: #38369e;
  --indigo-soft: #eeedfe;
  --green: #24764e;
  --green-soft: #e9f7ef;
  --amber: #865111;
  --amber-soft: #fff4dd;
  --red: #a7364a;
  --red-soft: #fff0f2;
  --shadow: 0 12px 34px #26305b0c;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.55; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 3vw, 35px); letter-spacing: -.04em; line-height: 1.2; }
h2 { font-size: 19px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.4; }
a { color: var(--indigo-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .62; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #6b66df; outline-offset: 2px;
}
input, textarea, select {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #dbe0ed;
  border-radius: 8px;
  min-height: 40px;
  min-width: 0;
  padding: 8px 11px;
}
input::placeholder, textarea::placeholder { color: #737c93; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--indigo); }
select { padding-right: 14px; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 0; min-width: 0; }
legend { color: var(--ink); font-size: 14px; font-weight: 650; padding: 0 6px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 13px 15px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { color: #58617b; background: #f7f8fc; font-weight: 650; white-space: nowrap; }
td { overflow-wrap: anywhere; }
td a { font-weight: 650; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfbfe; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
code { word-break: break-word; }

.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.boot button { margin-left: 12px; }
.login-layout { display: grid; grid-template-columns: minmax(340px, 5fr) minmax(380px, 6fr); min-height: 100vh; background: #fff; }
.login-aside { background: #242346; color: #fff; padding: 45px clamp(32px, 6vw, 92px); display: flex; flex-direction: column; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; line-height: 1.2; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 12px; color: #fff; font-weight: 760; font-size: 21px; background: #5550d3; }
.brand strong { font-size: 19px; display: block; letter-spacing: .04em; }
.brand small { color: inherit; opacity: .73; font-size: 12px; display: block; margin-top: 4px; }
.login-intro { margin: auto 0; padding: 56px 0; }
.login-intro h1 { font-size: clamp(36px, 5.5vw, 62px); max-width: 490px; font-weight: 760; margin: 20px 0; }
.login-intro > p { color: #d6d4f0; max-width: 400px; }
.login-rule { width: 46px; height: 4px; background: #9b93ff; border-radius: 20px; }
.login-flow { display: flex; gap: 11px 20px; flex-wrap: wrap; margin-top: 31px; color: #e6e2ff; font-size: 14px; }
.login-flow span { display: inline-flex; align-items: center; gap: 7px; }
.login-flow i { display: inline-block; background: #a79fff; width: 7px; height: 7px; border-radius: 50%; }
.login-foot { font-size: 13px; color: #cecaeb; }
.login-area { display: grid; place-items: center; padding: 36px; }
.login-card { width: min(100%, 410px); }
.login-card h2 { font-size: 29px; margin-bottom: 6px; letter-spacing: -.025em; }
.login-card form { margin-top: 23px; }
.login-card input { min-height: 46px; }
.login-button { min-height: 47px; width: 100%; margin-top: 4px; }
.mobile-brand { display: none; }
.demo-login { padding: 13px 14px; margin-top: 20px; background: #f1f0ff; border-radius: 11px; color: var(--indigo-dark); }
.demo-login > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.demo-login span { font-size: 13px; color: #57548a; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0,1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 21px 13px 16px; z-index: 5; overflow: auto;
}
.brand-home { color: var(--ink); display: block; margin: 0 8px 16px; }
.brand-home:hover { text-decoration: none; }
.nav-label { color: #6d7590; font-size: 12px; font-weight: 650; margin: 18px 11px 7px; }
.sidebar nav a { color: #49526b; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 11px; margin: 3px 0; border-radius: 9px; font-size: 14px; font-weight: 560; }
.sidebar nav a:hover { text-decoration: none; background: #f5f5fc; color: var(--indigo-dark); }
.sidebar nav a[aria-current] { background: var(--indigo-soft); color: var(--indigo-dark); font-weight: 730; }
.nav-icon { width: 20px; display: inline-block; text-align: center; font-size: 17px; line-height: 1; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); margin-top: auto; padding: 15px 7px 0; }
.sidebar-foot strong { font-size: 14px; display: block; }
.sidebar-foot small { display: block; color: var(--muted); font-size: 12px; }
.avatar { border-radius: 50%; display: grid; place-items: center; flex: 0 0 35px; height: 35px; background: var(--indigo-soft); color: var(--indigo-dark); font-size: 14px; font-weight: 740; }
.app-main { min-width: 0; }
.topbar { border-bottom: 1px solid var(--border); background: #fff; min-height: 62px; padding: 9px clamp(16px, 3vw, 34px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar > div { display: flex; align-items: center; gap: 11px; }
#current-title { font-size: 14px; font-weight: 720; }
.topbar-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.nav-toggle { display: none !important; }
.profile { position: relative; }
.profile summary { list-style: none; }
.profile summary::-webkit-details-marker { display: none; }
.profile-menu { position: absolute; top: calc(100% + 6px); min-width: 135px; right: 0; border-radius: 10px; padding: 5px; box-shadow: var(--shadow); border: 1px solid var(--border); background: #fff; z-index: 8; }
.profile-menu button { display: block; background: transparent; text-align: left; border: 0; width: 100%; padding: 8px 9px; font-size: 14px; border-radius: 6px; color: var(--ink); }
.profile-menu button:hover { background: var(--indigo-soft); }
.skip-link { position: fixed; left: 16px; top: -80px; color: white; background: var(--indigo-dark); z-index: 20; border-radius: 7px; padding: 7px 12px; }
.skip-link:focus { top: 12px; }
.page { max-width: 1510px; margin: 0 auto; padding: clamp(19px, 3.1vw, 39px); outline: none; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 23px; flex-wrap: wrap; }
.page-head p { margin-top: 7px; color: var(--muted); }
.loading { color: var(--muted); padding: 24px 0; }
.card, .panel { min-width: 0; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 19px; }
.card.plain { padding: 0; overflow: hidden; }
.section-space { margin-top: 18px; }
.section-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head p { margin-top: 3px; }
.dashboard-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.dashboard-filter label { color: var(--muted); font-size: 14px; font-weight: 620; }
.dashboard-filter select { min-width: min(56vw, 195px); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 174px), 1fr)); gap: 13px; }
.metric { border-top: 3px solid #d8d4ff; display: grid; gap: 7px; }
.metric > span { color: #4e5770; font-size: 14px; font-weight: 650; }
.metric > strong { font-size: clamp(25px, 3vw, 34px); font-weight: 740; letter-spacing: -.035em; overflow-wrap: anywhere; line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric > small { color: var(--muted); font-size: 12px; }
.queue-grid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 126px), 1fr)); }
.queue-tile { background: #f7f8fc; border: 1px solid #eff0f7; border-radius: 10px; padding: 12px; color: var(--ink); display: grid; gap: 3px; }
.queue-tile:hover { text-decoration: none; background: var(--indigo-soft); }
.queue-tile > span { font-size: 14px; font-weight: 650; }
.queue-tile > strong { font-size: 25px; line-height: 1.25; color: var(--indigo-dark); }
.queue-tile > small { font-size: 12px; color: var(--muted); }
.queue-tile.urgent { background: var(--red-soft); border-color: #f7dce1; }
.queue-tile.urgent strong { color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 39px; gap: 6px; border: 1px solid #dadfec; background: #fff; color: #323b58; border-radius: 8px; padding: 7px 13px; font-size: 14px; text-decoration: none; font-weight: 640; text-align: center; line-height: 1.4; }
.btn:hover { background: #f5f5fc; text-decoration: none; }
.btn.primary { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.btn.primary:hover { background: var(--indigo-dark); }
.btn.small { min-height: 32px; font-size: 13px; padding: 5px 9px; }
.btn.danger { color: var(--red); border-color: #efc5ce; }
.btn.danger:hover { background: var(--red-soft); }
.badge { display: inline-flex; max-width: 100%; min-height: 24px; align-items: center; border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 660; line-height: 1.45; color: #4f596e; background: #eff1f6; }
.badge-indigo, .badge-info, .badge-primary { color: var(--indigo-dark); background: var(--indigo-soft); }
.badge-success, .badge-green { color: var(--green); background: var(--green-soft); }
.badge-warning, .badge-amber, .badge-warn { color: var(--amber); background: var(--amber-soft); }
.badge-danger, .badge-red, .badge-error { color: var(--red); background: var(--red-soft); }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; align-content: start; }
.grid, .form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; color: #46506b; font-size: 14px; font-weight: 630; }
.field input, .field select, .field textarea { width: 100%; font-size: 15px; font-weight: 440; }
.field small { color: var(--muted); font-size: 12px; font-weight: 400; }
.checkbox { display: inline-flex; gap: 7px; align-items: center; min-height: 27px; font-size: 14px; }
.check-grid { display: grid; gap: 5px 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.filters, .toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { flex: 0 1 180px; }
.form-footer { justify-content: flex-end; padding-top: 5px; }
.table-wrap { width: 100%; overflow-x: auto; }
.empty { display: grid; padding: 26px 12px; min-height: 92px; place-content: center; text-align: center; gap: 5px; }
.empty p { color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 5px; margin: 0 0 13px; overflow-x: auto; }
.tabs a, .tabs button { white-space: nowrap; border: 1px solid var(--border); border-radius: 8px; background: white; color: #4e5771; padding: 7px 10px; font-size: 14px; }
.tabs a.selected, .tabs button.selected, .tabs a[aria-current] { background: var(--indigo-soft); color: var(--indigo-dark); font-weight: 700; }
.pager { justify-content: flex-end; padding: 13px 0; font-size: 14px; }
.form-error { color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 8px 11px; font-size: 14px; overflow-wrap: anywhere; }
.modal { width: min(680px, calc(100% - 24px)); padding: 0; border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 15px; max-height: 88vh; max-height: 88dvh; box-shadow: 0 25px 100px #14143656; }
.modal::backdrop { background: #19193282; }
.modal-head { padding: 14px 17px; background: #fff; position: sticky; top: 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 1; }
.modal-body { padding: 17px; }
.snapshot { background: #f6f7fb; border-radius: 8px; padding: 9px; font-size: 12px; max-height: 45vh; overflow: auto; }
.toasts { position: fixed; right: 15px; bottom: 15px; display: grid; gap: 7px; z-index: 50; width: min(360px, calc(100% - 30px)); pointer-events: none; }
.toast { color: #fff; background: #343273; border-radius: 9px; padding: 10px 13px; box-shadow: var(--shadow); font-size: 14px; }
.toast-error { background: #8b2940; }
@media (max-width: 850px) {
  .app-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .sidebar { padding-left: 9px; padding-right: 9px; }
  .queue-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%, 113px),1fr)); }
}
@media (max-width: 690px) {
  .login-layout { display: block; min-height: 100vh; }
  .login-aside { display: none; }
  .login-area { padding: 32px 18px; min-height: 100vh; place-items: start center; }
  .mobile-brand { display: block; margin-bottom: 31px; }
  .app-layout { display: block; }
  .sidebar { display: none; top: 58px; height: auto; max-height: calc(100dvh - 58px); position: fixed; width: 225px; border-radius: 0 0 12px 0; box-shadow: var(--shadow); }
  .app-layout.menu-open .sidebar { display: flex; }
  .sidebar-foot { margin-top: 13px; }
  .topbar { min-height: 58px; position: sticky; top: 0; z-index: 6; }
  .nav-toggle { display: inline-flex !important; }
  .topbar-date { display: none; }
  .page-head { align-items: flex-start; margin-bottom: 17px; }
  .page-head p { font-size: 14px; }
  .card, .panel { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 11px; }
  .metric > strong { font-size: clamp(18px, 5.6vw, 27px); }
  .queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .field { flex: 1 1 130px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  th, td { padding: 9px 10px; }
}
