/* ============================================================
   hub.css — 个人数字中心（Personal Digital Hub）共享设计系统
   ----------------------------------------------------------------
   设计理念：Notion + Linear + GitHub Dashboard 风格
   - 留白克制、卡片化、层次清晰
   - 二选一主题：护眼绿（默认） / 白色（手动选）
   - 移动端优先，桌面端居中容器
   ============================================================ */

/* ---------- 0. 设计令牌：护眼绿主题（默认） ---------- */
:root {
  /* 半径 */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* 字号 */
  --fs-xs: 13px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 17px;
  --fs-lg: 19px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-3xl: 42px;
  --fs-4xl: 56px;

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* 字体 */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
               Menlo, Consolas, monospace;

  /* 容器 */
  --container-max: 1280px;
  --container-px:  24px;

  /* Header 高度（用于 tab-bar 固定定位计算） */
  --header-h: 64px;
  --tabbar-h: 60px;

  /* === 现代阴影系统 === */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.14), 0 8px 16px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 4px rgba(91, 175, 111, 0.12);

  /* === 动画曲线 === */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === 渐变（品牌色） === */
  --grad-brand: linear-gradient(135deg, #5BAF6F 0%, #3d8a4d 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(91, 175, 111, 0.12) 0%, rgba(61, 138, 77, 0.04) 100%);
  --grad-text: linear-gradient(135deg, #5BAF6F 0%, #2d7a3f 100%);
  --grad-bg: linear-gradient(180deg, #f5f9ed 0%, #e8efe1 100%);

  /* === 半透明 + 模糊 === */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: blur(12px) saturate(1.4);

  /* === 字号扩展 === */
  --fs-5xl: 64px;
  --fs-6xl: 80px;

  /* === 间距扩展 === */
  --space-20: 80px;
  --space-24: 96px;
}

/* ---------- 0.1 主题：护眼绿（默认） ---------- */
/* 默认主题是绿色护眼色，所有 :root 变量都是绿色 */
:root {
  color-scheme: light;

  /* 背景：草绿色（护眼） */
  --bg:           #e8efe1;
  --bg-elevated:  #f0f5e9;
  --bg-card:      #f5f9ed;
  --bg-card-hover:#e8efe1;
  --bg-tag:       #dbe6cb;
  --bg-overlay:   rgba(15, 23, 42, 0.4);

  --border:       #c9d6b8;
  --border-strong:#a8b894;
  --border-accent:#6b8e4e;

  --text:         #2a3528;
  --text-secondary:#525252;
  --text-tertiary:#718096;

  --accent:       #6b8e4e;   /* 草绿 */
  --accent-hover: #3d6b2f;
  --accent-soft:  #dbe6cb;
  --accent-fg:    #ffffff;

  --success:      #10b981;
  --success-soft: #d1fae5;
  --danger:       #ef4444;
  --danger-soft:  #fee2e2;
  --warning:      #f59e0b;
  --warning-soft: #fef3c8;

  /* 进度 / 热力图 */
  --progress-from:#8fbb6f;
  --progress-to:  #3d6b2f;
  --progress-bg:  #dbe6cb;

  --heat-0:#e8efe1;
  --heat-1:#c8d8a8;
  --heat-2:#9fc275;
  --heat-3:#6b8e4e;
  --heat-4:#3d6b2f;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(60, 80, 40, 0.06);
  --shadow-sm: 0 1px 3px rgba(60, 80, 40, 0.08), 0 1px 2px rgba(60, 80, 40, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(60, 80, 40, 0.08), 0 2px 4px -2px rgba(60, 80, 40, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(60, 80, 40, 0.1), 0 4px 6px -4px rgba(60, 80, 40, 0.04);
}

/* ---------- 1. 全局重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0; }
button { font-family: inherit; }

/* ---------- 2. 布局容器 ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* ---------- 3. 顶部 Header / Nav ---------- */
.hub-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.hub-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.hub-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--container-px);
  max-width: var(--container-max);
  margin: 0 auto;
}
.hub-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text);
  letter-spacing: -0.02em;
}
.hub-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 13px;
}
/* 4 个导航项等距分布（flex:1 占满中间区域），样式统一 */
.hub-nav {
  display: flex;
  align-items: stretch;
  flex: 1;
  justify-content: space-around;
  max-width: 520px;
  margin: 0 auto;
  gap: 0;
}
.hub-nav > a,
.hub-nav-dropdown-trigger {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 19px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  text-align: center;
  white-space: nowrap;
}
.hub-nav > a:hover,
.hub-nav-dropdown-trigger:hover {
  color: var(--accent);
  background: transparent;
}
.hub-nav > a.is-active,
.hub-nav-dropdown-trigger.is-active {
  color: var(--accent);
  background: transparent;
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ---------- "学习" hover 下拉 ---------- */
.hub-nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
}
.hub-nav-dropdown-trigger {
  cursor: pointer;
  user-select: none;
}
.hub-nav-dropdown-trigger .caret {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.6;
  display: inline-block;
  transition: transform 0.15s ease;
}
.hub-nav-dropdown:hover .hub-nav-dropdown-trigger .caret,
.hub-nav-dropdown:focus-within .hub-nav-dropdown-trigger .caret {
  transform: rotate(180deg);
  opacity: 1;
}
.hub-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 10px 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 100;
}
.hub-nav-dropdown:hover .hub-nav-dropdown-menu,
.hub-nav-dropdown:focus-within .hub-nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* 上面小三角 */
.hub-nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 2px;
}
.hub-nav-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0;
}
.hub-nav-dropdown-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 14px 2px;
}
.hub-nav-dropdown-menu a {
  padding: 7px 14px !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--text-secondary) !important;
  border-bottom: none !important;
  border-radius: var(--radius-sm);
  text-align: left;
  white-space: nowrap;
  transition: background-color 0.1s ease, color 0.1s ease;
}
.hub-nav-dropdown-menu a:hover {
  background: var(--bg-tag) !important;
  color: var(--text) !important;
}
.hub-nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}
.hub-nav-dropdown-all {
  color: var(--accent) !important;
  font-weight: 500 !important;
}

.hub-actions { display: flex; align-items: center; gap: var(--space-2); }

/* ---------- 4. 顶部搜索按钮（Header 内） ---------- */
.hub-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  background: var(--bg-tag);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.hub-search-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.hub-search-btn kbd {
  display: inline-block;
  padding: 1px 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

/* ---------- 5. 主题切换按钮 ---------- */
.hub-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.hub-theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-tag);
}

/* ---------- 6. Hero 区域 ---------- */
.hub-hero {
  position: relative;
  padding: var(--space-20) 0 var(--space-16);
  isolation: isolate;
}
.hub-hero::before {
  content: '';
  position: absolute;
  inset: 0 -10vw 30% -10vw;
  background: var(--grad-brand-soft);
  filter: blur(60px);
  z-index: -1;
  opacity: 0.6;
  pointer-events: none;
}
.hub-hero__greeting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-tag);
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}
.hub-hero__name {
  font-size: clamp(30px, 4.4vw, var(--fs-4xl));
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-3);
}
/* 单栏 hero（无 __identity 时自动展开） */
.hub-hero:not(:has(.hub-hero__identity)) {
  grid-template-columns: 1fr;
}
.hub-hero__product {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-hover);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  vertical-align: 4px;
  -webkit-text-fill-color: var(--accent-hover);
  background-clip: padding-box;
}
.hub-hero__title {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
}
.hub-hero__desc {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: var(--space-6);
}
.hub-hero__focus {
  margin-bottom: var(--space-6);
}
.hub-hero__focus-label {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.hub-hero__focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.hub-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-fg);
}
.btn--secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover {
  background: var(--bg-tag);
  color: var(--text);
}
.btn--lg {
  padding: 12px 22px;
  font-size: var(--fs-base);
}

/* ---------- 8. 标签 / 徽章 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-tag);
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 500;
}
.tag--accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag--muted {
  background: var(--bg-tag);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- 9. 区块 / 卡片 ---------- */
.section {
  padding: var(--space-12) 0;
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}
.section__title {
  font-size: clamp(20px, 2.5vw, var(--fs-2xl));
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section__sub {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.section__link {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.section__link:hover { color: var(--accent); }

.grid {
  display: grid;
  gap: var(--space-4);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- 10. 通用卡片 ---------- */
.card {
  display: block;
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s var(--ease-out),
              background-color 0.2s var(--ease-out),
              transform 0.25s var(--ease-out),
              box-shadow 0.25s var(--ease-out);
}
.card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card--flat { padding: var(--space-4); }
.card--interactive { cursor: pointer; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
}
.card__title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}
.card__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}
.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

/* ---------- 11. 学习卡片（带进度条） ---------- */
.study-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, transform 0.15s ease,
              box-shadow 0.15s ease;
  text-decoration: none;
  color: var(--text);
}
.study-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.study-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.study-card__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 18px;
}
.study-card__lang {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.study-card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin: 0;
}
.study-card__progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.study-card__progress-info {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.study-card__progress-info b {
  color: var(--text);
  font-weight: 700;
}
.study-card__bar {
  height: 8px;
  background: var(--progress-bg);
  border-radius: 999px;
  overflow: hidden;
}
.study-card__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--progress-from), var(--progress-to));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.study-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}
.study-card__cta {
  font-weight: 600;
  color: var(--accent);
}

/* ---------- 12. 错题卡（警告色） ---------- */
.study-card--danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.study-card--danger .study-card__icon {
  background: var(--danger-soft);
  color: var(--danger);
}
.study-card--danger .study-card__bar-fill {
  background: linear-gradient(90deg, var(--danger), color-mix(in srgb, var(--danger) 70%, var(--warning)));
}

/* ---------- 13. 统计数字卡 ---------- */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-card__label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat-card__value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-card__hint {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.stat-card__icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 16px;
  margin-bottom: var(--space-2);
}

/* ---------- 14. 连续学习天数卡（特殊） ---------- */
.streak-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 14%, var(--bg-card)),
    var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.streak-card__fire {
  font-size: 28px;
}
.streak-card__value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.streak-card__label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.streak-card .stat-card__hint {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.01em;
  align-self: flex-start;
}

/* ---------- 15. 热力图（精简版） ---------- */
.heatmap-card {
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.heatmap-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-4);
}
.heatmap-card__title { font-weight: 700; font-size: var(--fs-md); }
.heatmap-card__sub { font-size: var(--fs-sm); color: var(--text-secondary); }

.heatmap {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--text-tertiary);
  overflow-x: auto;
  padding-bottom: 4px;
}
.heatmap__days {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  gap: 2px;
  align-self: start;
  margin-top: 18px;
}
.heatmap__days span {
  width: 12px;
  height: 12px;
  line-height: 12px;
}
.heatmap__main {
  flex: 1;
  min-width: 0;
}
.heatmap__months {
  position: relative;
  height: 14px;
  margin-bottom: 2px;
}
.heatmap__months span {
  position: absolute;
  top: 0;
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.heatmap__grid {
  display: grid;
  grid-template-columns: repeat(53, 12px);
  grid-template-rows: repeat(7, 12px);
  gap: 2px;
}
.heatmap__cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--heat-0);
  cursor: default;
  transition: outline 0.1s ease;
}
.heatmap__cell[data-level="1"] { background: var(--heat-1); }
.heatmap__cell[data-level="2"] { background: var(--heat-2); }
.heatmap__cell[data-level="3"] { background: var(--heat-3); }
.heatmap__cell[data-level="4"] { background: var(--heat-4); }
.heatmap__cell:hover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.heatmap__cell.is-today {
  box-shadow: 0 0 0 2px var(--accent);
}
.heatmap__legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-tertiary);
}
.heatmap__legend-cells {
  display: inline-flex;
  gap: 2px;
}
.heatmap__legend-cells span {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--heat-0);
}
.heatmap__legend-cells span[data-level="1"] { background: var(--heat-1); }
.heatmap__legend-cells span[data-level="2"] { background: var(--heat-2); }
.heatmap__legend-cells span[data-level="3"] { background: var(--heat-3); }
.heatmap__legend-cells span[data-level="4"] { background: var(--heat-4); }

.heatmap__tooltip {
  position: fixed;
  background: var(--text);
  color: var(--bg);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

/* ---------- 16. 项目卡（Lab / 技术） ---------- */
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease,
              box-shadow 0.15s ease;
  text-decoration: none;
  color: var(--text);
  min-height: 200px;
}
.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}
.project-card__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 18px;
  flex-shrink: 0;
}
.project-card__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.project-card__status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.project-card__status--active { background: var(--success-soft); color: var(--success); }
.project-card__status--wip    { background: var(--warning-soft); color: var(--warning); }
.project-card__status--paused { background: var(--bg-tag); color: var(--text-secondary); }

.project-card__title { font-size: var(--fs-md); font-weight: 700; line-height: 1.3; }
.project-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}
.project-card__stack .tag {
  font-size: 11px;
  padding: 2px 8px;
}

/* ---------- 17. 搜索弹窗 ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 20px;
  animation: fade-in 0.15s ease;
}
.search-overlay.is-open {
  display: flex;
}
.search-modal {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: scale-in 0.15s ease;
}
.search-modal__input {
  width: 100%;
  padding: 16px 20px;
  font-size: var(--fs-md);
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
}
.search-modal__input::placeholder {
  color: var(--text-tertiary);
}
.search-modal__results {
  max-height: 60vh;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.1s ease;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.is-focused {
  background: var(--bg-card-hover);
}
.search-result__icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-tag);
  font-size: 14px;
  flex-shrink: 0;
}
.search-result__main {
  flex: 1;
  min-width: 0;
}
.search-result__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result__sub {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 3px;
}
.search-section {
  padding: 4px 0;
}
.search-section + .search-section {
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.search-section__label {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-section__count {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}
.search-result__reading {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
  font-style: italic;
  margin-left: 4px;
}
.search-modal__empty {
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
}
.search-modal__hint {
  padding: 8px 20px;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

/* ---------- 18. 底部 Tab Bar（移动端） ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
  display: none;
  padding: 6px 4px calc(env(safe) + 6px);
}
.tab-bar__inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: var(--container-max);
  margin: 0 auto;
}
.tab-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  font-size: 11px;
  color: var(--text-tertiary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
  position: relative;
}
.tab-bar__item.is-active { color: var(--accent); }
.tab-bar__icon {
  font-size: 20px;
  line-height: 1;
}
.tab-bar__label {
  font-size: 10px;
  font-weight: 500;
}

/* 仅在窄屏显示 */
@media (max-width: 768px) {
  .tab-bar { display: block; }
  body.has-tab-bar {
    padding-bottom: calc(var(--tabbar-h) + env(safe));
  }
}

/* ---------- 19. Footer ---------- */
.hub-footer {
  margin-top: var(--space-16);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
}
.hub-footer a { color: var(--text-secondary); }
.hub-footer a:hover { color: var(--text); }
.hub-footer__divider {
  margin: 0 var(--space-2);
  color: var(--text-tertiary);
}

/* ---------- 20. 动画 ---------- */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in 0.3s ease; }
.slide-up { animation: slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

/* 进入页面元素渐入 */
.stagger > * { animation: slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }
.stagger > *:nth-child(6) { animation-delay: 0.24s; }
.stagger > *:nth-child(7) { animation-delay: 0.28s; }
.stagger > *:nth-child(8) { animation-delay: 0.32s; }
.stagger > *:nth-child(9) { animation-delay: 0.36s; }
.stagger > *:nth-child(10) { animation-delay: 0.40s; }

/* 尊重用户的 reduced-motion 设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 21. 响应式微调 ---------- */
@media (max-width: 768px) {
  :root {
    --container-px: 16px;
    --header-h: 56px;
    --fs-3xl: 30px;
    --fs-4xl: 36px;
  }
  .hub-nav { display: none; }
  .hub-search-btn kbd { display: none; }
  .hub-hero { padding: var(--space-10) 0 var(--space-8); }
}

@media (max-width: 480px) {
  .heatmap__grid { grid-template-columns: repeat(53, 10px); }
  .heatmap__cell { width: 10px; height: 10px; }
  .heatmap__days { margin-top: 16px; }
}

/* ---------- 22. 工具类 ---------- */
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
/* ---------- 23. 用户菜单（Header 右上） ---------- */
.hub-user-menu {
  position: relative;
}
.hub-user-menu__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  font-family: inherit;
}
.hub-user-menu__btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-card-hover);
}
.hub-user-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.hub-user-menu__name {
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-user-menu__chevron {
  font-size: 10px;
  color: var(--text-tertiary);
}
.hub-user-menu__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 100;
  animation: scale-in 0.12s ease;
}
.hub-user-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.hub-user-menu__item:hover {
  background: var(--bg-card-hover);
}
.hub-user-menu__item--danger { color: var(--danger); }
.hub-user-menu__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.hub-user-menu__login {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.hub-user-menu__login:hover {
  background: var(--accent-hover);
  color: var(--accent-fg);
}

/* 顶部词库下拉菜单（点击「学习」展开 8 套词库） */
.hub-vocab-menu {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
}
.hub-vocab-menu__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-family: inherit;
  font-size: 19px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  text-align: center;
  white-space: nowrap;
}
.hub-vocab-menu__btn:hover {
  color: var(--accent);
}
.hub-vocab-menu__btn[aria-expanded="true"] {
  color: var(--accent);
}
.hub-vocab-menu.is-active .hub-vocab-menu__btn {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.hub-vocab-menu__chevron {
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
  margin-left: 4px;
}
.hub-vocab-menu__btn[aria-expanded="true"] .hub-vocab-menu__chevron {
  transform: rotate(180deg);
}
.hub-vocab-menu__dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 100;
  animation: scale-in 0.12s ease;
}
.hub-vocab-menu__dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.hub-vocab-menu__group {
  margin-bottom: 6px;
}
.hub-vocab-menu__group:last-of-type {
  margin-bottom: 0;
}
.hub-vocab-menu__group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 10px 4px;
}
.hub-vocab-menu__item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.hub-vocab-menu__item:hover {
  background: var(--bg-card-hover);
}
.hub-vocab-menu__item-icon {
  font-size: 16px;
  line-height: 1;
}
.hub-vocab-menu__item-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-vocab-menu__item-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.hub-vocab-menu__footer {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.hub-vocab-menu__item--all {
  font-weight: 600;
  color: var(--accent);
}
.hub-vocab-menu__item--all:hover {
  background: var(--accent-soft);
}
.hub-vocab-menu__loading {
  padding: 12px 16px;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  text-align: center;
}

@media (max-width: 768px) {
  .hub-user-menu__name { display: none; }
  .hub-user-menu__chevron { display: none; }
  .hub-user-menu__btn { padding: 4px; }
}

/* ============================================================
 * 9. UI States — Loading / Empty / Error（ui-states.js）
 * ============================================================ */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  min-height: 80px;
}
.state__icon { font-size: 36px; margin-bottom: 8px; opacity: 0.6; }
.state__msg { font-size: 14px; color: var(--text-secondary, #666); margin-bottom: 4px; }
.state__hint { font-size: 12px; color: var(--text-tertiary, #999); }
.state__retry {
  margin-top: 12px;
  padding: 6px 14px;
  background: var(--accent, #5BAF6F);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.state__retry:hover { background: var(--accent-hover, #4a9659); }

/* Skeleton：渐变 shimmer 动画 */
.state--skeleton { align-items: stretch; gap: 10px; }
.skel-line {
  height: 14px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skel-shimmer 1.5s ease-in-out infinite;
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-color-scheme: dark) {
  .skel-line { background: linear-gradient(90deg, #374151 0%, #4b5563 50%, #374151 100%); background-size: 200% 100%; }
}

.state--error .state__icon { color: #ef4444; }
.state--empty .state__icon { opacity: 0.4; }


/* ============================================================
 * 现代工具类
 * ============================================================ */
.glass-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.divider-gradient {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 50%, transparent);
  margin: var(--space-6) 0;
}

/* 数字滚动动画（从 0 滚到目标值，需配合 JS data-count） */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.count-anim {
  animation: countUp 0.5s var(--ease-out) backwards;
}

/* hover 微动效：浮动 + 阴影 */
.hover-lift {
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}



/* ============================================================
 * 12. Bento Layout（现代互联网公司风格）
 * ============================================================ */

/* 状态点（live indicator） */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  position: relative;
}
.status-dot--live {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  animation: status-pulse 2s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* 标题 accent dot */
.dot-accent {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 0 0 4px rgba(91, 175, 111, 0.12);
}

/* Hero Bento 12 列布局 */
.hub-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  align-items: stretch;
}
.hub-hero__main { min-width: 0; }
.hub-hero__greeting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-tag);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}
.hub-hero__greeting-sep {
  opacity: 0.4;
  margin: 0 2px;
}

/* Identity 卡片（Hero 右侧） */
.hub-hero__identity {
  position: relative;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-self: start;
}
.identity-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-md);
}
.identity-avatar__pulse {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid var(--accent);
  animation: avatar-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes avatar-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}
.identity-meta__name {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.identity-meta__role {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}
.identity-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.identity-stat {
  flex: 1;
  text-align: center;
}
.identity-stat__value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.identity-stat__label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-weight: 600;
}
.identity-stat__divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}
.identity-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.identity-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.identity-link:hover {
  background: var(--bg-tag);
  color: var(--accent);
}
.identity-link span {
  color: var(--text-tertiary);
  transition: transform 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.identity-link:hover span {
  transform: translateX(2px);
  color: var(--accent);
}

/* Hero 响应式 */
@media (max-width: 900px) {
  .hub-hero { grid-template-columns: 1fr; }
  .hub-hero__identity { order: -1; }
}

/* ============================================================
 * 13. Bento Stats Grid（5 张数据卡）
 * ============================================================ */
.bento-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  padding: var(--space-6) 0;
}
@media (max-width: 1100px) {
  .bento-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .bento-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-stats .streak-card { grid-column: span 2; }
}
/* ----- mini sparkline (B 方案) ----- */
.stat-card__sparkline {
  margin-top: auto;
  padding-top: var(--space-2);
  display: block;
  width: 100%;
  height: 28px;
}
.stat-card__sparkline path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-card__sparkline .area {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
  stroke: none;
}
.streak-card .stat-card__sparkline path {
  stroke: var(--accent);
}
.stat-card--en .stat-card__sparkline path,
.stat-card--jp .stat-card__sparkline path {
  stroke: var(--accent);
}
.stat-card__icon-big {
  font-size: 22px;
  line-height: 1;
  margin-bottom: var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.streak-card {
  text-align: left;
  align-items: flex-start !important;
  gap: 2px;
}
.streak-card .stat-card__value {
  background: none;
  -webkit-text-fill-color: var(--text);
}
.stat-card--en .stat-card__value,
.stat-card--jp .stat-card__value {
  font-size: clamp(20px, 2.5vw, 26px);
}
.stat-card__bar {
  margin-top: var(--space-2);
  height: 6px;
  background: var(--bg-tag);
  border-radius: 999px;
  overflow: hidden;
}
.stat-card__bar-fill {
  height: 100%;
  background: var(--grad-brand);
  transition: width 0.8s var(--ease-out);
}

/* ============================================================
 * 14. Bento Learning（学习中心，3 卡混合）
 * ============================================================ */
.bento-learning { padding: var(--space-12) 0; }
.study-card--hero {
  grid-column: span 2;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
@media (max-width: 900px) {
  .study-card--hero { grid-column: span 1; }
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-tag);
  color: var(--accent);
}
.badge--live {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 3px rgba(91, 175, 111, 0.16);
}

/* ============================================================
 * 15. Bento Feeds（热力图 + 活动流 2/3 + 1/3）
 * ============================================================ */
.bento-feeds {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
  padding: var(--space-6) 0;
}
@media (max-width: 900px) {
  .bento-feeds { grid-template-columns: 1fr; }
}

/* 活动流 */
.activity-feed { padding: var(--space-5); }
.activity-feed__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.activity-feed__title { flex: 1; }
.activity-feed__live {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.activity-feed__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item__time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 56px;
}
.activity-item__icon { font-size: 16px; }
.activity-item__text { flex: 1; }
.activity-item b {
  font-weight: 800;
  font-size: var(--fs-base);
  margin: 0 2px;
}

/* ============================================================
 * 备案信息（全局统一风格）
 * 用法：<a class="site-beian" href="https://beian.miit.gov.cn/" ...>[svg]蒙ICP备...</a>
 * 容器可以是 footer 内联，也可以是 fixed-bottom 块（见 login.html）
 * ============================================================ */
.site-beian {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: auto;
  transition: color 0.15s var(--ease-out);
}
.site-beian:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.site-beian svg {
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.site-beian:hover svg {
  opacity: 1;
}
/* 全局统一备案容器：login 页 fixed-bottom / 其他页 footer 内嵌都用 */
.site-beian-bar {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.site-beian-divider {
  color: var(--text-tertiary);
  opacity: 0.45;
  font-size: var(--fs-xs);
  user-select: none;
}

/* ============================================================
 * 16. Footer（公司站风格：4 列 sitemap + 底部版权条）
 * ============================================================ */
.footer {
  margin-top: var(--space-16);
  padding: var(--space-12) 0 0;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, #dbe6cb 100%);
  border-top: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--border);
}
.footer__brand-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--fs-md);
}
.footer__logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--grad-brand);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.footer__tagline {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}
.footer__social {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.footer__social a {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s var(--ease-out);
}
.footer__social a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.footer__col-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-3);
  letter-spacing: 0.02em;
}
.footer__col-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer__col-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer__col-list a:hover {
  color: var(--accent);
}
.footer__col-list .footer__col-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  letter-spacing: 0.04em;
}
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-5) 0 var(--space-6);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}
.footer__bottom-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer__bottom-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer__bottom-links a:hover { color: var(--accent); }
.footer__beian {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.footer__beian-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 10px;
}
.footer__divider {
  color: var(--text-tertiary);
  opacity: 0.5;
  margin: 0 4px;
}
.footer__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-tertiary);
}
/* 响应式：移动端 footer 改成单列 */
@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
  .footer__brand-block {
    grid-column: span 2;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}
@media (max-width: 480px) {
  .footer__inner { grid-template-columns: 1fr; }
  .footer__brand-block { grid-column: span 1; }
}
