/* ================================================================
 * HORD Hub - 学习中枢 主样式表
 * 版本: 1.0.0 (Step 0 SPA 框架)
 * 作者: HORD Team
 *
 * 目录:
 *   1. CSS 变量 (主题系统)
 *   2. 全局重置
 *   3. 布局系统
 *   4. 侧边栏导航
 *   5. 顶部工具栏
 *   6. 内容区域
 *   7. 底部标签栏 (移动端)
 *   8. 组件: 卡片 / 按钮 / 表单 / 徽章
 *   9. 组件: 加载动画 / Toast 通知
 *  10. 工具类
 *  11. 动画关键帧
 *  12. 响应式断点
 * ================================================================ */

/* ────────────────────────────────────────────────────────────────
 * 1. CSS 变量 — 主题系统
 * ──────────────────────────────────────────────────────────────── */

/* 亮色主题（默认） */
:root {
  /* 背景 */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-toolbar: rgba(255, 255, 255, 0.82);
  --bg-hover: rgba(124, 58, 237, 0.06);
  --bg-active: rgba(124, 58, 237, 0.10);
  --bg-overlay: rgba(15, 23, 42, 0.40);

  /* 文字 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* 边框 */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* 强调色（与 Manager 品牌色 #7c3aed 对齐） */
  --accent-color: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: rgba(124, 58, 237, 0.12);
  --accent-text: #6d28d9;

  /* 语义色 */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.10);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.10);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.10);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.10);

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* 间距 */
  --toolbar-height: 48px;
  --content-max-width: 1500px;

  /* 过渡 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* 暗色主题 */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-toolbar: rgba(15, 23, 42, 0.85);
  --bg-hover: rgba(124, 58, 237, 0.12);
  --bg-active: rgba(124, 58, 237, 0.22);
  --bg-overlay: rgba(0, 0, 0, 0.60);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --border-color: #334155;
  --border-light: #334155;

  --accent-color: #a78bfa;
  --accent-hover: #8b5cf6;
  --accent-light: rgba(167, 139, 250, 0.18);
  --accent-text: #c4b5fd;

  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.40), 0 2px 4px -2px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.30);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.50), 0 8px 10px -6px rgba(0, 0, 0, 0.40);
}

/* ────────────────────────────────────────────────────────────────
 * 2. 全局重置
 * ──────────────────────────────────────────────────────────────── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 主题切换平滑过渡 */
  transition: background-color var(--transition-base), color var(--transition-base);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* 滚动条美化（Webkit） */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ═══ 阅读器 SPA 内嵌模式：隐藏 hero + Tab 导航 ═══ */
body.hub-reading-mode { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.hub-reading-mode .hub-hero { display: none; }
body.hub-reading-mode .hub-tabs { display: none; }
body.hub-reading-mode .hub-main { flex: 1; min-height: 0; overflow: hidden; max-width: none; }
body.hub-reading-mode .hub-content { padding: 0; flex: 1; min-height: 0; overflow: hidden; }

/* ────────────────────────────────────────────────────────────────
 * 3. 布局系统
 * ──────────────────────────────────────────────────────────────── */

/* ═══ Hero 顶栏（对齐 Manager hero 视觉设计） ═══ */
/* 默认（暗色模式 / 未设定主题时）— 深紫渐变 */
.hub-hero {
  background: linear-gradient(135deg, #312e81 0%, #5b21b6 45%, #7c3aed 100%);
  width: 100%;
  padding: 0;
  position: relative;
}
.hub-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, .18), rgba(15, 23, 42, .08));
  pointer-events: none;
}
.hub-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 20px 24px;
}
.heroHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* Title block (matches Manager .titleLine layout) */
.hero-title {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.titleLine {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.titleHord {
  font-size: 60px;
  line-height: 1;
  font-weight: 950;
  color: #ddd6fe;
  text-shadow: 0 2px 12px rgba(124,58,237,0.25);
}
.titleDot {
  font-size: 58px;
  font-weight: 900;
  color: #1e1b4b;
  line-height: 1;
  opacity: 0.92;
}
.titleCn {
  font-size: 60px;
  font-weight: 950;
  color: #0f172a;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(15,23,42,0.12);
}
.titleOwn {
  font-size: 28px;
  font-weight: 940;
  color: #f5f3ff;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(124,58,237,0.30);
}
.titleCNSub {
  font-size: 34px;
  font-weight: 820;
  color: #e2e8f0;
  line-height: 1.2;
}
.titleDesc {
  font-size: 15px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  line-height: 1.5;
}

/* Hero CTA 右侧按钮栈 */
.heroCtaStack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* 官网品牌芯片 (matches Manager .heroBrandChip white card style) */
.heroBrandRow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero-pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(34,197,94,.2);
  border: 1px solid rgba(134,239,172,.45);
  color: #dcfce7;
  cursor: default;
  line-height: 1.3;
  white-space: nowrap;
  height: 34px;
}
.heroBrandChip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(124, 58, 237, 0.20);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  transition: all 0.2s;
}
.heroBrandChip:hover {
  background: rgba(255,255,255,0.88);
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}
.heroBrandLogo { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; object-fit: cover; }
.heroBrandText { min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.heroBrandMain { font-size: 13px; font-weight: 900; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.heroBrandMain .hord { color: #7c3aed; }
.heroBrandSite { margin-left: 8px; font-size: 11px; color: #64748b; font-weight: 800; border: 1px solid rgba(100, 116, 139, 0.28); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.heroBrandSub { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

/* 按钮组 */
.hero-action-btns { display: flex; gap: 8px; align-items: center; }

/* 第三行控制按钮（设置 + 主题切换） */
.hero-controls-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.hero-ctrl-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}
.hero-theme-btn,
.hero-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  height: 34px;
}
.hero-theme-btn:hover,
.hero-sync-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}
.hero-theme-btn { min-width: 40px; justify-content: center; }
.hero-theme-icon { font-size: 16px; }
.hero-sync-btn { white-space: nowrap; }
.hero-sync-icon { font-size: 15px; }


/* Hero 设置按钮（图标按钮） */
.hero-settings-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.hero-settings-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); }

/* Hero 用户按钮 */
.hero-user-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.hero-user-btn:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.18); }
.hero-user-avatar {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

/* ═══ 暗色 Hero ═══ */
[data-theme="dark"] .hub-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
}
[data-theme="dark"] .titleLine { color: #f5f3ff; }
[data-theme="dark"] .titleOwn { color: #a78bfa; text-shadow: 0 2px 10px rgba(139,92,246,0.35); }
[data-theme="dark"] .titleCNSub { color: rgba(255,255,255,0.75); }
[data-theme="dark"] .titleDesc { color: rgba(255,255,255,0.55); }
[data-theme="dark"] .heroBrandChip { background: rgba(30,26,55,0.80); border-color: rgba(167,139,250,0.25); }
[data-theme="dark"] .heroBrandChip:hover { background: rgba(30,26,55,0.92); border-color: rgba(167,139,250,0.40); }
[data-theme="dark"] .heroBrandMain { color: #e7eeff; }
[data-theme="dark"] .heroBrandMain .hord { color: #a78bfa; }
[data-theme="dark"] .heroBrandSite { color: #94a3b8; border-color: rgba(148,163,184,0.35); }
[data-theme="dark"] .heroBrandSub { color: #94a3b8; }
[data-theme="dark"] .hero-theme-btn,
[data-theme="dark"] .hero-sync-btn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); color: #e0e7ff; }
[data-theme="dark"] .hero-theme-btn:hover,
[data-theme="dark"] .hero-sync-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }
[data-theme="dark"] .hero-settings-btn { border-color: rgba(255,255,255,0.14); color: rgba(255,255,255,0.65); }
[data-theme="dark"] .hero-settings-btn:hover { background: rgba(255,255,255,0.10); color: #fff; }
[data-theme="dark"] .hero-user-btn { border-color: rgba(255,255,255,0.20); }

/* ═══ Hero 亮色模式（对齐 Manager .hero 淡紫背景） ═══ */
body.vb-force-light .hub-hero {
  background: #f3f0ff !important;
  color: #0f172a;
}
body.vb-force-light .hub-hero::before { display: none !important; }
body.vb-force-light .hub-hero-inner { padding: 16px 24px 12px; }

/* 标题颜色 */
body.vb-force-light .titleHord { color: #4c1d95; font-size: 48px; }
body.vb-force-light .titleDot { color: #1e1b4b; font-size: 48px; }
body.vb-force-light .titleCn { color: #0f172a; font-size: 48px; }
body.vb-force-light .titleOwn { color: #7c3aed; font-size: 22px; text-shadow: none; }
body.vb-force-light .titleCNSub { color: #1e293b; font-size: 26px; }
body.vb-force-light .titleDesc { color: #475569; font-size: 13px; }
/* CTA 按钮和主题按钮 */
body.vb-force-light .hero-theme-btn,
body.vb-force-light .hero-sync-btn,
body.vb-force-light .hero-settings-btn {
  background: #ffffff;
  border-color: #d6dcf3;
  color: #334155;
}
body.vb-force-light .hero-theme-btn:hover,
body.vb-force-light .hero-sync-btn:hover,
body.vb-force-light .hero-settings-btn:hover {
  background: #f8fafc;
  border-color: #a78bfa;
}

/* 专业版标签 - 亮色模式 */
body.vb-force-light .hero-pro-badge {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

/* 设置按钮 */
body.vb-force-light .hero-settings-btn {
  border-color: #d6dcf3;
  color: #64748b;
}
body.vb-force-light .hero-settings-btn:hover {
  background: #f8fafc;
  border-color: #a78bfa;
  color: #334155;
}

/* 用户按钮 */
body.vb-force-light .hero-user-btn {
  border-color: #d6dcf3;
}
body.vb-force-light .hero-user-btn:hover {
  background: #f8fafc;
  border-color: #a78bfa;
}

/* 版本号 */

/* 品牌芯片在亮色模式保持白色（不变） */

.hub-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 主内容区（全宽 1500px 内居中，不再受侧边栏 margin 偏移） */
.hub-main {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* 阅读模式：隐藏 Tab 导航条（与 hero / toolbar 一并隐藏） */
body.hub-reading-mode .hub-tabs { display: none; }

/* ────────────────────────────────────────────────────────────────
 * 4. 水平 Tab 导航（对齐 Manager pill 按钮风格）
 * ──────────────────────────────────────────────────────────────── */

/* Tab 条容器（hero 的兄弟节点，不嵌入 hero 以免 overflow:hidden 破坏 sticky） */
.hub-tabs {
  position: sticky;
  top: 0;
  z-index: 140;
  width: 100%;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(14px) saturate(1.06);
  -webkit-backdrop-filter: blur(14px) saturate(1.06);
  transition: background var(--transition-base), border-color var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hub-tabs::-webkit-scrollbar { display: none; }

/* 单个 Tab（Manager pill 风格：border-radius: 999px） */
.hub-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), transform var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hub-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.hub-tab.active {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}
[data-theme="dark"] .hub-tab.active {
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.hub-tab-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.hub-tab-label {
  line-height: 1.2;
}

/* ────────────────────────────────────────────────────────────────
 * 5. 同步状态 / 用户下拉菜单（保留自旧 toolbar）
 * ──────────────────────────────────────────────────────────────── */

/* 同步状态指示器 */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: default;
  transition: all var(--transition-fast);
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.sync-dot.syncing {
  background: var(--warning);
  animation: sync-pulse 1.2s ease-in-out infinite;
}
.sync-dot.error { background: var(--danger); }
.sync-dot.offline { background: var(--text-muted); }

/* ── 主题图标切换（Hero 版）── */
.hero-theme-icon { display: none; }
[data-theme="dark"] .hero-theme-icon.light { display: block; }
[data-theme="dark"] .hero-theme-icon.dark  { display: none; }
body:not([data-theme="dark"]) .hero-theme-icon.light { display: none; }
body:not([data-theme="dark"]) .hero-theme-icon.dark  { display: block; }

/* 用户下拉菜单 */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}
.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}
.user-dropdown-email {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}
.user-dropdown-plan {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.user-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger:hover { background: var(--danger-bg); }

 * 6. 内容区域
 * ──────────────────────────────────────────────────────────────── */

.hub-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  animation: fade-in 0.3s ease-out;
}

/* 页面标题区 */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.page-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 占位页（Coming Soon） */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  padding: 40px 20px;
}
.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.6;
}
.coming-soon-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.coming-soon-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}

/* 404 页面 */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
}
.page-404-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent-color);
  opacity: 0.3;
  line-height: 1;
}
.page-404-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

 * 8. 组件: 卡片 / 按钮 / 表单 / 徽章
 * ──────────────────────────────────────────────────────────────── */

/* 卡片 */
.card {
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── 卡片暗色模式 ── */
[data-theme="dark"] .card,
body:not(.vb-force-light) .card {
  background: #1e1b2e;
  border-color: rgba(167,139,250,0.20);
}
[data-theme="dark"] .card-title,
body:not(.vb-force-light) .card-title { color: #eef2ff; }
[data-theme="dark"] .card-body,
body:not(.vb-force-light) .card-body { color: rgba(226,232,240,0.68); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--text-inverse);
  border-color: var(--accent-color);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  filter: brightness(0.9);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

/* 表单 */
.input, .select, .textarea {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.input::placeholder, .textarea::placeholder {
  color: var(--text-muted);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.badge-red {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-yellow {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge-green {
  background: var(--success-bg);
  color: var(--success);
}
.badge-blue {
  background: var(--info-bg);
  color: var(--info);
}

/* ────────────────────────────────────────────────────────────────
 * 9. 组件: 加载动画 / Toast 通知
 * ──────────────────────────────────────────────────────────────── */

/* CSS-only 加载旋转器 */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* 全页加载状态 */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 16px;
}
.loading-screen-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Toast 通知容器 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  transition: all var(--transition-base);
}
.toast.toast-out {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  word-break: break-word;
}
.toast-close {
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  line-height: 1;
}
.toast-close:hover { color: var(--text-primary); }

/* Toast 类型 */
.toast-success { border-left: 3px solid var(--success); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--info); }

/* ────────────────────────────────────────────────────────────────
 * 10. 工具类
 * ──────────────────────────────────────────────────────────────── */

/* 文字 */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent-color); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }

.text-sm   { font-size: 0.8rem; }
.text-base { font-size: 0.9rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.5rem; }
.text-bold { font-weight: 600; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }

/* 间距 */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-2  { padding: 8px; }
.p-3  { padding: 12px; }
.p-4  { padding: 16px; }

/* Flex */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap   { flex-wrap: wrap; }
.flex-1      { flex: 1; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Grid */
.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* 显示 */
.hidden   { display: none !important; }
.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;
}

/* 溢出 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 分割线 */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

/* ────────────────────────────────────────────────────────────────
 * 11. 动画关键帧
 * ──────────────────────────────────────────────────────────────── */

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

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

@keyframes sync-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes slide-out-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* 页面切换淡入 */
.page-enter {
  animation: fade-in 0.3s ease-out;
}

/* ────────────────────────────────────────────────────────────────
 * 12. 响应式断点
 * ──────────────────────────────────────────────────────────────── */

/* 平板: 768px - 1199px */
@media (max-width: 1199px) {
  .hub-hero-inner { padding: 20px 16px; }
  .heroHead { flex-direction: column; align-items: stretch; gap: 16px; }
  .titleHord { font-size: 44px; }
  .titleDot { font-size: 42px; }
  .titleCn { font-size: 44px; }
  .titleOwn { font-size: 22px; }
  .titleCNSub { font-size: 24px; }
  .titleDesc { display: none; }
  .heroCtaStack { align-items: stretch; }

  /* Tab 条内边距收紧 */
  .hub-tabs { padding: 8px 16px; gap: 6px; }
  .hub-tab { padding: 7px 13px; font-size: 13px; }
}

/* 移动端: < 768px */
@media (max-width: 767px) {
  .hub-hero-inner { padding: 16px 14px; }
  .titleLine { font-size: 17px; gap: 6px; }
  .titleHord { font-size: 30px; }
  .titleDot { font-size: 28px; }
  .titleCn { font-size: 26px; }
  .titleOwn { font-size: 16px; }
  .titleCNSub { display: none; }
  .heroBrandSub { display: none; }
  .heroBrandMain { max-width: 180px; }
  .hero-action-btns { flex-wrap: wrap; }
  .hero-controls-row { flex-wrap: wrap; }
  .hero-sync-btn { padding: 7px 10px; font-size: 12px; }
  .hero-settings-btn { width: 30px; height: 30px; }

  /* Tab 条：紧凑 + 滚动 */
  .hub-tabs { padding: 6px 12px; gap: 4px; }
  .hub-tab { padding: 6px 11px; font-size: 13px; gap: 4px; }
  .hub-tab-icon { font-size: 14px; }
  
  /* 内容区减少内边距 */
  .hub-content { padding: 16px; }

  /* 网格自适应 */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Toast 调整 */
  .toast-container {
    left: 12px;
    right: 12px;
    max-width: none;
  }

  /* 用户下拉调整 */
  .user-dropdown {
    right: 12px;
    min-width: 200px;
  }
}

/* 小平板: 768px - 1023px 网格保持 2 列 */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
