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

/* ── 变量 ── */
:root {
  --c-primary: #56228b;
  --c-primary-light: #7b3bbf;
  --c-primary-pale: rgba(86,34,139,0.12);
  --c-accent: #8b4513;
  --c-accent-light: #b85a1a;
  --c-dark: #1f1726;
  --c-dark-mid: #2e2040;
  --c-surface: #2a1d38;
  --c-surface2: #231630;
  --c-border: rgba(86,34,139,0.35);
  --c-text: #f0eaf8;
  --c-text-muted: #b8a8d0;
  --c-text-dim: #7a6a90;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-body: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-display: 'Varela Round', 'Nunito Sans', sans-serif;
  --max-w: 1100px;
  --gap: 24px;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--c-dark);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(86,34,139,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(139,69,19,0.12) 0%, transparent 55%);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-primary-light); }

/* ── 排版 ── */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── 站头 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(31,23,38,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px 10px;
}
.brand-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; flex-shrink: 0; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand-name:hover { color: var(--c-primary-light); }
.brand-tagline {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6px 20px 10px;
  flex-wrap: wrap;
}
.main-nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-text-muted);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.main-nav > a:hover,
.main-nav > a[aria-current="page"] {
  background: var(--c-primary-pale);
  color: var(--c-primary-light);
}

/* ── 面包屑 ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--c-text-dim);
  padding: 16px 0 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary-light); }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

/* ── wrap ── */
main { width: 100%; }
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ─────────────────────────────────────────
   首页 Hero
───────────────────────────────────────── */
.page-home .hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 120px 0 80px;
  overflow: hidden;
}
.hero-text {
  position: relative;
  z-index: 2;
  max-width: 540px;
}
.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--c-text);
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  margin-bottom: 0;
  line-height: 1.7;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}
.hero-blob {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 480px;
  opacity: 0.7;
  z-index: 0;
}
.hero-blob svg { width: 100%; height: auto; }
.hero-arc {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--c-dark);
  z-index: 1;
  clip-path: ellipse(55% 100% at 50% 100%);
}
/* 点阵底纹 */
.page-home .hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(86,34,139,0.25) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
}

/* ─────────────────────────────────────────
   通用 section heading
───────────────────────────────────────── */
.section-heading {
  font-size: 1.25rem;
  color: var(--c-text-muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────
   正文区块
───────────────────────────────────────── */
.content-section {
  margin: 32px 0;
}
.page-article {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--c-text);
}
.page-article h2, .page-article h3 {
  color: var(--c-primary-light);
  margin: 1.4em 0 0.6em;
}
.page-article h2 { font-size: 1.25rem; }
.page-article h3 { font-size: 1.05rem; }
.page-article ul, .page-article ol {
  padding-left: 1.6em;
  margin-bottom: 1rem;
}
.page-article li { margin-bottom: 0.4em; }
.page-article a { color: var(--c-primary-light); text-decoration: underline; text-underline-offset: 3px; }
.page-article a:hover { color: var(--c-accent-light); }
.page-article time { color: var(--c-text-dim); font-size: 0.88rem; }
.page-article strong { color: var(--c-text); font-weight: 700; }
.page-article blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 10px 18px;
  background: var(--c-primary-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-muted);
  font-style: italic;
  margin: 1rem 0;
}

/* ─────────────────────────────────────────
   分类导航卡片（首页）
───────────────────────────────────────── */
.cat-nav-section { margin: 40px 0; }
.cat-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
}
.nav-cat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.nav-cat-card strong {
  font-size: 1rem;
  color: var(--c-text);
  font-weight: 700;
}
.nav-cat-card span {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  line-height: 1.5;
}
.nav-cat-card:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-pale);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────
   子页卡片（首页 children）
───────────────────────────────────────── */
.children-section { margin: 40px 0; }
.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}
.child-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-surface2);
  transition: border-color 0.2s, transform 0.25s;
}
.child-card .card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.child-card .card-title {
  padding: 0 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
}
.child-card .card-desc {
  padding: 0 16px;
  font-size: 0.82rem;
  color: var(--c-text-dim);
  line-height: 1.5;
  flex: 1;
}
.child-card .card-date {
  padding: 0 16px 14px;
  font-size: 0.78rem;
  color: var(--c-text-dim);
}
.child-card:hover {
  border-color: var(--c-primary-light);
  transform: translateY(-3px);
}

/* ─────────────────────────────────────────
   栏目页 Hero
───────────────────────────────────────── */
.cat-hero {
  position: relative;
  padding: 48px 0 36px;
  overflow: hidden;
}
.cat-hero-inner {
  position: relative;
  z-index: 2;
}
.cat-h1 {
  color: var(--c-text);
  margin-bottom: 12px;
}
.cat-desc {
  color: var(--c-text-muted);
  font-size: 1rem;
  max-width: 600px;
}
.cat-blob {
  position: absolute;
  right: 0;
  top: 0;
  width: 300px;
  opacity: 0.7;
  z-index: 0;
}
.cat-blob svg { width: 100%; height: auto; }

/* ─────────────────────────────────────────
   栏目页条目列表
───────────────────────────────────────── */
.entries-section { margin: 32px 0; }
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.entry-block {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  opacity: 0;
  transform: translateY(18px);
  animation: revealUp 0.45s ease forwards;
  animation-delay: calc(var(--stagger, 0) * 0.07s);
}
.entry-block .entry-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.entry-block .entry-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  flex: 1;
}
.entry-block .entry-desc {
  font-size: 0.83rem;
  color: var(--c-text-dim);
  display: block;
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.5;
}
.entry-block .entry-date {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.entry-block .entry-arrow {
  color: var(--c-primary-light);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.entry-block:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-pale);
  transform: translateX(4px);
}
.entry-block:hover .entry-arrow { transform: translateX(4px); }

/* ─────────────────────────────────────────
   条目页
───────────────────────────────────────── */
.entry-top-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 28px 0 8px;
  align-items: center;
}
.entry-hero-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.entry-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.entry-type-badge {
  display: inline-block;
  background: var(--c-primary-pale);
  border: 1px solid var(--c-primary);
  color: var(--c-primary-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.entry-h1 {
  color: var(--c-text);
  margin-bottom: 12px;
}
.entry-lead {
  color: var(--c-text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 14px;
}
.entry-dates {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.pub-date, .mod-date {
  font-size: 0.8rem;
  color: var(--c-text-dim);
}

/* 同栏目推荐 */
.siblings-section { margin: 40px 0 24px; }
.siblings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.sibling-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, transform 0.2s;
}
.sibling-card strong { font-size: 0.92rem; color: var(--c-text); font-weight: 700; }
.sibling-card span { font-size: 0.8rem; color: var(--c-text-dim); line-height: 1.5; }
.sibling-card:hover { border-color: var(--c-accent); transform: translateY(-2px); }

.back-nav-section {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--c-text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.back-link:hover { border-color: var(--c-primary-light); color: var(--c-primary-light); }

/* ─────────────────────────────────────────
   关于页
───────────────────────────────────────── */
.about-header-section {
  position: relative;
  padding: 48px 0 32px;
  overflow: hidden;
}
.about-h1 { color: var(--c-text); margin-bottom: 12px; }
.about-lead { color: var(--c-text-muted); max-width: 580px; }
.about-blob {
  position: absolute;
  right: -20px;
  top: 0;
  width: 360px;
  opacity: 0.6;
  z-index: 0;
}
.about-blob svg { width: 100%; }
.about-header-section .about-h1,
.about-header-section .about-lead { position: relative; z-index: 1; }

.about-nav-section { margin: 40px 0; }
.about-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.about-nav-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, background 0.2s;
}
.about-nav-card strong { color: var(--c-text); font-size: 0.95rem; font-weight: 700; }
.about-nav-card span { color: var(--c-text-dim); font-size: 0.82rem; line-height: 1.5; }
.about-nav-card:hover { border-color: var(--c-accent); background: rgba(139,69,19,0.1); }

/* ─────────────────────────────────────────
   隐私政策页
───────────────────────────────────────── */
.privacy-header-section {
  padding: 48px 0 24px;
}
.privacy-h1 { color: var(--c-text); margin-bottom: 10px; }
.policy-date {
  display: block;
  font-size: 0.82rem;
  color: var(--c-text-dim);
  margin-bottom: 12px;
}
.privacy-lead { color: var(--c-text-muted); max-width: 600px; }
.privacy-footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ─────────────────────────────────────────
   页脚
───────────────────────────────────────── */
.site-footer {
  background: var(--c-surface2);
  border-top: 1px solid var(--c-border);
  margin-top: 40px;
}
.footer-cta {
  background: linear-gradient(120deg, var(--c-primary) 0%, var(--c-dark-mid) 100%);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.cta-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 0;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 30px;
  background: var(--c-accent);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.2s;
}
.cta-btn:hover { background: var(--c-accent-light); color: #fff; transform: scale(1.04); }

.footer-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 32px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-brand .brand-logo { width: 40px; height: 40px; border-radius: 8px; }
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--c-text);
}
.footer-brand p { font-size: 0.85rem; color: var(--c-text-dim); line-height: 1.6; }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links-heading {
  font-size: 0.8rem;
  color: var(--c-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.88rem;
  color: var(--c-text-muted);
  padding: 2px 0;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--c-primary-light); }

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--c-border);
  font-size: 0.8rem;
  color: var(--c-text-dim);
}
.footer-bar a { color: var(--c-text-dim); transition: color 0.2s; }
.footer-bar a:hover { color: var(--c-primary-light); }

/* ─────────────────────────────────────────
   动效
───────────────────────────────────────── */
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .entry-block,
  .scroll-reveal,
  .nav-cat-card,
  .child-card,
  .sibling-card {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ─────────────────────────────────────────
   移动端响应
───────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --gap: 16px; }
  .brand-row { padding: 12px 16px 8px; flex-wrap: wrap; }
  .brand-tagline { display: none; }
  .main-nav { padding: 4px 12px 8px; gap: 2px; }
  .main-nav > a { font-size: 0.78rem; padding: 5px 10px; min-height: 40px; }
  .wrap { padding: 0 16px 48px; }

  /* 首页 hero */
  .page-home .hero-section {
    min-height: 100vh;
    align-items: flex-start;
    text-align: left;
    padding: 80px 0 60px;
  }
  .hero-h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .hero-blob { width: 260px; right: -30px; opacity: 0.4; }

  /* 栏目页 */
  .cat-hero { padding: 32px 0 24px; }
  .cat-blob { width: 180px; opacity: 0.4; }

  /* 条目页 */
  .entry-top-section { grid-template-columns: 1fr; }
  .entry-hero-wrap { order: -1; }

  /* 卡片 */
  .entry-block { flex-wrap: wrap; gap: 12px; }
  .entry-block .entry-thumb { width: 60px; height: 42px; }
  .entry-block .entry-date { width: 100%; }

  /* 页脚 */
  .footer-body { grid-template-columns: 1fr; gap: 28px; padding: 28px 16px; }
  .footer-cta { padding: 28px 16px; }
  .footer-bar { padding: 14px 16px; gap: 12px; }

  .page-article { padding: 22px 18px; }

  .children-grid,
  .cat-nav-grid { grid-template-columns: 1fr 1fr; }
  .siblings-grid { grid-template-columns: 1fr 1fr; }
  .about-nav-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .children-grid,
  .cat-nav-grid,
  .siblings-grid,
  .about-nav-grid { grid-template-columns: 1fr; }
  .main-nav { gap: 1px; }
  .main-nav > a { font-size: 0.74rem; padding: 5px 8px; }
}
