@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* ===== 设计令牌 ===== */
:root {
  --c-deep: #0D1B2A;
  --c-forest: #1B4332;
  --c-mint: #A8EDCD;
  --c-mint-dim: rgba(168, 237, 205, 0.18);
  --c-mint-glow: rgba(168, 237, 205, 0.35);
  --c-text: #e8f4ee;
  --c-text-dim: rgba(232, 244, 238, 0.65);
  --c-text-muted: rgba(232, 244, 238, 0.42);
  --c-glass-bg: rgba(13, 27, 42, 0.55);
  --c-glass-border: rgba(168, 237, 205, 0.22);
  --c-overlay: rgba(13, 27, 42, 0.72);
  --c-hr: rgba(168, 237, 205, 0.28);
  --r-card: 18px;
  --r-btn: 8px;
  --nav-w: 240px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Lexend', 'Source Sans 3', system-ui, -apple-system, sans-serif;
}

/* ===== 重置与基础 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: var(--c-deep);
  color: var(--c-text);
}

body {
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  background: var(--c-deep);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-mint); text-decoration: none; transition: color var(--transition); }
a:hover { color: #d6fff0; }
ul, ol { list-style: none; }

/* ===== 布局外壳 ===== */
.layout-home,
.layout-topic,
.layout-article,
.layout-about,
.layout-privacy,
.layout-default {
  display: flex;
  min-height: 100vh;
}

/* ===== 左侧固定竖排导航 ===== */
.sidenav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidenav {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(13, 27, 42, 0.97) 0%, rgba(27, 67, 50, 0.92) 100%);
  border-right: 1px solid var(--c-glass-border);
  padding: 1.5rem 0 2rem;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidenav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--c-glass-border);
  color: var(--c-mint);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}

.brand-logo { width: 28px; height: 28px; flex-shrink: 0; border-radius: 6px; }
.brand-name { font-size: 0.82rem; letter-spacing: 0.03em; }

.sidenav-links {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidenav-link {
  display: block;
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem;
  color: var(--c-text-dim);
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.sidenav-link:hover,
.sidenav-link.active {
  color: var(--c-mint);
  border-left-color: var(--c-mint);
  background: var(--c-mint-dim);
}

/* ===== 页面主体 ===== */
.page-body {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===== 视差层基础 ===== */
.parallax-layer {
  will-change: transform;
}

/* ===== Hero 全宽 ===== */
.parallax-hero,
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 0.6s ease;
}

.hero-overlay,
.topic-header-overlay,
.article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13, 27, 42, 0.82) 0%, rgba(27, 67, 50, 0.55) 60%, transparent 100%);
  z-index: 1;
}

.hero-content,
.topic-header-content,
.article-header-text,
.inner-header-text {
  position: relative;
  z-index: 2;
  padding: 3rem 3rem 3.5rem;
  max-width: 640px;
  text-align: right;
}

.right-align { text-align: right; }

.hero-content h1,
.topic-header-content h1,
.article-header-text h1,
.inner-header-text h1 {
  font-family: var(--font-main);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--c-text-dim);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

/* ===== 主题页 / 内页 header ===== */
.topic-header {
  position: relative;
  min-height: 42vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: linear-gradient(135deg, var(--c-deep) 0%, var(--c-forest) 100%);
  overflow: hidden;
}

.topic-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, var(--c-mint-dim) 0%, transparent 65%);
}

.inner-header {
  position: relative;
  min-height: 30vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: linear-gradient(135deg, var(--c-deep) 0%, var(--c-forest) 80%);
  overflow: hidden;
  padding: 2rem 0 0;
}

.inner-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 75% 40%, rgba(168, 237, 205, 0.12) 0%, transparent 60%);
}

/* ===== 文章页 hero ===== */
.article-header {
  position: relative;
  min-height: 36vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: linear-gradient(135deg, var(--c-deep) 0%, var(--c-forest) 100%);
  overflow: hidden;
}

.article-hero-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.article-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.8rem;
  background: var(--c-mint);
  color: var(--c-deep);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--r-btn);
  letter-spacing: 0.04em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  min-height: 44px;
  align-items: center;
}

.btn-primary:hover {
  background: #d6fff0;
  color: var(--c-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 237, 205, 0.35);
}

/* ===== Section 双栏（aside 左 + figure 右） ===== */
.section-topics,
.section-content,
.section-articles,
.section-toc,
.section-main {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  padding: 4rem 3rem;
  border-bottom: 1px solid var(--c-glass-border);
  position: relative;
}

.section-aside {
  padding-right: 2rem;
  border-right: 1px solid var(--c-glass-border);
  position: sticky;
  top: 2rem;
  align-self: start;
}

.section-aside h2,
.section-aside h3 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-mint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-aside h3 {
  margin-top: 1.5rem;
}

.section-aside hr {
  border: none;
  border-top: 1px solid var(--c-hr);
  margin-bottom: 1rem;
}

.section-aside p {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  line-height: 1.6;
}

.section-figure {
  padding-left: 2.5rem;
}

/* ===== hr 全局（h2/h3 后紧跟）===== */
hr {
  border: none;
  border-top: 1px solid var(--c-hr);
  margin: 0.5rem 0 1rem;
}

/* ===== 玻璃拟态卡片 ===== */
.glass-card {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(168, 237, 205, 0.15);
  border-color: var(--c-mint-glow);
}

/* ===== 话题卡片网格 ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.topic-card a {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  height: 100%;
  color: var(--c-text);
}

.card-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--c-mint);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.topic-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: #fff;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  flex: 1;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.topic-card small {
  font-size: 0.72rem;
  color: var(--c-mint);
  margin-top: auto;
}

/* ===== 文章列表 ===== */
.article-list,
.sub-article-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  counter-reset: none;
}

.article-item a,
.sub-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--c-text);
}

.item-num,
.sub-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-mint);
  opacity: 0.5;
  min-width: 2.5rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.item-info,
.sub-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.item-info strong,
.sub-info strong {
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.4;
}

.item-info small,
.sub-info small {
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

.sub-date {
  font-size: 0.72rem;
  color: var(--c-mint);
  opacity: 0.7;
  white-space: nowrap;
  align-self: center;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--c-text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.breadcrumb a { color: var(--c-mint); opacity: 0.8; }
.breadcrumb a:hover { opacity: 1; }
.breadcrumb span[aria-hidden] { color: var(--c-text-muted); }

/* ===== 日期元数据 ===== */
.article-meta {
  display: flex;
  gap: 1.25rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.pub-date, .mod-date {
  font-size: 0.8rem;
  color: var(--c-mint);
  opacity: 0.75;
}

/* ===== 正文内容 ===== */
.prose-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  max-width: 72ch;
}

.prose-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  margin: 2.25rem 0 0.4rem;
  letter-spacing: -0.01em;
}

.prose-content h2 + hr {
  margin-bottom: 1rem;
}

.prose-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-mint);
  margin: 1.75rem 0 0.5rem;
}

.prose-content h3 + hr {
  margin-bottom: 0.75rem;
}

.prose-content p {
  margin-bottom: 1.1rem;
}

.prose-content ul,
.prose-content ol {
  margin: 0.75rem 0 1.1rem 1.5rem;
  list-style: disc;
}

.prose-content ol { list-style: decimal; }

.prose-content li {
  margin-bottom: 0.45rem;
  line-height: 1.7;
}

.prose-content a {
  color: var(--c-mint);
  border-bottom: 1px solid rgba(168, 237, 205, 0.3);
}

.prose-content a:hover {
  border-bottom-color: var(--c-mint);
}

.prose-content blockquote {
  border-left: 3px solid var(--c-mint);
  padding: 0.75rem 1.25rem;
  background: var(--c-mint-dim);
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  color: var(--c-text-dim);
  font-style: italic;
}

.prose-content code {
  background: rgba(168, 237, 205, 0.12);
  color: var(--c-mint);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, monospace;
}

.prose-content pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--c-glass-border);
  border-radius: 10px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.prose-content time { color: var(--c-mint); font-weight: 500; }

.article-prose { max-width: 75ch; }
.legal-prose { max-width: 70ch; font-size: 0.95rem; }

/* ===== aside 侧边栏内列表 ===== */
.aside-topic-list,
.aside-nav-list,
.aside-info-list,
.related-list,
.sibling-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.aside-topic-list a,
.aside-nav-list a,
.related-list a,
.sibling-list a {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  padding: 0.3rem 0;
  display: block;
  transition: color var(--transition), padding-left var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-topic-list a:hover,
.aside-nav-list a:hover,
.related-list a:hover,
.sibling-list a:hover {
  color: var(--c-mint);
  padding-left: 0.4rem;
}

.aside-info-list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.6rem;
}

.aside-info-list strong {
  font-size: 0.72rem;
  color: var(--c-mint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aside-info-list span {
  font-size: 0.82rem;
  color: var(--c-text-dim);
}

.aside-note {
  font-size: 0.78rem !important;
  color: var(--c-text-muted) !important;
  margin-top: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-top: 1.5rem;
  padding: 0.4rem 0;
  min-height: 40px;
}

.back-link:hover { color: var(--c-mint); }

/* ===== 页脚 ===== */
.site-footer {
  background: linear-gradient(180deg, rgba(13, 27, 42, 0) 0%, rgba(13, 27, 42, 0.98) 100%);
  border-top: 1px solid var(--c-glass-border);
  padding: 3rem 3rem 2rem;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  max-width: 1100px;
}

.footer-brand {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-mint);
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
}

.footer-about p {
  font-size: 0.83rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.footer-about address {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--c-text-muted);
  opacity: 0.7;
}

.footer-dl { display: flex; flex-direction: column; gap: 0; }

.footer-dl-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-mint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-glass-border);
  margin-bottom: 0.5rem;
  display: block;
}

.footer-dl dd { padding: 0; }

.footer-dl a {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  display: flex;
  align-items: center;
  padding: 0.35rem 0;
  min-height: 40px;
  transition: color var(--transition);
}

.footer-dl a:hover { color: var(--c-mint); }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0;
}

.footer-links a:hover { color: var(--c-mint); }

.copyright {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  opacity: 0.65;
  margin-top: 0.5rem;
}

/* ===== 视差滚动动效（JS 控制，CSS 准备） ===== */
.parallax-hero .hero-bg-img {
  transform-origin: center center;
}

/* ===== 动效：悬停微交互 ===== */
@media (prefers-reduced-motion: no-preference) {
  .glass-card {
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.28s ease,
                border-color 0.28s ease;
  }

  .sidenav-link {
    transition: all 0.22s ease;
  }

  .btn-primary {
    transition: background 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
  }

  .parallax-layer {
    transition: opacity 0.4s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  :root { --nav-w: 200px; }

  .section-topics,
  .section-content,
  .section-articles,
  .section-toc,
  .section-main {
    grid-template-columns: 180px 1fr;
    padding: 3rem 2rem;
  }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-about { grid-column: 1 / -1; }
}

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

  .sidenav-wrap {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 200;
  }

  .sidenav {
    flex-direction: row;
    height: auto;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-top: 1px solid var(--c-glass-border);
    background: rgba(13, 27, 42, 0.97);
  }

  .sidenav-brand {
    padding: 0.75rem 1rem;
    border-bottom: none;
    border-right: 1px solid var(--c-glass-border);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .brand-name { display: none; }

  .sidenav-links {
    flex-direction: row;
    padding: 0;
    gap: 0;
    overflow-x: auto;
  }

  .sidenav-links li { flex-shrink: 0; }

  .sidenav-link {
    padding: 0.75rem 0.9rem;
    font-size: 0.75rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    min-height: 44px;
  }

  .sidenav-link:hover,
  .sidenav-link.active {
    border-left: none;
    border-bottom-color: var(--c-mint);
    background: var(--c-mint-dim);
  }

  .page-body {
    margin-left: 0;
    margin-bottom: 56px;
  }

  .parallax-hero,
  .hero { min-height: 56vh; }

  .topic-header { min-height: 36vh; }
  .inner-header { min-height: 28vh; }

  .hero-content,
  .topic-header-content,
  .article-header-text,
  .inner-header-text {
    padding: 2rem 1.5rem 2.5rem;
    max-width: 100%;
  }

  .hero-content h1,
  .topic-header-content h1,
  .article-header-text h1,
  .inner-header-text h1 {
    font-size: clamp(1.5rem, 6vw, 2.4rem);
  }

  .section-topics,
  .section-content,
  .section-articles,
  .section-toc,
  .section-main {
    grid-template-columns: 1fr;
    padding: 2.5rem 1.5rem;
    gap: 1.5rem;
  }

  .section-aside {
    position: static;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--c-glass-border);
    padding-bottom: 1.25rem;
  }

  .section-figure { padding-left: 0; }

  .topic-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .site-footer { padding: 2rem 1.5rem 1.5rem; }
}

@media (max-width: 480px) {
  .topic-grid { grid-template-columns: 1fr; }

  .hero-content,
  .topic-header-content,
  .article-header-text,
  .inner-header-text {
    padding: 1.5rem 1.25rem 2rem;
  }

  .section-topics,
  .section-content,
  .section-articles,
  .section-toc,
  .section-main {
    padding: 2rem 1.25rem;
  }

  .site-footer { padding: 2rem 1.25rem 1.25rem; }
}
