:root {
  color-scheme: light;
  --canvas: #f5f7f8;
  --paper: #fff;
  --ink: #17242a;
  --muted: #596870;
  --line: #d6dee3;
  --blue: #2364d2;
  --green: #15735d;
  --red: #a93828;
  --focus: #174da5;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; }
::selection { background: #cfe0ff; color: #15345a; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: inherit; text-underline-offset: 4px; }
.topbar { display: flex; align-items: center; gap: 24px; min-height: 72px; padding: 12px 40px; border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 19px; font-weight: 700; flex-shrink: 0; }
.brand-mark { display: inline-flex; align-items: end; gap: 3px; height: 24px; }
.brand-mark i { width: 5px; height: 12px; background: var(--blue); }
.brand-mark i:nth-child(2) { height: 23px; background: var(--green); }
.brand-mark i:nth-child(3) { height: 17px; background: #d45a40; }
.admin-label { padding-left: 24px; border-left: 1px solid var(--line); color: var(--muted); }
#logout { margin-left: auto; }
main { max-width: 1120px; margin: 0 auto; padding: 40px; }
h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.35; }
h2, legend { margin: 0; font-size: 16px; font-weight: 650; }
.heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.neutral { color: var(--muted); }
.success { color: var(--green); }
.warning { color: #99501f; }
.error { color: var(--red); }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; margin-top: 32px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0 0 20px; }
.field { margin-bottom: 24px; }
label { display: block; font-size: 14px; font-weight: 600; }
input:not([type=checkbox]) { display: block; width: 100%; min-width: 0; height: 46px; padding: 10px 12px; margin-top: 8px; border: 1px solid #9aaab4; border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; caret-color: var(--blue); }
input::placeholder { color: #67757e; opacity: 1; }
input:focus { border-color: var(--blue); }
input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.checkbox-label { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 40px; color: var(--muted); font-size: 13px; font-weight: 400; cursor: pointer; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 6px; font: inherit; font-weight: 600; line-height: 1.4; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease; }
button:disabled { cursor: not-allowed; opacity: .55; }
.primary { background: var(--blue); color: white; }
.primary:hover:not(:disabled) { background: #174fae; }
.secondary { color: var(--ink); background: white; border-color: #aab8c0; }
.secondary:hover:not(:disabled) { background: #e9eef2; border-color: #738996; }
.quiet { background: transparent; color: #2055ab; }
.quiet:hover:not(:disabled) { background: #e5edf8; }
.label-row .quiet { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.actions .primary { margin-left: auto; }
.feedback { min-height: 24px; margin: 16px 0 8px; overflow-wrap: anywhere; }
.test-status { font-size: 13px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
#models-status { min-height: 20px; margin: 6px 0 0; }
.active-config { border-left: 1px solid var(--line); padding-left: 28px; min-width: 0; }
dl { margin: 24px 0 0; }
dt { color: var(--muted); font-size: 12px; margin-top: 22px; }
dd { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.login-panel { max-width: 410px; margin: 44px auto; }
.login-panel h1 { margin-bottom: 30px; }
.login-panel .primary { width: 100%; }
.boot-status { color: var(--muted); text-align: center; }
.site-footer { padding: 20px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 760px) {
  .topbar { padding: 12px 20px; gap: 12px; flex-wrap: wrap; }
  .admin-label { padding-left: 12px; font-size: 13px; }
  main { padding: 26px 20px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; margin-top: 26px; }
  .active-config { border-left: 0; padding-left: 0; padding-top: 26px; border-top: 1px solid var(--line); }
  dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px 12px; margin-top: 20px; }
  dt, dd { margin: 0; }
  .login-panel { margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
