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

/* ============================================================
   CSS 自定义属性
   ============================================================ */
:root {
  --c-primary: #5cc6b0;
  --c-secondary: #d4c4a8;
  --c-dark: #172623;
  --c-dark-80: rgba(23, 38, 35, 0.8);
  --c-primary-light: #8dd9c8;
  --c-primary-dark: #3aaa93;
  --c-secondary-dark: #b8a98a;
  --c-sand: #e8dcc8;
  --c-earth: #c8a87a;
  --c-bg: #f5f0e8;
  --c-bg-warm: #ede7da;
  --c-surface: #ffffff;
  --c-text: #1a2420;
  --c-text-muted: #4a5e58;
  --c-border: #d0c8b8;

  --font-head: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-soft: 0 2px 16px rgba(23, 38, 35, 0.08), 0 1px 4px rgba(23, 38, 35, 0.04);
  --shadow-card: 0 4px 24px rgba(23, 38, 35, 0.10), 0 1px 6px rgba(23, 38, 35, 0.06);
  --shadow-hover: 0 8px 32px rgba(23, 38, 35, 0.14), 0 2px 8px rgba(23, 38, 35, 0.08);

  --header-h: 72px;
  --anchors-h: 52px;
  --sticky-offset: calc(var(--header-h) + var(--anchors-h));

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-natural: cubic-bezier(0.4, 0, 0.2, 1);

  --max-w: 1200px;
  --content-w: 760px;
}

/* ============================================================
   Reset + Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--sticky-offset);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text);
  background-color: var(--c-bg);
  overflow-x: hidden;
}

body.home-page {
  background-color: var(--c-bg);
}

/* Grain texture overlay */
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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

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

a {
  color: var(--c-primary-dark);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

a:hover {
  color: var(--c-primary);
}

ol, ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-dark);
}

p {
  margin-bottom: 1.1em;
}

p:last-child {
  margin-bottom: 0;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Site Wrapper
   ============================================================ */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Header + Main Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--c-dark);
  border-bottom: 1px solid rgba(92, 198, 176, 0.15);
  box-shadow: 0 2px 20px rgba(23, 38, 35, 0.3);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-right {
  justify-content: flex-end;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--c-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.nav-link:hover {
  background: rgba(92, 198, 176, 0.15);
  color: var(--c-primary);
}

.brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px 20px;
  border-radius: var(--radius-pill);
  background: var(--c-primary);
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.brand-center:hover {
  background: var(--c-primary-dark);
  transform: translateY(-1px);
}

.brand-text {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-dark);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo-img {
  height: 32px;
  width: auto;
}

/* ============================================================
   Sticky Anchors Bar
   ============================================================ */
.sticky-anchors {
  position: sticky;
  top: var(--header-h);
  z-index: 190;
  height: var(--anchors-h);
  background: var(--c-bg-warm);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 8px rgba(23, 38, 35, 0.06);
}

.anchors-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.anchors-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.anchors-list::-webkit-scrollbar {
  display: none;
}

.anchor-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-head);
  color: var(--c-text-muted);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out);
}

.anchor-pill:hover {
  background: var(--c-primary);
  color: var(--c-dark);
  border-color: var(--c-primary);
}

.nav-search {
  flex-shrink: 0;
}

.search-input {
  width: 180px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--c-text);
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.search-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(92, 198, 176, 0.2);
}

.search-input::placeholder {
  color: var(--c-text-muted);
}

/* ============================================================
   Hero
   ============================================================ */
.hero-block {
  position: relative;
  min-height: 45vh;
  background: var(--c-dark);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-block::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--c-bg));
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 60px 24px 80px;
  width: 100%;
  position: relative;
}

.hero-bg-text {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-head);
  font-size: clamp(120px, 20vw, 260px);
  font-weight: 700;
  color: rgba(92, 198, 176, 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.05em;
}

.hero-content {
  position: relative;
  max-width: 680px;
}

.hero-eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--c-primary);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--c-secondary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(212, 196, 168, 0.75);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  min-height: 48px;
  border-radius: var(--radius-pill);
  background: var(--c-primary);
  color: var(--c-dark);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  box-shadow: 0 4px 16px rgba(92, 198, 176, 0.3);
}

.hero-cta:hover {
  background: var(--c-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(92, 198, 176, 0.4);
  color: var(--c-dark);
}

/* ============================================================
   Main Layout (div + aside)
   ============================================================ */
.site-main {
  flex: 1;
  padding: 48px 24px 64px;
}

.main-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

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

.content-section {
  /* direct child of div, satisfying main>div>section */
}

/* ============================================================
   Content (page.content) Typography
   ============================================================ */
.content-section h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 24px;
  color: var(--c-dark);
}

.content-section h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: var(--c-dark);
  margin-top: 48px;
  margin-bottom: 12px;
}

.content-section h2 + hr {
  border: none;
  border-top: 2px solid var(--c-primary);
  margin-bottom: 24px;
  width: 48px;
}

.content-section h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-dark);
  margin-top: 32px;
  margin-bottom: 10px;
}

.content-section h3 + hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin-bottom: 20px;
}

.content-section p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  margin-bottom: 1.2em;
}

.content-section ul,
.content-section ol {
  margin: 0 0 1.2em 1.5em;
  list-style: revert;
}

.content-section li {
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.content-section strong {
  font-weight: 700;
  color: var(--c-dark);
}

.content-section em {
  font-style: italic;
  color: var(--c-text-muted);
}

.content-section blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 3px solid var(--c-primary);
  background: rgba(92, 198, 176, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--c-text-muted);
}

.content-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.92rem;
}

.content-section th {
  background: var(--c-dark);
  color: var(--c-secondary);
  font-family: var(--font-head);
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
}

.content-section td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border);
}

.content-section tr:hover td {
  background: rgba(92, 198, 176, 0.05);
}

.content-section a {
  color: var(--c-primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-section a:hover {
  color: var(--c-primary);
}

/* Sections inside page.content */
.content-section section {
  scroll-margin-top: var(--sticky-offset);
  padding: 48px 0;
  border-bottom: 1px solid var(--c-border);
}

.content-section section:last-child {
  border-bottom: none;
}

/* HR styling (h2 + hr contract) */
hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 0 0 20px;
}

/* ============================================================
   Aside
   ============================================================ */
.page-aside {
  position: sticky;
  top: var(--sticky-offset);
  align-self: start;
}

.aside-inner {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  border: 1px solid var(--c-border);
}

.aside-label {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.aside-nav {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: aside-counter;
}

.aside-nav li {
  counter-increment: aside-counter;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.aside-nav li::before {
  content: counter(aside-counter, decimal-leading-zero);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.6;
  flex-shrink: 0;
}

.aside-nav a {
  font-size: 0.85rem;
  color: var(--c-text);
  line-height: 1.5;
  transition: color 0.15s;
}

.aside-nav a:hover {
  color: var(--c-primary-dark);
}

.aside-stat {
  background: var(--c-dark);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.aside-stat-num {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.aside-stat-desc {
  font-size: 0.78rem;
  color: var(--c-secondary);
  margin: 0;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--c-dark);
  border-top: 2px solid rgba(92, 198, 176, 0.2);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  padding: 56px 24px 0;
  max-width: 100%;
}

.site-footer > section {
  padding: 0 24px 48px;
  border-right: 1px solid rgba(212, 196, 168, 0.1);
}

.site-footer > section:last-child {
  border-right: none;
}

.footer-brand {
  grid-column: 1;
  padding-left: 0;
}

.footer-links {
  grid-column: 2;
}

.footer-info {
  grid-column: 3;
  border-right: none;
}

.footer-copy {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(212, 196, 168, 0.1);
  padding: 20px 0;
  text-align: center;
  border-right: none;
}

.footer-logo .logo-img {
  height: 36px;
  margin-bottom: 12px;
}

.footer-brand-name {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 10px;
}

.footer-brand-desc {
  font-size: 0.85rem;
  color: rgba(212, 196, 168, 0.7);
  line-height: 1.6;
  margin: 0;
}

.footer-col-title {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-primary);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: fnav;
}

.footer-nav-list li {
  counter-increment: fnav;
  margin-bottom: 10px;
}

.footer-nav-list a {
  font-size: 0.85rem;
  color: rgba(212, 196, 168, 0.75);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.footer-nav-list a:hover {
  color: var(--c-primary);
}

.footer-info-text {
  font-size: 0.85rem;
  color: rgba(212, 196, 168, 0.7);
  line-height: 1.6;
  margin-bottom: 12px;
}

.footer-host {
  font-size: 0.78rem;
  color: rgba(212, 196, 168, 0.45);
  margin: 0;
}

.copyright {
  font-size: 0.8rem;
  color: rgba(212, 196, 168, 0.45);
  margin: 0;
  letter-spacing: 0.04em;
}

/* ============================================================
   Animations & Micro-interactions
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .main-article,
  .page-aside {
    animation: fadeUp 0.5s var(--ease-out) both;
  }

  .page-aside {
    animation-delay: 0.1s;
  }

  .content-section section {
    animation: fadeUp 0.45s var(--ease-out) both;
  }

  .content-section section:nth-child(2) { animation-delay: 0.05s; }
  .content-section section:nth-child(3) { animation-delay: 0.10s; }
  .content-section section:nth-child(4) { animation-delay: 0.15s; }
  .content-section section:nth-child(5) { animation-delay: 0.20s; }
  .content-section section:nth-child(6) { animation-delay: 0.25s; }
  .content-section section:nth-child(7) { animation-delay: 0.30s; }

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

  .hero-title {
    animation: fadeUp 0.6s var(--ease-out) 0.1s both;
  }

  .hero-eyebrow {
    animation: fadeUp 0.5s var(--ease-out) both;
  }

  .hero-sub {
    animation: fadeUp 0.5s var(--ease-out) 0.2s both;
  }

  .hero-cta {
    animation: fadeUp 0.5s var(--ease-out) 0.3s both;
  }
}

/* ============================================================
   Responsive — Tablet
   ============================================================ */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .page-aside {
    position: static;
  }

  .aside-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
  }

  .aside-label {
    grid-column: 1 / -1;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
    padding: 48px 24px 0;
  }

  .footer-brand {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid rgba(212, 196, 168, 0.1);
    padding-bottom: 32px;
    margin-bottom: 8px;
  }

  .footer-info {
    border-right: none;
  }
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 600px) {
  :root {
    --header-h: 60px;
    --anchors-h: 48px;
  }

  .header-inner {
    padding: 0 16px;
  }

  /* On small screens collapse nav, only show brand + 3 items */
  .nav-left {
    display: none;
  }

  .nav-right {
    display: none;
  }

  .main-nav {
    justify-content: center;
  }

  .brand-center {
    padding: 8px 24px;
  }

  .anchors-inner {
    padding: 0 12px;
    gap: 8px;
  }

  .search-input {
    width: 120px;
  }

  .hero-inner {
    padding: 40px 16px 60px;
  }

  .hero-bg-text {
    font-size: clamp(80px, 28vw, 140px);
    right: -10px;
    opacity: 0.7;
  }

  .site-main {
    padding: 32px 16px 48px;
  }

  .aside-inner {
    display: block;
  }

  .aside-nav {
    margin-bottom: 16px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 40px 16px 0;
  }

  .site-footer > section {
    padding: 0 0 32px;
    border-right: none;
    border-bottom: 1px solid rgba(212, 196, 168, 0.08);
  }

  .footer-copy {
    border-bottom: none;
  }

  .footer-brand {
    border-bottom: 1px solid rgba(212, 196, 168, 0.1);
  }

  .content-section h2 {
    margin-top: 36px;
  }

  .content-section section {
    padding: 36px 0;
  }
}

/* ============================================================
   Focus styles (accessibility)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .site-header,
  .sticky-anchors,
  .page-aside,
  .site-footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
