/* ===== source: public/assets/ui/design/tokens.css ===== */
/* ============================================================================
 * QQboot UI 设计令牌（Design Tokens）
 * ----------------------------------------------------------------------------
 * 唯一依据文件。桌面端、手机端、用户端、管理端全部从这里取值。
 * 任何模板不得自造颜色、圆角、阴影、间距；缺什么先在这里加。
 *
 * 命名对齐 shadcn/ui v4 语义变量（background / foreground / card / primary /
 * secondary / muted / accent / destructive / border / input / ring），
 * 这样后续如果接入 Tailwind v4，可以直接把 @theme 映射过来。
 *
 * 取值说明：
 *   - 颜色一律 hex，不用 oklch()。目标环境含 Android 旧版 WebView 与
 *     iOS 15 以下，oklch 在这些内核上会整条声明失效并回退成黑色。
 *   - 对比度按 WCAG 2.2 AA：正文 ≥ 4.5:1，大字号与图标 ≥ 3:1。
 *   - 暗色模式用 [data-theme="dark"]，不依赖 prefers-color-scheme，
 *     避免用户在系统暗色下仍被强制变暗。
 * ========================================================================== */

:root {
  /* ---------------------------------------------------------------- 色板基底
   * 中性色取 zinc 系（略带冷调），比纯灰更有质感，也不会和主色打架。 */
  --gray-25:  #fcfcfd;
  --gray-50:  #f8f9fb;
  --gray-100: #f1f3f7;
  --gray-150: #eaedf3;
  --gray-200: #e2e6ee;
  --gray-300: #cbd2e0;
  --gray-400: #9aa4b8;
  --gray-500: #6b7689;
  --gray-600: #556074;
  --gray-700: #3d4759;
  --gray-800: #28313f;
  --gray-900: #1a2230;
  --gray-950: #0f1520;

  /* ---------------------------------------------------------------- 语义颜色 */
  --background: #f7f8fb;          /* 页面底色，比纯白低 2% 亮度，衬托白卡 */
  --foreground: #1a2230;          /* 主文字 14.8:1 */
  --card: #ffffff;                /* 卡片、弹窗、下拉 */
  --card-foreground: #1a2230;
  --popover: #ffffff;
  --popover-foreground: #1a2230;

  --primary: #2f5fe0;             /* 主色：蓝 600，按钮、链接、选中态 */
  --primary-hover: #2650c4;
  --primary-active: #1f44a8;
  --primary-foreground: #ffffff;
  --primary-soft: #eef3ff;        /* 主色浅底：选中标签、弱按钮 */
  --primary-soft-foreground: #2350c8;
  --primary-border: #c9d9ff;

  --secondary: #f1f3f7;           /* 次级按钮底 */
  --secondary-hover: #e8ebf2;
  --secondary-foreground: #28313f;

  --muted: #f4f6fa;               /* 弱背景：表头、代码块、空状态 */
  --muted-foreground: #667184;    /* 次要文字 4.64:1（在 --background 上） */
  /* 第三级文字：占位符、分隔符、图标等。
     取值经过四种背景实测：card 5.20 / background 4.89 / muted 4.80 / accent 4.68，
     全部达到 WCAG AA 4.5:1，因此在任何底色上承载次要文字都安全。 */
  --subtle-foreground: #646d80;

  --accent: #eef3ff;              /* hover 高亮底 */
  --accent-foreground: #2350c8;
  /* 在 --accent / --primary-soft 底上的次要文字，需比 --muted-foreground 再深一档（4.63:1） */
  --muted-foreground-on-accent: #636e81;

  --destructive: #ca3244;         /* 危险：删除、封禁、失败（4.61:1 on soft） */
  --destructive-hover: #bb2f40;
  --destructive-foreground: #ffffff;
  --destructive-soft: #fdeef0;
  --destructive-border: #f7cdd2;

  --success: #0f7d59;             /* 成功：正常、已发布、通过（4.61:1 on soft） */
  --success-soft: #e8f6f1;
  --success-border: #bfe6d8;

  --warning: #9d6104;             /* 警告：待审核、将过期（4.64:1 on soft） */
  --warning-soft: #fdf4e3;
  --warning-border: #f3ddb4;

  --info: #1b6bcc;                /* 信息：提示条（4.66:1 on soft） */
  --info-soft: #eaf3fd;
  --info-border: #c3ddf8;

  /* 边框与输入 */
  --border: #e4e8f0;              /* 卡片描边 */
  --border-strong: #d3d9e6;       /* 输入框、分隔强调 */
  --input: #dfe4ee;               /* 输入框默认描边 */
  --input-hover: #c8d0e0;
  --ring: #2f5fe0;                /* 焦点环 */

  /* 图表色（多序列，色盲友好顺序） */
  --chart-1: #2f5fe0;
  --chart-2: #12a08a;
  --chart-3: #d98324;
  --chart-4: #8b5cf6;
  --chart-5: #d33b4d;

  /* ---------------------------------------------------------------- 圆角
   * 8/10/12/16/999 五档。shadcn 的 0.625rem≈10px 与 --radius-md 对齐。 */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-pill: 999px;

  /* ---------------------------------------------------------------- 间距
   * 4px 基准栅格。命名按倍数，不用 t-shirt size，避免歧义。 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---------------------------------------------------------------- 搜索框
   * 全站搜索框（.search / .toolbar-search / .topbar__search）共用这一组。
   * 输入框左内边距不再手写像素，而是由「图标左内边距 + 图标宽度 + 图标与
   * 文字的间隙」相加得出 —— 三处任何一处调整，padding 自动跟随，
   * 不会再出现图标压住占位文字的情况。
   * 手机端把 --search-icon-size 换成 --search-icon-size-mobile（见下方）。 */
  --search-icon-size: 15px;            /* 图标本体尺寸，与 .icon 默认值一致 */
  --search-icon-inset: var(--space-3); /* 图标距容器左边缘 */
  --search-icon-gap: var(--space-2);   /* 图标右边缘到文字起点，留 8px 呼吸 */
  --search-input-padding: calc(
    var(--search-icon-inset) + var(--search-icon-size) + var(--search-icon-gap)
  );
  /* 手机端图标随输入框一起放大：--space-5 = 20px。默认值占位，由移动端
   * 样式表（public/assets/ui/mobile/mobile.css）在 .m-app 作用域内覆盖，
   * 这样桌面端不会因为手机断点判断而误改。 */
  --search-icon-size-mobile: var(--space-5);

  /* ---------------------------------------------------------------- 字号
   * 1.25 倍模块化。正文桌面 14px / 手机 16px（避免 iOS 输入框聚焦缩放）。 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;

  --leading-tight: 1.25;
  --leading-snug: 1.4;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-tight: -0.011em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;

  /* ---------------------------------------------------------------- 阴影
   * 浅色 SaaS 的关键：阴影要极轻，靠描边区分层级，不靠投影。 */
  --shadow-xs: 0 1px 2px rgba(24, 34, 48, .04);
  --shadow-sm: 0 1px 3px rgba(24, 34, 48, .06), 0 1px 2px rgba(24, 34, 48, .04);
  --shadow-md: 0 4px 12px rgba(24, 34, 48, .07), 0 1px 3px rgba(24, 34, 48, .05);
  --shadow-lg: 0 12px 28px rgba(24, 34, 48, .09), 0 2px 6px rgba(24, 34, 48, .05);
  --shadow-xl: 0 24px 48px rgba(24, 34, 48, .12), 0 4px 12px rgba(24, 34, 48, .06);
  --shadow-ring: 0 0 0 1px rgba(24, 34, 48, .05);

  /* 玻璃拟态：只用于悬浮操作条与弹层头部，不做整块卡片背景（性能与可读性） */
  --glass-bg: rgba(255, 255, 255, .72);
  --glass-bg-strong: rgba(255, 255, 255, .88);
  --glass-blur: saturate(180%) blur(20px);
  --glass-border: rgba(255, 255, 255, .6);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .85);

  /* ---------------------------------------------------------------- 动效 */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 280ms;

  /* ---------------------------------------------------------------- 层级 */
  --z-base: 1;
  --z-sticky: 20;
  --z-drawer: 40;
  --z-modal: 50;
  --z-toast: 60;
  --z-tooltip: 70;

  /* ---------------------------------------------------------------- 布局 */
  --sidebar-width: 248px;
  --sidebar-width-collapsed: 68px;
  --topbar-height: 60px;
  --container-max: 1360px;
  --content-max: 1120px;

  /* 手机端 */
  /* 手机端排版：正文 16px 与行高 1.55 独立于桌面取值（SPEC §3.2 / §6） */
  --text-base-mobile: 16px;
  --leading-mobile: 1.55;
  --input-font-size-mobile: 16px;   /* 防止 iOS 聚焦时自动缩放 */
  --mobile-tabbar-icon: 22px;

  --mobile-topbar-height: 56px;
  --mobile-tabbar-height: 60px;
  --touch-target: 44px;           /* WCAG 2.2 最小可点击 24px，Apple HIG 44px，取 44 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ============================================================================
 * 暗色模式
 * ----------------------------------------------------------------------------
 * 不是简单反色：底色用 #0f1520 而非纯黑（纯黑上白字发晕），卡片略亮一档，
 * 主色降饱和提亮，保证在深底上的对比度仍达 AA。
 * ========================================================================== */
[data-theme="dark"] {
  --background: #0f1520;
  --foreground: #e8ecf3;
  --card: #171e2b;
  --card-foreground: #e8ecf3;
  --popover: #1b2331;
  --popover-foreground: #e8ecf3;

  --primary: #5b83f0;
  --primary-hover: #7192f4;
  --primary-active: #4a72e0;
  --primary-foreground: #0f1520;
  --primary-soft: #1c2a4a;
  --primary-soft-foreground: #9db8ff;
  --primary-border: #2b3f66;

  --secondary: #1e2735;
  --secondary-hover: #26303f;
  --secondary-foreground: #e8ecf3;

  --muted: #1a2231;
  --muted-foreground: #a4aec0;
  --subtle-foreground: #7c8698;

  --accent: #1c2a4a;
  --accent-foreground: #9db8ff;

  --destructive: #f0677a;
  --destructive-hover: #f5808f;
  --destructive-foreground: #0f1520;
  --destructive-soft: #35202a;
  --destructive-border: #5a2c38;

  --success: #4ecfa4;
  --success-soft: #14332b;
  --success-border: #1f5a4a;

  --warning: #e0a94a;
  --warning-soft: #33280f;
  --warning-border: #5c4718;

  --info: #6aa9f0;
  --info-soft: #14263c;
  --info-border: #234668;

  --border: #242e3e;
  --border-strong: #32405a;
  --input: #2a3547;
  --input-hover: #3a4761;
  --ring: #5b83f0;

  --chart-1: #5b83f0;
  --chart-2: #4ecfa4;
  --chart-3: #e0a94a;
  --chart-4: #a78bfa;
  --chart-5: #f0677a;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
  --shadow-ring: 0 0 0 1px rgba(255, 255, 255, .06);

  --glass-bg: rgba(23, 30, 43, .72);
  --glass-bg-strong: rgba(23, 30, 43, .9);
  --glass-border: rgba(255, 255, 255, .08);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* ============================================================================
 * 基础重置
 * ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--foreground);
}

p { margin: 0; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: .92em; }

img, svg, video, canvas { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

/* 焦点可见：键盘用户必须看得见焦点，鼠标点击不显示 */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 3px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--gray-400); background-clip: padding-box; }

::selection { background: var(--primary-soft); color: var(--primary-soft-foreground); }

/* 屏幕阅读器专用 */
.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;
}

/* 跳转链接：键盘用户第一个 Tab 就能跳过导航 */
.skip-link {
  position: absolute;
  top: -100px; left: var(--space-4);
  z-index: var(--z-tooltip);
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-4);
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-medium);
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-3); text-decoration: none; }

/* ============================================================================
 * 打印：只留内容，去掉导航与操作
 * ========================================================================== */
@media print {
  .app-sidebar,
  .app-topbar,
  .m-topbar,
  .m-tabbar,
  .btn,
  .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
/* ===== source: public/assets/ui/design/components.css ===== */
/* ============================================================================
 * QQboot UI 组件层（Components）
 * ----------------------------------------------------------------------------
 * 只依赖 tokens.css 的变量，不写死任何颜色/尺寸。
 * 桌面端与手机端共用；手机端在 mobile.css 里做尺寸与排布的覆盖。
 *
 * 命名约定：BEM 简化版 —— .btn / .btn--primary / .btn__icon
 * 状态类统一：.is-active / .is-loading / .is-disabled
 * ========================================================================== */

/* hidden 属性必须压过组件自身 display（.empty 等用 flex 会覆盖 hidden） */
[hidden] { display: none !important; }

/* ============================================================================
 * 1. 按钮
 * ========================================================================== */
.btn {
  --btn-h: 36px;
  --btn-px: var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.btn:hover { background: var(--secondary-hover); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* 尺寸 */
.btn--sm { --btn-h: 30px; --btn-px: var(--space-3); font-size: var(--text-xs); }
.btn--lg { --btn-h: 44px; --btn-px: var(--space-6); font-size: var(--text-md); }
.btn--block { display: flex; width: 100%; }

/* ============================================================================
 * 相邻按钮兜底间距
 * ----------------------------------------------------------------------------
 * 为什么需要这条：.btn 只有内部 gap（图标与文字），没有外部间距。相邻按钮
 * 是否挨太近完全取决于父容器有没有 gap 或模板有没有写 margin。实测 4 个视图
 * 共 205 个按钮，只用过 32 次 gap-* 工具类 —— 绝大多数相邻按钮没有任何间距。
 *
 * 规则：当两个按钮是紧邻兄弟节点时，自动给后者加左/上间距。
 *   - 横向排列（inline-flex 或默认流）→ margin-left
 *   - 纵向堆叠（.btn--block 独占一行）→ margin-top
 *
 * 用 :not(:first-child) 而不是给所有按钮加 margin，避免容器首元素多出空白。
 * 只作用于「直接相邻」的按钮，不影响按钮与文字、按钮与表单字段的间距
 * （那些由各自的容器负责）。
 *
 * 按钮组 .btn-group 例外：那里 margin-left:-1px 让边框重叠是有意设计。
 * ========================================================================== */
.btn + .btn:not(.btn--block) { margin-left: var(--space-2); }
.btn--block + .btn,
.btn + .btn--block { margin-top: var(--space-3); }
.btn--block + .btn--block { margin-top: var(--space-3); }

/* 移动端旧类名兜底：mobile/ 下的模板与 JS 用的是 `class="primary block"`、
 * `class="block danger"`、`class="small"`，都不带 .btn，上面几条规则一条也
 * 匹配不到。移动端的对应规则写在 mobile/mobile.css 的 `.m-app .block + .block`
 * 一组里（那里能拿到 .m-app 作用域，也便于排除已用 gap 的容器）。
 * 这里不重复定义，避免两处维护。 */

/* 例外：父容器已经用 gap 排版时不要再叠加 margin，否则间距翻倍。
 * 这些容器实测都有 gap:var(--space-2)，按钮之间本来就分开了。 */
.topbar__actions > .btn + .btn,
.page-head__actions > .btn + .btn,
.section-actions > .btn + .btn,
.sec-model-actions > .btn + .btn,
.table .actions > .btn + .btn,
.row > .btn + .btn,
.btn-group > .btn + .btn { margin-left: 0; }
/* 按钮组用边框重叠做出连贯感，保留原有的 -1px */
.btn-group > .btn + .btn { margin-left: -1px; }

/* 变体 */
.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover { background: var(--primary-hover); }

.btn--outline {
  background: var(--card);
  border-color: var(--border-strong);
  color: var(--foreground);
}
.btn--outline:hover { background: var(--muted); border-color: var(--input-hover); }

.btn--ghost { background: transparent; color: var(--muted-foreground); }
.btn--ghost:hover { background: var(--muted); color: var(--foreground); }

.btn--soft {
  background: var(--primary-soft);
  color: var(--primary-soft-foreground);
  border-color: var(--primary-border);
}
.btn--soft:hover { background: var(--accent); }

.btn--danger {
  background: var(--destructive);
  color: var(--destructive-foreground);
}
.btn--danger:hover { background: var(--destructive-hover); }

.btn--danger-ghost { background: transparent; color: var(--destructive); }
.btn--danger-ghost:hover { background: var(--destructive-soft); }

/* 玻璃按钮：用于悬浮操作条、弹层头部，不做大面积 */
.btn--glass {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--foreground);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm), var(--glass-inset);
}
.btn--glass:hover { background: var(--glass-bg-strong); }

/* 胶囊：主 CTA 用，符合当下 SaaS 趋势 */
.btn--pill { border-radius: var(--radius-pill); }

/* 图标按钮 */
.btn--icon {
  --btn-px: 0;
  width: var(--btn-h);
  flex: 0 0 auto;
}

.btn__icon { display: inline-flex; flex: 0 0 auto; }
.btn__icon svg { width: 1.1em; height: 1.1em; }

/* 加载态：文字保留宽度，中间换成转圈 */
.btn.is-loading { pointer-events: none; color: transparent; position: relative; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--primary-foreground);
  animation: spin .6s linear infinite;
}
.btn--outline.is-loading::after,
.btn--ghost.is-loading::after,
.btn--soft.is-loading::after { color: var(--primary); }

@keyframes spin { to { transform: rotate(360deg); } }

/* 按钮组 */
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; margin-left: -1px; }
.btn-group > .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  margin-left: 0;
}
.btn-group > .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ============================================================================
 * 2. 卡片
 * ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card--pad { padding: var(--space-5); }
.card--flush { padding: 0; overflow: hidden; }
.card--hover {
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.card--hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.card__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}
.card__desc {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  line-height: var(--leading-snug);
}
.card__body { padding: var(--space-5); }
.card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================================
 * 3. 表单
 * ========================================================================== */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--foreground);
}
.field__label .req { color: var(--destructive); margin-left: 2px; }
.field__hint { font-size: var(--text-xs); color: var(--muted-foreground); line-height: var(--leading-snug); }
.field__error {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--destructive);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: var(--space-2) var(--space-3);
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--foreground);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--subtle-foreground); }

.input:hover,
.select:hover,
.textarea:hover { border-color: var(--input-hover); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 14%, transparent);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--destructive);
}
.input[aria-invalid="true"]:focus,
.textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 16%, transparent);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.textarea { min-height: 88px; resize: vertical; line-height: var(--leading-normal); }

.select {
  padding-right: var(--space-8);
  /* 箭头用 mask 绘制：颜色跟随 --muted-foreground，暗色模式自动适配，
     不再把颜色硬编码进 data-URI */
  background-image: none;
}
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: var(--space-3);
  top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  background: currentColor;
  color: var(--muted-foreground);
  pointer-events: none;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.select-wrap > .select { padding-right: var(--space-8); }

/* 带前后缀的输入 */
.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.input-group:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 14%, transparent);
}
.input-group > .input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.input-group > .input:focus { box-shadow: none; }
.input-group__prefix,
.input-group__suffix {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  background: var(--muted);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.input-group__suffix { border-right: 0; border-left: 1px solid var(--border); }

/* 后缀当按钮用时（密码显隐、复制密钥）：补齐语义与点击尺寸 */
.input-group__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 38px;
  padding: 0 var(--space-3);
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.input-group__btn:hover { background: var(--secondary-hover); color: var(--foreground); }
.input-group__btn:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.input-group__btn svg { width: 15px; height: 15px; }

/* 搜索框
 * ----------------------------------------------------------------------------
 * DOM 统一为：<div class="search"><span><svg class="icon"></span><input class="input"></div>
 * 图标用绝对定位贴着容器左侧垂直居中，**不参与 flex 布局**；输入框靠
 * --search-input-padding 让出「图标 inset + 图标宽 + 间隙」的空间。
 *
 * 为什么不用 flex 排图标：图标是装饰性的，绝对定位后 input 可以从容器左边缘
 * 开始铺满（背景、边框、聚焦环都是整块），而文字起点由 padding 精确控制。
 * 之前图标 absolute + input padding-left 写死 32px，两个值各改各的，
 * 一旦图标换尺寸（手机端 20px）就必然重叠。
 *
 * 选择器用后代（.search svg）而非直接子元素：真实 DOM 里 svg 被
 * <span aria-hidden="true"> 包着，`.search > .icon` 永远匹配不到。
 *
 * 三个类名共用同一组规则：
 *   .search         —— 主类名（桌面 admin.php、移动端 mobile/admin.php）
 *   .toolbar-search —— admin.php searchBox() 产出的裸容器，历史上只有宽度
 *                      规则、图标完全没有定位，靠这条别名兜住
 *   .topbar__search —— 顶栏搜索框（当前模板未使用，保留以免复用时再踩一次）
 * 只写一套，避免三处各写一份互相打架。 */
.search,
.toolbar-search,
.topbar__search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.search svg,
.search .icon,
.toolbar-search svg,
.toolbar-search .icon,
.topbar__search svg,
.topbar__search .icon {
  position: absolute;
  left: var(--search-icon-inset);
  top: 50%;
  transform: translateY(-50%);
  width: var(--search-icon-size);
  height: var(--search-icon-size);
  color: var(--subtle-foreground);
  pointer-events: none;
}
/* 输入框左内边距。
 * 三组选择器都必须写全：
 *   1) `.xxx .input`      —— 常规 DOM（桌面 admin.php、移动端 mobile/admin.php）
 *   2) `.xxx input`       —— admin.php searchBox() 产出的 input 没有 .input 类，
 *                            只写 .input 时它拿不到 padding，实测 gap = -25px。
 *                            用裸 input 兜底，保证任何写法的搜索框都不重叠。
 * 图标区不接收指针事件；padding 已保证文字起点在图标右边缘之外。 */
.search .input,
.search input,
.toolbar-search .input,
.toolbar-search input,
.topbar__search .input,
.topbar__search input {
  padding-left: var(--search-input-padding);
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 40px; height: 22px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch__track {
  width: 100%; height: 100%;
  /* 关闭态用 --muted：--gray-300 不随主题变化，暗色下是浅灰块，
     与深色背景反差过大，看起来像「已开启」。 */
  background: var(--muted);
  border-radius: var(--radius-pill);
  transition: background var(--duration-base) var(--ease-out);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--card);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.switch input:disabled + .switch__track { opacity: .5; cursor: not-allowed; }

/* 复选与单选 */
.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
  user-select: none;
}
.checkbox input,
.radio input {
  width: 16px; height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 表单栅格 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--space-5);
}
.form-grid > .span-2 { grid-column: 1 / -1; }

/* ============================================================================
 * 4. 表格
 * ========================================================================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--muted-foreground);
  text-align: left;
  white-space: nowrap;
  letter-spacing: var(--tracking-wide);
}
.table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--foreground);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--duration-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
}

/* ============================================================================
 * 5. 徽标与标签
 * ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 22px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}
.badge--neutral { background: var(--muted); color: var(--muted-foreground); border-color: var(--border); }
.badge--primary { background: var(--primary-soft); color: var(--primary-soft-foreground); border-color: var(--primary-border); }
.badge--success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.badge--danger  { background: var(--destructive-soft); color: var(--destructive); border-color: var(--destructive-border); }
.badge--info    { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.badge--pill { border-radius: var(--radius-pill); padding: 0 var(--space-3); }

/* 状态点 */
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.dot--pulse { animation: pulse 2s var(--ease-in-out) infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ============================================================================
 * 6. 统计卡
 * ========================================================================== */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.stat__label { font-size: var(--text-xs); color: var(--muted-foreground); font-weight: var(--weight-medium); }
.stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-soft-foreground);
}
.stat__icon svg { width: 15px; height: 15px; }
.stat__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat__meta { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--muted-foreground); }
.stat__trend--up { color: var(--success); }
.stat__trend--down { color: var(--destructive); }

/* ============================================================================
 * 7. 空状态
 * ========================================================================== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-5);
  text-align: center;
}
.empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: var(--radius-xl);
  background: var(--muted);
  color: var(--subtle-foreground);
}
.empty__icon svg { width: 22px; height: 22px; }
.empty__title { font-size: var(--text-md); font-weight: var(--weight-medium); }
.empty__desc { font-size: var(--text-sm); color: var(--muted-foreground); max-width: 40ch; }

/* ============================================================================
 * 8. 提示条
 * ========================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}
.alert__icon { flex: 0 0 auto; margin-top: 1px; }
.alert__icon svg { width: 16px; height: 16px; }
.alert__body { flex: 1; min-width: 0; }
.alert__title { font-weight: var(--weight-semibold); margin-bottom: var(--space-1); }
.alert--info { background: var(--info-soft); border-color: var(--info-border); color: var(--info); }
.alert--success { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.alert--warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.alert--danger { background: var(--destructive-soft); border-color: var(--destructive-border); color: var(--destructive); }

/* ============================================================================
 * 9. 标签页
 * ========================================================================== */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted-foreground);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}
.tab:hover { color: var(--foreground); }
.tab[aria-selected="true"],
.tab[aria-pressed="true"] { color: var(--primary); }
.tab[aria-selected="true"]::after,
.tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: var(--space-2); right: var(--space-2);
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
}
.tab__count {
  margin-left: var(--space-1);
  min-width: 18px;
  padding: 0 5px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] .tab__count,
.tab[aria-pressed="true"] .tab__count {
  background: var(--primary-soft);
  color: var(--primary-soft-foreground);
}

/* 分段控件：手机端主要分类切换方式 */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--muted);
  border-radius: var(--radius-md);
  gap: 2px;
  max-width: 100%;
}
/* 分类多到放不下时横向滚动，不撑破容器 */
.segmented--scroll {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.segmented--scroll::-webkit-scrollbar { display: none; }
.segmented--scroll .segmented__item { flex: 0 0 auto; }
.segmented__item {
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--muted-foreground);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.segmented__item[aria-selected="true"] {
  background: var(--card);
  color: var(--primary);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-xs);
}

/* 插件页四分类：铺满整行、触控友好、选中态更明显 */
#plugin-tabs {
  display: flex;
  width: 100%;
  margin-bottom: var(--space-3);
  padding: 4px;
  gap: 4px;
}
#plugin-tabs .segmented__item {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding: 0 var(--space-1);
  font-size: var(--text-sm);
  white-space: nowrap;
}
#plugin-tabs .segmented__item[aria-selected="true"] {
  background: var(--primary);
  color: var(--primary-foreground, #fff);
  box-shadow: none;
}

/* 插件列表：分隔清晰、操作按钮更醒目 */
#plugins .m-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
#plugins .m-item:last-child { border-bottom: 0; }
#plugins .m-item .body { min-width: 0; }
#plugins .m-item .side .btn { min-height: 36px; white-space: nowrap; }
#plugins #plugin-review .pill { min-width: 64px; justify-content: center; }
/* 描边按钮上的危险操作：保留按钮尺寸/边框，只把文字和边框染成警示色 */
.btn.text-danger,
.btn.text-danger:hover {
  color: var(--destructive);
  border-color: var(--destructive-border);
}
#plugins form label { display: block; margin-bottom: var(--space-3); }
#plugins form label > span { display: block; margin-bottom: 4px; color: var(--muted-foreground); font-size: var(--text-sm); }

/* ============================================================================
 * 10. 头像
 * ========================================================================== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-soft-foreground);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  overflow: hidden;
}
.avatar--sm { width: 24px; height: 24px; font-size: var(--text-2xs); }
.avatar--lg { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================================
 * 11. 弹窗与抽屉
 * ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(15, 21, 32, .45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in var(--duration-base) var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - var(--space-8));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: modal-in var(--duration-slow) var(--ease-spring);
  overflow: hidden;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal--wide { max-width: 720px; }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.modal__body {
  padding: var(--space-5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--muted);
}

/* 底部抽屉（手机端替代居中弹窗） */
/* 弹层用底部抽屉时的 overlay 组合：贴底、去掉内边距 */
.overlay--sheet {
  align-items: flex-end;
  padding: 0;
}

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-modal);
  max-height: 88vh;
  /* 左右必须留出安全边距：移动端 .sheet 贴满屏宽，内容区再加内边距，
     否则输入框、按钮会顶到屏幕边缘，看起来拥挤且容易误触。 */
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  box-shadow: var(--shadow-xl);
  padding-bottom: var(--safe-bottom);
  animation: sheet-in var(--duration-slow) var(--ease-out);
  /* 内容超出时由面板自身滚动；配合下方 [id] 内容区的 flex 约束，
     避免滚动穿透到下层页面。 */
  overflow: hidden;
  overscroll-behavior: contain;
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet__handle {
  width: 36px; height: 4px;
  margin: var(--space-2) auto var(--space-1);
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  flex: 0 0 auto;
}

/* ============================================================================
 * 12. 提示消息
 * ========================================================================== */
.toast {
  position: fixed;
  bottom: calc(var(--space-6) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: min(92vw, 420px);
  padding: var(--space-3) var(--space-4);
  /* 用 --popover：暗色下比 --card 亮一档，toast 与背景能分出层次；
     --gray-900 在暗色主题里和卡片几乎同色，看不出浮层边界。 */
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  animation: toast-in var(--duration-slow) var(--ease-spring);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.toast--error { background: var(--destructive); }
.toast--success { background: var(--success); }

/* ============================================================================
 * 13. 骨架屏
 * ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--muted) 25%, var(--border) 37%, var(--muted) 63%);
  background-size: 400% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s var(--ease-in-out) infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton--text { height: 12px; margin: var(--space-2) 0; }
.skeleton--title { height: 18px; width: 40%; margin-bottom: var(--space-4); }
.skeleton--circle { border-radius: 50%; }

/* ============================================================================
 * 14. 工具类
 * ========================================================================== */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; min-width: 0; }
.grow { flex-grow: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-muted { color: var(--muted-foreground); }
.text-subtle { color: var(--subtle-foreground); }
.text-strong { font-weight: var(--weight-semibold); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* 响应式显示 */
.only-mobile { display: none; }
@media (max-width: 767px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: revert; }
}
