:root {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #152538;
  background: #f3f7fa;
  --navy: #091a2a;
  --muted: #52677b;
  --line: #d9e3eb;
  --action: #00697a;
  --focus: #008398;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
button, input[type="text"], input[type="password"], input[type="search"] {
  border: 1px solid var(--line); border-radius: 8px; padding: .65rem .9rem; background: #fff; color: inherit;
}
button:hover { background: #e8f4f7; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.primary { background: var(--action); border-color: var(--action); color: #fff; font-weight: 650; }
.primary:hover { background: #005664; }
.danger { color: #a52836; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; border-radius: 11px; }
.brand b { display: block; font-size: 1.04rem; letter-spacing: .03em; }
.brand span { color: #a4bfce; font-size: .79rem; }
.login-screen { min-height: 100dvh; display: grid; place-items: center; background: radial-gradient(ellipse at 16% 12%, #135065, transparent 50%), var(--navy); padding: 2rem 1rem; }
.login-card { width: min(100%, 400px); background: white; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 65px #06111a66; }
.login-card .brand { color: #fff; background: #0e293b; padding: 24px 30px; }
.login-card form { padding: 28px 30px; display: grid; gap: 17px; }
.login-card h1 { font-size: 1.65rem; }
.field { display: grid; gap: 5px; }
.field > span { font-weight: 600; }
.field input:not([type="checkbox"]) { width: 100%; }
.error { color: #9d2838; padding: .7rem .95rem; border-radius: 8px; background: #fff0f2; }
.error:empty { display: none; }
.loading { padding: 3rem; text-align: center; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar {
  background: var(--navy); color: #ecf7ff; display: flex; flex-direction: column; gap: 30px; padding: 26px 18px 18px;
  position: sticky; top: 0; height: 100dvh;
}
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button, .account button { text-align: left; border-color: transparent; background: transparent; color: #c8dce7; }
.sidebar nav button[aria-current="page"], .sidebar nav button:hover, .account button:hover { background: #174154; color: #fff; }
.account { margin-top: auto; border-top: 1px solid #264051; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.account strong { max-width: 7rem; overflow-wrap: anywhere; }
.workspace { width: min(100%, 1360px); margin: 0 auto; padding: 38px clamp(18px, 4vw, 54px); }
.top, .tools, .row, .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top { justify-content: space-between; margin-bottom: 22px; }
.top p, .title-block p { margin-top: 6px; }
.tools { padding: 16px 20px; }
.tools input { min-width: min(100%, 230px); }
.actions { justify-content: flex-end; margin-top: 9px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; min-width: 0; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 18px 20px; }
.scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #edf3f7; color: #43576a; font-size: .88rem; white-space: nowrap; }
td, th { padding: 11px 16px; vertical-align: middle; }
tbody tr + tr td { border-top: 1px solid #edf2f6; }
tbody tr:hover { background: #f7fbfc; }
.table-link { border: 0; background: transparent; padding: 4px 0; text-align: left; color: #005d71; font-weight: 700; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); padding: 23px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 14px; font-size: .82rem; white-space: nowrap; background: #eaf0f5; color: #38516a; }
.badge.on { background: #e0f3ed; color: #12614f; }
.badge.off { background: #fcecef; color: #9b2838; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 14px; margin: 0 0 17px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 3px 0 0; font-size: 1.16rem; font-weight: 650; overflow-wrap: anywhere; }
.back { margin-bottom: 13px; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 12px; min-width: 0; }
legend { font-weight: 650; padding: 0 4px; }
.stack { display: grid; gap: 13px; }
.checkbox { display: flex; align-items: baseline; gap: 7px; padding: 4px; overflow-wrap: anywhere; }
.checkbox input { accent-color: var(--action); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 2px 6px; margin-top: 6px; }
.roots { max-height: 190px; overflow: auto; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 7px; }
.notice { background: #edf7f9; border-radius: 8px; color: #175260; padding: 8px 11px; }
details pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 5px 0; font: inherit; color: var(--muted); }
summary { cursor: pointer; color: #005d71; }
dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 26px); border: 1px solid var(--line); border-radius: 14px; padding: 0; color: inherit; }
dialog::backdrop { background: #06121fc0; }
.dialog-body { padding: 19px 21px; }
.secret input { font: .97rem ui-monospace, monospace; }
@media(max-width: 830px) {
  .split { grid-template-columns: 1fr; gap: 0; }
}
@media(max-width: 610px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; display: grid; gap: 10px; grid-template-columns: 1fr auto; padding: 13px; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; }
  .account { border: 0; padding: 0; }
  .workspace { padding-top: 19px; }
}

[hidden] { display: none !important; }
