@charset "UTF-8";
/* Claude 额度中心 — 浅色管理界面 */
:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f8f9f7;
  --border: #e2e5e1;
  --border-strong: #cdd3cd;
  --text: #1a2420;
  --text-2: #46524c;
  --text-3: #5f6b65;
  --accent: #145244;
  --accent-hover: #1b6656;
  --accent-soft: #e7f0eb;
  --focus: #1f6feb;
  --green: #1d6a45; --green-bg: #e5f2ea; --green-bar: #2f8a5f;
  --amber: #8a5300; --amber-bg: #fcf1dc; --amber-bar: #d08a10;
  --red: #b42318;   --red-bg: #fdebe9;   --red-bar: #d0412e;
  --blue: #1d4f91;  --blue-bg: #e8effa;
  --gray-bg: #eef0ed;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 35, 28, .05);
  --shadow-lg: 0 18px 48px rgba(20, 35, 28, .18);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); overflow-x: hidden; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; }
.skip-link:focus { top: 12px; }
.muted, .meta { color: var(--text-3); }
.meta { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ---------- 按钮 ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button:disabled { cursor: not-allowed; opacity: .6; }
.button[aria-busy="true"] { cursor: progress; opacity: .85; }
.button.block { width: 100%; }
.button.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.primary { background: var(--accent); color: #fff; }
.primary:not(:disabled):hover { background: var(--accent-hover); }
.secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.secondary:not(:disabled):hover { background: var(--surface-2); border-color: #b9c1ba; }
.ghost { background: transparent; color: var(--text-2); }
.ghost:not(:disabled):hover { background: var(--gray-bg); color: var(--text); }
.danger-solid { background: var(--red); color: #fff; }
.danger-solid:not(:disabled):hover { background: #9a1d13; }
.icon-button { width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); font-size: 22px; line-height: 1; }
.icon-button:not(:disabled):hover { background: var(--gray-bg); color: var(--text); }
.icon-button:disabled { opacity: .4; cursor: not-allowed; }
.spinner, .spin-icon { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; flex-shrink: 0; }
.spinner { animation: spin .8s linear infinite; }
.spin-icon { border-style: solid; opacity: .7; }
.is-loading .spin-icon { animation: spin .8s linear infinite; opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--gray-bg); color: var(--text-2); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; background: var(--surface-2); color: var(--text); max-width: 100%; overflow-wrap: anywhere; }
.chip em { font-style: normal; color: var(--text-3); }
.chip.green em { color: var(--green); font-weight: 600; }
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }

/* ---------- 提示 ---------- */
.notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.notice.info { background: var(--blue-bg); color: var(--blue); }
.notice.success { background: var(--green-bg); color: var(--green); }
.notice.warn { background: var(--amber-bg); color: var(--amber); border-color: #f2ddb0; }
.notice.error { background: var(--red-bg); color: var(--red); border-color: #f6cdc8; }
.notice.compact { padding: 7px 10px; font-size: 13px; }
.notice p { margin: 2px 0 0; }
.notice .meta { color: inherit; opacity: .85; }
.notice.pending { align-items: center; margin-bottom: 12px; }
.notice.pending > div { min-width: 0; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 8px; padding: 12px 10px 12px 14px; border-radius: 10px; background: #1f2a25; color: #f3f6f4; font-size: 14px; box-shadow: var(--shadow-lg); overflow-wrap: anywhere; }
.toast span { flex: 1; padding-top: 3px; }
.toast.success { background: #174a39; }
.toast.error { background: #8f1f16; }
.toast-close { border: 0; background: transparent; color: inherit; opacity: .8; width: 28px; height: 28px; border-radius: 6px; font-size: 18px; line-height: 1; }
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, .12); }

/* ---------- 启动与登录 ---------- */
.startup { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-3); }
.startup img { border-radius: 10px; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(1200px 500px at 50% -10%, #e6efe9, transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 36px 32px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 10px 30px rgba(20, 35, 28, .06); }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; color: var(--text-2); }
.login-brand img { border-radius: 10px; }
.login-title { margin-top: 28px; font-size: 24px; font-weight: 650; letter-spacing: -.2px; }
.login-sub { margin-top: 4px; color: var(--text-3); font-size: 14px; }
.login-card .notice { margin-top: 16px; }
#login-form { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
#login-form .notice { margin-top: 0; }
#login-form .button { min-height: 44px; margin-top: 4px; font-size: 15px; }
.login-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); text-align: center; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .perm-fieldset legend { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
input[type="text"], input[type="password"], input[type="search"], input:not([type]) {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #8b958f; }
input:hover:not(:disabled) { border-color: #b3bbb4; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20, 82, 68, .16); }
input:focus-visible { outline: none; }
input:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
input[aria-invalid="true"] { border-color: var(--red); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }
.field-hint { font-size: 12.5px; color: var(--text-3); }
.field-hint.warn { color: var(--amber); }
.input-with-action { position: relative; }
.input-with-action input { padding-right: 64px; }
.input-action { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; }
.input-action:hover { background: var(--gray-bg); }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.switch-line { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; font-weight: 600; cursor: pointer; }
.switch-line input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; min-height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15.5px; white-space: nowrap; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 4px; }
.nav-item { position: relative; min-height: 60px; padding: 0 12px; border: 0; background: transparent; color: var(--text-3); font-size: 14.5px; font-weight: 600; }
.nav-item:hover { color: var(--text); }
.nav-item[aria-current="page"] { color: var(--accent); }
.nav-item[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.account-menu { margin-left: auto; display: flex; align-items: center; gap: 4px; min-width: 0; }
.who { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; min-width: 0; }
.who-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }

/* ---------- 页面 ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 28px 24px 40px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.2px; line-height: 1.3; }
.page-sub { margin-top: 4px; color: var(--text-3); font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 12px; }
#last-refresh { font-variant-numeric: tabular-nums; border-radius: 6px; padding: 2px 6px; }
#last-refresh.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--green-bg); color: var(--green); } 100% { background: transparent; } }
#dashboard-alert:not(:empty) { margin-bottom: 16px; }
.app-footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); text-align: center; }

/* 概览 */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.summary:empty { display: none; }
.stat { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.stat-value { margin-top: 6px; font-size: 28px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat-value.text { font-size: 20px; line-height: 1.6; letter-spacing: 0; }
.stat-value small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.stat-note { margin-top: 4px; font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.stat-note.amber { color: var(--amber); }
.stat-note.red { color: var(--red); }

/* 容器 */
.instance-block { margin-bottom: 28px; }
.instance-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.instance-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.instance-title h2 { font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.instance-tags { display: flex; align-items: center; gap: 10px; }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }

/* 账号卡片 */
.account-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-id { min-width: 0; }
.account-name { font-weight: 650; font-size: 15.5px; overflow-wrap: anywhere; }
.account-id .meta { font-size: 12.5px; }
.quotas { display: flex; flex-direction: column; gap: 14px; }
.quota-head, .quota-foot { display: flex; justify-content: space-between; gap: 12px; }
.quota-name { font-size: 14px; font-weight: 600; color: var(--text-2); }
.quota-left { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.quota-left strong { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; margin-left: 2px; }
.quota.mid .quota-left strong { color: var(--amber); }
.quota.high .quota-left strong, .quota.out .quota-left strong { color: var(--red); }
.bar { height: 8px; margin: 7px 0 6px; border-radius: 999px; background: #e9ece8; overflow: hidden; }
.bar span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--green-bar); transition: width .4s ease; }
.quota.mid .bar span { background: var(--amber-bar); }
.quota.high .bar span, .quota.out .bar span { background: var(--red-bar); }
.quota-foot { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.quota-foot span:last-child { text-align: right; margin-left: auto; }
.empty-line { font-size: 13.5px; color: var(--text-3); }
.grants { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--border); margin-top: auto; }
.grants-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--text-2); }
.grant-list { display: flex; flex-direction: column; gap: 8px; }
.grant { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.grant-info { display: flex; flex-direction: column; min-width: 0; }
.grant-name { font-size: 14px; font-weight: 600; }
.grant-meta { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.grant-meta strong { color: var(--text); }
.grant-why { font-size: 12.5px; color: var(--amber); }
.lock-line { font-size: 12.5px; color: var(--text-3); }

/* 状态面板 */
.state-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); }
.state-panel h2 { font-size: 17px; font-weight: 650; color: var(--text); }
.state-panel p { max-width: 460px; font-size: 14px; color: var(--text-3); overflow-wrap: anywhere; }
.state-panel .button { margin-top: 8px; }
.state-panel.error { border-color: #f0c4be; }
.state-panel.inline { flex-direction: row; justify-content: space-between; padding: 16px 18px; text-align: left; border-style: solid; }
.state-panel.inline .button { margin-top: 0; }
.state-panel.inline.error { background: var(--red-bg); }
.state-panel.inline.error p { color: var(--red); }
.state-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--gray-bg); color: var(--text-3); font-weight: 700; font-size: 18px; }
.state-panel.error .state-icon { background: var(--red-bg); color: var(--red); }
.loading-state { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.skeleton-card, .skeleton-row, .skeleton-block { border-radius: var(--radius); background: linear-gradient(90deg, #eceee9 0%, #f5f6f3 50%, #eceee9 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton-card { height: 260px; }
.skeleton-row { height: 56px; grid-column: 1 / -1; }
.stat.skeleton-block { height: 104px; border: 0; box-shadow: none; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* 工具栏与表格 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { max-width: 320px; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 11px 16px; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfcfa; }
.data-table .sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.data-table .tag + .sub { margin-top: 6px; }
.data-table td > div { min-width: 0; }
.cell-action { text-align: right; white-space: nowrap; width: 1%; }
.users-table td:first-child { width: 24%; }
.users-table td:nth-child(2) { width: 110px; }

/* ---------- 对话框 ---------- */
dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(18, 28, 24, .42); }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px 24px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: -4px; }
.dialog-head h2 { font-size: 18px; font-weight: 650; line-height: 1.4; padding-top: 4px; overflow-wrap: anywhere; }
.dialog-text { font-size: 14px; color: var(--text-2); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.facts > div { padding: 10px 12px; background: var(--surface); min-width: 0; }
.facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin-top: 2px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
#reset-detail { display: flex; flex-direction: column; gap: 12px; }
.countdown { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.countdown.expired { color: var(--red); font-weight: 600; }
.result { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid; }
.result strong { font-size: 15px; }
.result p { margin-top: 4px; font-size: 14px; }
.result .meta { color: inherit; opacity: .85; font-size: 12.5px; }
.result.success { background: var(--green-bg); color: var(--green); border-color: #bfe0cb; }
.result.warn { background: var(--amber-bg); color: var(--amber); border-color: #f2ddb0; }
.result.error { background: var(--red-bg); color: var(--red); border-color: #f6cdc8; }
#reset-result:empty, #retry-result:empty, #retry-detail:empty { display: none; }

/* 权限分配 */
.perm-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.perm-fieldset legend { padding: 0; margin-bottom: 2px; }
.perm-bulk { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.perm-bulk .meta { margin-right: 4px; font-size: 12.5px; }
.perm-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.perm-row:last-child { border-bottom: 0; }
.perm-name { display: flex; flex-direction: column; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.perm-name .meta { font-size: 12.5px; }
.seg { display: inline-flex; flex-shrink: 0; padding: 3px; border-radius: 9px; background: var(--gray-bg); gap: 2px; }
.seg-item { position: relative; display: inline-flex; }
.seg-item input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-item span { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; transition: background-color .15s, color .15s; }
.seg-item:hover span { color: var(--text); }
.seg-item input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 35, 28, .14); }
.seg-item input[value="reset"]:checked + span { color: var(--green); }
.seg-item input[value="none"]:checked + span { color: var(--text-2); }
.seg-item input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { font-size: 15px; }
  .topbar-inner { flex-wrap: wrap; gap: 0 12px; padding: 0 16px; min-height: 56px; }
  .topbar-inner > .brand, .account-menu { min-height: 56px; }
  .brand-name { font-size: 15px; }
  .account-menu { gap: 0; }
  .who { margin-right: 4px; }
  .who-name { max-width: 30vw; }
  .nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; border-top: 1px solid var(--border); overflow-x: auto; }
  .nav-item { min-height: 46px; }
  .container { padding: 20px 16px 32px; }
  .page-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .page-head h1 { font-size: 21px; }
  .page-actions { justify-content: space-between; }
  .page-actions .button { flex: 0 0 auto; }
  #admin-view .page-actions .button { flex: 1; }
  .summary { gap: 10px; margin-bottom: 20px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 24px; }
  .stat-value.text { font-size: 17px; }
  .account-card { padding: 16px; }
  .state-panel.inline { flex-direction: column; align-items: flex-start; }
  .toolbar input { max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .perm-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .seg { display: flex; }
  .seg-item { flex: 1; }
  .seg-item span { justify-content: center; width: 100%; padding: 4px 6px; }
  .dialog-body { padding: 18px 16px 20px; }
  .dialog-foot { flex-direction: column-reverse; }
  .dialog-foot .button { width: 100%; min-height: 44px; }
  .input-row { flex-wrap: wrap; }
  .input-row input { flex-basis: 100%; }
  .input-row .button { flex: 1; }
  .toasts { right: 16px; left: 16px; width: auto; bottom: 16px; }

  /* 表格转卡片 */
  .table-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100% !important; }
  .data-table tr { margin-bottom: 10px; padding: 6px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
  .data-table td { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 8px 14px; border-bottom: 0; }
  .data-table td::before { content: attr(data-label); font-size: 12.5px; color: var(--text-3); padding-top: 2px; }
  .data-table td.cell-action { display: block; text-align: left; padding-top: 4px; }
  .data-table td.cell-action:empty { display: none; }
  .data-table td.cell-action::before { content: none; }
  .data-table td.cell-action .button { width: 100%; min-height: 42px; }
  .data-table tbody tr:hover td { background: transparent; }
}
@media (max-width: 420px) {
  .brand-name { display: none; }
  .summary { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .grant { flex-direction: column; align-items: stretch; }
  .grant .button { width: 100%; min-height: 42px; }
  .quota-foot span:last-child { margin-left: 0; text-align: left; }
}
@media (pointer: coarse) {
  .button { min-height: 44px; }
  .button.small { min-height: 40px; }
  .icon-button { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
