@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-mint:      #5cc6b0;
  --c-sand:      #d4c4a8;
  --c-dark:      #172623;
  --c-dark-80:   rgba(23,38,35,0.80);
  --c-dark-50:   rgba(23,38,35,0.50);
  --c-dark-10:   rgba(23,38,35,0.10);
  --c-sand-60:   rgba(212,196,168,0.60);
  --c-mint-20:   rgba(92,198,176,0.20);
  --c-mint-40:   rgba(92,198,176,0.40);
  --c-bg:        #ede6d9;
  --c-surface:   rgba(255,252,245,0.55);
  --c-text:      #1e3330;
  --c-text-mute: #4a5e59;
  --c-link:      #2a7a6b;
  --c-link-hov:  #1e5c51;
  --r-card:      18px;
  --r-sm:        10px;
  --sidenav-w:   220px;
  --font-main:   'Lexend', 'Source Sans 3', system-ui, sans-serif;
  --shadow-soft: 0 4px 24px rgba(23,38,35,0.12), 0 1px 4px rgba(23,38,35,0.08);
  --shadow-card: 0 8px 32px rgba(23,38,35,0.14);
  --transition:  0.25s ease-out;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 有机纹理覆盖层 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

a {
  color: var(--c-link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--c-link-hov); text-decoration: underline; }

img { display: block; max-width: 100%; height: auto; }

/* ─── 侧边导航 ─── */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidenav-w);
  height: 100vh;
  background: var(--c-dark);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 24px;
}

.sidenav__brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(92,198,176,0.18);
}

.sidenav__brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--c-mint-20);
  overflow: hidden;
  transition: background var(--transition);
}
.sidenav__brand-link:hover { background: var(--c-mint-40); text-decoration: none; }

.sidenav__logo-img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }

.sidenav__logo-text {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--c-mint);
  letter-spacing: 0.02em;
}

.sidenav__links {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}

.sidenav__link {
  display: block;
  padding: 11px 18px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--c-sand);
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  line-height: 1.4;
  min-height: 42px;
  display: flex;
  align-items: center;
}
.sidenav__link:hover {
  background: var(--c-mint-20);
  border-left-color: var(--c-mint);
  color: #fff;
  text-decoration: none;
}
.sidenav__link--active {
  background: var(--c-mint-20);
  border-left-color: var(--c-mint);
  color: var(--c-mint);
  font-weight: 600;
}

.sidenav__contact {
  padding: 12px 16px 4px;
  border-top: 1px solid rgba(92,198,176,0.12);
}
.sidenav__contact-link {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  font-size: 0.8rem;
  color: var(--c-sand);
  opacity: 0.7;
  min-height: 40px;
  transition: opacity var(--transition);
}
.sidenav__contact-link:hover { opacity: 1; text-decoration: none; }

/* ─── 页面主体 ─── */
.layout-home,
.layout-topic,
.layout-article,
.layout-about,
.layout-privacy {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.page-body {
  margin-left: var(--sidenav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

main { flex: 1; }

/* ─── 内容区块 ─── */
.content-section {
  padding: 36px 40px;
  max-width: 960px;
  width: 100%;
}

/* ─── 面包屑 ─── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--c-text-mute);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--c-link); }
.breadcrumb__sep { margin: 0 2px; opacity: 0.5; }

/* ─── 通用标题 ─── */
.page-h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.page-lead {
  font-size: 1.05rem;
  color: var(--c-text-mute);
  max-width: 640px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.section-heading {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--c-dark);
  margin-bottom: 6px;
}

.section-sub {
  font-size: 0.95rem;
  color: var(--c-text-mute);
  margin-bottom: 24px;
}

/* subtitle 通用 */
.subtitle {
  color: var(--c-text-mute);
  line-height: 1.6;
}

/* ─── Hero（首页）─── */
.hero-section {
  padding: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.hero__collage {
  position: relative;
  height: 45vh;
  min-height: 280px;
  max-height: 520px;
  overflow: hidden;
  background: var(--c-dark);
  display: flex;
  align-items: flex-end;
}

.hero__img,
.hero__img-placeholder {
  position: absolute;
  object-fit: cover;
}

.hero__img--1,
.hero__img-placeholder:first-child {
  width: 58%;
  height: 90%;
  top: 0;
  left: 0;
  border-radius: 0 var(--r-card) var(--r-card) 0;
}

.hero__img--2,
.hero__img-placeholder:last-of-type {
  width: 46%;
  height: 78%;
  bottom: 0;
  right: 0;
  border-radius: var(--r-card) 0 0 var(--r-card);
  opacity: 0.88;
}

.hero__img-placeholder {
  background: linear-gradient(135deg, var(--c-mint-20), var(--c-sand-60));
}

.hero__badge {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-mint);
  color: var(--c-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(92,198,176,0.35);
  z-index: 2;
}

.hero__copy {
  padding: 28px 40px 20px;
  max-width: 720px;
}

.hero__h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.hero__lead {
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* ─── 首页正文区 ─── */
.home-content-section { padding-top: 8px; }

/* ─── 首页 Topic 卡片 ─── */
.home-topics-section {
  padding: 24px 40px 40px;
  max-width: 1080px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.topic-card {
  background: var(--c-surface);
  border-radius: var(--r-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212,196,168,0.45);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(23,38,35,0.18);
}

.topic-card__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  color: var(--c-text);
  text-decoration: none;
}
.topic-card__link:hover { text-decoration: none; color: var(--c-text); }

.topic-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-dark);
  line-height: 1.3;
}

.topic-card__desc {
  font-size: 0.875rem;
  color: var(--c-text-mute);
  line-height: 1.5;
  flex: 1;
}

.topic-card__arrow {
  font-size: 1rem;
  color: var(--c-mint);
  align-self: flex-end;
  transition: transform var(--transition);
}
.topic-card:hover .topic-card__arrow { transform: translateX(4px); }

/* ─── 玻璃拟态通用 ─── */
.glass-card {
  background: var(--c-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212,196,168,0.40);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

/* ─── 内容 + 侧边栏布局 ─── */
.content-with-aside {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.content-aside {
  flex: 0 0 200px;
  position: sticky;
  top: 24px;
  background: var(--c-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212,196,168,0.40);
  border-radius: var(--r-card);
  padding: 20px 16px;
  box-shadow: var(--shadow-soft);
}

.aside__heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-dark);
  margin-bottom: 4px;
}

.aside__sub {
  font-size: 0.78rem;
  margin-bottom: 14px;
  display: block;
}

.aside__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aside__link {
  display: block;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--c-link);
  border-radius: var(--r-sm);
  transition: background var(--transition), color var(--transition);
  line-height: 1.35;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.aside__link:hover {
  background: var(--c-mint-20);
  color: var(--c-dark);
  text-decoration: none;
}

.aside__back {
  display: block;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--c-mint);
  padding: 8px 0;
  border-top: 1px solid var(--c-dark-10);
}
.aside__back:hover { text-decoration: underline; }

.prose {
  flex: 1;
  min-width: 0;
  max-width: 680px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
}

/* ─── 正文排版 ─── */
.prose h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2em 0 0.5em;
  color: var(--c-dark);
  border-left: 4px solid var(--c-mint);
  padding-left: 12px;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5em 0 0.4em;
  color: var(--c-dark);
}

.prose p { margin-bottom: 1em; }

.prose ul, .prose ol {
  margin: 0.8em 0 1em 1.4em;
}
.prose li { margin-bottom: 0.3em; }

.prose a { color: var(--c-link); }
.prose a:hover { color: var(--c-link-hov); }

.prose strong { font-weight: 600; color: var(--c-dark); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.9rem;
}
.prose th {
  background: var(--c-dark);
  color: var(--c-sand);
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
}
.prose td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--c-dark-10);
}
.prose tr:nth-child(even) td { background: rgba(212,196,168,0.15); }

.prose blockquote {
  border-left: 3px solid var(--c-mint);
  margin: 1em 0;
  padding: 10px 16px;
  background: var(--c-mint-20);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--c-text-mute);
  font-style: italic;
}

.prose img {
  border-radius: var(--r-sm);
  margin: 1em 0;
  box-shadow: var(--shadow-soft);
}

/* ─── 文章元信息 ─── */
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--c-text-mute);
}
.article-meta__date,
.article-meta__mod {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─── 文章 Hero 图 ─── */
.article-hero {
  margin-bottom: 20px;
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.article-hero__img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

/* ─── 栏目子页列表 ─── */
.topic-children-section {
  padding: 20px 40px 48px;
  max-width: 960px;
}

.child-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(212,196,168,0.40);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--c-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.child-list__term {
  padding: 14px 20px 4px;
  background: transparent;
}
.child-list__term + dd { border-bottom: 1px solid var(--c-dark-10); }

.child-list__link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-link);
  display: block;
  transition: color var(--transition);
}
.child-list__link:hover { color: var(--c-mint); text-decoration: none; }

.child-list__desc {
  padding: 4px 20px 14px;
  font-size: 0.875rem;
  color: var(--c-text-mute);
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-list__date {
  font-size: 0.78rem;
  color: var(--c-mint);
  white-space: nowrap;
}

/* ─── 关于页 ─── */
.about-links-section {
  padding: 8px 40px 48px;
  max-width: 960px;
}

.about-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.about-link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  color: var(--c-text);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.about-link-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--c-text);
}

.about-link-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-dark);
}
.about-link-card__desc {
  font-size: 0.8rem;
  color: var(--c-text-mute);
  line-height: 1.45;
}

/* ─── 页脚 ─── */
.site-footer {
  margin-top: auto;
  padding: 24px 40px 28px;
  border-top: 1px solid rgba(212,196,168,0.40);
  text-align: center;
  background: rgba(23,38,35,0.04);
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--c-text-mute);
  margin-bottom: 6px;
}

.footer__note {
  font-size: 0.78rem;
  color: var(--c-text-mute);
  opacity: 0.75;
}
.footer__note a {
  color: var(--c-link);
  transition: color var(--transition);
}
.footer__note a:hover { color: var(--c-link-hov); }

/* ─── Topic Hero ─── */
.topic-hero-section {
  background: linear-gradient(135deg, rgba(92,198,176,0.08) 0%, transparent 60%);
  border-bottom: 1px solid rgba(212,196,168,0.30);
  border-radius: 0 0 var(--r-card) var(--r-card);
}

/* ─── 动效 ─── */
@media (prefers-reduced-motion: no-preference) {
  .topic-card {
    animation: fadeUp 0.4s ease-out both;
  }
  .topic-card:nth-child(2) { animation-delay: 0.06s; }
  .topic-card:nth-child(3) { animation-delay: 0.12s; }
  .topic-card:nth-child(4) { animation-delay: 0.18s; }
  .topic-card:nth-child(5) { animation-delay: 0.24s; }
  .topic-card:nth-child(6) { animation-delay: 0.30s; }

  .child-list__term {
    animation: fadeUp 0.35s ease-out both;
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .hero__img--1 { animation: heroSlide1 0.8s ease-out both; }
  .hero__img--2 { animation: heroSlide2 0.8s 0.15s ease-out both; }

  @keyframes heroSlide1 {
    from { opacity: 0; transform: translateX(-18px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  @keyframes heroSlide2 {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 0.88; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── 响应式：平板 ─── */
@media (max-width: 900px) {
  :root { --sidenav-w: 56px; }

  .sidenav__links { padding: 8px 0; }
  .sidenav__link {
    padding: 12px;
    font-size: 0;
    justify-content: center;
    overflow: hidden;
    min-height: 44px;
  }
  .sidenav__contact-link { font-size: 0; justify-content: center; }
  .sidenav__brand-link { margin: 0 auto; }

  .content-section { padding: 24px 24px; }
  .home-topics-section { padding: 20px 24px 36px; }
  .topic-children-section { padding: 20px 24px 36px; }
  .about-links-section { padding: 8px 24px 36px; }
  .hero__copy { padding: 20px 24px 16px; }

  .content-with-aside { flex-direction: column; }
  .content-aside {
    flex: none;
    width: 100%;
    position: static;
  }
}

/* ─── 响应式：手机 ─── */
@media (max-width: 600px) {
  :root { --sidenav-w: 0px; }

  .sidenav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    z-index: 200;
    border-top: 1px solid rgba(92,198,176,0.20);
  }

  .sidenav__brand { padding: 10px 12px; border-bottom: none; border-right: 1px solid rgba(92,198,176,0.15); }
  .sidenav__brand-link { width: 40px; height: 40px; }

  .sidenav__links {
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
    padding: 0;
    align-items: stretch;
  }

  .sidenav__link {
    padding: 10px 12px;
    font-size: 0.7rem;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    min-height: 44px;
    flex-direction: column;
    gap: 2px;
    text-align: center;
    align-items: center;
    justify-content: center;
  }
  .sidenav__link--active {
    border-left: none;
    border-bottom-color: var(--c-mint);
  }

  .sidenav__contact { padding: 0 8px; border-top: none; border-left: 1px solid rgba(92,198,176,0.15); }
  .sidenav__contact-link { font-size: 0.7rem; white-space: nowrap; min-height: 44px; }

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

  .content-section { padding: 20px 16px; }
  .home-topics-section { padding: 16px 16px 28px; }
  .topic-children-section { padding: 16px 16px 28px; }
  .about-links-section { padding: 8px 16px 28px; }
  .hero__copy { padding: 16px 16px 12px; }

  .hero__collage { height: 38vh; min-height: 200px; }

  .topic-grid { grid-template-columns: 1fr; }
  .about-links-grid { grid-template-columns: 1fr; }

  .site-footer { padding: 20px 16px 24px; }
}

/* ─── 可访问性 ─── */
:focus-visible {
  outline: 2px solid var(--c-mint);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── 滚动条美化 ─── */
.sidenav::-webkit-scrollbar { width: 4px; }
.sidenav::-webkit-scrollbar-track { background: transparent; }
.sidenav::-webkit-scrollbar-thumb { background: rgba(92,198,176,0.25); border-radius: 2px; }
