/* ==========================================================================
 起司通行证 · UI/UX 统一设计系统（MD3 Expressive · 三主题：cheese / light / dark）

 完整对齐《起司云 UI & UX 完整设计规范》：
   - 主题偏好键：localStorage['zc-theme-preference']（system | cheese | light | dark）
   - 切换方式：<html data-theme="cheese|light|dark"> + color-scheme + 同名 class
   - 六大红线：
       1. 全站禁用常驻毛玻璃（实色表面 + --zc-scrim 遮罩）
       2. 卡片是表面而非控件（无悬停染色、无鼠标跟随光效、无 3D 视差）
       3. 严禁硬编码字面颜色（全站颜色统一走三主题 CSS 变量）
       4. 严禁压扁列宽消除表格横滚（全视口横滚契约 + 移动操作列粘性）
       5. 仅 :focus-visible 显示焦点层，完整支持 prefers-reduced-motion
       6. 高密度数值文本切换不加过渡动画，使用 tabular-nums
 ========================================================================== */

/* ===== 全局基础令牌（字体、布局、形状阶、动效、共用遮罩） ===== */
:root {
  color-scheme: light;
  --zc-font-sans: "MiSans", -apple-system, "SF Pro Text", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --zc-font-mono: "SFMono-Regular", "JetBrains Mono", Consolas,
    "Liberation Mono", Menlo, monospace;

  --zc-page-max: 1400px;
  --zc-topbar-h: 56px;
  --zc-nav-drawer-w: 240px;
  --zc-control-h: 40px;

  /* MD3 形状阶（Shape Scale） */
  --zc-radius-xs: 4px;
  --zc-radius-sm: 8px;
  --zc-radius-md: 12px;
  --zc-radius-lg: 16px;
  --zc-radius-xl: 28px;
  --md-sys-shape-corner-full: 9999px;

  /* MD3 动效令牌 */
  --zc-motion-out: cubic-bezier(0.2, 0, 0, 1);
  --zc-motion-in: cubic-bezier(0.3, 0, 1, 1);
  --zc-motion-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --zc-motion-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --zc-motion-spatial: cubic-bezier(0.32, 1.24, 0.52, 1); /* MD3 Expressive 空间轻弹曲线 */

  --zc-motion-quick: 90ms;
  --zc-motion-short: 150ms;
  --zc-motion-pop: 160ms;
  --zc-motion-panel: 240ms;
  --zc-motion-medium: 300ms;
  --zc-motion-long: 450ms;

  /* 滑动指示器统一参数（分段控制器 + 移动底栏共享） */
  --md-sys-motion-expressive-duration: 280ms;
  --md-sys-motion-expressive-easing: cubic-bezier(0.2, 0, 0, 1);

  /* 全局共用遮罩（Modal / Confirm / Drawer 统一使用） */
  --zc-scrim: color-mix(in srgb, #000 32%, transparent);
}

/* ===== 主题一：芝士色（默认，品牌主视觉） ===== */
:root,
:root[data-theme="cheese"] {
  color-scheme: light;
  --zc-background: #fbf8f3;
  --zc-foreground: #38312a;
  --zc-card: #fffcf6;
  --zc-card-foreground: #38312a;
  --zc-popover: #f3eee3;
  --zc-popover-foreground: #38312a;
  --zc-nav-bg: #faf8f3;

  --zc-primary: #d2a44a;
  --zc-primary-foreground: #ffffff;
  --zc-secondary: #efe7d6;
  --zc-secondary-foreground: #4e4433;
  --zc-muted: #f3eee3;
  --zc-muted-foreground: #7a6b58;
  --zc-accent: #f3e2c0;
  --zc-accent-foreground: #4a3608;

  --zc-destructive: #e5484d;
  --zc-destructive-foreground: #0e1116;
  --zc-success: #5e9b3f;
  --zc-success-foreground: #0e1116;
  --zc-warning: #d89438;
  --zc-warning-foreground: #0e1116;

  --zc-border: #e5dcc8;
  --zc-input: #8a7a5f;
  --zc-ring: #d2a44a;

  /* 语义深停文字色（小字 / 徽标保证高对比度） */
  --zc-primary-text: #8a5a10;
  --zc-success-text: #2c3a1e;
  --zc-warning-text: #8a5a10;
  --zc-destructive-text: #b91c1c;

  /* MD3 角色令牌 */
  --zc-primary-container: #f3e2c0;
  --zc-on-primary-container: #4a3608;
  --zc-secondary-container: #efe7d6;
  --zc-on-secondary-container: #4e4433;
  --zc-tertiary-container: #e4eada;
  --zc-on-tertiary-container: #2c3a1e;
  --zc-surface-container-low: #fffcf6;
  --zc-surface-container-high: #f3eee3;
  --zc-surface-container-highest: #ece5d4;
  --zc-outline: #8a7a5f;
  --zc-outline-variant: #e5dcc8;
  --zc-inverse-surface: #38312a;
  --zc-inverse-on-surface: #f5efe3;
  --zc-inverse-primary: #e0b870;

  /* 反色面（Snackbar / Toast）语义图标色 */
  --zc-on-inverse-primary: var(--zc-primary);
  --zc-on-inverse-success: var(--zc-success);
  --zc-on-inverse-warning: var(--zc-warning);
  --zc-on-inverse-destructive: var(--zc-destructive);

  /* 深色表面块 */
  --zc-surface-dark: #2a241d;
  --zc-surface-dark-fg: #f5efe3;
  --zc-surface-dark-muted: color-mix(in srgb, var(--zc-surface-dark-fg) 60%, transparent);
  --zc-surface-dark-border: color-mix(in srgb, var(--zc-surface-dark-fg) 14%, transparent);
  --zc-on-dark-muted: color-mix(in srgb, var(--zc-surface-dark-fg) 72%, var(--zc-surface-dark));
  --zc-gradient-from: #d2a44a;
  --zc-gradient-to: var(--zc-gradient-from);

  /* Elevation 五档阴影 */
  --zc-shadow-color: color-mix(in srgb, var(--zc-background) 35%, #000);
  --zc-shadow-card: 0 1px 2px 0 color-mix(in srgb, var(--zc-shadow-color) 16%, transparent),
                    0 6px 16px -4px color-mix(in srgb, var(--zc-shadow-color) 12%, transparent);
  --zc-shadow-hover: 0 2px 4px 0 color-mix(in srgb, var(--zc-shadow-color) 18%, transparent),
                     0 10px 28px -6px color-mix(in srgb, var(--zc-shadow-color) 14%, transparent);
  --zc-shadow-menu: 0 2px 6px 0 color-mix(in srgb, var(--zc-shadow-color) 14%, transparent),
                    0 8px 24px -6px color-mix(in srgb, var(--zc-shadow-color) 14%, transparent);
  --zc-shadow-dialog: 0 3px 6px 0 color-mix(in srgb, var(--zc-shadow-color) 16%, transparent),
                      0 14px 36px -10px color-mix(in srgb, var(--zc-shadow-color) 16%, transparent);
  --zc-shadow-float: 0 4px 10px 0 color-mix(in srgb, var(--zc-shadow-color) 16%, transparent),
                     0 18px 44px -12px color-mix(in srgb, var(--zc-shadow-color) 16%, transparent);

  /* 水波纹不透明度 */
  --md-sys-ripple-opacity: 0.05;

  /* —— 通行证业务扩展令牌（三主题对齐，均派生自标准令牌） —— */
  --zc-glass-bg: var(--zc-card);
  --zc-primary-strong: var(--zc-on-primary-container);
  --zc-primary-soft: var(--zc-inverse-primary);
  --zc-accent-strong: var(--zc-primary-container);
  --zc-accent-soft: color-mix(in srgb, var(--zc-primary) 12%, transparent);
  --zc-input-bg: var(--zc-card);
  --zc-input-focus: var(--zc-card);
  --zc-shadow-pop: var(--zc-shadow-menu);
  --zc-shadow-strong: var(--zc-shadow-dialog);
  --zc-success-bg: color-mix(in srgb, var(--zc-success-text) 14%, transparent);
  --zc-destructive-bg: color-mix(in srgb, var(--zc-destructive-text) 14%, transparent);
  --zc-warning-bg: color-mix(in srgb, var(--zc-warning-text) 14%, transparent);
  --zc-code-bg: var(--zc-surface-container-high);
  --zc-overlay: var(--zc-scrim);
  --zc-viewer-bg: color-mix(in srgb, #000 86%, transparent);
  --zc-qr-surface: #ffffff;
  --zc-brand-doc: #4a7fb5;
  --zc-auth-glow-1: color-mix(in srgb, var(--zc-primary) 16%, transparent);
  --zc-auth-glow-2: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  --zc-stat-grad: var(--zc-surface-container-high);
  --zc-sk-base: color-mix(in srgb, var(--zc-muted) 82%, var(--zc-card));
  --zc-sk-hi: color-mix(in srgb, var(--zc-muted) 30%, var(--zc-card));
}

/* ===== 主题二：浅色（清爽白灰） ===== */
:root[data-theme="light"] {
  color-scheme: light;
  --zc-background: #ffffff;
  --zc-foreground: #1a1d24;
  --zc-card: #fcfdfe;
  --zc-card-foreground: #1a1d24;
  --zc-popover: #f4f5f7;
  --zc-popover-foreground: #1a1d24;
  --zc-nav-bg: #ffffff;

  --zc-primary: #d2a44a;
  --zc-primary-foreground: #ffffff;
  --zc-secondary: #f4f5f7;
  --zc-secondary-foreground: #3a4048;
  --zc-muted: #f4f5f7;
  --zc-muted-foreground: #5a6270;
  --zc-accent: #f3e2c0;
  --zc-accent-foreground: #4a3608;

  --zc-destructive: #e5484d;
  --zc-destructive-foreground: #0e1116;
  --zc-success: #4f9f3a;
  --zc-success-foreground: #0e1116;
  --zc-warning: #d89438;
  --zc-warning-foreground: #0e1116;

  --zc-border: #e8ebf0;
  --zc-input: #7a828c;
  --zc-ring: #d2a44a;

  --zc-primary-text: #8a5a10;
  --zc-success-text: #2c3a1e;
  --zc-warning-text: #8a5a10;
  --zc-destructive-text: #b91c1c;

  --zc-primary-container: #f3e2c0;
  --zc-on-primary-container: #4a3608;
  --zc-secondary-container: #f4f5f7;
  --zc-on-secondary-container: #3a4048;
  --zc-tertiary-container: #e4eada;
  --zc-on-tertiary-container: #2c3a1e;
  --zc-surface-container-low: #fcfdfe;
  --zc-surface-container-high: #f4f5f7;
  --zc-surface-container-highest: #eceef1;
  --zc-outline: #7a828c;
  --zc-outline-variant: #e8ebf0;
  --zc-inverse-surface: #1a1d24;
  --zc-inverse-on-surface: #fcfcfd;
  --zc-inverse-primary: #e0b870;

  --zc-on-inverse-primary: var(--zc-primary);
  --zc-on-inverse-success: var(--zc-success);
  --zc-on-inverse-warning: var(--zc-warning);
  --zc-on-inverse-destructive: var(--zc-destructive);

  --zc-surface-dark: #2a241d;
  --zc-surface-dark-fg: #f5efe3;
  --zc-surface-dark-muted: color-mix(in srgb, var(--zc-surface-dark-fg) 60%, transparent);
  --zc-surface-dark-border: color-mix(in srgb, var(--zc-surface-dark-fg) 14%, transparent);
  --zc-on-dark-muted: color-mix(in srgb, var(--zc-surface-dark-fg) 72%, var(--zc-surface-dark));
  --zc-gradient-from: #d2a44a;
  --zc-gradient-to: var(--zc-gradient-from);

  --zc-shadow-color: color-mix(in srgb, var(--zc-background) 35%, #000);
  --zc-shadow-card: 0 1px 2px 0 color-mix(in srgb, var(--zc-shadow-color) 16%, transparent),
                    0 6px 16px -4px color-mix(in srgb, var(--zc-shadow-color) 12%, transparent);
  --zc-shadow-hover: 0 2px 4px 0 color-mix(in srgb, var(--zc-shadow-color) 18%, transparent),
                     0 10px 28px -6px color-mix(in srgb, var(--zc-shadow-color) 14%, transparent);
  --zc-shadow-menu: 0 2px 6px 0 color-mix(in srgb, var(--zc-shadow-color) 14%, transparent),
                    0 8px 24px -6px color-mix(in srgb, var(--zc-shadow-color) 14%, transparent);
  --zc-shadow-dialog: 0 3px 6px 0 color-mix(in srgb, var(--zc-shadow-color) 16%, transparent),
                      0 14px 36px -10px color-mix(in srgb, var(--zc-shadow-color) 16%, transparent);
  --zc-shadow-float: 0 4px 10px 0 color-mix(in srgb, var(--zc-shadow-color) 16%, transparent),
                     0 18px 44px -12px color-mix(in srgb, var(--zc-shadow-color) 16%, transparent);

  --md-sys-ripple-opacity: 0.05;

  --zc-glass-bg: var(--zc-card);
  --zc-primary-strong: var(--zc-on-primary-container);
  --zc-primary-soft: var(--zc-inverse-primary);
  --zc-accent-strong: var(--zc-primary-container);
  --zc-accent-soft: color-mix(in srgb, var(--zc-primary) 12%, transparent);
  --zc-input-bg: var(--zc-card);
  --zc-input-focus: var(--zc-card);
  --zc-shadow-pop: var(--zc-shadow-menu);
  --zc-shadow-strong: var(--zc-shadow-dialog);
  --zc-success-bg: color-mix(in srgb, var(--zc-success-text) 14%, transparent);
  --zc-destructive-bg: color-mix(in srgb, var(--zc-destructive-text) 14%, transparent);
  --zc-warning-bg: color-mix(in srgb, var(--zc-warning-text) 14%, transparent);
  --zc-code-bg: var(--zc-surface-container-high);
  --zc-overlay: var(--zc-scrim);
  --zc-viewer-bg: color-mix(in srgb, #000 86%, transparent);
  --zc-qr-surface: #ffffff;
  --zc-brand-doc: #4a7fb5;
  --zc-auth-glow-1: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  --zc-auth-glow-2: color-mix(in srgb, var(--zc-primary) 12%, transparent);
  --zc-stat-grad: var(--zc-surface-container-high);
  --zc-sk-base: color-mix(in srgb, var(--zc-muted) 82%, var(--zc-card));
  --zc-sk-hi: color-mix(in srgb, var(--zc-muted) 30%, var(--zc-card));
}

/* ===== 主题三：深色（暗夜炭灰 + 柔和亮金） ===== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --zc-background: #0e1116;
  --zc-foreground: #e6e6e8;
  --zc-card: #1b2029;
  --zc-card-foreground: #e6e6e8;
  --zc-popover: #232935;
  --zc-popover-foreground: #e6e6e8;
  --zc-nav-bg: #0f1218;

  --zc-primary: #eec27c;
  --zc-primary-foreground: #0e1116;
  --zc-secondary: #2a2f3a;
  --zc-secondary-foreground: #dde2ea;
  --zc-muted: #232935;
  --zc-muted-foreground: #a8b0bc;
  --zc-accent: #5a4310;
  --zc-accent-foreground: #f3e2c0;

  --zc-destructive: #ff6b6b;
  --zc-destructive-foreground: #0e1116;
  --zc-success: #6fcb5a;
  --zc-success-foreground: #0e1116;
  --zc-warning: #f0b560;
  --zc-warning-foreground: #0e1116;

  --zc-border: #3a4150;
  --zc-input: #8a93a0;
  --zc-ring: #eec27c;

  /* 深色下语义小字改用亮停 */
  --zc-primary-text: #eec27c;
  --zc-success-text: #6fcb5a;
  --zc-warning-text: #f0b560;
  --zc-destructive-text: #ff6b6b;

  --zc-primary-container: #5a4310;
  --zc-on-primary-container: #f3e2c0;
  --zc-secondary-container: #2a2f3a;
  --zc-on-secondary-container: #dde2ea;
  --zc-tertiary-container: #2c3a1e;
  --zc-on-tertiary-container: #d8e4c4;
  --zc-surface-container-low: #1b2029;
  --zc-surface-container-high: #232935;
  --zc-surface-container-highest: #2b323e;
  --zc-outline: #8a93a0;
  --zc-outline-variant: #3a4150;
  --zc-inverse-surface: #e6e6e8;
  --zc-inverse-on-surface: #1a1d24;
  --zc-inverse-primary: #8a6420;

  /* 深色下的 inverse-surface 翻转为浅底，语义图标切回深停保证可读 */
  --zc-on-inverse-primary: #8a6420;
  --zc-on-inverse-success: #2c3a1e;
  --zc-on-inverse-warning: #8a5a10;
  --zc-on-inverse-destructive: #b91c1c;

  --zc-surface-dark: #07090c;
  --zc-surface-dark-fg: #e6e6e8;
  --zc-surface-dark-muted: color-mix(in srgb, var(--zc-surface-dark-fg) 60%, transparent);
  --zc-surface-dark-border: color-mix(in srgb, var(--zc-surface-dark-fg) 14%, transparent);
  --zc-on-dark-muted: color-mix(in srgb, var(--zc-surface-dark-fg) 72%, var(--zc-surface-dark));
  --zc-gradient-from: #eec27c;
  --zc-gradient-to: var(--zc-gradient-from);

  --zc-shadow-color: color-mix(in srgb, var(--zc-background) 35%, #000);
  --zc-shadow-card: 0 1px 2px 0 color-mix(in srgb, var(--zc-shadow-color) 18%, transparent),
                    0 6px 16px -4px color-mix(in srgb, var(--zc-shadow-color) 14%, transparent);
  --zc-shadow-hover: 0 2px 4px 0 color-mix(in srgb, var(--zc-shadow-color) 20%, transparent),
                     0 10px 28px -6px color-mix(in srgb, var(--zc-shadow-color) 16%, transparent);
  --zc-shadow-menu: 0 2px 6px 0 color-mix(in srgb, var(--zc-shadow-color) 16%, transparent),
                    0 8px 24px -6px color-mix(in srgb, var(--zc-shadow-color) 16%, transparent);
  --zc-shadow-dialog: 0 3px 6px 0 color-mix(in srgb, var(--zc-shadow-color) 18%, transparent),
                      0 14px 36px -10px color-mix(in srgb, var(--zc-shadow-color) 16%, transparent);
  --zc-shadow-float: 0 4px 10px 0 color-mix(in srgb, var(--zc-shadow-color) 18%, transparent),
                     0 18px 44px -12px color-mix(in srgb, var(--zc-shadow-color) 18%, transparent);

  --md-sys-ripple-opacity: 0.06;

  --zc-glass-bg: var(--zc-card);
  --zc-primary-strong: var(--zc-primary);
  --zc-primary-soft: var(--zc-on-primary-container);
  --zc-accent-strong: var(--zc-primary-container);
  --zc-accent-soft: color-mix(in srgb, var(--zc-primary) 16%, transparent);
  --zc-input-bg: var(--zc-card);
  --zc-input-focus: var(--zc-card);
  --zc-shadow-pop: var(--zc-shadow-menu);
  --zc-shadow-strong: var(--zc-shadow-dialog);
  --zc-success-bg: color-mix(in srgb, var(--zc-success-text) 14%, transparent);
  --zc-destructive-bg: color-mix(in srgb, var(--zc-destructive-text) 14%, transparent);
  --zc-warning-bg: color-mix(in srgb, var(--zc-warning-text) 14%, transparent);
  --zc-code-bg: var(--zc-surface-container-high);
  --zc-overlay: var(--zc-scrim);
  --zc-viewer-bg: color-mix(in srgb, #000 90%, transparent);
  --zc-qr-surface: #ffffff;
  --zc-brand-doc: #6ba3d8;
  --zc-auth-glow-1: color-mix(in srgb, var(--zc-primary) 16%, transparent);
  --zc-auth-glow-2: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  --zc-stat-grad: var(--zc-surface-container-high);
  --zc-sk-base: color-mix(in srgb, var(--zc-muted) 82%, var(--zc-card));
  --zc-sk-hi: color-mix(in srgb, var(--zc-muted) 30%, var(--zc-card));
}

/* ===== 基础排版与主题过渡 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; background: var(--zc-background); }
body {
  min-height: 100%;
  font-family: var(--zc-font-sans);
  background: var(--zc-background);
  color: var(--zc-foreground);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--zc-primary-text); text-decoration: none; }
a:hover { color: var(--zc-on-primary-container); text-decoration: underline; text-underline-offset: 2px; }
.topbar a:hover, .brand:hover, .auth-logo:hover, .btn:hover, .btn-grad:hover, .btn-line2:hover, .side-item:hover, .nd-item:hover, .topbar-menu a:hover, .nav-drop-menu a:hover { text-decoration: none; }
.muted { color: var(--zc-muted-foreground); }
.small { font-size: 12px; }
h1, h2, h3 { font-weight: 600; color: var(--zc-foreground); }
b, strong { font-weight: 600; }

/* 主题切换平滑过渡（仅大面积底色/描边/文字，不干扰交互动效） */
body, .topbar, .card, .zc-card, .auth-card, .cert-card, .feature, .sidebar,
.side-item, .table td, .modal, .topbar-menu, .nav-drop-menu, .theme-pop, .iv-bar {
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, fill 200ms ease, stroke 200ms ease;
}

/* ===== M3 全局滚动条（悬浮呼吸感） ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--zc-muted-foreground) 28%, transparent);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--zc-muted-foreground) 48%, transparent);
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:active {
  background: color-mix(in srgb, var(--zc-primary) 65%, transparent);
  background-clip: content-box;
}
.m3-scroll-compact::-webkit-scrollbar { width: 6px; height: 6px; }
.m3-scroll-compact::-webkit-scrollbar-thumb { border-width: 1px; }

/* ===== M3 统一水波纹与状态层（见 js/ui-motion.js） ===== */
.m3-ripple-host { position: relative; }
.m3-ripple-clip { position: relative; overflow: hidden !important; isolation: isolate; }
.m3-state-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit !important;
  pointer-events: none;
  background-color: currentColor;
  opacity: 0;
  transition: opacity 150ms linear;
  z-index: 0;
}
.m3-ripple-container {
  position: absolute;
  inset: 0;
  border-radius: inherit !important;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.m3-ripple-wave {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, currentColor 0%, currentColor 70%, transparent 100%);
  opacity: var(--md-sys-ripple-opacity, 0.05);
  transform: translate(-50%, -50%) scale(0.2);
  transition: transform 400ms cubic-bezier(0.2, 0, 0, 1), opacity 200ms linear;
  will-change: transform, opacity;
}
.m3-ripple-wave--expanded {
  transform: translate(-50%, -50%) scale(1);
}
.m3-ripple-wave--exiting {
  opacity: 0;
}
@media (hover: hover) {
  .m3-ripple-host:hover:not(:disabled):not([aria-disabled="true"]) > .m3-state-layer {
    opacity: 0.08;
  }
}
/* 焦点状态层仅响应键盘 :focus-visible，鼠标点击不得残留灰底 */
.m3-ripple-host:focus-visible:not(:disabled):not([aria-disabled="true"]) > .m3-state-layer {
  opacity: 0.10;
}
/* 卡片表面豁免：内容卡片悬停不叠加染色状态层 */
.card > .m3-state-layer,
.zc-card > .m3-state-layer,
.cert-card > .m3-state-layer,
.feature > .m3-state-layer,
.auth-card > .m3-state-layer,
.group-card > .m3-state-layer {
  display: none !important;
}
/* 嵌套交互防穿透双保险：子交互控件激活时隐藏外层状态层 */
.m3-ripple-host:has(:is(button, a[href], input, select, textarea, [role="button"], [data-ripple-stop]):not(:disabled):is(:hover, :active, :focus-visible)) > .m3-state-layer {
  opacity: 0 !important;
}

/* ===== 顶栏（实色表面，z-index: 50） ===== */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: env(safe-area-inset-top) 16px 0;
  height: calc(var(--zc-topbar-h) + env(safe-area-inset-top));
  background: var(--zc-nav-bg);
  border-bottom: 1px solid var(--zc-border);
}
.brand {
  display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700;
  color: var(--zc-foreground); white-space: nowrap; border-radius: var(--zc-radius-sm);
}
.brand .logo, .brand .logo-img {
  width: 30px; height: 30px; border-radius: 9px; display: inline-block; flex-shrink: 0;
  background: var(--zc-qr-surface); object-fit: contain;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--zc-foreground) 10%, transparent);
}
.ic { width: 16px; height: 16px; vertical-align: -3px; }
.side-item .ic { width: 17px; height: 17px; flex-shrink: 0; }
.card h3 .ic { width: 17px; height: 17px; color: var(--zc-primary); }
.btn .ic { width: 15px; height: 15px; }
.topbar .spacer { flex: 1; }
.topbar .links { display: flex; align-items: center; gap: 4px; min-width: 0; }
.topbar .links a {
  padding: 6px 12px; border-radius: var(--md-sys-shape-corner-full);
  color: var(--zc-muted-foreground); font-weight: 500; white-space: nowrap;
}
.topbar .links a:hover, .topbar .links a.on { color: var(--zc-foreground); }
.topbar .links a.on {
  background: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  font-weight: 600;
}
/* 测量态：单行自然宽度测算（无绘制闪烁） */
.topbar.measuring .links { position: absolute; left: 0; top: 0; width: max-content; visibility: hidden; pointer-events: none; }
.avatar-mini {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--zc-primary-container); color: var(--zc-on-primary-container);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; overflow: hidden; cursor: pointer; position: relative; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--zc-foreground) 10%, transparent);
}
.avatar-mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ===== 顶栏用户菜单 / 平台导航 / 主题菜单（实色 + shadow-menu + z-index: 60） ===== */
.topbar-user { position: relative; }
.topbar-user .avatar-mini { display: flex; border: 2px solid transparent; transition: border-color 150ms ease; }
.topbar-user.open .avatar-mini { border-color: var(--zc-primary); }
.topbar-menu,
.nav-drop-menu,
.theme-pop {
  position: absolute; top: calc(100% + 8px); z-index: 60;
  background: var(--zc-card); border: 1px solid var(--zc-border);
  border-radius: var(--zc-radius-md); box-shadow: var(--zc-shadow-menu);
  padding: 6px;
  display: block; opacity: 0; visibility: hidden; pointer-events: none;
  transform-origin: top right;
  transform: translateY(-6px) scale(0.95);
  transition: opacity 110ms var(--zc-motion-in), transform 110ms var(--zc-motion-in), visibility 0s 110ms;
}
.topbar-menu { right: 0; min-width: 192px; }
.topbar-user.open .topbar-menu,
.nav-drop.open .nav-drop-menu,
.theme-slot.open .theme-pop {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 160ms var(--zc-motion-out), transform 220ms var(--zc-motion-spatial);
}
.topbar-menu .tm-head { padding: 8px 12px 8px; border-bottom: 1px solid var(--zc-border); margin-bottom: 4px; }
.topbar-menu .tm-head b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-menu .tm-head span { font-size: 12px; color: var(--zc-muted-foreground); font-variant-numeric: tabular-nums; }
.topbar-menu a, .topbar-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; padding: 9px 12px; min-height: 38px;
  border-radius: var(--zc-radius-sm); font-size: 14px; color: var(--zc-foreground);
  cursor: pointer; font-weight: 500; font-family: inherit;
}
.topbar-menu a:hover, .topbar-menu button:hover { background: var(--zc-surface-container-high); }
.topbar-menu button.danger { color: var(--zc-destructive-text); }

/* 顶栏平台导航下拉 */
.nav-drop { position: relative; display: inline-block; }
.nav-drop-btn {
  background: none; border: none; cursor: pointer; padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full); font: inherit; font-weight: 500;
  color: var(--zc-muted-foreground); display: inline-flex; align-items: center; gap: 4px;
}
.nav-drop-btn .nd-caret { font-size: 10px; transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1); line-height: 1; }
.nav-drop:hover .nav-drop-btn, .nav-drop.open .nav-drop-btn { color: var(--zc-foreground); }
.nav-drop.open .nav-drop-btn .nd-caret { transform: rotate(180deg); }
.nav-drop-menu { left: 50%; min-width: 204px; transform-origin: top center; transform: translate(-50%, -6px) scale(0.95); }
.nav-drop.open .nav-drop-menu { transform: translate(-50%, 0) scale(1); }
.nav-drop-menu a {
  display: block; padding: 9px 12px; border-radius: var(--zc-radius-sm);
  font-size: 14px; color: var(--zc-foreground); font-weight: 500; text-decoration: none;
}
.nav-drop-menu a:hover { background: var(--zc-surface-container-high); }
.nav-drop-menu .nd-name { display: inline-flex; align-items: center; gap: 8px; }
.nav-drop-menu .nd-ico {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.nd-ico--doc { background: var(--zc-brand-doc); color: var(--zc-qr-surface); }
.nd-ico--cloud { background: var(--zc-primary); color: var(--zc-primary-foreground); }
.nav-drop-menu .nd-desc { display: block; font-size: 11px; color: var(--zc-muted-foreground); font-weight: 400; margin-top: 2px; padding-left: 30px; }

/* ===== 主题切换（调色盘弹性旋转 + 四选项菜单） ===== */
.theme-slot { position: relative; display: inline-flex; align-items: center; }
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; background: transparent; color: var(--zc-muted-foreground);
  font: inherit; font-weight: 500; min-height: 36px; padding: 6px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  transition: color 150ms ease, background-color 150ms ease;
}
.theme-btn.m3-icon-btn { width: 36px; height: 36px; padding: 0; }
.theme-btn:hover { color: var(--zc-foreground); }
.theme-btn .ic {
  width: 18px; height: 18px; pointer-events: none;
  transition: transform var(--zc-motion-long) var(--zc-motion-spring);
}
@media (hover: hover) {
  .theme-btn:hover .ic { transform: rotate(45deg) scale(1.18); }
}
.theme-pop { right: 0; min-width: 176px; }
.theme-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; padding: 9px 12px; min-height: 38px;
  border-radius: var(--zc-radius-sm); font-size: 14px; font-weight: 500;
  color: var(--zc-foreground); cursor: pointer; font-family: inherit;
}
.theme-opt:hover { background: var(--zc-surface-container-high); }
.theme-opt .dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--zc-outline-variant); flex-shrink: 0; }
.theme-opt .t { flex: 1; }
.theme-opt .check { width: 15px; height: 15px; color: var(--zc-primary); opacity: 0; }
.theme-opt.on { background: var(--zc-secondary-container); color: var(--zc-on-secondary-container); font-weight: 600; }
.theme-opt.on .check { opacity: 1; }
/* 认证页右上角悬浮主题入口 */
.theme-fab {
  position: fixed; right: 18px; top: calc(18px + env(safe-area-inset-top)); z-index: 60;
}
.theme-fab .theme-btn {
  background: var(--zc-card); border: 1px solid var(--zc-outline-variant);
  box-shadow: var(--zc-shadow-card); color: var(--zc-foreground);
}
@media (max-width: 640px) { .theme-fab { right: 12px; top: calc(12px + env(safe-area-inset-top)); } }

/* ===== M3 圆形图标按钮 ===== */
.m3-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: none; background: transparent;
  color: var(--zc-foreground); cursor: pointer;
  border-radius: 50% !important; overflow: hidden !important; flex-shrink: 0;
}
.m3-icon-btn--md { width: 36px; height: 36px; }
.m3-icon-btn--sm { width: 32px; height: 32px; }
.m3-icon-btn svg, .m3-icon-btn i, .m3-icon-btn img { pointer-events: none; }

/* ===== 窄屏导航抽屉（z-index: 40，位于顶栏 50 下方、底栏 30 上方） ===== */
.nav-toggle {
  display: none; position: relative; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: 0 0 auto; border: none;
  border-radius: 50% !important; overflow: hidden !important;
  background: transparent; color: var(--zc-foreground); cursor: pointer; padding: 0;
  transition: background-color 180ms ease, color 180ms ease;
}
.nav-toggle:focus-visible { outline: 2px solid var(--zc-ring); outline-offset: 2px; }
.nav-toggle .nt-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.nav-toggle .ic { width: 20px; height: 20px; pointer-events: none; }
.nav-toggle .nt-menu { opacity: 1; transform: rotate(0deg) scale(1); transition: transform 450ms var(--zc-motion-out), opacity 300ms ease-out; }
.nav-toggle .nt-close { opacity: 0; transform: rotate(360deg) scale(.75); transition: transform 450ms var(--zc-motion-out), opacity 300ms ease-out; }
body.drawer-open .nav-toggle .nt-menu { opacity: 0; transform: rotate(-360deg) scale(.75); }
body.drawer-open .nav-toggle .nt-close { opacity: 1; transform: rotate(0deg) scale(1); }

.topbar.compact .links { display: none; }
.topbar.compact .nav-toggle { display: inline-flex; }
.topbar.compact .theme-btn .theme-label { display: none; }

.nav-mask {
  position: fixed; left: 0; right: 0; top: calc(var(--zc-topbar-h) + env(safe-area-inset-top)); bottom: 0; z-index: 39;
  background: var(--zc-scrim); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 220ms var(--zc-motion-out), visibility 220ms ease;
}
.nav-mask.show { opacity: 1; visibility: visible; pointer-events: auto; }

.nav-drawer {
  position: fixed; left: env(safe-area-inset-left); top: calc(var(--zc-topbar-h) + env(safe-area-inset-top)); bottom: 0; z-index: 40;
  width: var(--zc-nav-drawer-w); max-width: 84vw; display: flex; flex-direction: column;
  background: var(--zc-nav-bg); border-right: 1px solid var(--zc-border); box-shadow: var(--zc-shadow-dialog);
  transform: translateX(-100%); visibility: hidden; pointer-events: none;
  transition: transform 240ms var(--zc-motion-out), visibility 240ms ease;
}
.nav-drawer.show { transform: translateX(0); visibility: visible; pointer-events: auto; }
.nav-drawer .nd-scroll { flex: 1; overflow-y: auto; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); }
.nav-drawer .nd-label {
  font-size: 11px; letter-spacing: .06em; font-weight: 600;
  color: var(--zc-muted-foreground); padding: 12px 12px 6px;
}
.nav-drawer .nd-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
  border-radius: var(--zc-radius-md); color: var(--zc-muted-foreground); font-size: 14px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}
.nav-drawer .nd-item:hover { background: color-mix(in srgb, var(--zc-foreground) 6%, transparent); color: var(--zc-foreground); }
.nav-drawer .nd-item.on {
  background: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  color: var(--zc-foreground); font-weight: 600;
}
.nav-drawer .nd-item-link { min-height: 0; padding: 9px 12px; align-items: flex-start; }
.nav-drawer .nd-item-link .nd-text { display: flex; flex-direction: column; gap: 1px; color: var(--zc-foreground); }
.nav-drawer .nd-desc { font-size: 11px; font-weight: 400; color: var(--zc-muted-foreground); }
.nav-drawer .nd-ico {
  width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0; margin-top: 1px;
}
body.drawer-open { overflow: hidden; }

/* ===== 图片预览器（Lightbox，z-index: 9000） ===== */
.img-viewer {
  position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center;
  background: var(--zc-viewer-bg); backdrop-filter: blur(4px); user-select: none;
}
.img-viewer img {
  max-width: 92vw; max-height: 82vh; border-radius: var(--zc-radius-md); box-shadow: var(--zc-shadow-float);
  transform-origin: center center; transition: transform 120ms ease-out; cursor: grab; touch-action: none;
}
.img-viewer img.dragging { transition: none; cursor: grabbing; }
.img-viewer .iv-bar {
  position: fixed; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; background: var(--zc-card); border: 1px solid var(--zc-border);
  border-radius: var(--md-sys-shape-corner-full); padding: 6px 12px; box-shadow: var(--zc-shadow-menu);
}
.img-viewer .iv-bar button, .img-viewer .iv-bar a {
  border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--zc-foreground);
  padding: 5px 10px; border-radius: var(--md-sys-shape-corner-full); text-decoration: none;
}
.img-viewer .iv-bar button:hover, .img-viewer .iv-bar a:hover { background: var(--zc-surface-container-high); }
.img-viewer .iv-bar .iv-pct { font-size: 12px; color: var(--zc-muted-foreground); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.img-viewer .iv-close {
  position: fixed; top: calc(18px + env(safe-area-inset-top)); right: 18px; width: 40px; height: 40px;
  border-radius: 50% !important; overflow: hidden !important;
  border: 1px solid var(--zc-border); background: var(--zc-card); font-size: 18px; font-weight: 600;
  cursor: pointer; box-shadow: var(--zc-shadow-menu); color: var(--zc-foreground);
}
img[data-preview] { cursor: zoom-in; }

/* ===== 按钮体系（MD3 Expressive Pill + Spring Morph） ===== */
.btn, .btn-grad, .btn-line2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  min-height: 40px; padding: 0 20px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--zc-outline-variant);
  background: var(--zc-secondary-container);
  color: var(--zc-on-secondary-container);
  text-decoration: none;
  transition: border-radius 240ms var(--zc-motion-spring), background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn:active:not(:disabled):not(.m3-icon-btn):not(.m3-keep),
.btn-grad:active:not(:disabled),
.btn-line2:active:not(:disabled) {
  border-radius: var(--zc-radius-md);
  transition-duration: 120ms;
  transition-timing-function: var(--zc-motion-out);
}
.btn-gold, .btn-grad {
  background: var(--zc-primary);
  color: var(--zc-primary-foreground);
  border-color: transparent;
  font-weight: 600;
}
.btn-gold:hover, .btn-grad:hover { color: var(--zc-primary-foreground); }
.btn-ghost, .btn-line2 {
  background: transparent;
  border: 1px solid var(--zc-outline-variant);
  color: var(--zc-foreground);
}
.btn-ghost:hover, .btn-line2:hover { color: var(--zc-foreground); }
.btn-text {
  background: transparent;
  border-color: transparent;
  color: var(--zc-primary-text);
  padding: 0 16px;
}
.btn-text:hover {
  background: color-mix(in srgb, var(--zc-primary) 10%, transparent);
  color: var(--zc-primary-text);
}
.btn-danger {
  background: color-mix(in srgb, var(--zc-destructive) 12%, transparent);
  color: var(--zc-destructive-text);
  border-color: transparent;
}
.btn-danger-solid {
  background: var(--zc-destructive);
  color: var(--zc-destructive-foreground);
  border-color: transparent;
  font-weight: 600;
}
.btn-sm {
  min-height: 32px; padding: 0 12px; font-size: 12px; gap: 6px;
}
.btn-sm:active:not(:disabled):not(.m3-icon-btn):not(.m3-keep) {
  border-radius: var(--zc-radius-sm);
}
.btn-block { width: 100%; min-height: 44px; }
/* 高容器 / 多行按钮（≥56px）：遵循规范使用 16px 大圆角矩形，按下不收紧 */
.m3-btn-tall {
  flex-direction: column;
  gap: 3px;
  min-height: 56px;
  padding: 10px 18px;
  border-radius: var(--zc-radius-lg) !important;
  line-height: 1.3;
  text-align: center;
}
.m3-btn-tall .btn-sub {
  font-size: 12px;
  font-weight: 400;
  color: inherit;
  opacity: 0.86;
}
.notice-banner {
  border-radius: var(--zc-radius-md);
  padding: 10px 14px;
  background: var(--zc-accent-soft);
  color: var(--zc-primary-text);
  font-size: 13px;
  line-height: 1.55;
}
.btn:disabled, .btn-grad:disabled, .btn-line2:disabled,
.btn[aria-disabled="true"], .btn-grad[aria-disabled="true"], .btn-line2[aria-disabled="true"] {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
}
.btn[aria-busy="true"] { cursor: progress; }
/* MD3 Expressive Toggle 选中态：胶囊持久形变为 12px 圆角矩形 */
.btn[aria-pressed="true"] {
  border-radius: var(--zc-radius-md);
  background: var(--zc-primary-container);
  color: var(--zc-on-primary-container);
  border-color: color-mix(in srgb, var(--zc-primary) 45%, var(--zc-outline-variant));
  font-weight: 600;
}

/* 键盘焦点环统一走 :focus-visible */
button:focus-visible, a:focus-visible, [role="button"]:focus-visible, .btn:focus-visible, .side-item:focus-visible {
  outline: 2px solid var(--zc-ring);
  outline-offset: 2px;
}

/* ===== 表单控件（MD3 12px 圆角 + 1px 清晰焦点环 + 自定义下拉箭头 + M3 复选/单选） ===== */
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--zc-outline-variant);
  border-radius: var(--zc-radius-md);
  background: var(--zc-card);
  font-size: 14px; font-family: inherit; color: var(--zc-foreground);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
/* 只读信息展示块（div.input / input[readonly]）：与可编辑输入框明确区分视觉层级 */
div.input, .input[readonly] {
  background: var(--zc-surface-container-high);
  border-color: color-mix(in srgb, var(--zc-outline-variant) 65%, transparent);
}
/* 统一原生 select 下拉箭头，避免系统自带控件风格割裂 */
select.input, .frm select, .field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a6b58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
:root[data-theme="dark"] select.input,
:root[data-theme="dark"] .frm select,
:root[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b0bc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
textarea.input { min-height: 84px; line-height: 1.5; resize: vertical; }
.input:hover:not(:disabled):not([readonly]), select.input:hover:not(:disabled), textarea.input:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--zc-primary) 55%, var(--zc-outline-variant));
}
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--zc-primary);
  box-shadow: 0 0 0 1px var(--zc-primary);
}
.input:disabled, select.input:disabled, textarea.input:disabled {
  opacity: 0.55; cursor: not-allowed;
}

/* 原生复选框 & 单选框 M3 Expressive 风格（带弹性勾选动画） */
@keyframes m3-check-pop {
  from { transform: rotate(45deg) scale(0.4); opacity: 0; }
  to { transform: rotate(45deg) scale(1); opacity: 1; }
}
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  flex-shrink: 0; cursor: pointer; position: relative; vertical-align: middle;
  border: 2px solid var(--zc-muted-foreground);
  background: transparent;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 200ms var(--zc-motion-spring);
}
input[type="checkbox"] {
  width: 18px; height: 18px; border-radius: 4px;
}
input[type="checkbox"]:checked {
  border-color: var(--zc-primary);
  background: var(--zc-primary);
}
input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid var(--zc-primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: m3-check-pop 200ms var(--zc-motion-spring) both;
}
input[type="radio"] {
  width: 20px; height: 20px; border-radius: 50%;
}
input[type="radio"]:checked {
  border-color: var(--zc-primary);
  box-shadow: inset 0 0 0 4px var(--zc-card), inset 0 0 0 10px var(--zc-primary);
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: 2px solid var(--zc-ring); outline-offset: 2px;
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled {
  opacity: 0.45; cursor: not-allowed;
}

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--zc-foreground); margin-bottom: 6px; }
.field .hint { font-size: 12px; line-height: 1.55; color: var(--zc-muted-foreground); margin-top: 6px; }

/* ===== 人机验证（数字图片验证码） ===== */
.hc-wrap { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.hc-row { display: grid; grid-template-columns: 120px minmax(88px, 1fr) auto; gap: 8px; align-items: center; }
.hc-img {
  display: block; width: 120px; height: var(--zc-control-h); object-fit: cover;
  border-radius: var(--zc-radius-md); border: 1px solid var(--zc-outline-variant);
  cursor: pointer; background: var(--zc-qr-surface);
}
.hc-inp {
  width: 100%; height: var(--zc-control-h); padding: 0 12px;
  border: 1px solid var(--zc-outline-variant); border-radius: var(--zc-radius-md);
  background: var(--zc-card); color: var(--zc-foreground); font-size: 14px;
  font-family: var(--zc-font-mono); letter-spacing: 1px; outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.hc-inp:focus { border-color: var(--zc-primary); box-shadow: 0 0 0 1px var(--zc-primary); }
.hc-row .btn { height: var(--zc-control-h); min-height: var(--zc-control-h); padding: 0 14px; white-space: nowrap; }
.hc-inp.bad { border-color: var(--zc-destructive); box-shadow: 0 0 0 1px var(--zc-destructive); }
.hc-st { display: none; }
.hc-st.ok, .hc-st.err {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 13px; font-weight: 600; line-height: 1.45; padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
}
.hc-st.ok { background: var(--zc-success-bg); color: var(--zc-success-text); }
.hc-st.err { background: var(--zc-destructive-bg); color: var(--zc-destructive-text); }

/* ===== 认证页（安全垂直居中 + 柔和品牌光斑） ===== */
.pg-auth {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background-color: var(--zc-background);
  background-image:
    radial-gradient(640px 420px at 16% 4%, var(--zc-auth-glow-1), transparent 70%),
    radial-gradient(600px 420px at 86% 96%, var(--zc-auth-glow-2), transparent 70%);
  background-repeat: no-repeat;
}
.auth-card {
  width: 420px; max-width: 100%; flex: 0 0 auto; margin: auto 0;
  background-color: var(--zc-card); border: 1px solid var(--zc-border);
  border-radius: 20px; box-shadow: var(--zc-shadow-card); padding: 32px;
}
@media (min-width: 768px) {
  .auth-card { border-radius: var(--zc-radius-xl); }
  .auth-split {
    display: flex; width: 780px; padding: 0; overflow: hidden;
  }
  .auth-split .auth-brand {
    flex: 0 0 292px; display: flex; flex-direction: column; justify-content: center;
    padding: 44px 36px; background: var(--zc-surface-container-high);
    border-right: 1px solid var(--zc-border);
  }
  .auth-split .auth-brand .auth-logo { justify-content: flex-start; margin-bottom: 24px; }
  .auth-split .auth-brand h2 { text-align: left; font-size: 26px; letter-spacing: -0.025em; margin-bottom: 10px; line-height: 1.25; }
  .auth-split .auth-brand .auth-sub { text-align: left; font-size: 13px; line-height: 1.75; margin-bottom: 0; }
  .auth-split .auth-main { flex: 1; min-width: 0; padding: 36px 36px 32px; }
}
@media (max-width: 767px) {
  .auth-split .auth-brand h2, .auth-split .auth-brand .auth-sub { display: none; }
  .auth-split .auth-main { padding: 0; }
}
.pg-auth .input { min-height: var(--zc-control-h); }
.pg-auth .btn { min-height: var(--zc-control-h); }
.pg-auth .btn-block { min-height: 44px; }
.pg-auth .btn-sm { min-height: var(--zc-control-h); padding: 0 14px; font-size: 13px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--zc-foreground); margin-bottom: 20px; justify-content: center; }
.auth-logo .logo-img {
  width: 36px; height: 36px; border-radius: var(--zc-radius-md);
  background: var(--zc-qr-surface); object-fit: contain;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--zc-foreground) 10%, transparent);
}
.auth-card h2 { text-align: center; font-size: 22px; letter-spacing: -0.025em; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--zc-muted-foreground); font-size: 13px; margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--zc-muted-foreground); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--zc-muted-foreground); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--zc-border); }
.oauth-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; white-space: nowrap; }
.oauth-label { margin-right: 4px; color: var(--zc-muted-foreground); font-size: 12px; }
.oauth-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: 50% !important; overflow: hidden !important;
  background: transparent; color: var(--zc-muted-foreground); cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.oauth-btn svg { width: 20px; height: 20px; fill: currentColor; pointer-events: none; }
.oauth-btn:hover { border-color: var(--zc-outline-variant); color: var(--zc-foreground); }
.oauth-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== M3 分段控制器（.auth-tabs / .m3-segmented） ===== */
.auth-tabs, .m3-segmented {
  --m3-segmented-radius-outer: var(--md-sys-shape-corner-full);
  --m3-segmented-radius-inner: var(--md-sys-shape-corner-full);
  position: relative;
  display: flex;
  align-items: stretch;
  height: var(--zc-control-h);
  padding: 4px;
  margin-bottom: 18px;
  border-radius: var(--m3-segmented-radius-outer);
  background: var(--zc-surface-container-low);
  box-shadow: inset 0 0 0 1px var(--zc-outline-variant);
  isolation: isolate;
}
.m3-segmented--sm { height: 36px; }
.m3-segmented--rect {
  --m3-segmented-radius-outer: var(--zc-radius-lg);
  --m3-segmented-radius-inner: calc(var(--zc-radius-lg) - 4px);
}
.m3-segmented__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  height: auto !important;
  border-radius: var(--m3-segmented-radius-inner);
  background: var(--zc-secondary-container);
  z-index: 0;
  pointer-events: none;
  transition: transform var(--md-sys-motion-expressive-duration) var(--zc-motion-spatial),
              width var(--md-sys-motion-expressive-duration) var(--zc-motion-spatial);
  will-change: transform, width;
}
.m3-segmented__indicator.is-instant { transition: none !important; }
.m3-segmented--primary .m3-segmented__indicator { background: var(--zc-primary); }
.auth-tab, .m3-segmented__item {
  position: relative;
  z-index: 1;
  flex: 1;
  border: none;
  background: transparent;
  height: 100%;
  padding: 0 12px;
  border-radius: var(--m3-segmented-radius-inner);
  font-size: 13px;
  font-weight: 500;
  color: var(--zc-muted-foreground);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color 150ms ease;
}
.auth-tab:hover, .m3-segmented__item:hover { color: var(--zc-foreground); }
.auth-tab.on, .m3-segmented__item.on {
  color: var(--zc-on-secondary-container);
  font-weight: 600;
}
/* 未增强时的静态回退高亮 */
.auth-tabs:not(.has-indicator) .auth-tab.on {
  background: var(--zc-secondary-container);
}
.m3-segmented--primary .m3-segmented__item.on { color: var(--zc-primary-foreground); }

/* ===== 首页（分镜编排入场 Storyboard Stagger） ===== */
@keyframes zc-stage-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero { text-align: center; padding: 80px 24px 52px; max-width: var(--zc-page-max); margin: 0 auto; }
.hero h1 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.16; animation: zc-stage-in 300ms var(--zc-motion-out) both; }
.hero h1 .g { color: var(--zc-primary); }
.hero p { color: var(--zc-muted-foreground); font-size: 16px; max-width: 540px; margin: 16px auto 32px; line-height: 1.65; animation: zc-stage-in 300ms var(--zc-motion-out) 60ms both; }
#hero-actions { animation: zc-stage-in 320ms var(--zc-motion-spatial) 120ms both; }
.hero .btn { margin: 0 6px; min-height: 44px; padding: 0 28px; font-size: 15px; }
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; max-width: 1080px; margin: 16px auto 72px; padding: 0 24px;
}
.feature {
  background-color: var(--zc-card); border: 1px solid var(--zc-border); border-radius: var(--zc-radius-lg);
  padding: 24px; box-shadow: var(--zc-shadow-card);
  animation: zc-stage-in 280ms var(--zc-motion-out) both;
}
.feature:nth-child(1) { animation-delay: 150ms; }
.feature:nth-child(2) { animation-delay: 190ms; }
.feature:nth-child(3) { animation-delay: 230ms; }
.feature:nth-child(4) { animation-delay: 270ms; }
.feature:nth-child(5) { animation-delay: 310ms; }
.feature:nth-child(6) { animation-delay: 350ms; }
.feature .ico {
  width: 44px; height: 44px; border-radius: var(--zc-radius-lg); margin-bottom: 14px;
  background: color-mix(in srgb, var(--zc-primary) 12%, transparent);
  display: inline-flex; align-items: center; justify-content: center;
}
.feature .ico .ic, .feature .ico svg { width: 22px; height: 22px; color: var(--zc-primary-text); }
.feature h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: 13px; color: var(--zc-muted-foreground); line-height: 1.65; }
.footer { text-align: center; color: var(--zc-muted-foreground); font-size: 12px; padding: 28px 16px 36px; }
.footer a { color: var(--zc-muted-foreground); }
.footer a:hover { color: var(--zc-primary); }
.footer .sep { margin: 0 10px; opacity: 0.5; }
.footer .beian-ga { display: inline-flex; align-items: center; gap: 4px; }
.footer .beian-ga svg { color: var(--zc-success-text); }

/* ===== 控制台布局（顶栏 + 弹性折叠侧栏 + 视觉居中画布） ===== */
.console { display: flex; position: relative; min-height: calc(100svh - var(--zc-topbar-h) - env(safe-area-inset-top)); }
.sidebar {
  position: sticky; top: calc(var(--zc-topbar-h) + env(safe-area-inset-top)); align-self: flex-start;
  width: 240px; height: calc(100svh - var(--zc-topbar-h) - env(safe-area-inset-top)); padding: 12px;
  flex-shrink: 0; overflow-y: auto; overflow-x: hidden; isolation: isolate;
  background: var(--zc-nav-bg); border-right: 1px solid var(--zc-border);
  transition: width 280ms var(--zc-motion-spatial), transform 260ms var(--zc-motion-out);
}
.m3-side__indicator {
  position: absolute; left: 12px; right: 12px; top: 0; z-index: 0;
  border-radius: var(--zc-radius-md);
  background: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  pointer-events: none;
  transition: transform 280ms var(--zc-motion-spatial), height 220ms var(--zc-motion-out), opacity 150ms ease;
  will-change: transform, height;
}
.m3-side__indicator.is-instant { transition: none !important; }
.side-group {
  position: relative; z-index: 1;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--zc-muted-foreground); padding: 14px 12px 6px;
  max-height: 36px; overflow: hidden;
  transition: opacity 180ms ease, max-height 240ms var(--zc-motion-out), padding 240ms var(--zc-motion-out);
}
.side-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; min-height: 40px; border-radius: var(--zc-radius-md);
  cursor: pointer; color: var(--zc-muted-foreground); font-size: 14px; font-weight: 500;
  margin-bottom: 2px; border: 0; text-decoration: none;
  transition: padding 240ms var(--zc-motion-spatial), gap 240ms var(--zc-motion-spatial), background-color 150ms ease, color 150ms ease;
}
.side-item span.t {
  white-space: nowrap; overflow: hidden; max-width: 240px;
  transition: max-width 240ms var(--zc-motion-out), opacity 160ms ease, transform 240ms var(--zc-motion-out);
}
.side-item:hover { background: color-mix(in srgb, var(--zc-foreground) 6%, transparent); color: var(--zc-foreground); }
/* 激活态：品牌金 14% 淡底 + 前景文字，不使用左侧硬竖线（启用滑动块时底色交由滑动块承接） */
.side-item.on {
  background: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  color: var(--zc-foreground);
  font-weight: 600;
}
.sidebar.has-indicator .side-item.on { background: transparent; }
.sidebar.has-indicator .side-item.on:hover { background: color-mix(in srgb, var(--zc-primary) 6%, transparent); }
.side-item.on:hover { background: color-mix(in srgb, var(--zc-primary) 18%, transparent); }
.main {
  flex: 1; width: 100%; min-width: 0; max-width: var(--zc-page-max); margin: 0 auto;
  padding: clamp(20px, 2.5vw, 32px) clamp(16px, 2.8vw, 36px) 60px;
}
@media (min-width: 768px) {
  .sidebar[data-collapsed="true"] { width: 68px; }
  .sidebar[data-collapsed="true"] .side-item { justify-content: center; padding-left: 8px; padding-right: 8px; gap: 0; }
  .sidebar[data-collapsed="true"] .side-item span.t { max-width: 0; opacity: 0; transform: translateX(-8px); pointer-events: none; }
  .sidebar[data-collapsed="true"] .side-group { max-height: 16px; opacity: 0; padding-top: 8px; padding-bottom: 0; }
}

/* ===== 内容卡片（表面，非控件：无悬停染色、无鼠标光效、无 3D 视差） ===== */
.card, .zc-card, .feature, .auth-card, .cert-card {
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.card, .zc-card {
  background-color: var(--zc-card);
  border: 1px solid var(--zc-border);
  border-radius: var(--zc-radius-lg);
  box-shadow: var(--zc-shadow-card);
  padding: 20px 24px;
  margin-bottom: 20px;
  min-width: 0;
  overflow-x: auto;
}
/* 嵌套子卡片降级为 MD3 surface-container-high 扁平表面，避免套娃边框与双重阴影 */
.card .card, .auth-card .card, .cert-card .card {
  background-color: var(--zc-surface-container-high);
  border-color: color-mix(in srgb, var(--zc-outline-variant) 75%, transparent);
  border-radius: var(--zc-radius-md);
  box-shadow: none;
  padding: 16px;
  margin-bottom: 12px;
}
.zc-card--compact { border-radius: var(--zc-radius-md); padding: 16px; }
@media (hover: hover) {
  .zc-card--interactive:hover,
  :is(.feature, .card, .zc-card):is(a, button, [role="button"]):hover {
    box-shadow: var(--zc-shadow-hover);
  }
}
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ===== 数据表格（全视口横滚契约，严禁压扁列宽） ===== */
.m3-table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.m3-table-scroll-wrapper table,
.table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.m3-table-scroll-wrapper th,
.m3-table-scroll-wrapper td {
  white-space: nowrap !important;
}
.table th {
  height: 40px; text-align: left; color: var(--zc-muted-foreground); font-size: 12px; font-weight: 500;
  background: color-mix(in srgb, var(--zc-muted) 40%, transparent);
  padding: 0 16px; border-bottom: 1px solid var(--zc-border); white-space: nowrap;
}
.table td {
  padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--zc-border);
  vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
  .table--wrap { width: 100%; }
  .table--wrap td { white-space: normal; }
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--zc-muted) 40%, transparent); }
.table tbody tr:active td { background: color-mix(in srgb, var(--zc-muted) 60%, transparent); }
.table .ops { white-space: nowrap; text-align: right; }
.table .btn { white-space: nowrap; }

/* ===== 状态徽标（五档统一语义色） ===== */
.chip, .badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--md-sys-shape-corner-full);
  font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.chip.gold, .chip.primary, .badge.gold, .badge.primary {
  background: color-mix(in srgb, var(--zc-primary) 14%, transparent);
  color: var(--zc-primary-text);
}
.chip.green, .chip.success, .badge.green, .badge.success {
  background: color-mix(in srgb, var(--zc-success-text) 14%, transparent);
  color: var(--zc-success-text);
}
.chip.warn, .chip.warning, .badge.warn, .badge.warning {
  background: color-mix(in srgb, var(--zc-warning-text) 14%, transparent);
  color: var(--zc-warning-text);
}
.chip.red, .chip.danger, .badge.red, .badge.danger {
  background: color-mix(in srgb, var(--zc-destructive-text) 14%, transparent);
  color: var(--zc-destructive-text);
}
.chip.gray, .chip.muted, .badge.gray, .badge.muted {
  background: color-mix(in srgb, var(--zc-muted-foreground) 14%, transparent);
  color: var(--zc-muted-foreground);
}

/* ===== 模态弹窗（z-index: 9000）与确认框（z-index: 10000） ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--zc-scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.confirm-mask {
  z-index: 10000;
}
.modal {
  position: relative;
  background: var(--zc-popover);
  color: var(--zc-popover-foreground);
  border: 1px solid color-mix(in srgb, var(--zc-outline-variant) 55%, transparent);
  border-radius: var(--zc-radius-xl);
  padding: 24px;
  width: 460px; max-width: 100%; max-height: 90vh;
  overflow: auto;
  scrollbar-width: none;
  box-shadow: var(--zc-shadow-dialog);
}
.modal::-webkit-scrollbar { display: none; }
.modal:has(.table, .grid-2, .m3-table-scroll-wrapper) {
  width: min(760px, calc(100vw - 32px));
}
.modal--confirm {
  width: 384px;
  max-width: 24rem;
}
.modal h3 {
  margin-bottom: 12px; padding-right: 36px;
  font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35;
  display: flex; align-items: center; gap: 8px;
}
.modal > p.muted {
  line-height: 1.6;
  margin-bottom: 16px;
}
.confirm-warn-icon {
  color: var(--zc-destructive); display: inline-flex; flex-shrink: 0;
}
.modal .foot {
  position: sticky; bottom: -24px; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  margin: 20px -24px -24px; padding: 14px 24px 20px;
  background: var(--zc-popover);
  border-top: 1px solid var(--zc-border);
}
/* MD3 对话框操作层级：弹窗内取消/关闭等次级按钮自动收口为 Text 胶囊，突出主操作 */
.modal .foot > .btn:not(.btn-gold):not(.btn-danger):not(.btn-danger-solid):not(.btn-ghost) {
  background: transparent;
  border-color: transparent;
  color: var(--zc-primary-text);
}
.modal .foot > .btn:not(.btn-gold):not(.btn-danger):not(.btn-danger-solid):not(.btn-ghost):hover {
  background: color-mix(in srgb, var(--zc-primary) 10%, transparent);
}
.modal--confirm .foot {
  position: static; margin: 16px 0 0; padding: 4px 0 0; border-top: 0;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0;
  border-radius: 50% !important; overflow: hidden !important;
  background: transparent; color: var(--zc-muted-foreground); cursor: pointer;
}
.modal-close:hover { color: var(--zc-foreground); }

/* ===== MD3 Snackbar / Toast（反色面，z-index: 9999） ===== */
#toast {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  background: var(--zc-inverse-surface);
  color: var(--zc-inverse-on-surface);
  padding: 12px 16px;
  border: none;
  border-radius: var(--zc-radius-sm);
  font-size: 14px; font-weight: 400; line-height: 1.5;
  width: max-content; min-width: 220px; max-width: calc(100vw - 32px);
  opacity: 0; visibility: hidden; pointer-events: none;
  box-shadow: var(--zc-shadow-hover);
  transition: opacity 140ms var(--zc-motion-in), transform 140ms var(--zc-motion-in), visibility 0s 140ms;
}
#toast.show {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 200ms var(--zc-motion-out), transform 200ms var(--zc-motion-out);
  animation: zc-toast-in 200ms var(--zc-motion-out) both;
}
#toast .toast-icon { flex-shrink: 0; color: var(--zc-on-inverse-success); display: inline-flex; }
#toast.err .toast-icon { color: var(--zc-on-inverse-destructive); }
#toast.warn .toast-icon { color: var(--zc-on-inverse-warning); }
#toast.info .toast-icon { color: var(--zc-on-inverse-primary); }
#toast .toast-message { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#toast .toast-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50% !important; overflow: hidden !important;
  border: 0; background: transparent; color: var(--zc-inverse-on-surface); opacity: 0.75; cursor: pointer;
}
#toast .toast-close:hover { opacity: 1; }
@keyframes zc-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ===== 鱼骨骨架屏与统一空态 ===== */
.sk-bone {
  border-radius: var(--zc-radius-sm);
  background: linear-gradient(90deg, var(--zc-sk-base) 25%, var(--zc-sk-hi) 50%, var(--zc-sk-base) 75%);
  background-size: 200% 100%;
  animation: zc-sk-shimmer 1.5s ease-in-out infinite;
}
@keyframes zc-sk-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 36px 20px; gap: 10px;
}
.empty-state__ico {
  width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--zc-primary) 12%, transparent);
  color: var(--zc-primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.empty-state__title { font-size: 15px; font-weight: 600; color: var(--zc-foreground); }
.empty-state__desc { font-size: 12px; color: var(--zc-muted-foreground); max-width: 36em; line-height: 1.6; }

/* ===== 工具类 ===== */
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row > .input { min-width: 0; }
.row > .btn { flex: 0 0 auto; }
.row.between { justify-content: space-between; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.pagination {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--zc-border);
  font-size: 13px; color: var(--zc-muted-foreground);
  font-variant-numeric: tabular-nums;
}
/* 分页按钮降权为轻量 Outlined 胶囊，不抢表格主操作视觉焦点 */
.pagination .btn {
  min-height: 34px; padding: 0 14px; font-size: 13px;
  background: transparent; border-color: var(--zc-outline-variant); color: var(--zc-foreground);
}
.stat-num, .ov-stat-num { font-variant-numeric: tabular-nums; }
.stat-num { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.stat-card { text-align: center; padding: 18px 12px; }
code.k {
  font-family: var(--zc-font-mono); background: var(--zc-code-bg);
  color: var(--zc-on-primary-container); padding: 2px 7px;
  border-radius: var(--zc-radius-xs); font-size: 12px;
}
pre { font-family: var(--zc-font-mono); }

/* ===== 侧栏遮罩与移动端底部悬浮导航（MobileDock，z-index: 30） ===== */
body.modal-open, body.sidebar-open { overflow: hidden; }
/* 仅左侧页面侧栏开关在宽屏常驻；右侧站点导航入口（.site-nav-toggle）仅在顶栏收起（.compact）时显示 */
.topbar.has-sidebar #nav-toggle { display: inline-flex; }
.sidebar-mask {
  position: fixed; left: 0; right: 0; top: calc(var(--zc-topbar-h) + env(safe-area-inset-top)); bottom: 0; z-index: 39;
  background: var(--zc-scrim); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 220ms var(--zc-motion-out), visibility 220ms ease;
}
.mobile-dock { display: none; }

@media (max-width: 767px) {
  .console { display: block; }
  .sidebar {
    position: fixed; left: env(safe-area-inset-left); top: calc(var(--zc-topbar-h) + env(safe-area-inset-top)); bottom: 0; height: auto;
    width: 240px; max-width: 84vw; z-index: 40; transform: translateX(-100%);
    box-shadow: var(--zc-shadow-dialog);
  }
  .sidebar.mobile-show { transform: translateX(0); }
  .sidebar-mask.show { opacity: 1; visibility: visible; pointer-events: auto; }
  .main { padding: 20px 16px calc(5.5rem + env(safe-area-inset-bottom)); }
  .mobile-dock {
    position: fixed; z-index: 30;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%; transform: translateX(-50%);
    width: min(calc(100% - 2rem), 21rem);
    display: flex; align-items: stretch; gap: 0.25rem; padding: 0.35rem;
    background: var(--zc-card);
    border: 1px solid var(--zc-outline-variant);
    border-radius: var(--md-sys-shape-corner-full);
    box-shadow: var(--zc-shadow-hover);
    isolation: isolate;
    transition: transform 240ms var(--zc-motion-out), opacity 180ms ease;
  }
  body.modal-open .mobile-dock {
    transform: translateX(-50%) translateY(calc(100% + 2rem));
    opacity: 0;
    pointer-events: none;
  }
  .mobile-dock__indicator {
    position: absolute; top: 0.35rem; bottom: 0.35rem; left: 0; height: auto !important;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--zc-secondary-container);
    z-index: 0; pointer-events: none;
    transition: transform var(--md-sys-motion-expressive-duration) var(--zc-motion-spatial),
                width var(--md-sys-motion-expressive-duration) var(--zc-motion-spatial);
  }
  .mobile-dock__indicator.is-instant { transition: none !important; }
  .dock-item {
    position: relative; z-index: 1; flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 48px; padding: 4px 6px; border: 0;
    border-radius: var(--md-sys-shape-corner-full);
    background: transparent; color: var(--zc-muted-foreground);
    font-family: inherit; font-size: 11px; font-weight: 500; cursor: pointer;
    transition: color 150ms ease;
  }
  .dock-icon { display: inline-flex; align-items: center; justify-content: center; pointer-events: none; }
  .dock-icon svg, .dock-item .ic { width: 20px; height: 20px; pointer-events: none; }
  .dock-label { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .dock-item.on { color: var(--zc-on-secondary-container); font-weight: 600; }
  .mobile-dock:not(.has-indicator) .dock-item.on { background: var(--zc-secondary-container); }
}

/* ===== 总览统计格（账号中心） ===== */
.ov-stat {
  border: 1px solid var(--zc-outline-variant);
  border-radius: var(--zc-radius-md);
  padding: 16px 18px;
  background: var(--zc-surface-container-high);
}
.ov-stat-num { font-size: 24px; font-weight: 700; color: var(--zc-primary-text); }
.ov-stat-label { margin-top: 4px; font-size: 12px; color: var(--zc-muted-foreground); }
.avatar-edit-pill {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 8px; padding: 3px 10px; border-radius: var(--md-sys-shape-corner-full);
  font-size: 12px; font-weight: 500; cursor: pointer;
  color: var(--zc-primary-text);
  background: color-mix(in srgb, var(--zc-primary) 12%, transparent);
  transition: background-color 150ms ease;
}
.avatar-edit-pill:hover { background: color-mix(in srgb, var(--zc-primary) 20%, transparent); }
.contact-pane {
  border: 1px solid var(--zc-outline-variant);
  border-radius: var(--zc-radius-md);
  padding: 14px 16px;
  background: var(--zc-surface-container-high);
}

/* ===== 认证独立页与认证模块 ===== */
body.certify-page #tab-security > *:not(#rn-card-box):not(#student-card) { display: none !important; }
body.certify-page.embed-realname #student-card { display: none !important; }
body.certify-page.embed-student #rn-card-box { display: none !important; }
.certify-wrap { max-width: 780px; margin: 26px auto 60px; padding: 0 16px; }
.cert-main { max-width: 1000px; margin: 26px auto 70px; padding: 0 16px; }
.cert-title { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.cert-sub { font-size: 13px; color: var(--zc-muted-foreground); margin-top: 4px; }
.cert-card {
  background-color: var(--zc-card); border: 1px solid var(--zc-border);
  border-radius: var(--zc-radius-lg); padding: 24px; margin-top: 16px; box-shadow: var(--zc-shadow-card);
}
.cert-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.cert-head-l { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.cert-ico {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--zc-primary-container); color: var(--zc-on-primary-container);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cert-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.cert-head .sub { font-size: 12px; color: var(--zc-muted-foreground); margin-top: 3px; }
.st-ok { color: var(--zc-success-text); } .st-warn { color: var(--zc-warning-text); } .st-bad { color: var(--zc-destructive-text); }
.badge { vertical-align: 2px; margin-left: 8px; }
.info-box {
  background: var(--zc-surface-container-high); border: 1px solid var(--zc-outline-variant);
  border-radius: var(--zc-radius-md); padding: 16px 18px; margin: 16px 0;
}
.info-box .h { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 14px; }
.info-grid .k { color: var(--zc-muted-foreground); font-size: 12px; width: 64px; flex-shrink: 0; }
.info-grid .v { font-weight: 500; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 14px; margin-top: 18px; }
.pend-panel {
  background: var(--zc-surface-container-high); border: 1px solid var(--zc-outline-variant);
  border-radius: var(--zc-radius-md); padding: 24px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin: 16px 0;
}
.qr-box {
  width: 220px; height: 220px; background: var(--zc-qr-surface); border: 1px solid var(--zc-border);
  border-radius: var(--zc-radius-md); padding: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.qr-box img, .qr-box canvas { width: 100%; height: 100%; }
.frm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.frm-grid label, .frm label { font-size: 13px; font-weight: 500; display: block; }
.frm-grid input, .frm input, .frm select {
  width: 100%; height: 40px; margin-top: 6px; padding: 0 12px;
  border: 1px solid var(--zc-outline-variant); border-radius: var(--zc-radius-md);
  background: var(--zc-card); color: var(--zc-foreground); font-size: 14px; box-sizing: border-box;
  outline: none; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.frm-grid input:focus, .frm input:focus, .frm select:focus {
  border-color: var(--zc-primary); box-shadow: 0 0 0 1px var(--zc-primary);
}
.divider-line { border-top: 1px solid var(--zc-border); margin: 24px 0; }
.doc-radios { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.doc-radios label {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  border: 1px solid var(--zc-outline-variant); border-radius: var(--zc-radius-md);
  padding: 10px 12px; cursor: pointer; background: var(--zc-card);
}
.doc-radios input { margin: 0; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.up-grid label { font-size: 12px; color: var(--zc-muted-foreground); display: block; }
.up-grid input { margin-top: 6px; font-size: 12px; width: 100%; }
.up-item { border: 1px solid var(--zc-outline-variant); border-radius: var(--zc-radius-md); padding: 12px; background: var(--zc-surface-container-low); }
.up-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--zc-foreground); margin-bottom: 2px; }
.up-item-head .up-name { font-weight: 400; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-note { font-size: 12px; color: var(--zc-muted-foreground); margin-top: 8px; }
.wait-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--zc-primary-text); margin: 8px 0; }
.spin {
  width: 12px; height: 12px; border: 2px solid var(--zc-primary-container);
  border-top-color: var(--zc-primary); border-radius: 50%; animation: sp .8s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }
.drop {
  width: 100%; min-height: 96px; border: 1px dashed var(--zc-outline); border-radius: var(--zc-radius-md);
  background: var(--zc-surface-container-high); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  color: var(--zc-muted-foreground); font-size: 12px; cursor: pointer; margin-top: 6px;
}
.drop:hover { border-color: var(--zc-primary); background: var(--zc-primary-container); color: var(--zc-on-primary-container); }
.drop:disabled { opacity: 0.5; cursor: not-allowed; }
.file-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--zc-outline-variant); border-radius: var(--zc-radius-sm);
  padding: 8px 12px; margin-top: 8px; font-size: 12px; background: var(--zc-card);
}
.file-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .del { border: none; background: none; color: var(--zc-muted-foreground); cursor: pointer; font-size: 14px; }
.file-row .del:hover { color: var(--zc-destructive-text); }
.benefit { display: flex; gap: 8px; font-size: 14px; color: var(--zc-muted-foreground); line-height: 1.9; }
.benefit b { color: var(--zc-foreground); }

/* ===== 页面与内容入场动画 ===== */
@keyframes zc-content-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes zc-login-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.zc-content-enter, .page-anim-in { animation: zc-content-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero, .auth-card, .zc-fade-in, .zc-login-enter { animation: zc-login-in 260ms var(--zc-motion-out) both; }

/* ===== 全站移动端（<768px）防挤压兜底清单 ===== */
img { max-width: 100%; }
@media (max-width: 767px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  button, [role="button"], .btn, .m3-btn { white-space: nowrap; }
  button { flex-shrink: 0; }
  /* 阻止 iOS Safari 聚焦输入框自动放大 */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  textarea, select, .m3-select, .m3-datepicker {
    font-size: 16px !important;
  }
  .card, .zc-card, .cert-card, h1, h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  :where(div, section):has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { width: max-content; min-width: 100%; }
  th, td { white-space: nowrap; }
  .table th, .table td { padding: 12px 14px; }
  .table th.ops, .table td.ops {
    position: sticky; right: 0;
    background: var(--zc-card);
    border-left: 1px solid color-mix(in srgb, var(--zc-outline-variant) 35%, transparent);
  }
  .table th.ops {
    background: color-mix(in srgb, var(--zc-muted) 40%, var(--zc-card));
  }
  .table tbody tr:hover td.ops {
    background: color-mix(in srgb, var(--zc-muted) 40%, var(--zc-card));
  }
  .table tbody tr:active td.ops {
    background: color-mix(in srgb, var(--zc-muted) 60%, var(--zc-card));
  }
  .auth-tabs, .m3-segmented { max-width: 100%; }
  .auth-tab, .m3-segmented__item { white-space: nowrap; }
}
@media (max-width: 640px) {
  .topbar { padding: env(safe-area-inset-top) 12px 0; gap: 10px; }
  .topbar .links a { margin-right: 12px; font-size: 13px; }
  .card, .zc-card, .cert-card { padding: 16px; }
  .card h3 { flex-wrap: wrap; gap: 6px; }
  .grid-2, .info-grid, .meta-grid { grid-template-columns: 1fr; }
  .pend-panel { justify-content: center; text-align: center; }
  .row.between { flex-wrap: wrap; }
  .modal { padding: 20px; }
  .modal .foot { bottom: -20px; margin: 16px -20px -20px; padding: 14px 20px 18px; }
  .modal--confirm .foot { margin: 16px 0 0; padding: 4px 0 0; }
  .pg-auth { padding: 16px; }
  .auth-card { margin: auto 0; padding: 22px 18px; }
  .footer { padding: 20px 16px 28px; }
}
@media (max-width: 400px) {
  .topbar.has-sidebar .brand-name { display: none; }
  .topbar .links a, .nav-drop { margin-right: 10px; }
  .chip, .badge { padding: 2px 8px; font-size: 11px; }
}

/* ===== 减弱动态效果（prefers-reduced-motion: reduce） ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .zc-content-enter, .page-anim-in, .hero, .hero h1, .hero p, #hero-actions, .feature, .auth-card, .zc-fade-in, .zc-login-enter, #toast.show, .sk-bone, input[type="checkbox"]:checked::after {
    animation: none !important;
  }
  .sk-bone { background: var(--zc-sk-base); }
  .btn, .btn-grad, .btn-line2, .side-item, .dock-item, .sidebar, .sidebar .t, .side-group, .mobile-dock, #toast, .theme-btn .ic, .nav-toggle .nt-menu, .nav-toggle .nt-close {
    transition: none !important;
    transform: none !important;
  }
  .m3-segmented__indicator, .mobile-dock__indicator, .m3-side__indicator {
    transition: opacity 120ms linear !important;
  }
  /* 弹层在减弱动效下缩短时长（120ms / 100ms）而非置 0，保留交互反馈 */
  .topbar-menu, .nav-drop-menu, .theme-pop {
    transform: none !important;
    transition: opacity 100ms linear, visibility 0s 100ms !important;
  }
  .topbar-user.open .topbar-menu, .nav-drop.open .nav-drop-menu, .theme-slot.open .theme-pop {
    transform: none !important;
    transition: opacity 120ms linear !important;
  }
}
