@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Merriweather:wght@300;400;700&display=swap');

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

html {
  scroll-behavior: smooth;
  scroll-padding-bottom: 64px;
  font-size: 17px;
  background: #fdfbf7;
  color: #1a1a1a;
}

body {
  font-family: 'Merriweather', 'Noto Serif SC', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.8;
  background: #fdfbf7;
  color: #1a1a1a;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 纸质噪点纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  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%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

/* ===== 排版基础 ===== */
h1, h2, h3, h4, h5 {
  font-family: 'Abril Fatface', 'Georgia', serif;
  line-height: 1.2;
  color: #1a1a1a;
  font-weight: 400;
}

h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.7rem); }

p { line-height: 1.85; margin-bottom: 1.2em; }

a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: none;
}
a:hover { text-decoration: none; }

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

ol, ul { list-style: none; }

/* ===== 全站包装 ===== */
.site-wrapper {
  position: relative;
  z-index: 1;
}

/* ===== 底部固定导航条 ===== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: #1a1a1a;
  border-top: 1px solid #333;
  height: 56px;
}

.bottom-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 8px;
}

.brand-text {
  font-family: 'Abril Fatface', serif;
  font-size: 1.1rem;
  color: #fdfbf7;
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-toggle,
.hamburger {
  background: none;
  border: 1px solid #555;
  color: #fdfbf7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  flex-direction: column;
  gap: 4px;
  transition: none;
}

.search-toggle:hover,
.hamburger:hover {
  background: #333;
  border-color: #888;
}

.search-icon {
  font-size: 1rem;
  line-height: 1;
  color: #fdfbf7;
}

.hb-line {
  display: block;
  width: 18px;
  height: 2px;
  background: #fdfbf7;
}

/* ===== 全屏遮罩导航 ===== */
.fullscreen-nav {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  visibility: hidden;
  transition: none;
}

.fullscreen-nav.is-open {
  transform: translateY(0);
  visibility: visible;
}

.nav-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: 1px solid #555;
  color: #fdfbf7;
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-close:hover {
  background: #333;
}

.main-nav ol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  counter-reset: nav-counter;
}

.main-nav ol > li {
  counter-increment: nav-counter;
  border-bottom: 1px solid #333;
  width: 320px;
}

.main-nav ol > li:first-child {
  border-top: 1px solid #333;
}

.nav-mask-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  text-decoration: none;
  color: #fdfbf7;
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  min-height: 56px;
  transition: none;
}

.nav-mask-link::before {
  content: counter(nav-counter, decimal-leading-zero);
  font-family: 'Abril Fatface', serif;
  font-size: 0.75rem;
  color: #666;
  margin-right: 16px;
  min-width: 28px;
}

.nav-mask-link:hover {
  color: #c8b89a;
  text-decoration: none;
}

.nav-brand-footer {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Abril Fatface', serif;
  font-size: 0.85rem;
  color: #555;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===== 搜索遮罩 ===== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 960;
  background: rgba(26,26,26,0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: none;
}

.search-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.search-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: 1px solid #555;
  color: #fdfbf7;
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(480px, 90vw);
}

.search-label {
  font-family: 'Merriweather', serif;
  font-size: 0.85rem;
  color: #888;
  letter-spacing: 0.06em;
}

.search-input {
  background: none;
  border: none;
  border-bottom: 2px solid #fdfbf7;
  color: #fdfbf7;
  font-family: 'Merriweather', serif;
  font-size: 1.4rem;
  padding: 12px 0;
  outline: none;
  width: 100%;
  caret-color: #fdfbf7;
}

.search-input::placeholder { color: #555; }

/* ===== Hero ===== */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,26,26,0.55);
}

.hero-noise {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

/* 当无 hero 图时给一个纸色底 */
.hero-section:not(:has(.hero-img)) {
  background: #1a1a1a;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 760px;
}

.hero-badge {
  display: inline-block;
  border: 1px solid rgba(253,251,247,0.5);
  color: #fdfbf7;
  font-family: 'Merriweather', serif;
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  padding: 6px 16px;
  margin-bottom: 24px;
}

.hero-h1 {
  color: #fdfbf7;
  font-family: 'Abril Fatface', serif;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.hero-sub {
  color: rgba(253,251,247,0.82);
  font-family: 'Merriweather', serif;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-cta {
  display: inline-block;
  background: #fdfbf7;
  color: #1a1a1a;
  font-family: 'Merriweather', serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 14px 36px;
  text-decoration: none;
  border: 2px solid #fdfbf7;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.hero-cta:hover {
  background: transparent;
  color: #fdfbf7;
}

/* ===== 主内容 ===== */
.main-content {
  padding: 0 0 80px;
}

.content-section {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-areas: "body aside";
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px 0;
  align-items: start;
}

.content-body {
  grid-area: body;
  min-width: 0;
  padding-right: 48px;
}

.content-aside {
  grid-area: aside;
  position: sticky;
  top: 24px;
  border-left: 1px solid #e0e0e0;
  padding-left: 28px;
}

.aside-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.aside-heading {
  font-family: 'Abril Fatface', serif;
  font-size: 1rem;
  color: #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 10px;
  margin-bottom: 4px;
}

.aside-heading > span {
  display: inline-block;
}

.aside-toc {
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: toc-cnt;
}

.aside-toc li {
  counter-increment: toc-cnt;
  border-bottom: 1px solid #e8e4dc;
}

.aside-toc li a {
  display: block;
  padding: 9px 0;
  font-size: 0.82rem;
  font-family: 'Merriweather', serif;
  font-weight: 400;
  text-decoration: none;
  color: #444;
  line-height: 1.5;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.aside-toc li a::before {
  content: counter(toc-cnt, decimal-leading-zero);
  font-family: 'Abril Fatface', serif;
  font-size: 0.72rem;
  color: #bbb;
  min-width: 22px;
  flex-shrink: 0;
}

.aside-toc li a:hover {
  color: #1a1a1a;
  text-decoration: none;
}

.aside-deco {
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  padding: 16px;
  text-align: center;
}

.paper-grain-block {
  width: 100%;
  height: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  margin-bottom: 8px;
}

.aside-deco figcaption {
  font-family: 'Abril Fatface', serif;
  font-size: 0.72rem;
  color: #aaa;
  letter-spacing: 0.08em;
}

/* ===== 正文内容样式 ===== */
.content-body h2 {
  font-family: 'Abril Fatface', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 3em 0 1em;
  padding-bottom: 12px;
  border-bottom: 2px solid #1a1a1a;
  line-height: 1.25;
  scroll-margin-bottom: 64px;
}

.content-body h2 > span {
  display: inline-block;
}

.content-body h3 {
  font-family: 'Abril Fatface', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  margin: 2.2em 0 0.8em;
  scroll-margin-bottom: 64px;
}

.content-body h3 > span {
  display: inline-block;
}

.content-body p {
  font-size: 1rem;
  line-height: 1.9;
  color: #222;
  margin-bottom: 1.3em;
}

.content-body ul,
.content-body ol {
  margin: 0 0 1.3em 1.5em;
  list-style: disc;
}

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

.content-body li {
  margin-bottom: 0.5em;
  line-height: 1.75;
}

.content-body blockquote {
  border-left: 3px solid #1a1a1a;
  margin: 2em 0;
  padding: 12px 24px;
  background: #f5f5f5;
  font-style: italic;
}

.content-body strong { font-weight: 700; }

.content-body section {
  scroll-margin-bottom: 64px;
}

/* section 区块分隔 */
.content-body > section,
.content-body section {
  padding-top: 40px;
  margin-bottom: 20px;
}

.content-body figure {
  margin: 2em 0;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
}

.content-body figure img {
  width: 100%;
}

.content-body figcaption {
  font-size: 0.82rem;
  color: #777;
  padding: 10px 14px;
  font-style: italic;
  border-top: 1px solid #e0e0e0;
}

.content-body aside {
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  padding: 20px 24px;
  margin: 2em 0;
  font-size: 0.92rem;
}

.content-body aside > h4 {
  font-family: 'Abril Fatface', serif;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: #555;
}

/* ===== CTA 块 ===== */
.cta-band {
  background: #1a1a1a;
  border-top: 2px solid #1a1a1a;
  padding: 72px 24px 80px;
  text-align: center;
}

.cta-band-inner {
  max-width: 600px;
  margin: 0 auto;
}

.cta-heading {
  font-family: 'Abril Fatface', serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: #fdfbf7;
  margin-bottom: 16px;
}

.cta-heading > span {
  display: inline-block;
}

.cta-sub {
  color: rgba(253,251,247,0.7);
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  background: #fdfbf7;
  color: #1a1a1a;
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  padding: 14px 40px;
  text-decoration: none;
  border: 2px solid #fdfbf7;
  min-height: 48px;
}

.cta-btn:hover {
  background: transparent;
  color: #fdfbf7;
}

/* ===== 页脚 ===== */
.site-footer {
  background: #fdfbf7;
  border-top: 1px solid #e0e0e0;
  padding: 28px 24px 80px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-address {
  font-style: normal;
  font-family: 'Abril Fatface', serif;
  font-size: 1rem;
  color: #1a1a1a;
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  flex: 1;
  list-style: none;
}

.footer-links li {
  border-right: 1px solid #ddd;
}

.footer-links li:last-child {
  border-right: none;
}

.footer-links li > a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-family: 'Merriweather', serif;
  text-decoration: none;
  color: #555;
  min-height: 40px;
}

.footer-links li > a:hover {
  color: #1a1a1a;
}

.footer-copy {
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid #e8e4dc;
  font-size: 0.78rem;
  color: #aaa;
  font-family: 'Merriweather', serif;
  font-weight: 300;
}

/* ===== 动效：Stagger List ===== */
@media (prefers-reduced-motion: no-preference) {
  .main-nav ol > li {
    opacity: 0;
    transform: translateY(12px);
  }

  .fullscreen-nav.is-open ol > li {
    animation: stagger-in 0.22s forwards;
  }

  .fullscreen-nav.is-open ol > li:nth-child(1) { animation-delay: 0.04s; }
  .fullscreen-nav.is-open ol > li:nth-child(2) { animation-delay: 0.08s; }
  .fullscreen-nav.is-open ol > li:nth-child(3) { animation-delay: 0.12s; }
  .fullscreen-nav.is-open ol > li:nth-child(4) { animation-delay: 0.16s; }
  .fullscreen-nav.is-open ol > li:nth-child(5) { animation-delay: 0.20s; }
  .fullscreen-nav.is-open ol > li:nth-child(6) { animation-delay: 0.24s; }
  .fullscreen-nav.is-open ol > li:nth-child(7) { animation-delay: 0.28s; }

  @keyframes stagger-in {
    to { opacity: 1; transform: translateY(0); }
  }

  /* Hover micro-interaction */
  .nav-mask-link {
    position: relative;
    overflow: hidden;
  }

  .nav-mask-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: #c8b89a;
    transition: width 0.2s ease;
  }

  .nav-mask-link:hover::after {
    width: 100%;
  }

  .hero-cta, .cta-btn {
    position: relative;
    overflow: hidden;
  }

  .hero-cta::before, .cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.08);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.18s ease;
  }

  .hero-cta:hover::before, .cta-btn:hover::before {
    transform: scaleX(1);
  }
}

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

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
    grid-template-areas:
      "aside"
      "body";
    padding: 40px 20px 0;
  }

  .content-body {
    padding-right: 0;
  }

  .content-aside {
    position: static;
    border-left: none;
    border-bottom: 1px solid #e0e0e0;
    padding-left: 0;
    padding-bottom: 32px;
    margin-bottom: 32px;
  }

  .aside-toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 16px;
    scroll-padding-bottom: 56px;
  }

  .hero-h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 5px 12px;
  }

  .hero-cta {
    padding: 12px 28px;
    font-size: 0.85rem;
  }

  .main-nav ol > li {
    width: 88vw;
  }

  .aside-toc {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 24px 20px 80px;
  }

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

  .footer-links li {
    border-right: none;
    border-bottom: 1px solid #e8e4dc;
  }

  .footer-links li:last-child {
    border-bottom: none;
  }

  .content-section {
    padding: 32px 16px 0;
  }

  .cta-band {
    padding: 48px 20px 64px;
  }

  .cta-btn {
    padding: 12px 28px;
    font-size: 0.85rem;
  }
}

/* scroll-margin-top 确保吸顶导航 div 不被遮住 */
div[id] {
  scroll-margin-top: 0;
  scroll-margin-bottom: 64px;
}
