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

/* =============================================
   CSS 变量与基础重置
   ============================================= */
:root {
  --c-bg: #1a1a1a;
  --c-gold: #c9a84c;
  --c-light: #f5f5f5;
  --c-bg2: #242424;
  --c-bg3: #2e2e2e;
  --c-muted: #888;
  --c-border: rgba(201,168,76,0.2);
  --c-text: #d8d8d8;
  --c-text-dim: #999;
  --nav-w: 220px;
  --hero-h: 45vh;
  --radius: 10px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --shadow: 0 4px 24px rgba(0,0,0,0.45);
  --shadow-card: 0 6px 20px rgba(0,0,0,0.5);
  --scroll-offset: 80px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 17px;
  background: var(--c-bg);
  color: var(--c-text);
  scroll-padding-top: var(--scroll-offset);
}

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

body.dark-mode {
  background: var(--c-bg);
  color: var(--c-text);
}

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

a {
  color: var(--c-gold);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* =============================================
   布局骨架
   ============================================= */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* =============================================
   左侧固定导航
   ============================================= */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: linear-gradient(180deg, #111 0%, #1a1a1a 60%, #0e0e0e 100%);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 200;
  padding: 2rem 0;
  overflow-y: auto;
}

.side-nav__brand {
  padding: 0 1.2rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
  width: 100%;
}

.brand-link {
  display: inline-block;
  color: var(--c-light);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.brand-link:hover {
  color: var(--c-gold);
}

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

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-light);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.side-nav__menu {
  flex: 1;
  width: 100%;
  padding: 1.6rem 0;
  list-style: none;
}

.side-nav__menu dt,
.side-nav__menu dd {
  display: block;
  margin: 0;
}

.side-nav__menu dd a,
.side-nav__menu dt a {
  display: block;
  padding: 0.7rem 1.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text-dim);
  letter-spacing: 0.02em;
  transition: all var(--transition);
  border-left: 2px solid transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.side-nav__menu dd a:hover,
.side-nav__menu dt a:hover {
  color: var(--c-gold);
  border-left-color: var(--c-gold);
  background: rgba(201,168,76,0.07);
  padding-left: 2rem;
}

.side-nav__contact {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--c-border);
  width: 100%;
  text-align: center;
}

.contact-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =============================================
   主画布
   ============================================= */
.main-canvas {
  margin-left: var(--nav-w);
  width: calc(100% - var(--nav-w));
  min-height: 100vh;
}

/* =============================================
   Hero
   ============================================= */
.hero {
  position: relative;
  width: 100%;
  height: var(--hero-h);
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 3rem;
  overflow: hidden;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 40%, #222 70%, #1a0a00 100%);
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.4) 60%,
    rgba(0,0,0,0.15) 100%
  );
  z-index: 1;
}

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

.hero__content {
  position: relative;
  z-index: 10;
  padding: 0 3rem;
  max-width: 680px;
}

.hero__badge {
  display: inline-block;
  background: var(--c-gold);
  color: #111;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3em 0.9em;
  border-radius: 3px;
  margin-bottom: 1rem;
}

.hero__h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-light);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.8rem;
}

.hero__sub {
  font-size: 0.95rem;
  color: rgba(245,245,245,0.65);
  font-weight: 300;
  max-width: 480px;
  line-height: 1.6;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  right: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 10;
}

.scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--c-gold));
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--c-muted);
  writing-mode: vertical-rl;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* =============================================
   页内 div scroll-margin
   ============================================= */
div[id] {
  scroll-margin-top: var(--scroll-offset);
}

/* =============================================
   正文主容器
   ============================================= */
.page-main {
  background: var(--c-bg);
}

.content-section {
  position: relative;
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto;
  gap: 0 2.5rem;
  padding: 4rem 3rem 5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.parallax-section {
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg2) 100%);
}

/* figure 装饰 — div 直接子元素 */
.section-deco {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--c-gold) 0%, transparent 60%);
  margin: 0;
}

.deco-line {
  display: none;
}

.deco-dot {
  display: none;
}

/* aside — div 直接子元素，内容左侧 */
.section-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: 2rem;
  align-self: start;
  padding: 1.5rem;
  background: var(--c-bg3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.aside-eyebrow {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 1rem;
  font-weight: 600;
}

.toc-nav dl {
  list-style: none;
}

.toc-nav dt {
  margin-bottom: 0.3rem;
}

.toc-link {
  display: block;
  font-size: 0.82rem;
  color: var(--c-text-dim);
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  transition: all var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.toc-link:hover {
  color: var(--c-gold);
  background: rgba(201,168,76,0.08);
}

/* 正文内容列 */
.content-body {
  grid-column: 2;
  grid-row: 1;
}

.eyebrow-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 0.7rem;
}

.section-heading {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--c-light);
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  line-height: 1.3;
}

/* =============================================
   Prose — page.content 样式
   ============================================= */
.prose-content {
  max-width: 780px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
}

.prose-content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--c-light);
  margin: 3rem 0 1rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border);
  scroll-margin-top: var(--scroll-offset);
}

.prose-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-light);
  margin: 2rem 0 0.8rem;
  letter-spacing: 0.01em;
}

.prose-content p {
  margin-bottom: 1.2rem;
  color: var(--c-text);
}

.prose-content ul,
.prose-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1.4rem;
}

.prose-content li {
  margin-bottom: 0.5rem;
}

.prose-content a {
  color: var(--c-gold);
  border-bottom: 1px solid rgba(201,168,76,0.3);
  transition: border-color var(--transition), color var(--transition);
}

.prose-content a:hover {
  color: var(--c-light);
  border-bottom-color: var(--c-light);
}

.prose-content blockquote {
  margin: 1.8rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--c-gold);
  background: rgba(201,168,76,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--c-text);
  font-style: italic;
}

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

.prose-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.prose-content th {
  background: var(--c-bg3);
  color: var(--c-gold);
  font-weight: 600;
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}

.prose-content td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--c-text);
}

.prose-content tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* div 内的子区块 */
.prose-content div {
  padding: 3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.prose-content div:first-child {
  padding-top: 0;
}

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

/* =============================================
   卡片样式（正文内可能有卡片列表）
   ============================================= */
.prose-content .card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.prose-content .card {
  background: var(--c-bg3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.prose-content .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.6);
}

/* =============================================
   Reveal 动效
   ============================================= */
.reveal-heading,
.prose-content p,
.prose-content h2,
.prose-content h3 {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* 初始显示兜底 —— no-js / 无 IntersectionObserver */
.no-js .reveal-heading,
.no-js .prose-content p,
.no-js .prose-content h2,
.no-js .prose-content h3 {
  opacity: 1;
  transform: none;
}

/* =============================================
   页脚（footer 单行：logo + nav + copyright）
   ============================================= */
.site-footer {
  background: #0e0e0e;
  border-top: 1px solid var(--c-border);
  padding: 2.5rem 3rem;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-logo {
  flex: 0 0 auto;
  min-width: 160px;
}

.footer-tagline {
  font-size: 0.75rem;
  color: var(--c-muted);
  margin-top: 0.5rem;
  max-width: 180px;
  line-height: 1.5;
}

.footer-nav {
  flex: 1;
}

.footer-nav dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0;
  list-style: none;
}

.footer-nav dt,
.footer-nav dd {
  display: block;
  margin: 0;
}

.footer-nav dd a,
.footer-nav dt a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  color: var(--c-text-dim);
  transition: color var(--transition);
  min-height: 40px;
}

.footer-nav dd a:hover,
.footer-nav dt a:hover {
  color: var(--c-gold);
}

.footer-copy {
  flex: 0 0 auto;
  text-align: right;
  min-width: 200px;
}

.copyright {
  font-size: 0.78rem;
  color: var(--c-muted);
  margin-bottom: 0.3rem;
}

.footer-note {
  font-size: 0.72rem;
  color: #555;
}

/* =============================================
   Parallax / 视差滚动装饰带
   ============================================= */
.parallax-band {
  position: relative;
  overflow: hidden;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  opacity: 0.4;
  margin: 0;
}

/* =============================================
   Stagger 动效 — prose 内列表项
   ============================================= */
.prose-content li {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.prose-content li.is-visible {
  opacity: 1;
  transform: none;
}

/* =============================================
   prefers-reduced-motion
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal-heading,
  .prose-content p,
  .prose-content h2,
  .prose-content h3,
  .prose-content li {
    opacity: 1;
    transform: none;
  }
}

/* =============================================
   响应式 — 平板 ≤1024px
   ============================================= */
@media (max-width: 1024px) {
  :root {
    --nav-w: 180px;
  }

  .content-section {
    grid-template-columns: 160px 1fr;
    padding: 3rem 2rem 4rem;
    gap: 0 1.5rem;
  }

  .hero__content {
    padding: 0 2rem;
  }

  .footer-inner {
    gap: 2rem;
  }
}

/* =============================================
   响应式 — 移动端 ≤768px
   ============================================= */
@media (max-width: 768px) {
  :root {
    --nav-w: 0px;
    --scroll-offset: 60px;
  }

  html {
    font-size: 16px;
  }

  /* 侧导航 → 顶部横栏 */
  .side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    z-index: 300;
    overflow: visible;
  }

  .side-nav__brand {
    padding: 0 1rem;
    border-bottom: none;
    border-right: 1px solid var(--c-border);
    height: 52px;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
  }

  .side-nav__menu {
    display: flex;
    flex: 1;
    overflow-x: auto;
    padding: 0;
    scrollbar-width: none;
  }

  .side-nav__menu::-webkit-scrollbar {
    display: none;
  }

  .side-nav__menu dt,
  .side-nav__menu dd {
    display: inline-block;
    white-space: nowrap;
  }

  .side-nav__menu dd a,
  .side-nav__menu dt a {
    padding: 0 1rem;
    font-size: 0.8rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    height: 52px;
    min-height: 52px;
  }

  .side-nav__menu dd a:hover,
  .side-nav__menu dt a:hover {
    padding-left: 1rem;
    border-bottom-color: var(--c-gold);
    border-left-color: transparent;
    background: rgba(201,168,76,0.07);
  }

  .side-nav__contact {
    display: none;
  }

  /* 主画布 */
  .main-canvas {
    margin-left: 0;
    width: 100%;
    padding-top: 52px;
  }

  /* Hero */
  .hero {
    height: auto;
    min-height: 240px;
    padding: 3rem 1.5rem 2rem;
    align-items: flex-end;
  }

  .hero__content {
    padding: 0;
    max-width: 100%;
  }

  .hero__h1 {
    font-size: 1.7rem;
  }

  .hero__scroll-hint {
    display: none;
  }

  /* 正文区：单列 */
  .content-section {
    display: block;
    padding: 2rem 1.2rem 3rem;
  }

  .section-aside {
    position: static;
    margin-bottom: 2rem;
    width: 100%;
  }

  .content-body {
    width: 100%;
  }

  /* 页脚 */
  .site-footer {
    padding: 2rem 1.2rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer-copy {
    text-align: left;
    min-width: auto;
  }

  .footer-nav dl {
    flex-direction: column;
  }

  .footer-nav dd a,
  .footer-nav dt a {
    padding: 0.5rem 0;
    min-height: 44px;
  }
}

/* =============================================
   极窄屏 ≤375px
   ============================================= */
@media (max-width: 375px) {
  .hero__h1 {
    font-size: 1.45rem;
  }

  .side-nav__brand .logo-text {
    font-size: 0.95rem;
  }
}

/* =============================================
   滚动吸附辅助 — 可选
   ============================================= */
.prose-content div {
  scroll-margin-top: var(--scroll-offset);
}

/* =============================================
   焦点样式（可访问性）
   ============================================= */
a:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
  border-radius: 3px;
}

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