/* app.css — taikula 同步面板（多账号同步管理控制台）
 * 自包含；不依赖 app/ 之外任何文件。配色/字体对齐营销页 index.html（近黑底 + 信号绿）。
 * 服务于 /app/*，受严格 CSP 约束：所有交互逻辑在 panel.js，本文件仅样式。
 *
 * 设计基调（2026-07 redesign）：单强调色（信号绿），语义色只做状态
 * （琥珀=claude/临期、蓝=codex、红=危险）；圆角三级制——面板 14px、
 * 控件 9px、徽章与 chip 全圆；数字一律 tabular-nums。 */

:root {
  /* 表面 */
  --bg: #0a0b0d;
  --bg-soft: #101216;
  --panel: #0e1014;
  --panel-2: #0c0e12;
  --raise: #14171c;
  --line: #1e2229;
  --line-soft: #15181d;
  --line-strong: #2c313a;
  /* 文字：faint 也保证 ≥AA（4.5:1）对比 */
  --fg: #eceef2;
  --fg-dim: #a8afba;
  --fg-faint: #7e8795;
  /* 单强调色 + 语义色 */
  --ok: #3ddc97;
  --ok-hover: #4ee6a4;
  --ok-ink: #06281c;
  --ok-soft: rgba(61, 220, 151, .13);
  --ok-line: rgba(61, 220, 151, .38);
  --warn: #e0b341;
  --warn-soft: rgba(224, 179, 65, .12);
  --err: #e2695c;
  --err-soft: rgba(226, 105, 92, .12);
  --accent: #6aa8ff;
  --accent-soft: rgba(106, 168, 255, .12);
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Cascadia Code", "JetBrains Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  /* 圆角三级制 */
  --r-lg: 14px;
  --r: 9px;
  --r-pill: 999px;
  /* 焦点环 */
  --ring: 0 0 0 3px var(--ok-soft);
  --ring-line: rgba(61, 220, 151, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* 环境光：顶部一缕品牌绿 + 极淡点阵，压在最底层 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(110% 60% at 50% -12%, rgba(61, 220, 151, .06), transparent 55%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .016) 1px, transparent 0);
  background-size: auto, 24px 24px;
}

code, kbd, .mono { font-family: var(--mono); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(61, 220, 151, .25); }

/* 焦点可见性：键盘导航统一绿环（鼠标点击不显） */
:focus-visible { outline: 2px solid var(--ring-line); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible { outline: none; }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 通用内联小图标（Phosphor 内联 SVG，随文字色） */
svg.ic { width: 15px; height: 15px; flex: 0 0 auto; fill: currentColor; display: inline-block; vertical-align: -2px; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; height: 54px;
  padding: 0 clamp(16px, 4vw, 32px);
  background: rgba(10, 11, 13, .84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.topbar .mark {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(61, 220, 151, .16), rgba(61, 220, 151, .05));
  border: 1px solid var(--ok-line);
  font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--ok); line-height: 1;
}
.topbar .brand b { font-weight: 650; color: var(--fg); }
.topbar .brand-sub { color: var(--fg-faint); font-size: 13px; margin-left: 2px; }
.topbar .spacer { flex: 1 1 auto; }
.topbar .who { font-size: 12.5px; color: var(--fg-dim); display: flex; align-items: center; gap: 10px; }
.topbar .who .email {
  color: var(--fg-dim); font-size: 12px; max-width: 30vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 10px; border: 1px solid var(--line-soft); border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .02);
}
.topbar .who[hidden], .topbar .btn[hidden] { display: none; }

/* 多库切换器（单库时 hidden，主界面不露「库」概念）*/
.switcher { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.switcher .switcher-label { font-size: 12px; color: var(--fg-faint); }
.switcher select { min-width: 220px; width: auto; padding: 7px 12px; }

/* ============ 布局 ============ */
.shell { display: flex; max-width: 1300px; margin: 0 auto; min-height: calc(100dvh - 54px); }
.nav {
  flex: 0 0 208px; padding: 20px 12px; border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 54px; align-self: flex-start; max-height: calc(100dvh - 54px);
}
.nav[hidden] { display: none; }
.nav button {
  position: relative;
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--fg-dim);
  background: transparent; border: 0; border-radius: var(--r);
  padding: 9px 12px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav button:hover { background: rgba(255, 255, 255, .035); color: var(--fg); }
.nav button.active { background: var(--ok-soft); color: var(--ok); font-weight: 560; }
.nav button.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px;
  border-radius: 2px; background: var(--ok);
}
.nav button .ic { width: 16px; height: 16px; opacity: .85; }
.nav button.active .ic { opacity: 1; }
.content { flex: 1 1 auto; padding: clamp(20px, 4vw, 36px); min-width: 0; }

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .nav {
    position: static; max-height: none;
    flex: 0 0 auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 10px 12px;
  }
  .nav button { width: auto; flex: 0 0 auto; }
  .nav button.active::before { display: none; }
  .topbar .who .email { max-width: 38vw; }
  .topbar .brand-sub { display: none; }
}

/* ============ 视图 ============ */
.view { display: none; }
.view.active { display: block; animation: viewIn .3s cubic-bezier(.2, .7, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.view-head h1 { font-size: clamp(19px, 3vw, 23px); font-weight: 650; letter-spacing: -.015em; color: var(--fg); line-height: 1.3; }
.view-head .sub { font-size: 12.5px; color: var(--fg-faint); margin-top: 5px; max-width: 72ch; }

.kicker { font-size: 11px; letter-spacing: .26em; color: var(--ok); text-transform: uppercase; margin-bottom: 10px; }

/* ============ 卡片 / 面板 ============ */
.card {
  border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--panel);
  padding: clamp(16px, 3vw, 22px);
}
.card + .card { margin-top: 14px; }
.card h2 { font-size: 14px; font-weight: 620; color: var(--fg); letter-spacing: .01em; }
.card .card-sub { font-size: 12px; color: var(--fg-faint); margin: 2px 0 14px; max-width: 88ch; }
/* 卡片头：标题左、动作右，贴齐一行 */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.card-head .count {
  font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--fg-faint);
  margin-left: 8px; padding: 1px 8px; border: 1px solid var(--line); border-radius: var(--r-pill);
  vertical-align: 2px;
}
.card-gap { height: 18px; }

/* 认证页 */
.auth-wrap { max-width: 400px; margin: clamp(24px, 9vh, 90px) auto 0; }
.auth-card { padding: clamp(22px, 4vw, 28px); }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--fg-faint); margin-top: 16px; }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--r); margin-bottom: 20px; }
.tabs button {
  flex: 1 1 0; font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--fg-faint);
  background: transparent; border: 0; border-radius: 6px; padding: 8px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tabs button:hover { color: var(--fg-dim); }
.tabs button.active { background: var(--raise); color: var(--fg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }

/* ============ 表单 ============ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--fg-dim); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--fg-faint); margin-top: 6px; line-height: 1.55; }
input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%; font-family: var(--mono); font-size: 13px; color: var(--fg);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; transition: border-color .15s ease, box-shadow .15s ease; outline: none;
}
input::placeholder { color: var(--fg-faint); opacity: .8; }
input:focus, select:focus { border-color: var(--ring-line); box-shadow: var(--ring); }
select { font-family: var(--sans); appearance: none; cursor: pointer; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--sans); font-size: 13px; font-weight: 560; letter-spacing: .01em;
  border: 1px solid var(--line); background: var(--raise); color: var(--fg-dim);
  border-radius: var(--r); padding: 9px 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover:not(:disabled) { color: var(--fg); border-color: var(--line-strong); background: #181c22; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ok); color: var(--ok-ink); border-color: var(--ok); font-weight: 640; }
.btn.primary:hover:not(:disabled) { background: var(--ok-hover); border-color: var(--ok-hover); color: var(--ok-ink); }
.btn.danger { color: var(--err); border-color: rgba(226, 105, 92, .32); background: transparent; }
.btn.danger:hover:not(:disabled) { background: var(--err-soft); border-color: var(--err); color: var(--err); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.block { width: 100%; }
.btn .ic { width: 14px; height: 14px; }
.btn .spin {
  width: 13px; height: 13px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; display: none;
}
.btn.loading .spin { display: inline-block; }
.btn.loading .label { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; letter-spacing: .02em;
  padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--fg-dim);
  background: rgba(255, 255, 255, .02); white-space: nowrap; line-height: 1.7;
}
.badge.type-claude { color: var(--warn); border-color: rgba(224, 179, 65, .3); background: var(--warn-soft); }
.badge.type-codex { color: var(--accent); border-color: rgba(106, 168, 255, .3); background: var(--accent-soft); }
.badge.revoked { color: var(--err); border-color: rgba(226, 105, 92, .3); background: var(--err-soft); }
.badge.state-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.badge.state-err { color: var(--err); border-color: rgba(226, 105, 92, .3); background: var(--err-soft); }

/* ============ 列表 ============ */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line-soft); border-radius: var(--r); padding: 13px 16px;
  background: var(--panel-2);
  transition: border-color .15s ease, background .15s ease;
}
.row.clickable { cursor: pointer; }
.row.clickable:hover { border-color: var(--line); background: rgba(255, 255, 255, .03); }
.row.selected { border-color: var(--ok-line); box-shadow: 0 0 0 1px rgba(61, 220, 151, .08) inset; }
.row .grow { flex: 1 1 auto; min-width: 0; }
.row .title { font-size: 13.5px; font-weight: 580; color: var(--fg); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.row .meta { font-size: 11.5px; color: var(--fg-faint); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.row .meta .mono { color: var(--fg-dim); }
.modal-input, .owner-select {
  width: 100%; margin-top: 10px; padding: 9px 11px;
  background: var(--panel-2); color: inherit;
  border: 1px solid var(--line); border-radius: var(--r);
  font: inherit; color-scheme: dark;
}
.modal-input:focus, .owner-select:focus { border-color: var(--ring-line); box-shadow: var(--ring); outline: none; }
.row .actions { flex: 0 0 auto; display: flex; gap: 8px; }
.row.muted { opacity: .55; }
.row.muted .title { text-decoration: line-through; }

/* 空态：标题 + 提示两级 */
.empty {
  text-align: center; color: var(--fg-dim); font-size: 13px; padding: 34px 16px;
  border: 1px dashed var(--line); border-radius: var(--r); background: rgba(255, 255, 255, .008);
}
.empty .empty-title { font-weight: 560; color: var(--fg-dim); }
.empty .empty-hint { font-size: 12px; color: var(--fg-faint); margin-top: 4px; }
.empty .empty-hint .mono { color: var(--fg-dim); }

/* 骨架屏：占位条随内容形状；reduced-motion 下静止 */
.loading-block { padding: 4px 0; }
.skel-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
.skel-row:last-child { border-bottom: 0; }
.skel-bar {
  height: 12px; border-radius: 6px; flex: 0 0 auto;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, .04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ============ 账号表格（列式布局，对齐 CLI `taikula account ls`） ============ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.acct-table th {
  text-align: left; font-size: 11px; font-weight: 560; letter-spacing: .08em;
  color: var(--fg-faint); padding: 7px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.acct-table td {
  padding: 10px 8px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; white-space: nowrap;
}
.acct-table .badge { padding: 1px 7px; font-size: 10.5px; }
.acct-table tbody tr:last-child td { border-bottom: 0; }
.acct-table tbody tr { transition: background .12s ease; }
.acct-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.acct-table th:first-child, .acct-table td:first-child { padding-left: 4px; }
.acct-table th:last-child, .acct-table td:last-child { padding-right: 4px; text-align: right; }
.acct-table .alias { font-weight: 620; font-size: 13px; color: var(--fg); margin-right: 8px; }
.acct-table .cell-email { color: var(--fg-dim); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.acct-table .cell-usage { color: var(--fg-dim); font-size: 12px; }
.acct-table .cell-sync { color: var(--fg-faint); }
.acct-table .sync-sub { font-size: 10.5px; color: var(--fg-faint); margin-top: 3px; font-variant-numeric: tabular-nums; }
.acct-table .dim { color: var(--fg-faint); }
.acct-table .badge + .badge { margin-left: 5px; }
/* 行内可点 chip（到期/周限/owner）：统一高度融进行高；未设置时虚线示意可点 */
.acct-table .btn.chip {
  padding: 2px 9px; font-size: 11.5px; border-color: var(--line-soft);
  background: transparent; border-radius: var(--r-pill); min-height: 22px;
}
.acct-table .btn.chip:hover:not(:disabled) { border-color: var(--line-strong); background: var(--raise); }
/* 设备行的默认账号 chip（单机默认）：同款行内 chip，落在 .row .meta 语境 */
.device-defaults .btn.chip {
  padding: 2px 9px; font-size: 11.5px; border-color: var(--line-soft);
  background: transparent; border-radius: var(--r-pill); min-height: 22px;
}
.device-defaults .btn.chip:hover:not(:disabled) { border-color: var(--line-strong); background: var(--raise); }
.btn.due-warn { color: var(--warn); border-color: rgba(224, 179, 65, .35) !important; background: var(--warn-soft) !important; }
.btn.due-over { color: var(--err); border-color: rgba(226, 105, 92, .35) !important; background: var(--err-soft) !important; }
/* 启动命令列：自定义命令 chip + 删除 ×、追加 ＋ */
.acct-table .badge.handle {
  font-family: var(--mono); color: var(--fg); font-weight: 560;
  background: var(--raise); border-color: var(--line); padding-right: 6px;
}
.acct-table .badge.handle + .badge.handle { margin-left: 4px; }
.acct-table .handle-name { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-table .owner-chip { display: inline-block; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; padding: 0; margin-left: 3px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--fg-faint); font-size: 13px; line-height: 1; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.chip-x:hover { background: var(--err-soft); color: var(--err); }
.acct-table .add-handle {
  padding: 0 7px; font-size: 13px; margin-left: 4px; color: var(--fg-faint);
  min-height: 22px; border-radius: var(--r-pill); border-color: transparent; background: transparent;
}
.acct-table .add-handle:hover:not(:disabled) { color: var(--fg); border-color: var(--line); background: var(--raise); }
.acct-table .cell-act .btn.sm { padding: 2px 8px; font-size: 12px; min-height: 22px; border-radius: var(--r-pill); }
/* 删除钮降噪：默认隐入背景，行悬停/键盘聚焦时现身（触屏无 hover 则常显） */
.acct-table .del-btn { border-color: transparent; }
@media (hover: hover) and (pointer: fine) {
  .acct-table .del-btn { opacity: .3; }
  .acct-table tbody tr:hover .del-btn, .acct-table .del-btn:focus-visible { opacity: 1; }
}

/* ============ 提示横幅 ============ */
.notice {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 12.8px; line-height: 1.6; color: var(--fg-dim);
  border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px;
  background: rgba(255, 255, 255, .015); margin-bottom: 18px;
}
.notice .ic { flex: 0 0 auto; }
.notice b { color: var(--fg); font-weight: 600; }
.notice.warn { border-color: rgba(224, 179, 65, .3); background: var(--warn-soft); color: #d9c79a; }
.notice.warn b { color: var(--warn); }
.notice.info { border-color: rgba(106, 168, 255, .28); background: var(--accent-soft); }

/* ============ Toast ============ */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, 90vw);
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.5; color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px;
  background: var(--raise); box-shadow: 0 16px 44px -20px rgba(0, 0, 0, .9);
  animation: toastIn .25s cubic-bezier(.2, .7, .2, 1);
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast .ic { flex: 0 0 auto; font-weight: 700; }
.toast.ok { border-color: var(--ok-line); }
.toast.ok .ic { color: var(--ok); }
.toast.err { border-color: rgba(226, 105, 92, .4); }
.toast.err .ic { color: var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ============ 模态 ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 5, 7, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 460px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .95);
  padding: clamp(20px, 4vw, 26px);
}
.modal-backdrop.open .modal { animation: modalIn .22s cubic-bezier(.2, .7, .2, 1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 16px; font-weight: 640; color: var(--fg); margin-bottom: 10px; }
.modal p { font-size: 13px; color: var(--fg-dim); line-height: 1.65; margin-bottom: 8px; }
.modal pre { font-size: 12.5px; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; overflow-x: auto; margin: 6px 0; }
.modal .btn-row { margin-top: 20px; }

/* ============ 子帐号授权（建号→勾选→对方登录） ============ */
/* 新建子帐号：桌面端表单横排，按钮贴齐输入框底 */
.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { flex: 1 1 200px; margin-bottom: 0; }
.form-inline .btn { flex: 0 0 auto; }

.subuser {
  border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 16px;
  background: var(--panel-2);
}
.subuser .subuser-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13.5px; font-weight: 580; color: var(--fg); }
.subuser .subuser-head .email { font-family: var(--mono); font-weight: 500; }
.grant-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.grant {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  font-size: 12.5px; color: var(--fg-dim);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 13px 6px 10px;
  background: var(--panel); transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.grant:hover { border-color: var(--line-strong); color: var(--fg); }
.grant.checked { border-color: var(--ok-line); background: var(--ok-soft); color: var(--fg); }
.grant input[type="checkbox"] { accent-color: var(--ok); width: 14px; height: 14px; margin: 0; cursor: pointer; }
.grant .grant-mail { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subuser .subuser-foot { display: flex; align-items: center; gap: 10px; }
.subuser .subuser-foot .dirty-hint { font-size: 11.5px; color: var(--warn); }
.subuser .hint { font-size: 12px; color: var(--fg-faint); }

/* 邀请链接复制框 */
.copybox {
  display: flex; align-items: stretch; gap: 0; border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; background: var(--panel-2);
}
.copybox code { flex: 1 1 auto; padding: 10px 13px; font-size: 12.5px; color: var(--fg); overflow-x: auto; white-space: nowrap; }
.copybox .btn { border: 0; border-left: 1px solid var(--line); border-radius: 0; flex: 0 0 auto; background: var(--raise); }
.copybox .btn.done { color: var(--ok); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13px; }
.kv dt { color: var(--fg-faint); }
.kv dd { color: var(--fg); font-family: var(--mono); word-break: break-all; }

/* ============ 动效降级 ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .skel-bar { animation: none; background: rgba(255, 255, 255, .05); }
}

[hidden] { display: none !important; }
