/* 管理界面样式：只引用 tokens.css 里的变量，不写硬编码色值。
   说明文字（12px）用 --neutral 而非 --muted-foreground：后者在白卡上仅 4.28，达不到正文档 4.5（定义书 2.3.1）。 */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page-bg); color: var(--foreground); font: var(--text-body)/var(--lh-body) var(--font-sans); }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { color: var(--accent); }
.num, td.num, .stat-value { font-variant-numeric: tabular-nums; }
.caption { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--neutral); }
.section-label { font-size: var(--text-caption); line-height: var(--lh-caption); font-weight: 600; letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--primary); }
.grad-text { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.progress-line { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-gradient); z-index: 50; }

/* 布局：左侧固定导航 + 顶部工具栏 + 卡片内容区 */
.shell { display: flex; min-height: 100vh; }
.sidenav { position: fixed; top: 0; bottom: 0; left: 0; width: 220px; background: var(--card); border-right: 1px solid var(--border); padding: 20px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: var(--text-card-title); line-height: var(--lh-card-title); font-weight: 600; padding: 0 12px 20px; }
.brand-mark { width: 24px; height: 24px; border-radius: var(--radius-button); background: var(--brand-gradient); box-shadow: var(--shadow-accent); }
.sidenav nav { display: flex; flex-direction: column; gap: 20px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 12px 4px; }
.sidenav nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: var(--radius-button); color: var(--foreground); }
.sidenav nav a:hover { background: var(--tint); color: var(--accent); }
.sidenav nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav-badge { min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--danger); color: var(--card); font-size: var(--text-caption); line-height: var(--lh-caption); font-weight: 600; text-align: center; }
.shell-bare .sidenav, .shell-bare #bell, .shell-bare #change-pw { display: none; }
.shell-bare .main { margin-left: 0; }
.main { flex: 1; margin-left: 220px; min-width: 0; }
.toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 10px 32px; background: var(--page-bg); border-bottom: 1px solid var(--border); }
.toolbar-right { display: flex; align-items: center; gap: 12px; }
.toolbar-title { min-width: 0; display: flex; flex-direction: column; }
.page-desc { margin: 0; }
.page-title { margin: 0; font-size: var(--text-page-title); line-height: var(--lh-page-title); font-weight: 600; }
.content-col { max-width: var(--content-max); margin: 0 auto; padding: 0 32px; }
.content { padding: 24px 0 48px; display: flex; flex-direction: column; gap: 20px; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .btn-sm { flex: none; }
.card-title { margin: 0; font-size: var(--text-card-title); line-height: var(--lh-card-title); font-weight: 600; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .caption { display: block; }
.stat .bar { margin-top: 8px; }
.stat-value { font-size: var(--text-stat); line-height: var(--lh-stat); font-weight: 700; color: var(--primary); }
.stat-value small { font-size: var(--text-card-title); font-weight: 500; color: var(--neutral); }
.stat-danger .stat-value { color: var(--danger); }

/* 按钮 */
.btn { font: inherit; font-weight: 500; border-radius: var(--radius-button); padding: 7px 16px; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
a.btn { color: inherit; }
.btn-sm { padding: 3px 12px; font-size: var(--text-caption); line-height: var(--lh-caption); }
.btn-primary { background: var(--brand-gradient); color: var(--card); box-shadow: var(--shadow-accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--card); color: var(--foreground); border-color: var(--border); }
.btn-secondary:hover { color: var(--accent); border-color: var(--primary); }
.btn-danger { background: var(--card); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--card); }
/* 8 操作列：幽灵小按钮；危险操作红字，靠右 */
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--tint); color: var(--accent); }
.btn-ghost-danger { background: transparent; color: var(--danger); }
.btn-ghost-danger:hover { background: var(--card); border-color: var(--danger); }
.col-actions .btn-row { justify-content: flex-end; }
th.col-actions { text-align: right; }
.btn-icon { padding: 6px 8px; position: relative; }
/* 4 提交中：内联转圈 */
.btn.is-loading::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-foot { margin-top: 16px; }
.card-foot:empty, .card-foot:has(> [hidden]:only-child) { display: none; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--foreground); font-weight: 500; }
.field-hint { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--neutral); }
.field-error { margin: 0; font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--danger); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field input:disabled, .field select:disabled { background: var(--page-bg); color: var(--neutral); cursor: not-allowed; }
.input-suffix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-button); background: var(--card); }
.input-suffix input { border: 0; flex: 1; }
.input-suffix > .caption { padding: 0 12px 0 4px; white-space: nowrap; }
.field.invalid .input-suffix { border-color: var(--danger); }
.input-suffix:focus-within { outline: 2px solid var(--primary); border-color: var(--primary); }
.input-suffix input:focus { outline: none; }
.field-check { align-self: end; padding-bottom: 8px; }
textarea { font: inherit; color: var(--foreground); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-button); padding: 7px 12px; resize: vertical; }
.details summary { cursor: pointer; font-weight: 500; padding: 4px 0; }
.details[open] summary { margin-bottom: 8px; }
.details .overrides { margin-top: 12px; }
.claim-checks { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.claim-list { max-height: 360px; overflow: auto; }
.input-sm { width: 120px; }
input, select { font: inherit; height: 38px; color: var(--foreground); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-button); padding: 7px 12px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
input[type=checkbox] { height: auto; width: 16px; height: 16px; accent-color: var(--primary); }
/* 15 焦点环 */
a:focus-visible, button:focus-visible, summary:focus-visible, tr.clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input.num { text-align: right; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-grid > p { margin: 0; }
.form-grid .span-2 { grid-column: span 2; }
.form-error { margin: 0; color: var(--danger); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.filters select { max-width: 100%; min-width: 0; }
.page-root { display: contents; }
.login-notice { margin: 0; padding: 8px 12px; border-radius: var(--radius-button); background: var(--primary-soft); color: var(--foreground); }
.checkbox { display: flex; gap: 8px; align-items: center; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--banner-bg); }
.login-card { width: 380px; display: flex; flex-direction: column; gap: 16px; padding: 32px; }
.login-card .caption { margin: 0; }
.login-foot { text-align: center; }
.login-title { margin: 0; font-size: var(--text-page-title); line-height: var(--lh-page-title); font-weight: 600; display: flex; flex-direction: column; }
.login-title .grad-text { font-size: var(--text-stat); line-height: var(--lh-stat); font-weight: 700; }

/* 表格：表头浅紫底、只有水平细线、数字列右对齐 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--tint); font-size: var(--text-caption); line-height: var(--lh-caption); font-weight: 600; text-align: left; padding: 8px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
th:first-child { border-top-left-radius: var(--radius-button); border-bottom-left-radius: var(--radius-button); }
th:last-child { border-top-right-radius: var(--radius-button); border-bottom-right-radius: var(--radius-button); }
td { padding: 11px 12px; height: 44px; white-space: nowrap; border-bottom: 1px solid var(--border); vertical-align: middle; }
td.num, th.num { font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--tint); }
tbody tr.empty-row:hover td { background: transparent; }
tbody tr:last-child td { border-bottom: 0; }
.cell-2l { display: flex; flex-direction: column; align-items: flex-start; line-height: var(--lh-caption); gap: 2px; }
.cell-2l > :first-child { font-size: var(--text-body); }
.cell-2l > .caption { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.col-check { width: 36px; padding-right: 0; }
/* 审批表：理由两行截断、参考条件缩写（全文在 title），保证 1440 宽下“同意/拒绝”不被挤出可视区 */
.reason-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 220px; white-space: normal; }
.cell-2l > .ev-cap { max-width: 200px; }
.col-reason { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-detail { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-row { display: flex; gap: 4px; flex-wrap: wrap; }
.batch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--radius-button); background: var(--primary-soft); }
th.num, td.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--tint); }
tr.clickable:hover td:first-child { box-shadow: inset 2px 0 0 var(--primary); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--neutral); padding: 32px 16px; }
.empty p { margin: 0; }
.empty-text { color: var(--foreground); }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-soft); position: relative; }
.empty-icon::before { content: ""; position: absolute; inset: 15px 13px 13px; border: 2px solid var(--primary); border-radius: 4px; }
.empty-icon::after { content: ""; position: absolute; left: 13px; right: 13px; top: 22px; height: 2px; background: var(--primary); }
.empty .btn { margin-top: 4px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.text-danger { color: var(--danger); }

/* 胶囊徽标：仅主色在徽标配方下达标（2.3.1），其余状态用白底 + 实色字 + 边框 */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-pill); padding: 1px 10px; font-size: var(--text-caption); line-height: var(--lh-caption); font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.pill-active { background: var(--primary-soft); color: var(--primary); }
.pill-active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.pill-disabled { background: var(--card); color: var(--neutral); border-color: var(--neutral); }
.pill-revoked { background: var(--card); color: var(--danger); border-color: var(--danger); }
.pill-expired { background: var(--card); color: var(--foreground); border-color: var(--border); }
.pill-expired::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.pill-stream { background: var(--primary-soft); color: var(--primary); }
.pill-tier { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pill-mark { font-weight: 400; color: var(--accent); }
.pill-neutral { background: var(--card); color: var(--neutral); border-color: var(--border); }
.dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 进度条 */
.bar { height: 10px; border-radius: var(--radius-pill); background: var(--tint); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-gradient); border-radius: var(--radius-pill); width: 0; }
.bar.bar-danger > i { background: var(--danger); }
.bar.bar-warn > i { background: var(--warning); }
.bar-lg { height: 14px; }
.meter { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.meter-text { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }

/* 图表 */
.chart { width: 100%; height: 220px; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--neutral); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar-main { fill: var(--primary); }
.chart .bar-err { fill: var(--danger); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--primary-soft); }
.legend { display: flex; gap: 16px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .lg-main { background: var(--primary); }
.legend .lg-err { background: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-button); overflow: hidden; }
.seg button { font: inherit; font-size: var(--text-caption); line-height: var(--lh-caption); background: var(--card); color: var(--foreground); border: 0; padding: 4px 12px; cursor: pointer; }
.seg button.on { background: var(--primary-soft); color: var(--primary); font-weight: 500; }

/* 键值描述 */
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; }
.kv div > span { display: block; font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--neutral); }
.kv div > b { font-weight: 500; font-variant-numeric: tabular-nums; }
.kv-inline { grid-template-columns: 1fr; align-self: end; padding-bottom: 8px; }

/* 弹窗与提示 */
.modal-mask { position: fixed; inset: 0; background: rgba(34, 40, 68, 0.32); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal-wide { width: 720px; }
.confirm-body { display: flex; flex-direction: column; gap: 12px; }
.confirm-body p { margin: 0; }
.modal { width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-accent); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--tint); border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.secret-box code { flex: 1; word-break: break-all; font-size: var(--text-body); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-left: 4px solid var(--warning); border-radius: var(--radius-button); padding: 10px 14px; background: var(--card); color: var(--foreground); margin: 0; }
.notice-body { display: flex; flex-direction: column; gap: 2px; }
.notice-danger { border-left-color: var(--danger); }
.notice-info { border-left-color: var(--info); }
.notice-primary { border-left-color: var(--primary); }
.toast { position: fixed; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; max-width: 420px; background: var(--foreground); color: var(--card); padding: 10px 16px; border-radius: var(--radius-button); box-shadow: var(--shadow-accent); z-index: 60; cursor: pointer; }
.toast-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.toast.toast-err { background: var(--danger); }
.toast.toast-err .toast-dot { background: var(--card); }

/* 窄屏：侧栏改为顶部横向导航，主区不再左移；表格在卡片内横向滚动；前缀与操作按钮不折行 */
td .mono, td .btn-row { white-space: nowrap; flex-wrap: nowrap; }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidenav { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; gap: 16px; overflow-x: auto; }
  .sidenav .brand { padding: 0; flex: none; }
  .sidenav nav { flex-direction: row; gap: 12px; }
  .nav-group { flex-direction: row; align-items: center; gap: 2px; }
  .nav-label { padding: 0 4px 0 0; }
  .content-col { padding: 0 16px; }
  .toolbar-right .me-name, #change-pw { display: none; }
  .banner { padding: 20px; }
  .modal-wide { width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .sidenav nav a { white-space: nowrap; }
  .main { margin-left: 0; }
  .toolbar { padding: 0 16px; }
  .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 16px 0 32px; }
  .card { min-width: 0; }
  .table-wrap td { white-space: nowrap; }
  .card-head { flex-wrap: wrap; gap: 12px; }
  .filters { flex-wrap: wrap; }
}
/* 上游不可用横幅：语义警示色 --warning（左条 + 浅底），正文用前景色保证对比度 */
.upstream-banner { margin: 24px 0 0; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--warning); border-left-width: 4px; background: rgba(245, 158, 11, 0.10); color: var(--foreground); font-size: var(--text-body); line-height: var(--lh-body); }
.upstream-banner b { margin-right: 8px; }
.pill-warning { background: var(--card); color: var(--foreground); border-color: var(--warning); }
.pill-warning::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
/* 页面加载骨架 */
.page-loading { order: 99; display: flex; flex-direction: column; gap: 20px; }
.skel-table { display: flex; flex-direction: column; gap: 1px; }
.skeleton.skel-th { height: 36px; border-radius: var(--radius-button); margin-bottom: 4px; }
.skeleton.skel-row { height: 44px; border-radius: 6px; }
.skeleton.skel-line { height: 14px; width: 40%; border-radius: 6px; }
.skeleton.skel-num { height: 38px; width: 60%; border-radius: 8px; margin-top: 8px; }
.skeleton.skel-chart { height: 220px; border-radius: var(--radius); }
.skeleton { height: 72px; border-radius: var(--radius-card); background: linear-gradient(90deg, var(--tint), var(--card), var(--tint)); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* 19 可点击卡片 */
.card.clickable { cursor: pointer; }
.card.clickable:hover { box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow-card); }

/* 顶栏：应急红条、铃铛、身份 */
.break-glass { background: var(--danger); color: var(--card); padding: 8px 32px; font-size: var(--text-body); }
.break-glass b { margin-right: 8px; }
.me { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.bell-wrap { position: relative; }
.bell-icon { display: block; width: 16px; height: 16px; position: relative; }
.bell-icon::before { content: ""; position: absolute; left: 2px; right: 2px; top: 1px; bottom: 4px; border: 2px solid currentColor; border-bottom-width: 2px; border-radius: 7px 7px 2px 2px; }
.bell-icon::after { content: ""; position: absolute; left: 6px; bottom: 0; width: 4px; height: 3px; border-radius: 0 0 3px 3px; background: currentColor; }
.bell-count { position: absolute; top: 0; right: 0; min-width: 16px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--danger); color: var(--card); font-size: 11px; line-height: 16px; font-weight: 600; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 420px; overflow: auto; padding: 12px; z-index: 30; box-shadow: var(--shadow-accent); }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.bell-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bell-list a { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--radius-button); color: var(--foreground); }
.bell-list a:hover { background: var(--tint); }
.bell-list li.unread .bell-title { font-weight: 600; }
.bell-list li.unread .bell-title::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: 2px; }

/* 页面内分节头 */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head-title { margin: 0; font-size: var(--text-card-title); line-height: var(--lh-card-title); font-weight: 600; }
.page-head p { margin: 0; }

/* 21 概览 Banner（定义书 7.1）：浅紫底 + 2~3 个径向光斑 + 44px 淡出网格 + 渐变标语 */
.banner { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px 32px; border-radius: var(--radius-card); border: 1px solid var(--border);
  background:
    radial-gradient(420px 220px at 8% 0%, rgba(80, 72, 229, 0.18), transparent 70%),
    radial-gradient(360px 240px at 92% 20%, rgba(36, 99, 235, 0.14), transparent 70%),
    radial-gradient(300px 200px at 60% 120%, rgba(124, 59, 237, 0.12), transparent 70%),
    var(--banner-bg); }
.banner-grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(80, 72, 229, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(80, 72, 229, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%); mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%); }
.banner > :not(.banner-grid) { position: relative; }
.banner-main { display: flex; flex-direction: column; gap: 4px; }
.banner-title { margin: 0; font-size: var(--text-page-title); line-height: var(--lh-page-title); font-weight: 600; }
.banner-title .grad-text { font-size: var(--text-stat); line-height: var(--lh-stat); font-weight: 700; }
.banner-sub { margin: 0; }
.banner-metrics { display: flex; gap: 40px; flex-wrap: wrap; }
.banner-metric { display: flex; flex-direction: column; gap: 2px; }

/* ---------- 用户门户（portal.js）专用的几处排版；全部取设计令牌 ---------- */
.narrow { max-width: 480px; width: 100%; margin: 0 auto; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack > .btn-block { margin-top: 4px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--radius); background: var(--tint); }
.mini-stat b { font-size: var(--text-card-title); line-height: var(--lh-card-title); font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.quota { display: flex; flex-direction: column; gap: 12px; }
.quota-line { display: flex; align-items: baseline; gap: 8px; }
.quota-line b { font-size: var(--text-stat); line-height: var(--lh-stat); font-weight: 700; font-variant-numeric: tabular-nums; }
.fold summary { cursor: pointer; color: var(--brand-blue); margin: 12px 0 8px; font-weight: 500; }
.fold summary:hover { color: var(--accent); }
td.col-current, th.col-current { background: var(--primary-soft); }
td.col-current { color: var(--primary); font-weight: 600; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; }
.code-wrap { position: relative; }
.code-wrap > .btn { position: absolute; top: 8px; right: 8px; }
.code { margin: 0; padding: 16px; padding-right: 72px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--tint); overflow: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: var(--text-caption); line-height: var(--lh-caption); white-space: pre; }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }
