@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* ===== 变量 ===== */
:root {
  --color-bg: #1A1A2E;
  --color-accent: #E94560;
  --color-fg: #F5F5F5;
  --color-bg2: #16213E;
  --color-bg3: #0F3460;
  --color-muted: #8B8FA8;
  --color-border: #2A2A4A;
  --color-card: #1E1E38;
  --color-card-hover: #252545;
  --color-accent-dim: rgba(233,69,96,0.15);
  --nav-width: 220px;
  --topbar-h: 36px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius: 0;
  --transition: 0.28s cubic-bezier(0.4,0,0.2,1);
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--color-bg); color: var(--color-fg); font-family: var(--font); font-size: 16px; line-height: 1.7; min-height: 100vh; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #ff6b81; }
ul, ol { list-style: none; }
hr { border: none; border-top: 1px solid var(--color-border); margin: 1.5rem 0; }
address { font-style: normal; }

/* ===== 布局外壳 ===== */
.site-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== 左侧固定导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--color-bg2);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  padding-bottom: 2rem;
}

.sidenav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem 1.2rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-fg);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.sidenav nav { flex: 1; padding: 0.8rem 0; }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-list dt {
  display: block;
}

.nav-list dt a {
  display: block;
  padding: 0.65rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: background var(--transition), color var(--transition), border-left var(--transition);
  border-left: 2px solid transparent;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.nav-list dt a:hover,
.nav-list dt a[aria-current="page"] {
  color: var(--color-fg);
  background: var(--color-accent-dim);
  border-left-color: var(--color-accent);
}

.sidenav-tagline {
  padding: 1rem 1.2rem;
  font-size: 0.7rem;
  color: var(--color-muted);
  line-height: 1.5;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* ===== 主体区域 ===== */
.page-body {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== 顶部公告条 ===== */
.topbar-notice {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg3);
  border-bottom: 1px solid var(--color-border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ===== main + wrap + article + section 四层 ===== */
main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 0;
  align-items: start;
}

main > .wrap {
  min-width: 0;
  padding: 2rem 2rem 3rem;
}

/* ===== 侧边栏 aside ===== */
.global-aside {
  padding: 2rem 1.2rem 2rem 1rem;
  border-left: 1px solid var(--color-border);
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.global-aside h2 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.global-aside hr {
  margin: 0.5rem 0 0.8rem;
}

.aside-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.5rem;
}

.aside-links li a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.8rem;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-links li a:hover { color: var(--color-fg); }

.aside-tags h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-cloud li a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  background: var(--color-card);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  transition: background var(--transition), color var(--transition);
  min-height: 32px;
  line-height: 1.6;
}

.tag-cloud li a:hover {
  background: var(--color-accent-dim);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ===== Parallax 效果层 ===== */
.parallax-layer {
  will-change: transform;
}

/* ===== 首页 Hero ===== */
.hero-section {
  min-height: 45vh;
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--color-bg2) 0%, var(--color-bg3) 100%);
  overflow: hidden;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  padding: 2rem;
  align-items: center;
}

.hero-media {
  position: relative;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 320px;
}

.hero-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-bg3), var(--color-border));
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.hero-text h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-fg);
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.7;
}

.btn-primary {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  transition: background var(--transition), transform var(--transition);
  min-height: 44px;
  line-height: 1.6;
}

.btn-primary:hover {
  background: #c73652;
  color: #fff;
  transform: translateY(-2px);
}

/* ===== 内容区 ===== */
.content-section { margin-bottom: 2.5rem; }

.page-article { width: 100%; }

.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-fg);
  max-width: 72ch;
}

.prose h2, .prose h3 { color: var(--color-fg); margin: 1.5rem 0 0.6rem; font-weight: 700; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.05rem; }
.prose p { margin-bottom: 1rem; }
.prose a { color: var(--color-accent); }
.prose a:hover { color: #ff6b81; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose time { color: var(--color-muted); font-size: 0.85rem; }
.prose hr { margin: 1.5rem 0; }

/* ===== 网格区块 ===== */
.cats-section, .featured-section, .children-section, .related-section,
.tag-related, .all-tags-section, .about-nav-section, .privacy-links-section { margin-bottom: 2.5rem; }

.cats-section h2, .featured-section h2, .children-section h2,
.related-section h2, .tag-related h2, .all-tags-section h2,
.about-nav-section h2, .privacy-links-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

/* ===== 卡片网格 ===== */
.entries-grid, .cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.entry-card, .child-card, .cat-card {
  background: var(--color-card);
  padding: 1.2rem;
  border-left: 2px solid var(--color-border);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  opacity: 0;
  transform: translateY(20px);
}

.entry-card.revealed, .child-card.revealed, .cat-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.entry-card:hover, .child-card:hover, .cat-card:hover {
  background: var(--color-card-hover);
  border-left-color: var(--color-accent);
  transform: translateY(-3px);
}

.entry-card h3, .child-card h3, .cat-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.entry-card h3 a, .child-card h3 a, .cat-card h3 a {
  color: var(--color-fg);
}

.entry-card h3 a:hover, .child-card h3 a:hover, .cat-card h3 a:hover {
  color: var(--color-accent);
}

.entry-card p, .child-card p, .cat-card p {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.entry-card time, .child-card time {
  font-size: 0.72rem;
  color: var(--color-accent);
  font-weight: 500;
}

/* ===== 栏目页 Hero ===== */
.cat-hero, .tag-header, .about-header, .privacy-header {
  padding: 2rem 0 1.5rem;
}

.cat-hero-inner, .tag-header-inner, .about-header-inner, .privacy-header-inner {
  max-width: 640px;
}

.cat-eyebrow, .tag-eyebrow, .about-eyebrow, .privacy-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.6rem;
}

.cat-hero h1, .tag-header h1, .about-header h1, .privacy-header h1, .entry-header h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-fg);
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.cat-desc, .about-lead { font-size: 0.95rem; color: var(--color-muted); }

/* ===== 文章页 ===== */
.entry-header { padding: 2rem 0 1rem; }
.entry-header-inner { max-width: 760px; }

.breadcrumb {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-bottom: 0.8rem;
}

.breadcrumb a { color: var(--color-accent); }

.entry-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.entry-meta time {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.entry-hero-wrap {
  margin: 1rem 0;
  overflow: hidden;
  max-height: 360px;
}

.entry-hero-img {
  width: 100%;
  object-fit: cover;
  max-height: 360px;
}

.entry-prose .prose { max-width: 72ch; }

/* ===== 标签页 ===== */
.tag-index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-index-list li a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--color-card);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  font-size: 0.82rem;
  transition: all var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.tag-index-list li a:hover {
  background: var(--color-accent-dim);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ===== 关于页 ===== */
.about-nav-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}

.about-nav-card {
  background: var(--color-card);
  padding: 1rem;
  border-left: 2px solid var(--color-border);
  transition: border-color var(--transition), background var(--transition);
}

.about-nav-card:hover {
  border-left-color: var(--color-accent);
  background: var(--color-card-hover);
}

.about-nav-card h3 { font-size: 0.88rem; font-weight: 700; margin-bottom: 0.4rem; }
.about-nav-card h3 a { color: var(--color-fg); }
.about-nav-card h3 a:hover { color: var(--color-accent); }
.about-nav-card p { font-size: 0.78rem; color: var(--color-muted); line-height: 1.5; }

/* ===== 隐私页 ===== */
.privacy-meta time { font-size: 0.8rem; color: var(--color-muted); }
.privacy-meta { margin-bottom: 0.8rem; }

.privacy-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.privacy-related li a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--color-card);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  font-size: 0.82rem;
  min-height: 40px;
  transition: all var(--transition);
}

.privacy-related li a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-dim);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--color-bg2);
  border-top: 1px solid var(--color-border);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-brand strong {
  font-size: 0.95rem;
  color: var(--color-fg);
  font-weight: 700;
}

.footer-brand span {
  font-size: 0.78rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-nav dt a {
  font-size: 0.78rem;
  color: var(--color-muted);
  padding: 0.2rem 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.footer-nav dt a:hover { color: var(--color-accent); }

.footer-links {
  grid-column: 1 / -1;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-links li a {
  font-size: 0.78rem;
  color: var(--color-muted);
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.footer-links li a:hover { color: var(--color-accent); }

.footer-copy {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.footer-copy p {
  font-size: 0.72rem;
  color: var(--color-muted);
}

/* ===== 揭示动画 ===== */
.reveal-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* 交错卡片 */
.entry-card, .child-card, .cat-card, .about-nav-card {
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
  .global-aside {
    border-left: none;
    border-top: 1px solid var(--color-border);
    position: static;
    max-height: none;
    padding: 1.5rem 2rem;
  }
}

@media (max-width: 700px) {
  :root { --nav-width: 0px; }

  .sidenav {
    position: fixed;
    left: -260px;
    width: 260px;
    transition: left var(--transition);
    z-index: 200;
  }

  .sidenav.open { left: 0; }

  .page-body { margin-left: 0; }

  .topbar-notice {
    justify-content: flex-start;
    padding: 0 1rem;
    gap: 1rem;
  }

  .topbar-notice::before {
    content: '≡';
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-fg);
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  main > .wrap { padding: 1.2rem 1rem 2rem; }

  .hero-inner { grid-template-columns: 1fr; gap: 1rem; padding: 1.2rem; }
  .hero-media { display: none; }
  .hero-text { align-items: flex-start; text-align: left; }
  .hero-section { min-height: auto; }

  .entries-grid, .cats-grid { grid-template-columns: 1fr; }

  .site-footer { grid-template-columns: 1fr; padding: 1.5rem 1rem; }
  .footer-links { grid-column: 1; }
  .footer-copy { grid-column: 1; }

  .about-nav-list { grid-template-columns: 1fr; }
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .reveal-section { opacity: 1; transform: none; transition: none; }
  .entry-card, .child-card, .cat-card { opacity: 1; transform: none; transition: none; }
  .parallax-layer { will-change: auto; }
  * { animation: none !important; transition: none !important; }
}
