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

/* ============================================================
   CSS 变量 & 基础重置
   ============================================================ */
:root {
  --c-bg: #fafaf8;
  --c-mid: #4a4a4a;
  --c-ink: #1a1a1a;
  --c-line: #1a1a1a;
  --c-paper: #f0ede6;
  --c-accent: #2e2e2e;
  --ff-serif: 'Cormorant', 'Noto Serif SC', Georgia, serif;
  --ff-sans: 'Montserrat', 'Noto Sans SC', system-ui, sans-serif;
  --fs-base: 17px;
  --lh-base: 1.75;
  --nav-h: 64px;
  --announce-h: 36px;
  --scroll-top: calc(var(--nav-h) + var(--announce-h));
  --max-w: 1160px;
  --gap: clamp(1.5rem, 4vw, 3rem);
}

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

html {
  scroll-behavior: smooth;
  font-size: var(--fs-base);
  background: var(--c-bg);
  color: var(--c-ink);
}

body {
  font-family: var(--ff-sans);
  line-height: var(--lh-base);
  background: var(--c-bg);
  color: var(--c-ink);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, menu { list-style: none; }

/* ============================================================
   纸质肌理 pseudo-overlay
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

/* ============================================================
   公告条
   ============================================================ */
.site-announcement {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--announce-h);
  background: var(--c-ink);
  color: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid #333;
}

/* ============================================================
   导航 (details > summary + menu > li > a)
   ============================================================ */
.site-header {
  position: fixed;
  top: var(--announce-h);
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--c-bg);
  border-bottom: 2px solid var(--c-line);
}

.nav-details {
  height: 100%;
}

/* Hide the default marker */
.nav-details > summary {
  list-style: none;
}
.nav-details > summary::-webkit-details-marker {
  display: none;
}

/* Desktop: summary hidden as toggle, show full menu */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: var(--nav-h);
  cursor: pointer;
  font-family: var(--ff-sans);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  border: none;
  background: none;
}

.nav-toggle-close { display: none; }
.nav-details[open] .nav-toggle-close { display: inline; }
.nav-details[open] .nav-toggle-icon { display: none; }

/* Desktop nav menu */
.nav-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  gap: 1rem;
}

.nav-left-group,
.nav-right-group {
  flex: 1;
}

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

.nav-inner {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1.5rem);
}

.nav-inner li a {
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-mid);
  padding: 0.6rem 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  display: inline-block;
  min-height: 40px;
  line-height: 40px;
}

.nav-inner li a:hover,
.nav-inner li a:focus {
  color: var(--c-ink);
  border-bottom-color: var(--c-ink);
  outline: none;
}

.nav-brand-cell {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.brand-text {
  font-family: var(--ff-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.site-logo {
  max-height: 40px;
  width: auto;
}

/* ============================================================
   Hero
   ============================================================ */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + var(--announce-h));
  overflow: hidden;
  border-bottom: 2px solid var(--c-line);
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-3deg);
  font-family: var(--ff-serif);
  font-size: clamp(5rem, 18vw, 20rem);
  font-weight: 700;
  color: var(--c-ink);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.08em;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap) clamp(1rem, 3vw, 2.5rem);
  width: 100%;
  gap: var(--gap);
}

.hero-content {
  flex: 0 0 auto;
  max-width: 520px;
  text-align: left;
}

.hero-h1 {
  font-family: var(--ff-serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--c-ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  position: relative;
}

.hero-h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--c-ink);
  margin-top: 1rem;
  transform: rotate(-1deg);
}

.hero-sub {
  font-family: var(--ff-sans);
  font-size: 1rem;
  font-weight: 300;
  color: var(--c-mid);
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 420px;
}

.hero-cta {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-bg);
  background: var(--c-ink);
  padding: 0.9rem 2.2rem;
  border: 2px solid var(--c-ink);
  transition: background 0.15s, color 0.15s;
  min-height: 48px;
  line-height: 1.4;
}

.hero-cta:hover,
.hero-cta:focus {
  background: var(--c-bg);
  color: var(--c-ink);
  outline: none;
}

.hero-figure {
  flex: 0 0 auto;
  width: clamp(260px, 38vw, 520px);
  border: 2px solid var(--c-line);
  transform: rotate(1.5deg);
  overflow: hidden;
  position: relative;
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.05);
}

.hero-figure--placeholder {
  background: var(--c-paper);
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-sketch {
  width: 100%;
  height: 100%;
  min-height: 380px;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 6px,
      rgba(26,26,26,0.07) 6px,
      rgba(26,26,26,0.07) 7px
    );
}

/* ============================================================
   页面包裹
   ============================================================ */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   主内容区
   ============================================================ */
.site-main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 3vw, 2.5rem);
  width: 100%;
}

/* section > figure/aside 交错 */
.content-section {
  display: flex;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: flex-start;
  position: relative;
}

.content-section--primary {
  border-top: 2px solid var(--c-line);
  padding-top: clamp(2rem, 4vw, 4rem);
}

/* aside 在左侧 */
.content-aside {
  flex: 0 0 200px;
  position: sticky;
  top: calc(var(--scroll-top) + 2rem);
  border: 2px solid var(--c-line);
  padding: 1.5rem 1.2rem;
  background: var(--c-paper);
  transform: rotate(-0.5deg);
}

.aside-label {
  font-family: var(--ff-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-mid);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--c-mid);
  padding-bottom: 0.5rem;
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.aside-nav-list li a {
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--c-mid);
  line-height: 1.5;
  display: block;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.1s;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-nav-list li a:hover,
.aside-nav-list li a:focus {
  color: var(--c-ink);
  border-bottom-color: var(--c-ink);
  outline: none;
}

.aside-stamp {
  margin-top: 1.5rem;
  font-family: var(--ff-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-ink);
  opacity: 0.12;
  letter-spacing: 0.05em;
  transform: rotate(8deg);
  display: inline-block;
  border: 2px solid currentColor;
  padding: 0.2rem 0.5rem;
}

/* figure 是 section 的直接子元素 */
.content-figure {
  flex: 1 1 0;
  min-width: 0;
}

/* ============================================================
   正文内容样式
   ============================================================ */
.content-body {
  color: var(--c-ink);
  font-family: var(--ff-sans);
  font-size: 1rem;
  line-height: var(--lh-base);
}

/* 页内 section 的 scroll-margin-top */
.content-body section,
section[id] {
  scroll-margin-top: var(--scroll-top);
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4 {
  font-family: var(--ff-serif);
  color: var(--c-ink);
  line-height: 1.2;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.content-body h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

.content-body h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
}

.content-body h4 {
  font-size: 1.1rem;
  font-family: var(--ff-sans);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* h2/h3 后紧跟 hr */
.content-body h2 + hr,
.content-body h3 + hr {
  border: none;
  border-top: 2px solid var(--c-ink);
  margin: 0.4rem 0 1.5rem;
  opacity: 0.25;
  transform: rotate(-0.3deg);
}

hr {
  border: none;
  border-top: 1px solid var(--c-mid);
  margin: 2rem 0;
  opacity: 0.3;
}

.content-body p {
  margin-bottom: 1.25rem;
  max-width: 68ch;
}

.content-body ul,
.content-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.content-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.content-body a {
  color: var(--c-ink);
  border-bottom: 1px solid var(--c-mid);
  transition: border-color 0.1s;
}

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

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

.content-body blockquote {
  border-left: 3px solid var(--c-ink);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: var(--c-paper);
  font-family: var(--ff-serif);
  font-size: 1.1rem;
  color: var(--c-mid);
  transform: rotate(-0.3deg);
}

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

.content-body th,
.content-body td {
  border: 1px solid var(--c-line);
  padding: 0.6rem 0.9rem;
  text-align: left;
}

.content-body th {
  background: var(--c-ink);
  color: var(--c-bg);
  font-family: var(--ff-sans);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* section 内的图片与卡片 */
.content-body section {
  border-top: 1px solid rgba(26,26,26,0.12);
  padding-top: 2.5rem;
  margin-top: 2.5rem;
}

.content-body section:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* ============================================================
   页脚 (footer 极简: 仅 p + small)
   ============================================================ */
.site-footer {
  border-top: 2px solid var(--c-line);
  background: var(--c-ink);
  color: var(--c-bg);
  text-align: center;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 3vw, 2.5rem) 2rem;
}

.footer-cta {
  font-family: var(--ff-serif);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-bg);
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.footer-cta strong {
  border-bottom: 2px solid var(--c-bg);
  padding-bottom: 0.1em;
}

.footer-copy {
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 300;
  color: rgba(250,250,248,0.5);
  letter-spacing: 0.1em;
  display: block;
}

/* ============================================================
   Scroll Reveal 动效
   ============================================================ */
.js-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   mobile 导航切换
   ============================================================ */
@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .nav-details > .nav-menu {
    display: none;
  }

  .nav-details[open] > .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    position: fixed;
    top: calc(var(--announce-h) + var(--nav-h));
    left: 0;
    right: 0;
    background: var(--c-bg);
    border-bottom: 2px solid var(--c-line);
    padding: 1.5rem;
    z-index: 99;
    gap: 0.5rem;
  }

  .nav-left-group,
  .nav-right-group,
  .nav-brand-cell {
    width: 100%;
  }

  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .nav-inner li {
    width: 100%;
  }

  .nav-inner li a {
    font-size: 0.9rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(26,26,26,0.1);
    width: 100%;
    min-height: 48px;
    line-height: 48px;
    letter-spacing: 0.05em;
  }

  .nav-brand-cell {
    justify-content: flex-start;
    padding: 0.75rem 0;
    order: -1;
  }

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

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .content-section {
    flex-direction: column;
  }

  .content-aside {
    position: static;
    flex: none;
    width: 100%;
    transform: rotate(0);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
  }

  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }

  .aside-nav-list li a {
    min-height: 40px;
  }

  .aside-stamp {
    margin-top: 0;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    padding-top: 4rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-h1::after {
    margin: 1rem auto 0;
  }

  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-figure {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    transform: rotate(0.8deg);
  }

  .hero-figure--placeholder {
    min-height: 260px;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-base: 16px;
  }

  .hero-section {
    min-height: 100svh;
  }

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

  .content-body blockquote {
    transform: none;
    padding: 0.8rem 1rem;
  }

  .site-main {
    padding: 2rem 1rem;
  }
}

/* ============================================================
   段落区块分隔 (page.content 内 section)
   ============================================================ */
.content-body > section {
  position: relative;
}

.content-body > section::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1rem;
  width: 3px;
  height: 100%;
  background: var(--c-ink);
  opacity: 0.06;
}

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