/* ============================================================
   缀雨博客 · 主样式
   Modern Design System — v2.0
   ============================================================ */

/* ---- CSS 自定义属性 ---- */
:root {
  /* 色彩体系 */
  --bg:             #eaf2fb;
  --bg2:            #f4f8fd;
  --bg3:            #ddeaf7;
  --bg-glass:       rgba(255, 255, 255, 0.6);
  --bg-glass-hover: rgba(255, 255, 255, 0.82);

  --border:         rgba(100, 149, 200, 0.14);
  --border-hover:   rgba(74, 144, 217, 0.28);

  --text:           #1e3048;
  --text-muted:     #607d99;
  --text-light:     #8fa8c0;

  --accent:         #4a90d9;
  --accent-dark:    #2e74c0;
  --accent-light:   #79baf0;
  --accent-glow:    rgba(74, 144, 217, 0.14);
  --accent-glow-lg: rgba(74, 144, 217, 0.22);

  --rain:           rgba(74, 144, 217, 0.2);
  --tag-bg:         rgba(74, 144, 217, 0.07);
  --tag-border:     rgba(74, 144, 217, 0.2);

  /* 渐变 */
  --gradient-hero:  linear-gradient(150deg, #deeef9 0%, #cfe4f5 35%, #c4dbf2 65%, #b8d2ee 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
  --gradient-card:  linear-gradient(160deg, rgba(255,255,255,0.72), rgba(255,255,255,0.5));

  /* 字体 */
  --font-serif:     'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-sans:      'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;

  /* 间距 */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* 圆角 */
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-xs:  0 1px 4px rgba(30, 60, 100, 0.06);
  --shadow-sm:  0 2px 12px rgba(30, 60, 100, 0.08);
  --shadow:     0 4px 24px rgba(30, 60, 100, 0.10);
  --shadow-lg:  0 8px 40px rgba(30, 60, 100, 0.13);
  --shadow-xl:  0 16px 60px rgba(30, 60, 100, 0.16);
  --shadow-glow: 0 4px 24px var(--accent-glow-lg);

  /* 过渡 */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition:  0.22s var(--ease);
  --transition-lg: 0.35s var(--ease);

  /* 布局 */
  --nav-height: 66px;
  --container:  1100px;
}

/* ---- 重置 & 基础 ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.72;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-light); }

img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

::selection {
  background: rgba(74, 144, 217, 0.18);
  color: var(--accent-dark);
}

/* ---- 滚动条美化 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 217, 0.35);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---- 雨滴画布 ---- */
#rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* ================================================================
   导航栏
   ================================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(234, 242, 251, 0.82);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition), background var(--transition);
}

.navbar.scrolled {
  background: rgba(234, 242, 251, 0.94);
  box-shadow: 0 2px 24px rgba(30, 60, 100, 0.08);
}

.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg2), var(--bg2)) padding-box,
    var(--gradient-accent) border-box;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nav-brand:hover .brand-logo {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 0 18px var(--accent-glow-lg);
}

.brand-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px; height: 2px;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: transform var(--transition);
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(74, 144, 217, 0.1);
  font-weight: 500;
}

.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ================================================================
   主内容容器
   ================================================================ */
.main-content {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-height);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ================================================================
   Hero 区域
   ================================================================ */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 30% 30%, rgba(121, 192, 255, 0.08) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 75% 70%, rgba(74, 144, 217, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(234, 242, 251, 0.6));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) var(--space-lg);
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.2rem, 10vw, 7.5rem);
  font-weight: 300;
  letter-spacing: 0.22em;
  color: var(--text);
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 40px rgba(74, 144, 217, 0.12);
  animation: fadeInUp 0.9s var(--ease) both;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: clamp(0.88rem, 2.4vw, 1.05rem);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  max-width: 440px;
  margin: 0 auto var(--space-xl);
  animation: fadeInUp 0.9s 0.18s var(--ease) both;
  line-height: 1.8;
}

/* Hero 社交链接 */
.hero-social {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.9s 0.28s var(--ease) both;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(100, 149, 200, 0.22);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.social-link svg {
  width: 20px; height: 20px;
  transition: transform var(--transition);
}

.social-link:hover {
  color: var(--accent);
  border-color: rgba(74, 144, 217, 0.45);
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.social-link:hover svg {
  transform: scale(1.1);
}

/* Hero 滚动提示 */
.hero-scroll {
  animation: fadeInUp 0.9s 0.38s var(--ease) both;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  color: var(--text-muted);
  border: none;
  background: transparent;
  position: relative;
  z-index: 2;
}

.hero-scroll:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.hero-scroll:active { transform: scale(0.96); }

.hero-scroll span {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 22px; height: 22px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  animation: bounce 1.8s var(--ease) infinite;
  border-radius: 1px;
}

/* ================================================================
   区域通用
   ================================================================ */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-md);
  letter-spacing: 0.04em;
}

.section-line {
  width: 48px; height: 2px;
  background: var(--gradient-accent);
  margin: 0 auto var(--space-sm);
  border-radius: var(--radius-full);
}

.section-desc {
  color: var(--text-light);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

/* ================================================================
   视频展示区
   ================================================================ */
.video-section {
  padding: var(--space-3xl) 0;
}

/* 视频网格 - 横屏 16:9 */
.video-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
  max-width: 1100px;
  margin: 0 auto;
}

.video-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition-lg), box-shadow var(--transition-lg), border-color var(--transition);
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border-color: rgba(121, 192, 255, 0.35);
}

.video-card-iframe {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 横屏比例 */
  background: var(--bg3);
}

.video-card-iframe iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-card-title {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 文章入口按钮 */
.btn-articles {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 11px 28px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 0.9rem;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-articles:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: var(--accent-dark);
}

.btn-articles svg {
  width: 16px; height: 16px;
  transition: transform var(--transition);
}

.btn-articles:hover svg {
  transform: translateX(3px);
}

/* ================================================================
   文章列表区域
   ================================================================ */
.articles-section {
  padding: var(--space-3xl) 0;
}

/* ---- 搜索框 ---- */
.search-bar {
  position: relative;
  max-width: 460px;
  margin: 0 auto var(--space-2xl);
}

.search-bar input {
  width: 100%;
  padding: 12px 48px 12px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: all var(--transition);
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.88);
}

.search-bar input::placeholder { color: var(--text-light); }

.search-icon {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-light);
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 16px; height: 16px;
}

/* ---- 文章网格 ---- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

/* ---- 文章卡片 ---- */
.article-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: all var(--transition-lg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.article-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.15) 0%,
    transparent 50%,
    rgba(74, 144, 217, 0.03) 100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-lg);
}

.article-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(74, 144, 217, 0.08);
}

.article-card:hover::before { opacity: 1; }
.article-card:hover::after  { opacity: 1; }

.card-cover {
  width: 100%;
  height: 156px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.78rem;
  color: var(--text-light);
}

.card-date,
.card-read-time {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-date svg,
.card-read-time svg {
  width: 13px; height: 13px;
  opacity: 0.7;
  flex-shrink: 0;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  transition: color var(--transition);
  letter-spacing: 0.02em;
}

.article-card:hover .card-title { color: var(--accent); }

.card-excerpt {
  font-size: 0.855rem;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: var(--space-xs);
}

.card-tag {
  padding: 3px 10px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  color: var(--accent);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-tag svg {
  width: 10px; height: 10px;
  opacity: 0.8;
}

.card-tag:hover {
  background: rgba(121, 192, 255, 0.16);
  border-color: rgba(74, 144, 217, 0.36);
  transform: scale(1.06) translateY(-1px);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ---- 空状态 ---- */
.empty-state {
  text-align: center;
  padding: 64px var(--space-lg);
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.empty-icon {
  display: block;
  margin: 0 auto var(--space-md);
  opacity: 0.5;
}

.empty-icon svg {
  width: 48px; height: 48px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ================================================================
   页面头部（标签页、关于页等通用）
   ================================================================ */
.page-header {
  padding: var(--space-2xl) 0 var(--space-xl);
  text-align: center;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.04em;
}

.page-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ================================================================
   标签云
   ================================================================ */
.tag-cloud-section {
  margin-bottom: var(--space-2xl);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tag-cloud-item {
  padding: 6px 18px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-cloud-item:hover,
.tag-cloud-item.active {
  background: rgba(121, 192, 255, 0.18);
  border-color: var(--accent);
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.tag-count {
  font-size: 0.72rem;
  background: rgba(74, 144, 217, 0.12);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  color: var(--accent-dark);
}

/* ---- 标签筛选信息 ---- */
.tag-filter-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tag-filter-info h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
}

.clear-filter {
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-full);
  color: #e57373;
  font-size: 0.82rem;
  transition: all var(--transition);
}

.clear-filter:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* ================================================================
   留言板 / 评论区
   ================================================================ */
.comment-section {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl) 40px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.comment-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.comment-title::before {
  content: '';
  display: block;
  width: 4px; height: 20px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

.comment-form-wrap { margin-bottom: var(--space-xl); }

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.form-group label {
  font-size: 0.83rem;
  color: var(--text-muted);
  font-weight: 500;
}

.required { color: #e57373; }

.form-group input,
.form-group textarea {
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: all var(--transition);
  outline: none;
  resize: vertical;
  line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.9);
}

.char-count {
  font-size: 0.72rem;
  color: var(--text-light);
  text-align: right;
  margin-top: 3px;
}

.btn-submit {
  align-self: flex-start;
  padding: 10px 26px;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(46, 116, 192, 0.28);
  letter-spacing: 0.03em;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(46, 116, 192, 0.38);
  filter: brightness(1.06);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(46, 116, 192, 0.22);
}

.comment-status {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  min-height: 22px;
}

.comment-status.success { color: #4caf77; }
.comment-status.error   { color: #e57373; }

/* 留言列表 */
.comment-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.comment-item:last-child { border-bottom: none; }

.comment-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  font-family: var(--font-serif);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(46, 116, 192, 0.22);
}

.comment-body { flex: 1; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 500;
  color: var(--text);
  font-size: 0.875rem;
}

.comment-time {
  font-size: 0.775rem;
  color: var(--text-light);
}

.comment-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.72;
}

.comment-text p { margin: 0; }

.loading-comments {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-lg);
  font-size: 0.875rem;
}

.no-comments {
  text-align: center;
  color: var(--text-light);
  padding: var(--space-xl);
  font-size: 0.875rem;
}

/* ================================================================
   页脚
   ================================================================ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.85rem;
  background: rgba(234, 242, 251, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.footer a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer a:hover { color: var(--accent); }

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ================================================================
   返回顶部按钮
   ================================================================ */
.back-to-top {
  position: fixed;
  bottom: 32px; right: 32px;
  z-index: 999;
  width: 46px; height: 46px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(12px);
}

.back-to-top svg {
  width: 18px; height: 18px;
  transition: transform var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow), var(--shadow);
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

/* ================================================================
   动画关键帧
   ================================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0);   }
  50%       { transform: rotate(45deg) translateY(7px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ================================================================
   骨架屏 / 加载态
   ================================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg2) 25%,
    var(--bg3) 50%,
    var(--bg2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sk-line   { height: 13px; border-radius: 4px; }
.sk-title  { height: 19px; border-radius: 4px; width: 78%; }

/* ================================================================
   Spinner
   ================================================================ */
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ================================================================
   文章页专用
   ================================================================ */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-xl) 0 var(--space-3xl);
}

.article-header {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.article-title-main {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: var(--space-md);
  letter-spacing: 0.04em;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

.article-content {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--text);
  margin: 2em 0 0.75em;
  letter-spacing: 0.03em;
}

.article-content h2 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-sm);
}

.article-content h3 { font-size: 1.15rem; }

.article-content p {
  margin: 1em 0;
}

.article-content blockquote {
  margin: 1.5em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(74, 144, 217, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-content code {
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.88em;
  background: rgba(74, 144, 217, 0.08);
  color: var(--accent-dark);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(74, 144, 217, 0.14);
}

.article-content pre {
  margin: 1.5em 0;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--border);
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.9em;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-content th,
.article-content td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
}

.article-content th {
  background: rgba(74, 144, 217, 0.07);
  font-weight: 500;
  color: var(--text);
  text-align: left;
}

.article-content tr:last-child td { border-bottom: none; }

.article-content ul,
.article-content ol {
  padding-left: 1.5em;
  margin: 1em 0;
}

.article-content li { margin: 0.4em 0; }

.article-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2em 0;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(74, 144, 217, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition);
}

.article-content a:hover {
  text-decoration-color: var(--accent);
}

/* 相关文章 */
.related-articles {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.related-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.related-card {
  padding: var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.related-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.related-card h4 {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.5;
  transition: color var(--transition);
}

.related-card:hover h4 { color: var(--accent); }

.related-card span {
  font-size: 0.76rem;
  color: var(--text-light);
}

/* ================================================================
   响应式断点
   ================================================================ */

/* 1024px 以下 — 平板 */
@media (max-width: 1024px) {
  :root {
    --container: 900px;
  }

  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .video-container {
    grid-template-columns: 1fr;
  }
}

/* 768px 以下 — 移动端 */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
    --space-3xl: 72px;
    --space-2xl: 48px;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 0.83rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .comment-section {
    padding: var(--space-lg) var(--space-md);
  }

  .tag-filter-info {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  .video-container {
    grid-template-columns: 1fr;
  }

  .hero-social {
    gap: var(--space-sm);
  }

  .article-body {
    padding: var(--space-md) 0 var(--space-2xl);
  }
}

/* 480px 以下 — 小屏手机 */
@media (max-width: 480px) {
  :root {
    --space-3xl: 56px;
    --space-2xl: 40px;
  }

  .hero-title {
    letter-spacing: 0.12em;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .comment-section {
    padding: var(--space-md);
  }

  .hero-social .social-link {
    width: 40px;
    height: 40px;
  }

  .nav-container {
    padding: 0 var(--space-md);
  }

  .video-container {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
