@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

/* ============================
   CSS 变量 & 重置
   ============================ */
:root {
  --c-ink: #000000;
  --c-paper: #ffffff;
  --c-accent: #000000;
  --c-mid: #444444;
  --c-light: #f5f5f5;
  --c-border: #1a1a1a;
  --c-glass-bg: rgba(255,255,255,0.72);
  --c-glass-border: rgba(0,0,0,0.12);
  --radius: 10px;
  --nav-h: 60px;
  --max-w: 1200px;
  --font-serif: 'EB Garamond', 'Crimson Text', Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

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

html {
  font-size: 18px;
  line-height: 1.65;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-serif);
  background: var(--c-paper);
  color: var(--c-ink);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Scroll margin for fixed nav */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}

/* ============================
   站点外壳
   ============================ */
.site-wrapper {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  padding-bottom: var(--nav-h);
}

/* ============================
   底部固定导航条
   ============================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--nav-h);
  background: var(--c-ink);
  color: var(--c-paper);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1rem;
  border-top: 2px solid var(--c-paper);
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--c-paper);
  min-height: 44px;
  padding: 0 0.5rem;
}

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

.nav-brand img {
  max-height: 36px;
  width: auto;
  filter: invert(1);
}

/* details / summary 导航 */
.nav-details {
  position: relative;
}

.nav-details--left { justify-self: start; }
.nav-details--right { justify-self: end; }

.nav-toggle {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-paper);
  padding: 0.6rem 0.8rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  user-select: none;
  transition: background var(--transition);
}

.nav-toggle::-webkit-details-marker,
.nav-toggle::marker { display: none; }

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(255,255,255,0.12);
  outline: none;
}

.nav-dropdown {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  background: var(--c-paper);
  color: var(--c-ink);
  border: 2px solid var(--c-ink);
  border-radius: var(--radius);
  list-style: none;
  padding: 0.5rem 0;
  min-width: 160px;
  white-space: nowrap;
  box-shadow: 4px 4px 0 var(--c-ink);
}

.nav-dropdown--left { left: 0; }
.nav-dropdown--right { right: 0; }

.nav-dropdown li a {
  display: block;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--c-ink);
  text-decoration: none;
  min-height: 40px;
  line-height: 1.4;
  transition: background var(--transition), padding-left var(--transition);
}

.nav-dropdown li a:hover,
.nav-dropdown li a:focus-visible {
  background: var(--c-ink);
  color: var(--c-paper);
  padding-left: 1.4rem;
  outline: none;
}

/* ============================
   Hero 区块
   ============================ */
.hero {
  min-height: 45vh;
  display: flex;
  align-items: stretch;
  background: var(--c-ink);
  color: var(--c-paper);
  overflow: hidden;
  position: relative;
}

.hero-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 45vh;
}

.hero-media {
  position: relative;
  overflow: hidden;
  background: #111;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.hero-media:hover .hero-img {
  transform: scale(1.03);
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  min-height: 45vh;
  background: repeating-linear-gradient(
    -45deg,
    #111 0px,
    #111 20px,
    #1e1e1e 20px,
    #1e1e1e 40px
  );
}

/* 斜切色带 */
.hero-slash {
  position: absolute;
  top: 0;
  right: -2px;
  width: 60px;
  height: 100%;
  background: var(--c-paper);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 2;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 3rem 2.5rem 3rem 3rem;
  gap: 1rem;
  background: var(--c-paper);
  color: var(--c-ink);
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-mid);
  border-bottom: 1px solid var(--c-ink);
  padding-bottom: 0.3rem;
}

.hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

.hero-desc {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--c-mid);
  max-width: 36ch;
}

.hero-cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.65rem 1.6rem;
  background: var(--c-ink);
  color: var(--c-paper);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--c-ink);
  border-radius: 2px;
  min-height: 44px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: background var(--transition), color var(--transition);
}

.hero-cta:hover,
.hero-cta:focus-visible {
  background: var(--c-paper);
  color: var(--c-ink);
  outline: 2px solid var(--c-ink);
  outline-offset: 2px;
}

/* ============================
   主内容区
   ============================ */
.site-main {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

.content-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  gap: 2.5rem 3rem;
  align-items: start;
}

/* ============================
   侧边 Aside（左侧）
   ============================ */
.content-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: 2rem;
}

.content-aside small {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-mid);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--c-ink);
  padding-bottom: 0.4rem;
}

.aside-nav menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.aside-nav menu li a {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--c-mid);
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-left: 2px solid transparent;
  transition: border-color var(--transition), color var(--transition), padding-left var(--transition);
  min-height: 40px;
  line-height: 1.5;
}

.aside-nav menu li a:hover,
.aside-nav menu li a:focus-visible {
  color: var(--c-ink);
  border-left-color: var(--c-ink);
  padding-left: 1rem;
  outline: none;
}

/* ============================
   装饰 Figure（右上角几何）
   ============================ */
.content-figure {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  margin-bottom: -1rem;
}

.deco-grid {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.deco-block {
  display: block;
  background: var(--c-ink);
  width: 12px;
  height: 24px;
}

.deco-block--sm {
  height: 14px;
  opacity: 0.35;
}

.deco-block--lg {
  height: 36px;
}

/* ============================
   正文内容区
   ============================ */
.content-body {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

/* 正文内所有节 */
.content-body section {
  padding: 3.5rem 0 3rem;
  border-top: 1px solid #e0e0e0;
}

.content-body section:first-child {
  border-top: 3px solid var(--c-ink);
}

/* 玻璃拟态卡片（正文内 .card 或 div 元素） */
.content-body .card,
.content-body div {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  padding: 1.6rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--transition), border-color var(--transition);
}

.content-body .card:hover,
.content-body div:hover {
  transform: translateY(-2px);
  border-color: rgba(0,0,0,0.3);
}

/* 正文标题层级 */
.content-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1.2rem;
}

.content-body h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 600;
  margin: 2rem 0 0.8rem;
}

.content-body h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

/* small 眉题（在 h2/h3 前） */
.content-body small,
small + h2,
small + h3 {
  display: block;
}

.content-body small {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-mid);
  margin-bottom: 0.4rem;
}

/* 正文段落 */
.content-body p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: #222;
  margin-bottom: 1.1rem;
  max-width: 70ch;
}

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

.content-body li {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.45rem;
}

.content-body a {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness var(--transition);
}

.content-body a:hover {
  text-decoration-thickness: 2px;
}

.content-body blockquote {
  border-left: 4px solid var(--c-ink);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--c-light);
  font-style: italic;
}

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

.content-body th,
.content-body td {
  padding: 0.65rem 1rem;
  border: 1px solid #ccc;
  text-align: left;
}

.content-body th {
  background: var(--c-ink);
  color: var(--c-paper);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1.5rem 0;
}

/* ============================
   区块分隔视觉强化（正文 section 交错 figure/aside）
   ============================ */
.content-body section > figure {
  margin: 1.5rem 0;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  overflow: hidden;
}

.content-body section > figure figcaption {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--c-mid);
  padding: 0.5rem 0.8rem;
  background: var(--c-light);
}

.content-body section > aside {
  background: var(--c-light);
  border-left: 3px solid var(--c-ink);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--c-mid);
}

/* ============================
   页脚（极简：仅 p + small）
   ============================ */
.site-footer {
  background: var(--c-ink);
  color: var(--c-paper);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.2rem 2rem;
  font-family: var(--font-sans);
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--c-paper);
  line-height: 1.5;
}

.site-footer small {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  max-width: 40ch;
  text-align: right;
  line-height: 1.5;
}

/* ============================
   视差效果（JS 增强，CSS 基础层）
   ============================ */
.parallax-hero {
  will-change: transform;
}

/* ============================
   响应式断点
   ============================ */

/* 平板 ~768px */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 35vw;
  }

  .hero-copy {
    align-items: flex-start;
    text-align: left;
    padding: 2rem 1.5rem;
  }

  .hero-slash {
    display: none;
  }

  .content-section {
    grid-template-columns: 1fr;
  }

  .content-aside {
    grid-column: 1;
    grid-row: auto;
    position: static;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .aside-nav menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem 0.8rem;
  }

  .content-figure {
    grid-column: 1;
  }

  .content-body {
    grid-column: 1;
  }
}

/* 手机 ~375px */
@media (max-width: 600px) {
  html { font-size: 16px; }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    min-height: auto;
  }

  .hero-media {
    min-height: 220px;
  }

  .hero-h1 {
    font-size: 1.75rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .site-main {
    padding: 2.5rem 1rem 4rem;
  }

  .bottom-nav {
    padding: 0 0.5rem;
  }

  .nav-toggle {
    font-size: 0.7rem;
    padding: 0.5rem 0.6rem;
  }

  .brand-text {
    font-size: 0.85rem;
  }

  .content-body h2 {
    font-size: 1.4rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.2rem;
  }

  .site-footer small {
    text-align: left;
    max-width: none;
  }

  .nav-dropdown {
    min-width: 140px;
  }

  .content-body p {
    max-width: 100%;
  }
}

/* ============================
   无障碍：焦点环
   ============================ */
:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
}

/* 跳过导航 */
.skip-nav {
  position: absolute;
  top: -999px;
  left: 0;
  padding: 0.7rem 1.2rem;
  background: var(--c-ink);
  color: var(--c-paper);
  z-index: 9999;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.skip-nav:focus {
  top: 0;
}
