/* ============================================================
   DESIGN TOKENS — 个人网站统一设计语言
   Shared by: index-v2.html + blog/post-*.html
   ============================================================ */

/* ========== FONT FAMILIES ========== */
:root {
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Noto Sans SC', system-ui, sans-serif;
}

/* ========== TYPE SCALE (统一字号层级) ========== */
:root {
  --text-eyebrow: 0.625rem;    /* 10px - 标签/eyebrow/分类头 */
  --text-caption: 0.75rem;     /* 12px - 辅助说明/脚注 */
  --text-tag: 0.75rem;         /* 12px - 标签/徽章 */
  --text-body-sm: 0.8125rem;   /* 13px - 小正文/导航 */
  --text-body: 0.875rem;       /* 14px - 标准正文 */
  --text-body-lg: 1rem;        /* 16px - 大正文/卡片标题 */
  --text-h4: 1.125rem;         /* 18px */
  --text-h3: 1.25rem;          /* 20px */
  --text-h2: 1.5rem;           /* 24px - 卡片内大标题 */
  --text-h1: 2rem;             /* 32px - Section标题 */
  --text-hero-sub: 1.25rem;    /* 20px - Hero副标题 */
  --text-hero: clamp(3rem, 8vw, 6rem); /* Hero大标题 */
}

/* Mobile type scale — 整体比桌面端小一档，保持呼吸感 */
@media (max-width: 767px) {
  :root {
    --text-h1: 1.25rem;          /* 20px (desktop 32px) */
    --text-h2: 1.125rem;         /* 18px (desktop 24px) */
    --text-h3: 1.0625rem;        /* 17px (desktop 20px) */
    --text-h4: 1rem;             /* 16px (desktop 18px) */
    --text-body-lg: 0.9375rem;   /* 15px (desktop 16px) */
    --text-body: 0.8125rem;      /* 13px (desktop 14px) */
    --text-body-sm: 0.75rem;     /* 12px (desktop 13px) */
    --text-hero: clamp(2.25rem, 12vw, 3.75rem);
    --text-hero-sub: 1.0625rem;  /* 17px (desktop 20px) */
  }
}

/* ========== RADIUS SCALE ========== */
:root {
  --radius-sm: 0.5rem;         /* 8px */
  --radius-md: 0.75rem;        /* 12px */
  --radius-lg: 1rem;           /* 16px */
  --radius-xl: 1.5rem;         /* 24px - 移动端卡片 */
  --radius-2xl: 2rem;          /* 32px - 桌面端卡片 */
  --radius-full: 9999px;
}

/* ========== SPACING ========== */
:root {
  --section-py: 6rem;          /* ~py-24 */
  --section-py-lg: 8rem;       /* ~lg:py-32 */
  --container-narrow: 48rem;   /* max-w-3xl - 博客正文 */
  --container-normal: 64rem;   /* max-w-5xl - 内容Section */
  --container-wide: 72rem;     /* max-w-6xl - Hero/Blog列表 */
}

/* ========== COLOR TOKENS (Light) ========== */
:root {
  --glass-bg: rgba(255,255,255,0.55);
  --glass-bg-strong: rgba(255,255,255,0.78);
  --glass-bg-subtle: rgba(255,255,255,0.35);
  --glass-border: rgba(0,0,0,0.06);
  --glass-border-light: rgba(255,255,255,0.1);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --bg-page: #fafbfc;
  --bg-page-alt: #f2f4f8;
  --divider-color: rgba(0,0,0,0.08);
  --accent: #6366f1;
  --accent-glow: rgba(99,102,241,0.18);
  --accent-color: #6366f1;
  --card-outer-bg: rgba(0,0,0,0.02);
  --card-outer-ring: rgba(0,0,0,0.05);
  --card-inner-bg: #ffffff;
  --card-inner-highlight: inset 0 1px 2px rgba(255,255,255,0.8);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 8px 48px rgba(0,0,0,0.04), 0 2px 12px rgba(0,0,0,0.02);
  --card-shadow-hover: 0 2px 4px rgba(0,0,0,0.04), 0 12px 64px rgba(0,0,0,0.06), 0 4px 20px rgba(99,102,241,0.06);

  /* Blog prose colors */
  --prose-heading: #0f172a;
  --prose-body: #475569;
  --prose-strong: #0f172a;
  --prose-blockquote: #64748b;
  --prose-blockquote-border: #6366f1;
  --nav-bg: rgba(255,255,255,0.8);
  --nav-border: rgba(0,0,0,0.06);
}

/* ========== COLOR TOKENS (Dark) ========== */
.dark {
  --glass-bg: rgba(15,23,42,0.55);
  --glass-bg-strong: rgba(15,23,42,0.78);
  --glass-bg-subtle: rgba(15,23,42,0.32);
  --glass-border: rgba(255,255,255,0.06);
  --glass-border-light: rgba(255,255,255,0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --bg-page: #030712;
  --bg-page-alt: #060b16;
  --divider-color: rgba(255,255,255,0.06);
  --accent: #818cf8;
  --accent-glow: rgba(129,140,248,0.12);
  --accent-color: #818cf8;
  --card-outer-bg: rgba(255,255,255,0.02);
  --card-outer-ring: rgba(255,255,255,0.06);
  --card-inner-bg: rgba(15,23,42,0.85);
  --card-inner-highlight: inset 0 1px 2px rgba(255,255,255,0.04);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 8px 48px rgba(0,0,0,0.25), 0 2px 12px rgba(0,0,0,0.15);
  --card-shadow-hover: 0 2px 4px rgba(0,0,0,0.25), 0 12px 64px rgba(0,0,0,0.3), 0 4px 20px rgba(129,140,248,0.08);

  /* Blog prose colors */
  --prose-heading: #f1f5f9;
  --prose-body: #94a3b8;
  --prose-strong: #e2e8f0;
  --prose-blockquote: #94a3b8;
  --prose-blockquote-border: #818cf8;
  --nav-bg: rgba(15,23,42,0.8);
  --nav-border: rgba(255,255,255,0.06);
}

/* ========== PAGE TRANSITION ========== */
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: background 0.7s cubic-bezier(0.32,0.72,0,1), color 0.7s cubic-bezier(0.32,0.72,0,1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 3px; }

/* ========== UTILITY CLASSES ========== */

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dark .gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 40%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Eyebrow badge */
.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(99,102,241,0.08);
  color: #6366f1;
  border: 1px solid rgba(99,102,241,0.12);
}
.dark .eyebrow {
  background: rgba(129,140,248,0.1);
  color: #818cf8;
  border-color: rgba(129,140,248,0.15);
}

/* Section title */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Skill tag */
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--text-tag);
  font-weight: 500;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.5s cubic-bezier(0.32,0.72,0,1);
}
.skill-tag:hover {
  box-shadow: 0 0 24px var(--accent-glow);
  border-color: rgba(99,102,241,0.3);
}

/* ========== DOUBLE-BEZEL CARD ========== */
.card-outer {
  background: var(--card-outer-bg);
  border: 1px solid var(--card-outer-ring);
  border-radius: var(--radius-2xl);
  padding: 3px;
  transition: all 0.7s cubic-bezier(0.32,0.72,0,1);
}
.card-outer:hover {
  box-shadow: var(--card-shadow-hover);
}
.card-inner {
  background: var(--card-inner-bg);
  border-radius: calc(2rem - 3px);
  box-shadow: var(--card-inner-highlight), var(--card-shadow);
  overflow: hidden;
  transition: box-shadow 0.7s cubic-bezier(0.32,0.72,0,1);
}

/* ========== BUTTONS ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: var(--text-body-sm);
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  transition: all 0.6s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 4px 24px rgba(99,102,241,0.25);
}
.btn-primary:hover {
  box-shadow: 0 8px 40px rgba(99,102,241,0.4);
  transform: scale(1.02);
}
.btn-primary:active { transform: scale(0.98); }
.dark .btn-primary {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
}

.btn-icon-nest {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.6s cubic-bezier(0.32,0.72,0,1);
}
.btn-primary:hover .btn-icon-nest {
  transform: translateX(2px) translateY(-1px);
  background: rgba(255,255,255,0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: var(--text-body-sm);
  font-weight: 600;
  transition: all 0.6s cubic-bezier(0.32,0.72,0,1);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--glass-bg); }

/* ========== DIVIDER ========== */
.glass-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--divider-color), transparent);
}

/* ========== EXP SUB-CARD ========== */
.exp-sub-card {
  background: var(--glass-bg-subtle);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.5s cubic-bezier(0.32,0.72,0,1);
}
.exp-sub-card:hover {
  background: var(--glass-bg);
  border-color: rgba(99,102,241,0.2);
}

/* ========== METRIC BADGE ========== */
.metric-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  font-weight: 600;
  background: rgba(34,197,94,0.08);
  color: #22c55e;
  white-space: nowrap;
}

/* ========== SECTION LAYOUT ========== */
.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
  position: relative;
}
@media (min-width: 1024px) {
  .section {
    padding-top: var(--section-py-lg);
    padding-bottom: var(--section-py-lg);
  }
}

.section-alt { background: var(--bg-page-alt); }
.section-main { background: var(--bg-page); }

/* ========== BLOG PROSE ========== */
.prose {
  font-size: var(--text-body-lg);
  line-height: 1.85;
  color: var(--prose-body);
}
.prose h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--prose-heading);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--prose-heading);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}
.prose p {
  margin-bottom: 1.25rem;
  color: var(--prose-body);
}
.prose strong {
  color: var(--prose-strong);
  font-weight: 600;
}
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.prose ul { list-style-type: disc; }
.prose li {
  margin-bottom: 0.5rem;
  line-height: 1.85;
  color: var(--prose-body);
}
.prose blockquote {
  border-left: 3px solid var(--prose-blockquote-border);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: var(--prose-blockquote);
  font-style: italic;
}

/* ========== BLOG NAV BAR (子页面统一) ========== */
.blog-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
}

/* ========== BLOG POST NAV (文章页顶栏) ========== */
.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
.blog-back-link:hover { color: var(--accent); }

.blog-theme-btn {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: background 0.5s ease, color 0.5s ease;
}
.blog-theme-btn:hover { background: var(--glass-bg); color: var(--text-primary); }

/* ========== BLOG POST PAGER (文章页底部上一篇/下一篇) ========== */
.post-pager {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--divider-color);
}
.post-pager-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 46%;
  text-decoration: none;
  min-width: 0;
}
.post-pager-item .lbl {
  font-size: var(--text-caption);
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
}
.post-pager-item .ttl {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  transition: color 0.4s ease;
}
.post-pager-item:hover .ttl { color: var(--accent); }
.post-pager-item.next { text-align: right; align-items: flex-end; }
.post-pager-back {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}
