/* ============================================
   拾光集 · 生活随笔博客
   现代潮流设计风格
   ============================================ */

/* ===== CSS 变量 ===== */
:root {
  /* 主色调 - 温暖渐变系 */
  --color-primary: #6C5CE7;
  --color-primary-light: #a29bfe;
  --color-accent: #FD79A8;
  --color-accent-2: #FDCB6E;
  --color-warm: #E17055;
  --color-cool: #00B894;

  /* 背景色 */
  --bg-base: #FAFAFF;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.88);
  --bg-glass: rgba(255, 255, 255, 0.55);

  /* 文字色 */
  --text-primary: #2D2D44;
  --text-secondary: #63636E;
  --text-muted: #9999A8;
  --text-on-gradient: #ffffff;

  /* 边框与阴影 */
  --border-color: rgba(108, 92, 231, 0.12);
  --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.06);
  --shadow-md: 0 8px 32px rgba(108, 92, 231, 0.10);
  --shadow-lg: 0 16px 48px rgba(108, 92, 231, 0.14);
  --shadow-xl: 0 24px 64px rgba(108, 92, 231, 0.18);

  /* 渐变 */
  --gradient-main: linear-gradient(135deg, #6C5CE7 0%, #FD79A8 50%, #FDCB6E 100%);
  --gradient-primary: linear-gradient(135deg, #6C5CE7, #a29bfe);
  --gradient-accent: linear-gradient(135deg, #FD79A8, #FDCB6E);
  --gradient-cool: linear-gradient(135deg, #00B894, #55EFC4);
  --gradient-warm: linear-gradient(135deg, #E17055, #FDCB6E);
  --gradient-hero: linear-gradient(135deg, #6C5CE7 0%, #8E7CF0 30%, #FD79A8 65%, #FDCB6E 100%);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;

  /* 过渡 */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* 布局 */
  --nav-height: 68px;
  --max-width: 860px;
  --max-width-wide: 1100px;
}

/* 暗色模式 */
body.dark {
  --bg-base: #0F0F1A;
  --bg-card: rgba(30, 30, 50, 0.72);
  --bg-card-hover: rgba(40, 40, 65, 0.88);
  --bg-glass: rgba(20, 20, 35, 0.55);
  --text-primary: #E8E8F0;
  --text-secondary: #A0A0B8;
  --text-muted: #6B6B80;
  --border-color: rgba(162, 155, 254, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6);

  /* 暗色模式下的半透明表面色（替代硬编码 rgba(255,255,255,...)） */
  --surface-nav: rgba(20, 20, 35, 0.6);
  --surface-nav-scrolled: rgba(25, 25, 45, 0.8);
  --surface-chip: rgba(30, 30, 50, 0.7);
  --surface-input: rgba(30, 30, 50, 0.7);
  --surface-hero-stats: rgba(25, 25, 45, 0.5);
  --surface-footer: rgba(20, 20, 35, 0.4);
  --surface-white-60: rgba(30, 30, 50, 0.6);
  --surface-white-70: rgba(30, 30, 50, 0.7);
  --border-light: rgba(162, 155, 254, 0.12);
}

/* 亮色模式下的半透明表面色 */
:root {
  --surface-nav: rgba(255, 255, 255, 0.5);
  --surface-nav-scrolled: rgba(255, 255, 255, 0.75);
  --surface-chip: rgba(255, 255, 255, 0.7);
  --surface-input: rgba(255, 255, 255, 0.7);
  --surface-hero-stats: rgba(255, 255, 255, 0.5);
  --surface-footer: rgba(255, 255, 255, 0.4);
  --surface-white-60: rgba(255, 255, 255, 0.6);
  --surface-white-70: rgba(255, 255, 255, 0.7);
  --border-light: rgba(255, 255, 255, 0.6);
}

body.dark .blob {
  opacity: 0.15;
}

body.dark .bg-decorations::before {
  opacity: 0.4;
}

body.dark .bg-decorations::after {
  opacity: 0.3;
}

/* ===== 重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', 'WenQuanYi Micro Hei', 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== 背景装饰 ===== */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 星尘光点层 */
.bg-decorations::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(108, 92, 231, 0.4), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(253, 121, 168, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 50% 50%, rgba(253, 203, 110, 0.4), transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(108, 92, 231, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 90% 60%, rgba(253, 121, 168, 0.3), transparent),
    radial-gradient(2px 2px at 33% 80%, rgba(253, 203, 110, 0.35), transparent),
    radial-gradient(1px 1px at 15% 65%, rgba(108, 92, 231, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 70% 25%, rgba(253, 121, 168, 0.25), transparent),
    radial-gradient(1px 1px at 45% 15%, rgba(253, 203, 110, 0.3), transparent),
    radial-gradient(2px 2px at 85% 85%, rgba(108, 92, 231, 0.25), transparent);
  background-size: 100% 100%;
  animation: twinkle 8s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 细腻网格纹理 */
.bg-decorations::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(108, 92, 231, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 92, 231, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: blobFloat 25s ease-in-out infinite;
  will-change: transform;
}

.blob-1 {
  width: 550px;
  height: 550px;
  background: linear-gradient(135deg, var(--color-primary), #8b7cf5);
  top: -150px;
  right: -120px;
  animation-delay: 0s;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, var(--color-accent), #ff9ec4);
  top: 35%;
  left: -150px;
  animation-delay: -9s;
}

.blob-3 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--color-accent-2), #ffe0a3);
  bottom: -150px;
  right: 15%;
  animation-delay: -17s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(40px, -30px) scale(1.05) rotate(2deg); }
  50% { transform: translate(-20px, 20px) scale(0.98) rotate(-1deg); }
  75% { transform: translate(30px, 40px) scale(1.02) rotate(1deg); }
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: var(--surface-nav);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: var(--surface-nav-scrolled);
  box-shadow: 
    0 4px 30px rgba(108, 92, 231, 0.08),
    0 1px 0 var(--border-light) inset;
  border-bottom-color: var(--border-color);
}

.nav-container {
  max-width: var(--max-width-wide);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform var(--transition-fast);
}

.nav-logo:hover {
  transform: scale(1.03);
}

.logo-icon {
  -webkit-text-fill-color: var(--color-accent);
  font-size: 1.2em;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  position: relative;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  overflow: hidden;
}

.nav-link:hover {
  color: var(--color-primary);
  background: rgba(108, 92, 231, 0.08);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--text-on-gradient);
  background: var(--gradient-primary);
  background-size: 200% 200%;
  animation: navGradient 4s ease infinite;
  box-shadow: 
    0 4px 16px rgba(108, 92, 231, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

@keyframes navGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 主题切换按钮 */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--surface-white-60);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  transform: rotate(-15deg) scale(1.1);
  background: rgba(108, 92, 231, 0.1);
  border-color: var(--color-primary-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== 主内容区 ===== */
.main-content {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* ===== 页面切换动画 ===== */
.page-enter {
  animation: pageEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Hero 区域 ===== */
.hero {
  position: relative;
  padding: 80px 32px 60px;
  text-align: center;
  overflow: hidden;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: clamp(8rem, 20vw, 16rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(108, 92, 231, 0.08);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  animation: bgTextBreath 6s ease-in-out infinite;
}

@keyframes bgTextBreath {
  0%, 100% { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1);
  }
  50% { 
    opacity: 0.7; 
    transform: translate(-50%, -50%) scale(1.02);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border-radius: var(--radius-full);
  background: var(--surface-chip);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-light);
  box-shadow: 
    0 4px 24px rgba(108, 92, 231, 0.1),
    inset 0 1px 0 var(--border-light);
  font-size: 0.85rem;
  font-weight: 500;
  background-image: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 28px;
  animation: badgeFloat 4s ease-in-out infinite;
  position: relative;
}

.hero-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-main);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
}

@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 24px;
  text-shadow: 0 4px 30px rgba(108, 92, 231, 0.1);
}

.hero-title .gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  filter: drop-shadow(0 4px 20px rgba(253, 121, 168, 0.2));
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 40px;
  letter-spacing: 0.02em;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 48px;
  padding: 28px 48px;
  background: var(--surface-hero-stats);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: 
    0 8px 32px rgba(108, 92, 231, 0.08),
    inset 0 1px 0 var(--border-light);
  display: inline-flex;
}

.hero-stat {
  text-align: center;
  position: relative;
}

.hero-stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, transparent, var(--border-color), transparent);
}

.hero-stat-num {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(108, 92, 231, 0.15));
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* ===== 标签筛选栏 ===== */
.tag-filter-section {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 32px 40px;
}

.tag-filter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tag-filter-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tag-filter-header .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-color), transparent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-chip {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-chip);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.04);
}

.tag-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.tag-chip:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 6px 20px rgba(108, 92, 231, 0.15),
    0 2px 6px rgba(108, 92, 231, 0.08);
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}

.tag-chip.active {
  color: var(--text-on-gradient);
  border-color: transparent;
  box-shadow: 
    0 6px 20px rgba(108, 92, 231, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  transform: translateY(-2px);
}

.tag-chip.active::before {
  opacity: 1;
  animation: tagGradient 4s ease infinite;
}

@keyframes tagGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.tag-chip .tag-count {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: 6px;
  font-weight: 600;
}

/* ===== 文章列表 ===== */
.article-list-section {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 32px 80px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title .accent-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-accent);
  margin-left: 6px;
  vertical-align: middle;
}

.section-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 搜索框 */
.search-box {
  position: relative;
  flex-shrink: 0;
}

.search-box input {
  width: 200px;
  padding: 10px 32px 10px 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--surface-input);
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  width: 240px;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
  background: var(--bg-card-hover);
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.6;
  pointer-events: none;
}

/* 加载更多 */
.load-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.load-more-btn {
  padding: 12px 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.load-more-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  background: rgba(108, 92, 231, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.12);
}

.load-more-count {
  opacity: 0.7;
  font-size: 0.85rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* 文章卡片 */
.article-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.35s ease,
              background 0.35s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 
    0 16px 48px rgba(108, 92, 231, 0.15),
    0 6px 18px rgba(253, 121, 168, 0.08);
  background: var(--bg-card-hover);
  border-color: var(--color-primary-light);
}

/* 卡片外发光 */
.article-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-main);
  opacity: 0;
  z-index: -1;
  filter: blur(12px);
  transition: opacity 0.4s ease;
}

.article-card:hover::after {
  opacity: 0.3;
}

/* 卡片顶部渐变条 */
.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-main);
  background-size: 200% 100%;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 2;
  animation: shimmer 3s linear infinite;
}

.article-card:hover::before {
  opacity: 1;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 卡片封面渐变区 */
.card-cover {
  height: 160px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

.article-card:hover .card-cover::after {
  left: 150%;
}

.card-cover-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.article-card:hover .card-cover-gradient {
  transform: scale(1.08);
}

.card-cover-icon {
  position: relative;
  z-index: 1;
  font-size: 2.8rem;
  opacity: 0.95;
  filter: 
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.article-card:hover .card-cover-icon {
  transform: scale(1.2) rotate(-5deg);
  filter: 
    drop-shadow(0 6px 20px rgba(0, 0, 0, 0.2))
    drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
}

.card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.card-tag {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(253, 121, 168, 0.1));
  color: var(--color-primary);
  font-weight: 600;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(108, 92, 231, 0.1);
}

.card-title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.article-card:hover .card-title {
  color: var(--color-primary);
}

.card-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.card-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-read-more {
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition-fast);
}

.article-card:hover .card-read-more {
  gap: 8px;
}

/* 卡片渐入动画 */
.article-card {
  animation: cardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
.article-card:nth-child(7) { animation-delay: 0.35s; }
.article-card:nth-child(8) { animation-delay: 0.4s; }
.article-card:nth-child(9) { animation-delay: 0.45s; }

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 32px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ===== 文章详情页 ===== */
.article-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 32px 80px;
  position: relative;
}

/* 阅读进度条 */
.reading-progress {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-main);
  background-size: 200% 100%;
  z-index: 999;
  transition: width 0.1s linear, opacity 0.3s ease;
  box-shadow: 0 0 10px rgba(108, 92, 231, 0.4);
  animation: progressShimmer 3s linear infinite;
  opacity: 0;
}

@keyframes progressShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 文章目录 */
.article-toc {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.article-toc.visible {
  opacity: 1;
  visibility: visible;
}

.article-toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.05em;
}

.toc-list {
  list-style: none;
}

.toc-item {
  margin-bottom: 6px;
}

.toc-item a {
  display: block;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1.5;
  border-left: 2px solid transparent;
}

.toc-item a:hover {
  color: var(--color-primary);
  background: rgba(108, 92, 231, 0.06);
}

.toc-item.active a {
  color: var(--color-primary);
  background: rgba(108, 92, 231, 0.1);
  border-left-color: var(--color-primary);
  font-weight: 600;
}

.toc-item.level-3 {
  padding-left: 16px;
}

.toc-item.level-3 a {
  font-size: 0.8rem;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  transition: all var(--transition-fast);
}

.article-back:hover {
  color: var(--color-primary);
  gap: 10px;
}

.article-detail-header {
  margin-bottom: 40px;
}

.article-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.article-detail-tag {
  font-size: 0.82rem;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(108, 92, 231, 0.08);
  color: var(--color-primary);
  font-weight: 500;
}

.article-detail-title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(108, 92, 231, 0.1));
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.article-detail-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(108, 92, 231, 0.04);
  border-radius: var(--radius-full);
}

/* 文章正文 Markdown 渲染 */
.article-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.article-content > p:first-of-type::first-letter {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 3.2em;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin-right: 12px;
  margin-top: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 2em;
  margin-bottom: 0.8em;
  scroll-margin-top: 90px;
}

.article-content h1 {
  font-size: 1.8rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-content h2 {
  font-size: 1.5rem;
  position: relative;
  padding-left: 16px;
}

.article-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 24px;
  border-radius: 3px;
  background: var(--gradient-accent);
}

.article-content h3 {
  font-size: 1.25rem;
  color: var(--color-primary);
}

.article-content p {
  margin-bottom: 1.2em;
}

.article-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-primary-light);
  text-underline-offset: 3px;
  transition: all var(--transition-fast);
}

.article-content a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.2em;
  padding-left: 1.8em;
}

.article-content li {
  margin-bottom: 0.5em;
}

.article-content ul li::marker {
  color: var(--color-accent);
}

.article-content ol li::marker {
  color: var(--color-primary);
  font-weight: 700;
}

.article-content blockquote {
  position: relative;
  margin: 2em 0;
  padding: 20px 24px 20px 28px;
  border-radius: var(--radius-md);
  background: 
    linear-gradient(135deg, rgba(108, 92, 231, 0.06), rgba(253, 121, 168, 0.06)),
    var(--bg-card);
  backdrop-filter: blur(10px);
  border-left: 4px solid var(--color-primary);
  color: var(--text-secondary);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.06);
  font-style: italic;
}

.article-content blockquote::before {
  content: '"';
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-primary-light);
  opacity: 0.5;
}

.article-content blockquote p {
  margin-bottom: 0;
}

.article-content blockquote p:not(:last-child) {
  margin-bottom: 0.8em;
}

.article-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(108, 92, 231, 0.1);
  color: var(--color-primary);
}

.article-content pre {
  margin: 2em 0;
  padding: 24px 28px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  overflow-x: auto;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.article-content pre::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 
    20px 0 0 #ffbd2e,
    40px 0 0 #27ca40;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: #e0e0e0;
  font-size: 0.9rem;
  line-height: 1.7;
  padding-top: 8px;
  display: block;
}

.article-content img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 1.5em 0;
  box-shadow: var(--shadow-md);
}

.article-content hr {
  border: none;
  height: 2px;
  margin: 2.5em 0;
  border-radius: 2px;
  background: linear-gradient(to right, transparent, var(--border-color), var(--color-primary-light), var(--border-color), transparent);
}

.article-content table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.article-content th {
  background: rgba(108, 92, 231, 0.06);
  font-weight: 600;
  color: var(--color-primary);
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content tr:hover td {
  background: rgba(108, 92, 231, 0.03);
}

/* 文章底部 */
.article-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.article-nav-item {
  flex: 1;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 48%;
  box-shadow: 0 2px 12px rgba(108, 92, 231, 0.06);
}

.article-nav-item:hover {
  border-color: var(--color-primary-light);
  box-shadow: 
    0 8px 28px rgba(108, 92, 231, 0.12),
    0 2px 8px rgba(108, 92, 231, 0.06);
  transform: translateY(-3px);
  background: var(--bg-card-hover);
}

.article-nav-item.next {
  text-align: right;
}

.article-nav-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.article-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.article-nav-item:hover .article-nav-title {
  color: var(--color-primary);
}

/* ===== 关于页面 ===== */
.about-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 32px 80px;
}

.about-hero {
  text-align: center;
  margin-bottom: 56px;
}

.about-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--gradient-hero);
  background-size: 200% 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 3rem;
  font-weight: 900;
  color: white;
  box-shadow: 
    0 16px 48px rgba(108, 92, 231, 0.3),
    0 0 0 4px rgba(255, 255, 255, 0.8),
    0 0 0 6px rgba(108, 92, 231, 0.15);
  position: relative;
  animation: avatarFloat 5s ease-in-out infinite, avatarGradient 6s ease infinite;
}

@keyframes avatarFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes avatarGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.about-name {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.about-social {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.about-social-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.about-social-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.about-section {
  margin-bottom: 48px;
}

.about-section-title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-section-title .icon {
  font-size: 1.2rem;
}

.about-section-content {
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 1rem;
}

.about-section-content p {
  margin-bottom: 1em;
}

.about-section-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about-section-content blockquote {
  position: relative;
  margin: 1.5em 0 0;
  padding: 16px 20px 16px 24px;
  border-radius: var(--radius-md);
  background: 
    linear-gradient(135deg, rgba(108, 92, 231, 0.06), rgba(253, 121, 168, 0.06)),
    var(--bg-card);
  border-left: 4px solid var(--color-primary);
  color: var(--text-secondary);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.06);
}

.about-section-content blockquote p {
  margin-bottom: 0.5em;
}

.about-section-content blockquote p:last-child {
  margin-bottom: 0;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-skill {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.about-skill:hover {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.25);
}

.about-timeline {
  position: relative;
  padding-left: 28px;
}

.about-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent), var(--color-accent-2));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 3px solid var(--bg-base);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.timeline-date {
  font-size: 0.82rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== 页脚 ===== */
.footer {
  position: relative;
  z-index: 1;
  padding: 56px 32px 32px;
  text-align: center;
  border-top: 1px solid var(--border-light);
  background: var(--surface-footer);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-primary-light), var(--color-accent), var(--color-primary-light), transparent);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-logo {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-main);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  animation: footerGradient 6s ease infinite;
}

@keyframes footerGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: inline-block;
  padding-left: 32px;
  padding-right: 32px;
}

.footer-icp {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 8px;
  letter-spacing: 0.05em;
}

.footer-icp a {
  color: var(--text-muted);
  opacity: 0.7;
  transition: all var(--transition-fast);
}

.footer-icp a:hover {
  opacity: 1;
  color: var(--color-primary);
}

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 28px rgba(108, 92, 231, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  animation: btnGradient 4s ease infinite;
}

@keyframes btnGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 
    0 14px 36px rgba(108, 92, 231, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.back-to-top:active {
  transform: translateY(-2px) scale(0.98);
}

/* ===== 加载动画 ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 20px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 50px 20px 40px;
  }

  .hero-stats {
    gap: 28px;
  }

  .hero-stat-num {
    font-size: 1.6rem;
  }

  .tag-filter-section,
  .article-list-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .article-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .article-detail,
  .about-page {
    padding: 40px 20px 60px;
  }

  .section-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .article-nav {
    flex-direction: column;
  }

  .article-nav-item {
    max-width: 100%;
  }

  .article-nav-item.next {
    text-align: left;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
  }

  /* 搜索框在移动端占满宽度，避免溢出 */
  .section-header {
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  .search-box input:focus {
    width: 100%;
  }

  /* Hero 统计在窄屏避免横向溢出 */
  .hero-stats {
    padding: 20px 12px;
    gap: 16px;
    max-width: 100%;
  }

  .hero-stat:not(:last-child)::after {
    display: none;
  }

  .blob {
    filter: blur(60px);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .article-detail-title {
    font-size: 1.5rem;
  }

  .card-body {
    padding: 20px;
  }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-accent));
  border-radius: 10px;
  border: 2px solid var(--bg-base);
  opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
}

/* ===== 文字选中 ===== */
::selection {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.25), rgba(253, 121, 168, 0.25));
  color: var(--color-primary);
}

/* ===== 代码复制按钮 ===== */
.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-family: inherit;
  color: #cdd3e0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all var(--transition-fast);
  z-index: 2;
}

.code-copy-btn:hover {
  color: #fff;
  background: rgba(108, 92, 231, 0.5);
  border-color: rgba(162, 155, 254, 0.6);
}

.code-copy-btn.copied {
  color: #fff;
  background: var(--gradient-cool);
  border-color: transparent;
}

/* ===== 文章分享栏 ===== */
.article-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 36px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.share-label {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.share-btns {
  display: flex;
  gap: 10px;
}

.share-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.share-btn:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.25);
}

/* ===== 相关文章 ===== */
.related-section {
  margin-top: 16px;
}

.related-title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 22px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all var(--transition-fast);
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.related-cover {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.2);
}

.related-body {
  min-width: 0;
}

.related-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.related-card:hover .related-card-title {
  color: var(--color-primary);
}

.related-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== Toast 轻提示 ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: rgba(30, 30, 50, 0.92);
  color: #fff;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 移动端适配补充 */
@media (max-width: 768px) {
  .article-share {
    flex-direction: column;
    align-items: flex-start;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   响应式增强 + 无障碍 + 交互体验
   ============================================ */

/* 跳转主内容链接（键盘/读屏用户） */
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 2000;
  padding: 10px 18px;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transition: top var(--transition-fast);
  animation: btnGradient 4s ease infinite;
}

.skip-link:focus {
  top: 12px;
}

/* 统一的键盘焦点样式 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.toc-toggle:focus-visible,
.share-btn:focus-visible,
.article-card:focus-visible,
.tag-chip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* 让可点击的卡片/标签具备可聚焦外观 */
.article-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(108, 92, 231, 0.18);
}

.tag-chip:focus-visible {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}

/* ===== 移动端目录开关（≤1200px 显示） ===== */
.toc-toggle {
  display: none;
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  color: #fff;
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 28px rgba(108, 92, 231, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: btnGradient 4s ease infinite;
  transition: transform var(--transition-fast);
}

.toc-toggle:hover {
  transform: translateY(-3px) scale(1.05);
}

.toc-toggle:active {
  transform: scale(0.95);
}

/* 中等屏幕（平板）下，固定目录改为底部抽屉，由开关键控制 */
@media (max-width: 1200px) {
  .toc-toggle {
    display: flex;
  }

  .article-toc {
    right: 16px;
    left: 16px;
    top: auto;
    bottom: 84px;
    width: auto;
    max-height: 55vh;
    transform: translateY(20px);
    border-radius: var(--radius-lg);
  }

  .article-toc.visible {
    transform: translateY(0);
  }
}

/* 超小屏进一步收紧 */
@media (max-width: 380px) {
  .hero-stats {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .hero-stat-num {
    font-size: 1.4rem;
  }
}

/* ===== Hero 滚动指示器 ===== */
.hero-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  animation: badgeFloat 3s ease-in-out infinite;
}

.hero-scroll-hint .mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--text-muted);
  border-radius: 14px;
  position: relative;
}

.hero-scroll-hint .mouse::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--color-primary);
  animation: scrollWheel 1.8s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% { opacity: 0; transform: translate(-50%, 0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ===== 骨架屏加载 ===== */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton-cover {
  height: 160px;
  background: linear-gradient(
    90deg,
    rgba(108, 92, 231, 0.04) 25%,
    rgba(108, 92, 231, 0.10) 50%,
    rgba(108, 92, 231, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-body {
  padding: 24px;
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    rgba(108, 92, 231, 0.04) 25%,
    rgba(108, 92, 231, 0.10) 50%,
    rgba(108, 92, 231, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== 搜索框清除按钮 ===== */
.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  line-height: 1;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ===== 增强空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 32px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
  animation: emptyBounce 3s ease-in-out infinite;
}

@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== 暗色模式下的代码块 & 首字下沉微调 ===== */
body.dark .article-content > p:first-of-type::first-letter {
  filter: drop-shadow(0 2px 8px rgba(162, 155, 254, 0.2));
}

body.dark .article-content pre {
  background: linear-gradient(135deg, #0d0d1a 0%, #141428 100%);
}

/* ===== 尊重「减少动态效果」偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  /* 依赖动画进入的元素需强制显示最终态 */
  .article-card {
    opacity: 1 !important;
    animation: none !important;
  }

  .page-enter {
    animation: none !important;
    opacity: 1 !important;
  }

  .hero-bg-text,
  .hero-scroll-hint,
  .empty-state-icon,
  .skeleton-cover,
  .skeleton-line {
    animation: none !important;
  }

  .bg-decorations::before {
    animation: none !important;
  }
}
