:root {
  color-scheme: light;
  --navy: #111d35;
  --navy-soft: #1d2c47;
  --background: #f4f6fa;
  --surface: #ffffff;
  --text: #17243b;
  --muted: #66748a;
  --line: #e5eaf1;
  --primary: #335eea;
  --primary-hover: #2547bc;
  --blue-soft: #edf2ff;
  --success: #137257;
  --success-soft: #e8f6ef;
  --danger: #b83645;
  --danger-soft: #fff0f1;
  --warning: #86580b;
  --warning-soft: #fff7e5;
  --radius: 14px;
  --shadow: 0 3px 16px rgb(28 45 78 / 3%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--background); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
input, select, textarea { min-width: 0; }
:focus-visible { outline: 3px solid #537cf4; outline-offset: 3px; }
:where(h1, h2, h3, p) { margin: 0; }
h1 { font-size: 29px; line-height: 1.35; font-weight: 700; letter-spacing: -.7px; }
h2 { font-size: 16px; font-weight: 650; line-height: 1.5; }
h3 { font-size: 14px; font-weight: 650; }
a { color: var(--primary); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted, .field-hint { color: var(--muted); }
.mono, .code-block, .secret-value { font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 16px; background: white; border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.boot-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.noscript-notice { position: fixed; inset: 0; padding: 25vh 24px; background: var(--background); text-align: center; z-index: 101; }
.spinner { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; border: 2px solid #d8e1f5; border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login is deliberately separate from the authenticated workspace. */
.login-screen { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100dvh; background: white; }
.login-story { position: relative; isolation: isolate; overflow: hidden; min-height: 100%; display: flex; flex-direction: column; padding: 44px clamp(36px, 5vw, 86px); color: white; background: var(--navy); }
.login-story::before, .login-story::after { content: ""; position: absolute; border: 1px solid rgb(144 170 234 / 13%); border-radius: 50%; z-index: -1; width: 580px; height: 580px; right: -340px; bottom: -180px; }
.login-story::after { width: 760px; height: 760px; right: -425px; bottom: -270px; background: radial-gradient(circle, rgb(65 98 190 / 13%), transparent 70%); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 650; letter-spacing: -.25px; }
.brand small { display: block; margin-top: 2px; color: #a0afc9; font-size: 10px; font-weight: 500; letter-spacing: 1.8px; }
.brand-mark { width: 39px; height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 1px; font-size: 25px; font-weight: 750; border-radius: 11px; background: #4d71f1; color: white; flex-shrink: 0; }
.brand-mark span { font-size: 16px; align-self: flex-start; margin-top: 5px; }
.login-story-copy { margin-block: auto; padding: 90px 0; max-width: 440px; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 1.5px; color: var(--primary); }
.login-story .eyebrow { color: #b0c2ff; }
.login-story h2 { font-size: clamp(32px, 3.4vw, 54px); line-height: 1.4; letter-spacing: -1.5px; margin: 20px 0 24px; }
.login-story-copy > p { color: #b6c3da; font-size: 15px; line-height: 1.95; max-width: 360px; }
.login-capabilities { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 38px; color: #c7d3eb; font-size: 12px; }
.login-capabilities span { display: flex; gap: 8px; align-items: center; }
.login-capabilities .icon { width: 17px; height: 17px; color: #93adff; }
.login-story-footer { color: #91a1bc; font-size: 11px; }
.login-form-wrap { display: grid; place-items: center; padding: 48px 32px; }
.login-card { width: min(100%, 380px); }
.login-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #e0e8ff; border-radius: 14px; color: var(--primary); background: #f4f7ff; margin-bottom: 28px; }
.login-icon .icon { width: 24px; height: 24px; }
.login-card h1 { margin: 8px 0 10px; font-size: 30px; }
.login-card > .muted { margin-bottom: 30px; }
.plain-fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 20px; }
.login-submit { width: 100%; justify-content: space-between !important; margin-top: 8px; min-height: 46px !important; }
.login-card input { min-height: 46px; }
.security-note { display: flex; gap: 9px; font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.security-note .icon { width: 16px; height: 16px; margin-top: 2px; }
#logout-retry { margin-bottom: 20px; }

.app-shell { min-height: 100dvh; }
.sidebar { width: 236px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; background: var(--navy); color: white; z-index: 10; padding: 30px 18px 0; }
.sidebar .brand { padding: 0 10px 34px; }
.sidebar .brand small { font-size: 10px; letter-spacing: 2px; margin-top: 4px; }
.nav-caption { padding: 8px 14px 12px; color: #8799b6; font-size: 10px; letter-spacing: 1.5px; }
.main-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 46px; border: 1px solid transparent; border-radius: 9px; padding: 10px 15px; color: #adbbd2; background: transparent; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { color: white; background: var(--navy-soft); }
.nav-item[aria-current="page"] { background: #263e77; color: #fff; border-color: #324f91; box-shadow: inset 3px 0 #83a1ff; }
.nav-item .icon { width: 19px; height: 19px; }
.sidebar-note { display: flex; gap: 10px; margin: auto 10px 22px; padding-top: 36px; color: #a4b3ce; font-size: 11px; line-height: 1.9; }
.sidebar-note .icon { width: 17px; height: 17px; margin-top: 3px; color: #90a9ed; }
.sidebar-note span { color: #7f92b3; }
.sidebar-account { display: flex; align-items: center; gap: 10px; border-top: 1px solid #2a3650; margin: 0 -18px; padding: 20px 20px; }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; flex-shrink: 0; color: #c7d4f9; background: #293a60; border-radius: 10px; font-size: 13px; font-weight: 700; }
.sidebar-account > div { min-width: 0; flex: 1; }
.account-password-button { display: block; border: 0; background: none; color: #b6caff; padding: 4px 0; font-size: 12px; text-align: left; cursor: pointer; }
.account-password-button:hover { color: white; text-decoration: underline; }
.sidebar-account strong { display: block; overflow-wrap: anywhere; font-size: 12px; font-weight: 550; }
.sidebar-account small { display: block; font-size: 10px; color: #93a5c0; margin-top: 1px; }
.logout-button { background: transparent; color: #c1cde2; border: 1px solid #485776; border-radius: 6px; padding: 4px 8px; font-size: 11px; min-height: 32px; }
.logout-button:hover { color: white; border-color: #8aa0c9; }
.main-content { margin-left: 236px; padding: 30px clamp(22px, 3vw, 48px) 18px; max-width: 2000px; min-height: 100dvh; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.breadcrumb { color: var(--muted); font-size: 11px; margin-bottom: 15px; }
.breadcrumb > span:first-child { margin: 0 9px; color: #b2bac9; }
.breadcrumb > span:last-child { color: #44536c; }
.page-header h1 { margin-bottom: 8px; }
.page-header > div > .muted { font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.session-badge { display: inline-flex; align-items: center; gap: 7px; color: #51617a; font-size: 11px; white-space: nowrap; }
.session-badge > span { width: 6px; height: 6px; border-radius: 50%; background: #2b9b7a; box-shadow: 0 0 0 4px #e7f3ee; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px 17px; }
.section-heading p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.subtle-tag { display: inline-flex; align-items: center; flex-shrink: 0; padding: 3px 8px; font-size: 10px; color: #68768c; background: #f4f6fa; border: 1px solid #e9edf4; border-radius: 5px; }
.filters-panel { margin-bottom: 24px; }
.filters-panel .section-heading { padding-bottom: 18px; }
#filters-form { padding: 0 24px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, .secret-label { font-size: 12px; color: #44526a; font-weight: 550; }
.label-hint { margin-left: 4px; font-size: 10px; font-weight: 400; color: var(--muted); }
.field :is(input, select), .secret-value { width: 100%; border: 1px solid #dce2ec; border-radius: 7px; background: #fff; color: var(--text); padding: 9px 11px; min-height: 39px; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: #8994a6; opacity: 1; font-size: 11px; }
.field :is(input, select):hover { border-color: #bdc9df; }
.field :is(input, select):focus { border-color: #6c8aed; box-shadow: 0 0 0 3px #edf2ff; }
.field :is(input, select):disabled { color: #8893a3; background: #f5f7fa; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[type="datetime-local"] { font-size: 12px; min-width: 0; }
.filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #edf0f5; padding: 16px 0; margin-top: 19px; }
.filter-footer p { font-size: 10px; overflow-wrap: anywhere; }
.filter-footer .button { min-height: 34px; padding: 6px 13px; font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; border: 1px solid transparent; border-radius: 7px; padding: 8px 15px; font-size: 12px; font-weight: 550; line-height: 1.5; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.button .icon { width: 16px; height: 16px; }
.button-primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 2px 3px rgb(51 94 234 / 12%); }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button-secondary { color: #40516d; background: white; border-color: #dce3ee; }
.button-secondary:hover:not(:disabled) { color: var(--primary); background: #f7f9ff; border-color: #b6c6ef; }
.button-quiet { color: #536786; background: transparent; }
.button-quiet:hover:not(:disabled) { color: var(--primary); background: var(--blue-soft); }
.button-small { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.button-danger { color: var(--danger); border-color: #efcdd2; background: #fff; }
.button-danger:hover:not(:disabled) { background: var(--danger-soft); }
.button-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: #f5f7fb; border: 1px solid var(--line); border-radius: 8px; color: #62718a; }
.icon-button:hover { color: var(--text); background: #eaf0f8; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border: 1px solid #f0cdd2; background: var(--danger-soft); color: var(--danger); border-radius: 8px; font-size: 12px; margin-bottom: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.notice[data-tone="info"] { color: #375480; background: #eef4ff; border-color: #dbe7ff; }
.notice[data-tone="warning"] { color: var(--warning); background: var(--warning-soft); border-color: #efdfb8; }
.notice[data-tone="success"] { color: var(--success); background: var(--success-soft); border-color: #cbe7d9; }
.notice .icon { width: 18px; height: 18px; margin-top: 1px; }
.inset-notice { margin: 0 24px 16px; }
#filter-error { margin-top: 15px; margin-bottom: 0; }
.inline-warning { color: var(--warning); padding: 0 24px 15px; font-size: 11px; }
.loading-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; padding: 12px 0 18px; }
.card > .loading-line, #keys-content > .loading-line { padding-left: 24px; padding-right: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.stat-card { min-width: 0; padding: 19px 20px 17px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.stat-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-heading h2 { color: #64728a; font-size: 12px; font-weight: 550; }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; font-size: 20px; }
.stat-icon .icon { width: 18px; height: 18px; }
.blue { background: #edf2ff; color: #4b6ce1; }
.purple { background: #f1edff; color: #805cd5; }
.teal { background: #eaf7f5; color: #238778; }
.orange { background: #fff2e7; color: #bc7339; }
.stat-value { font-size: clamp(23px, 2.3vw, 35px); font-weight: 650; letter-spacing: -.9px; margin: 15px 0 7px; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-caption { color: var(--muted); font-size: 10px; line-height: 1.8; }
.usage-note { display: flex; align-items: flex-start; gap: 7px; margin: 14px 2px 23px; font-size: 10px; color: #6c7b91; }
.usage-note .icon { width: 14px; height: 14px; margin-top: 2px; }
.usage-note.is-warning { color: var(--warning); }
.trend-card { margin-bottom: 22px; }
.segmented-control { display: inline-flex; flex-shrink: 0; border: 1px solid var(--line); border-radius: 7px; padding: 3px; background: #f8f9fc; }
.segmented-control button { border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; padding: 5px 12px; min-height: 30px; }
.segmented-control button[aria-pressed="true"] { color: var(--primary); border-color: #e1e7f1; background: #fff; box-shadow: 0 1px 3px rgb(25 42 76 / 5%); }
.chart-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 18px; padding: 0 26px; font-size: 10px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.legend-dot.secondary { background: #d27541; }
.trend-chart { min-height: 245px; padding: 14px 19px 0; display: grid; align-items: center; }
.trend-chart svg { display: block; width: 100%; height: auto; min-height: 160px; overflow: visible; }
.chart-gridline { stroke: #e9edf5; stroke-dasharray: 3 5; }
.chart-axis-label { fill: #728097; font-size: 10px; font-family: inherit; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart-line.secondary { stroke: #c76f3e; stroke-dasharray: 6 4; }
.chart-point { fill: white; stroke: var(--primary); stroke-width: 2; }
.chart-point.secondary { stroke: #c76f3e; }
.chart-area { fill: #edf2ff; }
.trend-data { border-top: 1px solid #edf0f5; margin-top: 6px; }
.trend-data summary { padding: 11px 24px; cursor: pointer; color: #607397; font-size: 11px; }
.trend-data summary:hover { background: #f8faff; }
.ranking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.table-scroll { width: 100%; overflow: auto; overscroll-behavior: contain; }
.ranking-scroll { max-height: 345px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { background: #f8fafd; color: #69778e; font-size: 10px; font-weight: 550; white-space: nowrap; }
th, td { padding: 14px 20px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
td { color: #41516c; }
td:first-child, th:first-child { padding-left: 24px; }
td:last-child, th:last-child { padding-right: 24px; }
.cell-primary { display: block; color: var(--text); font-weight: 550; overflow-wrap: anywhere; max-width: 310px; }
.cell-secondary { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; overflow-wrap: anywhere; max-width: 310px; }
.cell-actions { display: flex; gap: 5px; align-items: center; }
.cell-empty { text-align: center; color: var(--muted); padding: 34px 20px !important; font-size: 12px; }
.empty-message { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 9px; color: var(--muted); padding: 50px 28px; min-height: 255px; }
.empty-state h3 { color: #4f617d; margin-top: 5px; }
.empty-state p { font-size: 12px; max-width: 290px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: #f0f4fb; color: #7e93b8; }
.empty-icon .icon { width: 25px; height: 25px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; font-size: 10px; font-weight: 550; white-space: nowrap; background: #f0f3f8; color: #61718a; }
.badge[data-tone="success"] { color: var(--success); background: var(--success-soft); }
.badge[data-tone="error"] { color: var(--danger); background: var(--danger-soft); }
.badge[data-tone="warning"] { color: var(--warning); background: var(--warning-soft); }
.badge[data-tone="info"] { color: var(--primary); background: var(--blue-soft); }
.create-user-card { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; }
.create-user-card .muted { font-size: 11px; margin-top: 5px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; width: min(100%, 420px); }
.inline-form .field { flex: 1; }
.users-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.heading-count { color: #6a7c9b; font-size: 11px; background: #f0f4fb; border-radius: 5px; padding: 2px 7px; margin-left: 5px; font-weight: 500; }
tr.is-selected { background: #f0f4ff; }
tr.is-selected:hover { background: #eaf0ff; }
.key-user-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 0 24px 18px; }
.key-user-summary strong { overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.key-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 19px 24px; border-block: 1px solid var(--line); background: #fbfcfe; margin-bottom: 18px; }
.field-hint { font-size: 11px; line-height: 1.8; }
.key-form .field-hint { grid-column: 1 / -1; }
.key-list-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 24px 10px; }
.key-list-heading h3 { font-size: 12px; color: #6a7890; font-weight: 500; }
.keys-list { list-style: none; margin: 0; padding: 0; }
.key-item { padding: 17px 24px; border-top: 1px solid #edf0f5; }
.key-item-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.key-item-heading strong { font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.key-prefix { display: block; color: #54698e; background: #f5f7fb; padding: 5px 8px; border-radius: 5px; margin: 9px 0; font-size: 11px; overflow-wrap: anywhere; }
.key-item-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 10px; color: var(--muted); }
.key-item-footer p { margin-bottom: 3px; }
.audit-table { min-width: 940px; }
.audit-table td { padding-block: 16px; }
.audit-table .cell-primary { max-width: 220px; }
.audit-table .cell-secondary { max-width: 240px; }
.audit-table td:first-child { white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 24px; border-top: 1px solid var(--line); }
.pagination p, .page-number { font-size: 11px; color: var(--muted); }
.page-number { padding-inline: 4px; white-space: nowrap; }
.page-footnote { font-size: 10px; color: var(--muted); margin: 14px 2px 0; line-height: 1.9; }
.upstreams-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.upstream-url { display: block; margin: 0 24px 18px; color: #63728b; background: #f7f9fc; border: 1px solid #e8edf4; padding: 10px 12px; border-radius: 7px; font-size: 11px; overflow-wrap: anywhere; }
.capabilities { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 24px 18px; }
.capabilities .badge { white-space: normal; overflow-wrap: anywhere; }
.upstreams-grid .cell-primary { max-width: none; }
.workspace-footer { display: flex; justify-content: space-between; gap: 12px; padding: 30px 2px 5px; color: #7d889c; font-size: 10px; }
.workspace-footer > span:first-child > span { margin: 0 5px; }

.modal { position: fixed; padding: 0; max-height: calc(100dvh - 48px); width: min(600px, calc(100vw - 32px)); color: var(--text); border: 1px solid #dfe5f0; border-radius: 16px; box-shadow: 0 24px 100px rgb(8 21 48 / 26%); overscroll-behavior: contain; }
.modal::backdrop { background: rgb(12 24 48 / 52%); backdrop-filter: blur(3px); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 23px 26px 20px; border-bottom: 1px solid var(--line); background: white; }
.modal-header h2 { font-size: 21px; margin-top: 5px; }
.modal-content { padding: 23px 26px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 17px 26px; background: #f9fafd; border-top: 1px solid var(--line); }
.modal-footer .muted { margin-right: auto; font-size: 10px; }
.secret-label { display: block; margin: 18px 0 8px; }
.secret-value { display: block; resize: vertical; background: #f6f8ff; color: #294987; font-size: 13px; line-height: 1.8; margin-bottom: 18px; }
#secret-owner { overflow-wrap: anywhere; font-size: 12px; }
.secret-modal .field-hint { margin-top: 13px; }
.inline-status { min-height: 1.5em; font-size: 12px; color: var(--primary); margin-top: 12px; }
.audit-modal { width: min(1100px, calc(100vw - 40px)); }
#detail-id { font-size: 10px; margin-top: 6px; overflow-wrap: anywhere; }
.detail-metadata { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 24px; margin: 0 0 22px; }
.detail-metadata > div { min-width: 0; }
.detail-metadata dt { font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.detail-metadata dd { font-size: 12px; color: var(--text); margin: 0; overflow-wrap: anywhere; }
.detail-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.detail-tabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; padding: 11px 13px; font-size: 12px; white-space: nowrap; min-height: 41px; }
.detail-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }
.detail-tabs button:hover { background: #f4f7ff; }
.checkbox-label { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); cursor: pointer; }
.checkbox-label input { accent-color: var(--primary); width: 15px; height: 15px; }
#detail-payload-note { margin-block: 12px; }
.code-block { white-space: pre; overflow: auto; tab-size: 2; padding: 18px; border: 1px solid #dfe7f3; border-radius: 9px; background: #f6f8fc; color: #2b3f60; font-size: 12px; line-height: 1.75; margin: 0; max-height: 52dvh; min-height: 150px; }
.code-block.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.large-content { padding: 30px 24px; border: 1px dashed #ccd8ed; border-radius: 9px; background: #f7f9fd; }
.large-content h3 { color: #3f5376; }
.large-content > p { font-size: 12px; color: var(--muted); line-height: 1.9; margin: 10px 0 17px; }
.large-content .button[aria-disabled="true"] { opacity: .55; cursor: wait; }
.large-content #detail-download-status { margin-bottom: 0; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 40; max-width: min(90vw, 620px); padding: 12px 19px; border: 1px solid #43577d; border-radius: 10px; background: #1c2e50; color: white; box-shadow: 0 8px 30px rgb(24 44 78 / 20%); font-size: 12px; overflow-wrap: anywhere; }

.model-help-modal { width: min(940px, calc(100vw - 24px)); }
.model-help-modal .modal-header h2 { font-size: 22px; margin-top: 5px; }
.model-help-modal .modal-header .muted { font-size: 12px; margin-top: 6px; }
.model-help-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 20px; margin: 20px 0; background: #f5f8ff; border: 1px solid #e0e8f8; border-radius: 10px; }
.model-help-facts dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.model-help-facts dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.model-help-limits { margin: 22px 0; }
.model-help-limits ul { padding-left: 20px; color: #53637c; font-size: 12px; }
.model-help-limits li + li { margin-top: 7px; }
#model-help-status { margin-top: 18px; }
.model-help-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 20px 0 10px; }
.model-help-heading label { font-size: 12px; font-weight: 550; }
.model-help-code { display: block; width: 100%; resize: vertical; white-space: pre; overflow: auto; min-height: 95px; border: 1px solid #dfe7f3; border-radius: 9px; padding: 16px; color: #2b3f60; background: #f6f8fc; font: 12px/1.75 "Cascadia Code", Consolas, monospace; tab-size: 2; }
#model-help-route { margin-top: 9px; }
#model-help-examples > .field-hint { margin-top: 10px; }
@media (max-width: 600px) {
  .model-help-facts { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .model-help-code { font-size: 11px; padding: 12px; }
  .model-help-heading .segmented-control button { padding-inline: 8px; }
}

@media (min-width: 1650px) {
  .filter-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 1250px) {
  .sidebar { width: 210px; padding-inline: 12px; }
  .sidebar .brand { padding-inline: 7px; font-size: 15px; gap: 9px; }
  .sidebar-account { margin-inline: -12px; padding-inline: 16px; }
  .main-content { margin-left: 210px; padding-inline: 24px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 26px; }
  .header-actions { gap: 10px; }
  .session-badge { display: none; }
  .users-layout { grid-template-columns: minmax(0, 1fr); }
  .keys-panel { width: 100%; }
  .create-user-card { align-items: flex-start; }
  .create-user-card > div { max-width: 235px; }
  .inline-form { width: min(100%, 360px); }
}
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 31px; }
  .ranking-grid, .upstreams-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-footer { align-items: flex-start; flex-direction: column; }
  .filter-footer .button-group { align-self: flex-end; }
  .create-user-card { flex-direction: column; gap: 18px; }
  .create-user-card > div { max-width: none; }
  .inline-form { width: 100%; }
  .detail-metadata { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login-story { padding: 34px; }
  .login-story h2 { font-size: 37px; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; padding: 18px 18px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .sidebar .brand { padding: 0; }
  .sidebar .brand small, .nav-caption, .sidebar-note { display: none; }
  .brand-mark { width: 33px; height: 35px; font-size: 23px; }
  .sidebar-account { grid-column: 2; grid-row: 1; border: 0; margin: 0; padding: 0; gap: 8px; }
  .sidebar-account .avatar, .sidebar-account small { display: none; }
  .sidebar-account strong { font-size: 10px; max-width: 110px; }
  .main-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .nav-item { gap: 7px; justify-content: center; min-height: 40px; padding: 8px 4px; font-size: 11px; border-radius: 7px; }
  .nav-item .icon { width: 16px; height: 16px; }
  .nav-item[aria-current="page"] { box-shadow: none; }
  .main-content { margin-left: 0; padding: 22px 20px 16px; min-height: calc(100dvh - 130px); }
  .page-header { margin-bottom: 22px; gap: 12px; }
  .breadcrumb { margin-bottom: 10px; }
  h1 { font-size: 25px; }
  .page-header > div > .muted { font-size: 11px; max-width: 280px; }
  .header-actions .button { padding: 8px 11px; font-size: 11px; }
  .section-heading { padding: 19px 19px 15px; }
  #filters-form { padding-inline: 19px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-story { min-height: auto; padding: 25px 28px; }
  .login-story-copy, .login-story-footer { display: none; }
  .login-form-wrap { padding: 44px 25px; align-items: start; }
  .login-card { max-width: 380px; }
  .login-icon { margin-bottom: 24px; }
  .modal { max-height: calc(100dvh - 24px); }
  .audit-modal { width: calc(100vw - 20px); }
  .modal-header, .modal-content { padding: 20px; }
  .modal-footer { padding: 15px 20px; }
  .detail-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-block { font-size: 11px; padding: 13px; }
}
@media (max-width: 440px) {
  .sidebar { padding-inline: 12px; }
  .sidebar .brand { font-size: 13px; }
  .sidebar-account strong { max-width: 70px; }
  .nav-item { flex-direction: column; gap: 4px; font-size: 10px; }
  .main-content { padding-inline: 12px; }
  .page-header { align-items: flex-start; }
  .header-actions { padding-top: 30px; }
  .header-actions .icon { display: none; }
  .header-actions .button { min-height: 34px; padding-inline: 9px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-heading h2 { font-size: 10px; }
  .stat-icon { width: 25px; height: 25px; border-radius: 7px; }
  .stat-icon .icon { width: 15px; height: 15px; }
  .stat-value { font-size: 25px; }
  .stat-caption { font-size: 9px; }
  .filter-grid { grid-template-columns: 1fr; gap: 12px; }
  .section-heading { gap: 10px; }
  .section-heading .subtle-tag { font-size: 9px; padding-inline: 5px; }
  .trend-card .section-heading { flex-wrap: wrap; }
  .trend-chart { padding-inline: 6px; min-height: 190px; }
  .pagination { flex-direction: column; align-items: flex-start; padding: 15px 18px; }
  .pagination .button-group { align-self: flex-end; }
  .workspace-footer { flex-direction: column; gap: 4px; }
  .detail-tabs { width: 100%; }
  .detail-tabs button { padding-inline: 9px; font-size: 11px; }
  .detail-metadata { gap: 14px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .muted { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .app-shell, .login-screen, .modal, .toast, .boot-screen { display: none !important; }
  body::before { content: "管理页面含敏感信息，不提供打印视图。"; display: block; padding: 32px; }
}
