@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  background: #fafaf8;
  color: #1a1a1a;
}
body {
  font-family: 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 400;
  background: #fafaf8;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Paper texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.06'/%3E%3C/svg%3E");
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
}
p { line-height: 1.7; }
a { color: #1a1a1a; text-decoration: none; }
a:hover { opacity: 0.65; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

/* ── Overlay Menu ── */
.overlay-menu {
  position: fixed;
  inset: 0;
  background: #1a1a1a;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: none;
  transform: rotate(-1deg) scale(0.97);
}
.overlay-menu.is-open {
  opacity: 1;
  pointer-events: all;
  transform: rotate(0deg) scale(1);
  transition: opacity 0.15s steps(3), transform 0.1s steps(2);
}
.overlay-menu nav ul {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}
.overlay-menu nav ul li a {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  color: #fafaf8;
  letter-spacing: 0.04em;
  position: relative;
  display: inline-block;
}
.overlay-menu nav ul li a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 2px;
  background: #fafaf8;
  transition: none;
}
.overlay-menu nav ul li a:hover::after { width: 100%; }
.overlay-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none;
  border: 2px solid #fafaf8;
  color: #fafaf8;
  font-size: 1.4rem;
  width: 48px; height: 48px;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(3deg);
}
.overlay-close:hover { transform: rotate(-3deg); }

/* ── Site Aside (DOM requirement: aside > nav > ul > li > a) ── */
.site-aside {
  position: fixed;
  left: -9999px;
  width: 0;
  overflow: hidden;
  visibility: hidden;
  aria-hidden: true;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fafaf8;
  border-bottom: 2px solid #1a1a1a;
}
/* hand-drawn border effect */
.site-header::after {
  content: '';
  display: block;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #1a1a1a 0px, #1a1a1a 12px,
    transparent 12px, transparent 16px,
    #4a4a4a 16px, #4a4a4a 22px,
    transparent 22px, transparent 26px
  );
  opacity: 0.35;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  gap: 1rem;
}
.hamburger {
  background: none;
  border: 2px solid #1a1a1a;
  width: 44px; height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  transform: rotate(-1deg);
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #1a1a1a;
}
.hamburger:hover { transform: rotate(1deg); }
.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1a1a1a;
}
.brand-logo { height: 36px; width: auto; }
.header-spacer { flex: 0 0 44px; }

/* ── Anchor bar ── */
.anchor-bar {
  background: #1a1a1a;
  overflow: hidden;
}
.anchor-bar-inner {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.anchor-bar-inner::-webkit-scrollbar { display: none; }
.anchor-link {
  color: #fafaf8;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.55rem 1rem;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
  border-right: 1px solid #4a4a4a;
  transition: none;
}
.anchor-link:last-child { border-right: none; }
.anchor-link:hover { background: #4a4a4a; opacity: 1; }

/* ── Scroll margin for sticky header ── */
section[id] { scroll-margin-top: 90px; }

/* ── Hero ── */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 70vh;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}
.hero-figure {
  position: relative;
  background: #1a1a1a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-figure .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  filter: grayscale(30%) contrast(1.05);
}
.hero-img-placeholder {
  width: 100%; height: 100%;
  min-height: 70vh;
  background: repeating-linear-gradient(
    -45deg,
    #1a1a1a 0px, #1a1a1a 2px,
    #4a4a4a 2px, #4a4a4a 14px
  );
  opacity: 0.85;
}
/* Diagonal slash divider */
.hero-slash {
  position: absolute;
  top: 0; right: -30px;
  width: 60px; height: 100%;
  background: #fafaf8;
  clip-path: polygon(30px 0, 100% 0, 30px 100%, 0 100%);
  z-index: 2;
}
.hero-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 3rem 2.5rem 3rem 3rem;
  background: #fafaf8;
  position: relative;
  z-index: 3;
}
.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  position: relative;
}
.hero-h1::before {
  content: '';
  display: block;
  width: 48px; height: 4px;
  background: #1a1a1a;
  margin-left: auto;
  margin-bottom: 0.75rem;
  transform: rotate(1.5deg);
}
.hero-desc {
  font-size: 1rem;
  color: #4a4a4a;
  max-width: 28ch;
  margin-bottom: 1.75rem;
}
.hero-cta {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: #1a1a1a;
  color: #fafaf8;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border: 2px solid #1a1a1a;
  transform: rotate(-0.8deg);
  transition: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.hero-cta:hover {
  background: #fafaf8;
  color: #1a1a1a;
  opacity: 1;
  transform: rotate(0.8deg);
}

/* ── Content section (main > section > aside交错) ── */
.content-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 3rem;
  align-items: start;
}
.content-sidebar {
  position: sticky;
  top: 90px;
  padding: 1.5rem 0;
}
.sidebar-inner {
  border-left: 3px solid #1a1a1a;
  padding-left: 1rem;
}
.sidebar-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #4a4a4a;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sidebar-nav-list li a {
  font-size: 0.85rem;
  color: #4a4a4a;
  display: block;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #4a4a4a;
  transition: none;
}
.sidebar-nav-list li a:hover {
  color: #1a1a1a;
  padding-left: 6px;
  opacity: 1;
}
.content-body {
  padding: 2.5rem 0 3rem;
  min-width: 0;
}

/* ── Content body inner styling (page.content 内部) ── */
.content-body h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 2.5rem 0 0.75rem;
  position: relative;
  padding-bottom: 0.4rem;
}
.content-body h2::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0; left: 0;
  width: 40px; height: 3px;
  background: #1a1a1a;
  transform: rotate(-0.5deg);
}
.content-body h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: #4a4a4a;
}
.content-body p {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #1a1a1a;
}
.content-body ul, .content-body ol {
  margin: 0.75rem 0 1rem 1.25rem;
}
.content-body ul { list-style: disc; }
.content-body ol { list-style: decimal; }
.content-body li { margin-bottom: 0.4rem; }
.content-body a {
  color: #1a1a1a;
  border-bottom: 1.5px solid #1a1a1a;
}
.content-body a:hover { opacity: 0.6; }
.content-body strong { font-weight: 700; }
.content-body blockquote {
  border-left: 4px solid #1a1a1a;
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: #f0efe8;
  font-style: italic;
  transform: rotate(-0.3deg);
}
.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}
.content-body th, .content-body td {
  border: 1.5px solid #1a1a1a;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.content-body th { background: #1a1a1a; color: #fafaf8; }

/* Section-level styling inside page.content */
.content-body section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #4a4a4a;
  opacity: 0.98;
  position: relative;
}
.content-body section:last-child { border-bottom: none; }

/* ── Small eyebrow (h2 前紧邻 small) ── */
small + h2, small + h3 {
  margin-top: 0.25rem;
}
small {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #4a4a4a;
  text-transform: uppercase;
}

/* ── Cards ── */
.card {
  border: 2px solid #1a1a1a;
  border-radius: 28px;
  padding: 1.25rem;
  background: #fafaf8;
  box-shadow: none;
  transform: rotate(var(--tilt, 0deg));
}

/* ── Footer ── */
.site-footer {
  border-top: 3px solid #1a1a1a;
  background: #1a1a1a;
  color: #fafaf8;
  padding: 0.9rem 1.5rem;
}
.site-footer > article,
.site-footer > nav {
  display: inline-flex;
  align-items: center;
}
/* footer 单行 flex */
.site-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.footer-logo .brand-text { color: #fafaf8; font-size: 1rem; }
.footer-logo .brand-logo { height: 28px; filter: invert(1); }
.footer-logo a { display: flex; align-items: center; }
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.footer-nav ul li a {
  color: #fafaf8;
  font-size: 0.8rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0.2rem 0;
}
.footer-nav ul li a:hover { opacity: 0.65; }
.footer-copy {
  font-size: 0.75rem;
  color: #4a4a4a;
  white-space: nowrap;
}
.footer-copy span { color: #888; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(18px) rotate(0.5deg);
  transition: none;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
  transition: opacity 0.4s steps(4), transform 0.35s steps(3);
}
.stagger-list > * {
  opacity: 0;
  transform: translateX(-12px);
  transition: none;
}
.stagger-list.is-visible > * {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s steps(3), transform 0.25s steps(2);
}
.stagger-list.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-list.is-visible > *:nth-child(2) { transition-delay: 60ms; }
.stagger-list.is-visible > *:nth-child(3) { transition-delay: 120ms; }
.stagger-list.is-visible > *:nth-child(4) { transition-delay: 180ms; }
.stagger-list.is-visible > *:nth-child(5) { transition-delay: 240ms; }
.stagger-list.is-visible > *:nth-child(6) { transition-delay: 300ms; }
.stagger-list.is-visible > *:nth-child(7) { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger-list > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
  }
  .content-sidebar {
    position: static;
    border-top: 2px solid #1a1a1a;
    padding-top: 1.25rem;
  }
  .sidebar-inner {
    border-left: none;
    border-top: 3px solid #1a1a1a;
    padding-left: 0;
    padding-top: 0.75rem;
  }
  .sidebar-nav-list { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
}

@media (max-width: 768px) {
  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-figure {
    min-height: 40vw;
    display: block;
  }
  .hero-slash { display: none; }
  .hero-aside {
    align-items: flex-start;
    text-align: left;
    padding: 2rem 1.25rem;
  }
  .hero-h1::before { margin-left: 0; }
  .hero-desc { max-width: 100%; }
  .anchor-link { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  .footer-nav ul { display: none; }
  .site-footer { gap: 0.75rem; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0.6rem 1rem; }
  .content-section { padding: 0 1rem; }
  .content-body { padding: 1.5rem 0 2rem; }
  .hero-aside { padding: 1.5rem 1rem; }
  .anchor-bar-inner { padding: 0 0.5rem; }
}
