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

/* ===== 变量 ===== */
:root {
  --c-bg: #f5e6c8;
  --c-accent: #d4a574;
  --c-ink: #262117;
  --c-ink-soft: #4a3c2a;
  --c-ink-muted: #7a6a52;
  --c-border: #c4956a;
  --c-card-bg: #fdf3e0;
  --c-shadow: rgba(38, 33, 23, 0.18);
  --c-hero-overlay: rgba(38, 33, 23, 0.45);
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --radius: 10px;
  --nav-h: 64px;
  --max-content: 860px;
  --max-wide: 1200px;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-ink); text-decoration: underline; text-decoration-color: var(--c-accent); }
a:hover { color: var(--c-accent); }
ul, ol { list-style: none; }

/* ===== 胶片纹理 grain ===== */
.film-wrap {
  position: relative;
}
.film-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23grain)' opacity='0.07'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.55;
  mix-blend-mode: multiply;
}
.grain-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(38,33,23,0.03) 0px,
    rgba(38,33,23,0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 2;
}
.vhs-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(245,230,200,0.08) 0%,
    transparent 40%,
    rgba(212,165,116,0.06) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 3;
  animation: vhs-track 8s linear infinite;
}
@keyframes vhs-track {
  0%   { transform: translateY(0) skewX(0deg); opacity: 1; }
  48%  { transform: translateY(0) skewX(0deg); opacity: 1; }
  50%  { transform: translateY(2px) skewX(0.3deg); opacity: 0.85; }
  52%  { transform: translateY(0) skewX(0deg); opacity: 1; }
  100% { transform: translateY(0) skewX(0deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .vhs-overlay { animation: none; }
  .film-wrap::before { display: none; }
}

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-ink);
  border-bottom: 2px solid var(--c-accent);
}
.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.top-nav {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 0;
}
.nav-left, .nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.nav-right { justify-content: flex-end; }
.nav-brand {
  flex: 0 0 auto;
  padding: 0 1.25rem;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--c-accent);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.brand-logo { height: 32px; width: auto; }
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.65rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--c-bg);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
  min-height: 40px;
  white-space: nowrap;
}
.nav-link:hover {
  background: var(--c-accent);
  color: var(--c-ink);
}

/* ===== Hero (首页) ===== */
.hero-wrap {
  position: relative;
  height: 100vh;
  min-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media .hero-img, .hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.35) contrast(1.05) saturate(0.82) brightness(0.88);
}
.hero-wrap .vhs-overlay,
.hero-wrap .grain-overlay { z-index: 2; }
.hero-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(38,33,23,0.72) 100%);
  z-index: 1;
}
.hero-text-block {
  position: relative;
  z-index: 4;
  text-align: right;
  padding: 3rem 3rem 4rem;
  max-width: 600px;
}
.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--c-bg);
  text-shadow: 0 2px 16px rgba(38,33,23,0.7);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--c-accent);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.2rem;
  background: var(--c-accent);
  color: var(--c-ink);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 48px;
  transition: background 0.18s, transform 0.18s;
  box-shadow: 0 4px 16px var(--c-shadow);
}
.hero-cta:hover {
  background: var(--c-bg);
  transform: translateY(-2px);
}

/* ===== 频道 Hero ===== */
.channel-hero {
  position: relative;
  background: var(--c-ink);
  overflow: hidden;
  padding: 5rem 2rem 3.5rem;
  border-bottom: 3px solid var(--c-accent);
}
.channel-hero-text {
  position: relative;
  z-index: 2;
  max-width: var(--max-wide);
  margin: 0 auto;
}
.channel-h1 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--c-accent);
  margin-bottom: 0.75rem;
}
.channel-desc {
  font-size: 1rem;
  color: var(--c-bg);
  max-width: 640px;
  line-height: 1.65;
}

/* ===== 主体布局 ===== */
.main-wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

/* ===== 文章区域 ===== */
.home-article,
.channel-article,
.article-body,
.about-article,
.privacy-article {
  min-width: 0;
}

/* ===== Section 标题 ===== */
.section-title {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}
.section-title + hr,
h2 + hr, h3 + hr {
  border: none;
  border-top: 2px solid var(--c-accent);
  margin-bottom: 1.5rem;
  opacity: 0.6;
}
hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 1.25rem 0;
  opacity: 0.5;
}

/* ===== 频道卡片列表 ===== */
.channel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 0;
}
.channel-card {
  background: var(--c-card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px var(--c-shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(212,165,116,0.25);
}
.channel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px var(--c-shadow);
}
.card-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  text-decoration: none;
  height: 100%;
}
.card-link:hover { color: inherit; }
.card-thumb, .card-thumb img {
  border-radius: 6px;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  filter: sepia(0.2) saturate(0.9);
  margin-bottom: 0.5rem;
}
.card-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--c-ink);
  line-height: 1.35;
}
.card-desc {
  font-size: 0.85rem;
  color: var(--c-ink-muted);
  line-height: 1.5;
}

/* ===== 文章列表 ===== */
.article-list, .child-list, .explore-list, .privacy-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
}
.article-item, .child-item {
  background: var(--c-card-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(212,165,116,0.2);
  box-shadow: 0 1px 6px var(--c-shadow);
  transition: transform 0.18s, box-shadow 0.18s;
  overflow: hidden;
}
.article-item:hover, .child-item:hover {
  transform: translateX(3px);
  box-shadow: 0 3px 14px var(--c-shadow);
}
.article-link, .child-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  text-decoration: none;
}
.article-link:hover, .child-link:hover { color: inherit; }
.article-title, .child-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--c-ink);
  flex: 1;
  line-height: 1.4;
}
.article-meta, .child-meta {
  font-size: 0.8rem;
  color: var(--c-ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.child-thumb, .child-thumb img {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  filter: sepia(0.15) saturate(0.9);
}
.child-list .child-link {
  flex-direction: row;
}

/* ===== 探索列表 / 隐私 ===== */
.explore-list li, .privacy-nav-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--c-card-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(212,165,116,0.2);
}
.explore-list a, .privacy-nav-list a {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--c-ink);
  flex: 1;
}
.explore-list small, .privacy-nav-list small {
  font-size: 0.8rem;
  color: var(--c-ink-muted);
}

/* ===== 文章页 ===== */
.article-h1, .about-h1, .privacy-h1 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.25;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.article-meta-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--c-ink-muted);
}
.date-pub, .date-mod {
  font-family: var(--font-body);
}
.article-hero-wrap {
  margin-bottom: 2rem;
}
.polaroid {
  background: #fff;
  padding: 0.75rem 0.75rem 2.5rem;
  box-shadow: 0 4px 20px var(--c-shadow), 0 1px 4px rgba(0,0,0,0.12);
  border-radius: 4px;
  transform: rotate(-0.8deg);
  transition: transform 0.25s;
  display: inline-block;
  max-width: 100%;
}
.polaroid:hover { transform: rotate(0deg) scale(1.01); }
.article-hero-img, .article-hero-img img {
  width: 100%;
  border-radius: 2px;
  filter: sepia(0.25) contrast(1.05) saturate(0.85);
}

/* ===== 文章内容富文本 ===== */
.article-content-section h2,
.about-content-section h2,
.privacy-content-section h2,
.channel-intro-section h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-ink);
  margin-top: 2rem;
  margin-bottom: 0.4rem;
}
.article-content-section h2 + hr,
.about-content-section h2 + hr,
.privacy-content-section h2 + hr,
.channel-intro-section h2 + hr {
  margin-bottom: 0.75rem;
}
.article-content-section h3,
.about-content-section h3,
.privacy-content-section h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-ink-soft);
  margin-top: 1.5rem;
  margin-bottom: 0.35rem;
}
.article-content-section p,
.about-content-section p,
.privacy-content-section p,
.channel-intro-section p,
.home-content-section p {
  margin-bottom: 1.15rem;
  line-height: 1.75;
  color: var(--c-ink-soft);
}
.article-content-section ul,
.article-content-section ol,
.about-content-section ul,
.privacy-content-section ul,
.privacy-content-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  list-style: disc;
}
.article-content-section ol,
.privacy-content-section ol { list-style: decimal; }
.article-content-section li,
.about-content-section li,
.privacy-content-section li { margin-bottom: 0.4rem; line-height: 1.65; }

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--c-ink-muted);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--c-ink-muted); text-decoration: underline; }
.breadcrumb span[aria-hidden] { color: var(--c-border); }

/* ===== 侧边栏 ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}
.sidebar-block {
  background: var(--c-card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid rgba(212,165,116,0.25);
  box-shadow: 0 2px 10px var(--c-shadow);
}
.sidebar-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--c-ink);
  margin-bottom: 0.5rem;
}
.sidebar-title + hr {
  margin-bottom: 0.85rem;
  opacity: 0.5;
}
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-links li a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font-head);
  text-decoration: none;
  color: var(--c-ink-soft);
  transition: background 0.15s, color 0.15s;
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}
.sidebar-links li a:hover {
  background: rgba(212,165,116,0.18);
  color: var(--c-ink);
}

/* ===== 关于页 ===== */
.about-head-section {
  padding: 2rem 0 1rem;
}
.about-lead {
  font-size: 1.05rem;
  color: var(--c-ink-soft);
  line-height: 1.7;
  margin-top: 0.75rem;
}
.about-channel-list {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.about-channel-card .card-link {
  min-height: 80px;
}

/* ===== 隐私页 ===== */
.privacy-head-section {
  padding: 2rem 0 1rem;
}
.privacy-date {
  font-size: 0.85rem;
  color: var(--c-ink-muted);
  margin-bottom: 0.75rem;
}
.privacy-lead {
  font-size: 1rem;
  color: var(--c-ink-soft);
  line-height: 1.7;
}

/* ===== 首页内容区 ===== */
.home-content-section {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(212,165,116,0.2);
  margin-bottom: 2rem;
}
.home-channels {
  margin-bottom: 2.5rem;
}
.home-latest {
  margin-bottom: 2rem;
}
.channel-intro-section {
  padding: 1rem 0;
  margin-bottom: 2rem;
}
.channel-children {
  margin-bottom: 2rem;
}
.child-list-section {
  padding-top: 0;
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-ink);
  color: var(--c-bg);
  border-top: 3px solid var(--c-accent);
  padding: 2.5rem 1.5rem 1.5rem;
}
.footer-nav {
  max-width: var(--max-wide);
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.footer-dl {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-dl-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: none;
}
.footer-dl dd a {
  color: rgba(245,230,200,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s;
  display: inline-block;
  padding: 0.2rem 0;
  min-height: 32px;
  line-height: 1.4;
}
.footer-dl dd a:hover { color: var(--c-accent); }
.footer-bar {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(212,165,116,0.2);
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 0.82rem;
  color: rgba(245,230,200,0.5);
}
.footer-links {
  display: flex;
  gap: 1.25rem;
}
.footer-links a {
  font-size: 0.82rem;
  color: rgba(245,230,200,0.55);
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.footer-links a:hover { color: var(--c-accent); }

/* ===== 页脚内导航（dl结构要求）===== */
.footer-nav nav dl {
  /* 支持footer内nav>dl>dt/dd>a 抽签结构 */
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ===== Scroll Reveal 动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .main-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .sidebar {
    position: static;
  }
  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .header-inner { padding: 0 1rem; }
  .top-nav { gap: 0; height: auto; flex-wrap: wrap; padding: 0.4rem 0; }
  .nav-left, .nav-right {
    flex: 1 1 100%;
    justify-content: center;
    order: 2;
  }
  .nav-brand { order: 1; flex: 1 1 100%; justify-content: center; display: flex; padding: 0.5rem 0; }
  .nav-link { font-size: 0.8rem; padding: 0.5rem 0.55rem; min-height: 40px; }
  .hero-text-block { padding: 2rem 1.25rem 3rem; text-align: right; }
  .hero-h1 { font-size: 1.75rem; }
  .channel-list { grid-template-columns: 1fr 1fr; }
  .footer-nav { grid-template-columns: 1fr; gap: 1.5rem; }
  .main-wrap { padding: 1.5rem 1rem; }
  .article-link, .child-link { flex-direction: column; align-items: flex-start; }
  .child-thumb { width: 100%; height: 140px; }
  .footer-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .polaroid { transform: none; }
}
@media (max-width: 400px) {
  .channel-list { grid-template-columns: 1fr; }
  .hero-h1 { font-size: 1.5rem; }
  .top-nav { flex-direction: column; }
}
