/* =============================================================
   jiazichen.cn 自定义样式 (v5 赛博朋克科技感)
   ============================================================= */

:root {
  --bg-deep: #0a0e27;
  --bg-mid: #14143a;
  --bg-purple: #1a0a2e;
  --text-primary: #e8eaff;
  --text-secondary: #8a92b8;
  --text-muted: #5a5f7f;
  --accent-cyan: #00f0ff;
  --accent-blue: #4a9eff;
  --accent-purple: #b794f6;
  --accent-pink: #ff6bb5;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-bg-hover: rgba(255, 255, 255, 0.07);
  --card-border: rgba(99, 179, 237, 0.18);
  --card-border-hover: rgba(0, 240, 255, 0.5);
  --card-glow: 0 4px 24px rgba(0, 240, 255, 0.08);
  --card-glow-hover: 0 8px 40px rgba(0, 240, 255, 0.18);
  --grid-line: rgba(99, 179, 237, 0.06);
}

/* ---------- 全局: 深空底色 + 浅冷白文字 + 网格底纹 + 粒子 ---------- */
html {
  background: var(--bg-deep);
  color-scheme: dark;
}
body {
  background:
    /* 顶部星点 (用 radial-gradient 模拟) */
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 80% 20%, rgba(255,255,255,0.35) 50%, transparent 50%),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 90% 50%, rgba(255,255,255,0.25) 50%, transparent 50%),
    radial-gradient(1px 1px at 10% 60%, rgba(255,255,255,0.3) 50%, transparent 50%),
    /* 大色块光晕 (左下青/右上紫) */
    radial-gradient(circle at 15% 85%, rgba(0, 240, 255, 0.12), transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(183, 148, 246, 0.15), transparent 50%),
    /* 基础渐变 (深蓝→深紫) */
    linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 50%, var(--bg-purple) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "SF Pro Display", sans-serif;
  min-height: 100vh;
}

/* 网格底纹覆盖 (赛博味) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* main 内容提到网格之上 */
.main, .header, #splash, .page-transition { position: relative; z-index: 1; }
.main { z-index: 2; }

/* ---------- 顶部导航: 玻璃态 + 霓虹边 ---------- */
.header {
  z-index: 10000 !important;
  position: sticky !important;
  top: 0;
  background: rgba(10, 14, 39, 0.65);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 1px 0 rgba(0, 240, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.3);
}
.header, .header-nav,
.logo a, .menu a, .menu a span, .menu .active,
.logo-switches button, .logo-switches svg {
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}
.logo a {
  font-weight: 700 !important;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.3);
}
.menu a:hover, .menu .active {
  color: var(--accent-cyan) !important;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

/* ---------- 头部 logo/主题切换按钮 ---------- */
.theme-toggle {
  color: var(--text-secondary) !important;
}
.theme-toggle:hover { color: var(--accent-cyan) !important; }

/* ---------- 首页: 开场大字 (赛博霓虹) ---------- */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.5s ease 0.1s;
}
#splash.show {
  opacity: 1;
  pointer-events: auto;
}
#splash .splash-inner {
  text-align: center;
  transform: translateY(80vh);
  transition: transform 1.0s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
#splash.show .splash-inner {
  transform: translateY(0);
}
#splash h1 {
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0;
  background: linear-gradient(135deg, #00f0ff 0%, #4a9eff 30%, #b794f6 60%, #ff6bb5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 32px rgba(0, 240, 255, 0.4)) drop-shadow(0 0 64px rgba(183, 148, 246, 0.3));
  position: relative;
}
/* 大字后面的光晕圆 (赛博) */
#splash .splash-inner::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(0, 240, 255, 0.25), transparent 60%);
  z-index: -1;
  filter: blur(40px);
  pointer-events: none;
}
#splash .splash-sub {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.4em;
  font-weight: 300;
  text-transform: uppercase;
}

/* 首页 main 在 splash 下方 (splash 占满视口,大字停在中央,下面滚动显示) */
body.first-visit main.main {
  padding-top: 100vh;
  margin-top: -100vh;  /* 让 main 的开头(文章列表)和视口顶部重合,splash 在它上方 */
}
/* splash 期间: main 内容隐藏 (splash 透明后能看到背景,但 main 在 padding-top 区域也是空) */
body.first-visit-anim main.main {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
body.first-visit-done main.main {
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: auto;
}

/* ---------- 文章卡片: 玻璃态 + 霓虹边 ---------- */
.post-entry {
  background: var(--card-bg) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border) !important;
  border-radius: 14px !important;
  padding: 32px 36px !important;
  margin: 20px 0 !important;
  box-shadow: var(--card-glow) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  position: relative;
  overflow: hidden;
}
.post-entry::before {
  /* 顶部高光描边 (赛博感) */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-cyan) 50%, transparent 100%);
  opacity: 0.4;
}
.post-entry:hover {
  background: var(--card-bg-hover) !important;
  transform: translateY(-3px);
  box-shadow: var(--card-glow-hover) !important;
  border-color: var(--card-border-hover) !important;
}
.post-entry .entry-header h2 {
  font-size: clamp(20px, 2.2vw, 28px) !important;
  font-weight: 700 !important;
  margin: 0 0 12px 0 !important;
  line-height: 1.3 !important;
  color: var(--text-primary) !important;
}
.post-entry .entry-header h2 a,
.post-entry .entry-header h2 {
  color: var(--text-primary) !important;
  transition: color 0.2s ease;
}
.post-entry:hover .entry-header h2 {
  color: var(--accent-cyan) !important;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}
.post-entry .entry-content p {
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: var(--text-secondary) !important;
  margin: 8px 0 12px 0 !important;
}
.post-entry .entry-footer {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  margin-top: 14px;
}
.post-entry .entry-footer a,
.post-entry .entry-footer span {
  color: var(--text-muted) !important;
}

/* ---------- 大屏: 2 列网格 ---------- */
@media (min-width: 1100px) {
  body.home main.main {
    max-width: 1400px !important;
    margin: 0 auto !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  body.home main.main .post-entry {
    margin: 0 !important;
  }
  body.home main.main .page-footer {
    grid-column: 1 / -1;
  }
}

/* ---------- 列表 header (section pages) ---------- */
.page-header h1 {
  font-size: clamp(28px, 3vw, 40px) !important;
  font-weight: 800 !important;
  margin: 0 0 8px 0 !important;
  color: var(--text-primary) !important;
}
.page-header .post-description {
  font-size: 16px !important;
  color: var(--text-secondary) !important;
  margin-bottom: 20px;
}

/* ---------- 普通链接颜色 (覆盖 PaperMod 默认) ---------- */
a, a:visited {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
a:hover {
  color: var(--accent-purple);
  text-shadow: 0 0 8px rgba(183, 148, 246, 0.4);
}

/* ---------- 站内跳转 (无整屏滑动, 保持原位) ---------- */
/* 已移除 .page-transition — 不再整屏滑入滑出 */

/* ---------- 模块入场: 从底部淡入 + 上滑 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.reveal-in {
  opacity: 1;
  transform: translateY(0);
}
/* 标题类稍大一些的上滑 */
h1.reveal, h2.reveal {
  transform: translateY(24px);
}
/* 已被 body.first-visit-done 标记的元素直接显示 (避免首页大字入场后下面还隐藏) */
body.first-visit-done .reveal { /* 让 IO 触发 */ }
/* 已在视口内(加载时可见)的元素也立即显示 */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.reveal-in { opacity: 1; transform: none; transition: none; }
}
