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

/* ===== 变量 ===== */
:root {
  --c-dark: #1a1a2e;
  --c-gold: #e0a800;
  --c-light: #f5f5f5;
  --c-dark-80: rgba(26,26,46,0.85);
  --c-dark-60: rgba(26,26,46,0.6);
  --c-gold-light: #f0c030;
  --c-text: #1a1a2e;
  --c-text-muted: #555568;
  --c-border: #d0d0e0;
  --c-bg: #f8f8fc;
  --c-card-bg: #ffffff;
  --nav-h: 64px;
  --radius: 18px;
  --max-w: 1160px;
  --prose-w: 740px;
  --font-main: 'Figtree', 'Noto Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Noto Sans', 'Figtree', system-ui, -apple-system, sans-serif;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-dark); text-decoration: none; }
a:hover { color: var(--c-gold); }
ul { list-style: none; }
button, input, select, textarea { font: inherit; }

/* ===== 导航 ===== */
.site-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-dark);
  border-bottom: 2px solid var(--c-gold);
  min-height: var(--nav-h);
}

details#site-nav {
  width: 100%;
}

details#site-nav > summary {
  list-style: none;
  cursor: default;
}
details#site-nav > summary::-webkit-details-marker { display: none; }

.nav-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.5rem;
  min-height: var(--nav-h);
  max-width: var(--max-w);
  margin: 0 auto;
}

.nav-brand {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--c-gold) !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.nav-brand:hover { color: var(--c-gold-light) !important; }

.nav-left-links,
.nav-right-links {
  flex: 1;
}
.nav-left-links { text-align: right; }
.nav-right-links { text-align: left; }

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  align-items: center;
}
.nav-left-links .nav-menu { justify-content: flex-end; }
.nav-right-links .nav-menu { justify-content: flex-start; }

.nav-menu li a {
  color: var(--c-light);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  display: block;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-menu li a:hover {
  color: var(--c-gold);
  background: rgba(224,168,0,0.08);
}

.nav-search { flex-shrink: 0; }
.search-form {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid rgba(224,168,0,0.4);
  border-radius: 8px;
  overflow: hidden;
}
.search-form input[type="search"] {
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--c-light);
  padding: 0.45rem 0.75rem;
  width: 140px;
  min-height: 40px;
  outline: none;
}
.search-form input::placeholder { color: rgba(245,245,245,0.4); }
.search-form button {
  background: var(--c-gold);
  border: none;
  color: var(--c-dark);
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  min-height: 40px;
  cursor: pointer;
  transition: background 0.2s;
}
.search-form button:hover { background: var(--c-gold-light); }

/* ===== Hero（首页） ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--c-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  will-change: transform;
}

.hero-slant {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 90px;
  background: var(--c-bg);
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 4rem 1.5rem 6rem;
  max-width: 760px;
  margin: 0 auto;
}

.hero-h1 {
  font-family: var(--font-main);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(245,245,245,0.82);
  margin-bottom: 2rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-block;
  background: var(--c-gold);
  color: var(--c-dark);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  transition: background 0.2s, transform 0.2s;
  min-height: 48px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.hero-cta:hover {
  background: var(--c-gold-light);
  color: var(--c-dark);
  transform: translateY(-2px);
}

/* ===== Banner（内页通用） ===== */
.page-banner {
  position: relative;
  background: var(--c-dark);
  min-height: 220px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.banner-slant {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--c-bg);
  clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
  z-index: 2;
}

.banner-slant-bottom {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--c-bg);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
  z-index: 2;
}

.banner-content {
  position: relative;
  z-index: 3;
  padding: 3rem 1.5rem 4.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.banner-h1 {
  font-family: var(--font-main);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.banner-desc {
  color: rgba(245,245,245,0.78);
  font-size: 1rem;
  max-width: 600px;
}

/* 文章 Banner */
.article-banner {
  position: relative;
  background: var(--c-dark);
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.article-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
}
.article-banner-overlay {
  position: relative;
  z-index: 3;
  width: 100%;
}
.article-banner-content {
  padding: 2.5rem 1.5rem 4rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.article-h1 {
  font-family: var(--font-main);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.article-meta time {
  color: var(--c-gold);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.83rem;
  color: rgba(245,245,245,0.6);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: rgba(245,245,245,0.75); }
.breadcrumb a:hover { color: var(--c-gold); }
.breadcrumb span { color: rgba(245,245,245,0.6); }

/* ===== 布局 ===== */
.layout-with-aside {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  max-width: var(--max-w);
  margin: 2rem auto;
  padding: 0 1.5rem;
  align-items: start;
}

.main-col { min-width: 0; }

/* ===== 正文容器（契约：main > article.wrap > div > section） ===== */
main .wrap {
  width: 100%;
}

.content-section {
  background: var(--c-card-bg);
  border-radius: var(--radius);
  border: 1.5px solid var(--c-border);
  overflow: hidden;
  margin-bottom: 2rem;
}

.page-content {
  padding: 2rem 2.5rem;
}

/* ===== Prose ===== */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
}
.prose h2 {
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-dark);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--c-gold);
}
.prose h3 {
  font-family: var(--font-main);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--c-dark);
  margin: 1.5rem 0 0.5rem;
}
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.prose li { margin-bottom: 0.35rem; }
.prose a { color: var(--c-dark); border-bottom: 1px solid var(--c-gold); }
.prose a:hover { color: var(--c-gold); }
.prose strong { font-weight: 700; color: var(--c-dark); }
.prose blockquote {
  border-left: 4px solid var(--c-gold);
  padding: 0.75rem 1.25rem;
  background: rgba(224,168,0,0.06);
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  color: var(--c-text-muted);
}
.prose img {
  border-radius: 10px;
  margin: 1.25rem 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}
.prose th, .prose td {
  border: 1px solid var(--c-border);
  padding: 0.6rem 0.85rem;
  text-align: left;
}
.prose th {
  background: var(--c-dark);
  color: #fff;
  font-weight: 600;
}
.prose tr:nth-child(even) td { background: rgba(224,168,0,0.04); }

/* ===== 区块标题 ===== */
.section-heading {
  font-family: var(--font-main);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-heading > span {
  position: relative;
}
.section-heading > span::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--c-gold);
  border-radius: 2px;
  margin-top: 3px;
}

/* ===== Sections ===== */
.section-inner,
.children-section,
.channels-section,
.articles-section,
.tags-section,
.about-channels {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

.channels-section,
.articles-section {
  padding-top: 0.5rem;
}

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

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* 子页卡片（契约：a > strong/span） */
.child-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.35rem 1.5rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-card-bg);
  color: var(--c-text);
  transition: border-color 0.2s, transform 0.2s;
}
.child-card:hover {
  border-color: var(--c-gold);
  transform: translateY(-3px);
  color: var(--c-text);
}
.child-card .card-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.35rem 1.5rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-card-bg);
  color: var(--c-text);
  transition: border-color 0.2s, transform 0.2s;
}
.article-card:hover {
  border-color: var(--c-gold);
  transform: translateY(-3px);
  color: var(--c-text);
}

.card-title {
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.4;
  display: block;
}
.card-desc {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.55;
  display: block;
}
.card-date {
  font-size: 0.8rem;
  color: var(--c-gold);
  font-weight: 500;
  margin-top: auto;
  padding-top: 0.5rem;
  display: block;
}

/* 频道块 */
.channel-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.15rem 1.25rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-card-bg);
  color: var(--c-text);
  transition: border-color 0.2s, background 0.2s;
}
.channel-block:hover {
  border-color: var(--c-gold);
  background: rgba(224,168,0,0.04);
  color: var(--c-text);
}
.channel-block strong {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-dark);
}
.channel-block span {
  font-size: 0.83rem;
  color: var(--c-text-muted);
}

/* ===== 标签 ===== */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tag-pill {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--c-gold);
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-dark);
  background: transparent;
  transition: background 0.2s, color 0.2s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.tag-pill:hover {
  background: var(--c-gold);
  color: var(--c-dark);
}
.tags-cloud.small .tag-pill {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
}

/* ===== Aside ===== */
.content-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}
.aside-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.aside-section {
  background: var(--c-card-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}
.aside-title {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.aside-title > span {
  border-left: 3px solid var(--c-gold);
  padding-left: 0.6rem;
  display: block;
}
.aside-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.aside-links li a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--c-text);
  transition: background 0.15s, color 0.15s;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.aside-links li a:hover {
  background: rgba(224,168,0,0.1);
  color: var(--c-gold);
}
.aside-text {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* 首页 aside */
.home-aside {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}
.home-aside .aside-inner {
  background: var(--c-card-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}
.home-aside .aside-title {
  width: 100%;
  font-size: 1.1rem;
}
.home-aside .aside-links {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.home-aside .aside-links li a {
  border: 1.5px solid var(--c-border);
  border-radius: 50px;
  padding: 0.45rem 1.1rem;
  font-size: 0.88rem;
}

/* ===== 元数据 ===== */
.meta-date {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
}
.meta-date time { color: var(--c-gold); font-weight: 600; }
.pub-date, .mod-date { font-size: 0.85rem; }

/* ===== 页脚（契约：footer 只有 p + small） ===== */
.site-footer {
  background: var(--c-dark);
  border-top: 2px solid var(--c-gold);
  padding: 2rem 1.5rem;
  text-align: center;
}
.footer-brand {
  color: var(--c-gold);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.footer-copy {
  color: rgba(245,245,245,0.55);
  font-size: 0.82rem;
  line-height: 1.6;
  display: block;
}
.footer-copy a {
  color: rgba(245,245,245,0.7);
  border-bottom: 1px solid rgba(224,168,0,0.4);
}
.footer-copy a:hover { color: var(--c-gold); }

/* ===== Scroll Reveal 动效 ===== */
.reveal-section {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.children-grid .child-card,
.articles-grid .article-card,
.channels-grid .channel-block {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.2s, background 0.2s;
}
.is-visible .child-card,
.is-visible .article-card,
.is-visible .channel-block {
  opacity: 1;
  transform: translateY(0);
}

/* stagger delay */
.children-grid .child-card:nth-child(1),
.articles-grid .article-card:nth-child(1),
.channels-grid .channel-block:nth-child(1) { transition-delay: 0.05s; }
.children-grid .child-card:nth-child(2),
.articles-grid .article-card:nth-child(2),
.channels-grid .channel-block:nth-child(2) { transition-delay: 0.1s; }
.children-grid .child-card:nth-child(3),
.articles-grid .article-card:nth-child(3),
.channels-grid .channel-block:nth-child(3) { transition-delay: 0.15s; }
.children-grid .child-card:nth-child(4),
.articles-grid .article-card:nth-child(4),
.channels-grid .channel-block:nth-child(4) { transition-delay: 0.2s; }
.children-grid .child-card:nth-child(5),
.articles-grid .article-card:nth-child(5),
.channels-grid .channel-block:nth-child(5) { transition-delay: 0.25s; }
.children-grid .child-card:nth-child(6),
.articles-grid .article-card:nth-child(6),
.channels-grid .channel-block:nth-child(6) { transition-delay: 0.3s; }

/* ===== Parallax Hero ===== */
@supports (animation-timeline: scroll()) {
  .hero-img {
    animation: heroParallax linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 60vh;
  }
  @keyframes heroParallax {
    from { transform: translateY(0); }
    to { transform: translateY(40px); }
  }
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .reveal-section,
  .children-grid .child-card,
  .articles-grid .article-card,
  .channels-grid .channel-block {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-img { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ===== 辅助 ===== */
.no-content {
  color: var(--c-text-muted);
  font-size: 0.95rem;
  padding: 1rem 0;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .layout-with-aside {
    grid-template-columns: 1fr;
  }
  .content-aside {
    position: static;
  }
}

@media (max-width: 720px) {
  .nav-summary {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    gap: 0.4rem;
  }
  .nav-left-links,
  .nav-right-links {
    flex: 0 0 100%;
    text-align: center;
  }
  .nav-left-links .nav-menu,
  .nav-right-links .nav-menu {
    justify-content: center;
  }
  .nav-brand {
    order: -1;
    width: 100%;
    justify-content: center;
  }
  .nav-search {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .search-form input[type="search"] { width: 100%; }
  .search-form { width: 100%; max-width: 340px; }

  .hero-section { min-height: 60vh; }
  .hero-content { padding: 2.5rem 1rem 5rem; }

  .page-content { padding: 1.25rem 1rem; }

  .children-grid,
  .articles-grid { grid-template-columns: 1fr; }
  .channels-grid { grid-template-columns: 1fr 1fr; }

  .home-aside .aside-inner { flex-direction: column; padding: 1rem; }
}

@media (max-width: 480px) {
  .channels-grid { grid-template-columns: 1fr; }
  .banner-content { padding: 2rem 1rem 3.5rem; }
  .article-banner-content { padding: 1.5rem 1rem 3rem; }
  .section-inner,
  .children-section,
  .channels-section,
  .articles-section,
  .tags-section,
  .about-channels {
    padding: 0 1rem;
  }
  .layout-with-aside { padding: 0 1rem; }
}
