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

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: #fafaf8;
  color: #1a1a1a;
}

body {
  font-family: 'Lexend', 'Source Sans 3', system-ui, sans-serif;
  line-height: 1.65;
  background: #fafaf8;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ===== 纸张肌理背景 ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 24px,
      rgba(74,74,74,0.04) 25px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 24px,
      rgba(74,74,74,0.025) 25px
    );
  background-size: 25px 25px;
}

/* ===== 布局骨架 ===== */
.site-wrap {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== 左侧固定导航 ===== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #1a1a1a;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #4a4a4a;
  overflow-y: auto;
  overflow-x: hidden;
  /* raw sketch border effect */
  box-shadow: 3px 0 0 rgba(74,74,74,0.3), 5px 0 0 rgba(74,74,74,0.1);
}

.side-nav summary { display: flex; }
.side-nav[open] summary { border-bottom: 1px solid #4a4a4a; }

.side-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  min-height: 70px;
  gap: 8px;
}
.side-nav__toggle::-webkit-details-marker { display: none; }

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.brand-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { width: 36px; height: 36px; border-radius: 4px; }

.brand-name {
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fafaf8;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fafaf8;
  border-radius: 1px;
}

/* 导航菜单 */
.side-nav__menu {
  flex: 1;
  padding: 12px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #4a4a4a;
  padding: 8px 20px 4px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(250,250,248,0.75);
  font-size: 0.9rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: none;
  min-height: 44px;
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  color: #fafaf8;
  border-left-color: #fafaf8;
  background: rgba(250,250,248,0.06);
  transform: translateX(2px) rotate(0.3deg);
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a4a4a;
  flex-shrink: 0;
  border: 1px solid rgba(250,250,248,0.3);
}

.nav-link:hover .nav-dot,
.nav-link:focus .nav-dot {
  background: #fafaf8;
}

.nav-text { flex: 1; }

.nav-cta-wrap {
  padding: 16px 20px;
  margin-top: auto;
}

.btn-cta {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: #fafaf8;
  color: #1a1a1a;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  border: 2px solid #fafaf8;
  border-radius: 4px;
  letter-spacing: 0.06em;
  min-height: 44px;
  /* raw sketch: slight rotate */
  transform: rotate(-0.5deg);
}
.btn-cta:hover {
  background: #1a1a1a;
  color: #fafaf8;
  transform: rotate(0.5deg) translateY(-1px);
}

/* ===== 主内容区 ===== */
.main-content {
  margin-left: 240px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: #1a1a1a;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* 文在上，图在下 */
.hero-text-layer {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 48px 60px;
  min-height: 55vh;
}

.hero-media-layer {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(30%) contrast(1.08);
  opacity: 0.6;
}

.hero-texture {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(26,26,26,0.15) 0px,
      rgba(26,26,26,0.15) 1px,
      transparent 1px,
      transparent 8px
    );
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(250,250,248,0.1);
  border: 1px solid rgba(250,250,248,0.25);
  color: rgba(250,250,248,0.85);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  border-radius: 2px;
  margin-bottom: 24px;
  transform: rotate(-0.8deg);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fafaf8;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-h1 {
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: #fafaf8;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 700px;
  margin-bottom: 20px;
  /* raw: slight skew */
  transform: rotate(-0.3deg);
}

.hero-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(250,250,248,0.7);
  max-width: 500px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.btn-hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  background: transparent;
  border: 2px solid #fafaf8;
  color: #fafaf8;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  border-radius: 2px;
  min-height: 48px;
  transform: rotate(0.4deg);
}
.btn-hero-cta:hover {
  background: #fafaf8;
  color: #1a1a1a;
  transform: rotate(-0.4deg) translateY(-2px);
}

/* 浮动徽章 */
.sketch-badge {
  position: absolute;
  background: #fafaf8;
  color: #1a1a1a;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 6px 12px;
  border: 2px solid #1a1a1a;
  letter-spacing: 0.06em;
}

.sketch-badge--1 {
  top: 15%;
  left: 8%;
  transform: rotate(-4deg);
  animation: float-badge 4s ease-in-out infinite;
}
.sketch-badge--2 {
  top: 35%;
  right: 10%;
  transform: rotate(3deg);
  animation: float-badge 5s ease-in-out infinite 1s;
}
.sketch-badge--3 {
  bottom: 20%;
  left: 12%;
  transform: rotate(-2deg);
  animation: float-badge 4.5s ease-in-out infinite 0.5s;
}

@keyframes float-badge {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-8px); }
}
.sketch-badge--2 { animation-name: float-badge-2; }
@keyframes float-badge-2 {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-6px); }
}
.sketch-badge--3 { animation-name: float-badge-3; }
@keyframes float-badge-3 {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-10px); }
}

/* sketch lines */
.sketch-line {
  position: absolute;
  background: rgba(250,250,248,0.15);
  pointer-events: none;
}
.sketch-line--1 {
  width: 1px;
  height: 60%;
  left: 20%;
  top: 10%;
  transform: rotate(8deg);
}
.sketch-line--2 {
  width: 40%;
  height: 1px;
  right: 0;
  bottom: 30%;
  transform: rotate(-3deg);
}

/* ===== 主内容 main ===== */
.page-main {
  background: #fafaf8;
  position: relative;
  z-index: 1;
}

.content-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* aside 在内容左侧 */
.content-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  padding: 48px 24px 48px 0;
  border-right: 1px solid rgba(74,74,74,0.2);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  align-self: start;
  /* raw sketch border */
  box-shadow: 2px 0 0 rgba(74,74,74,0.08);
}

.aside-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aside-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #4a4a4a;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(74,74,74,0.2);
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-nav-list a {
  display: block;
  padding: 7px 10px;
  font-size: 0.85rem;
  color: #4a4a4a;
  border-left: 2px solid transparent;
  line-height: 1.4;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.aside-nav-list a:hover {
  color: #1a1a1a;
  border-left-color: #1a1a1a;
  transform: translateX(2px);
}

/* figure 装饰 */
.content-figure {
  grid-column: 2;
  grid-row: 1;
  padding: 24px 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.figure-sketch {
  position: relative;
  width: 60px;
  height: 60px;
  opacity: 0.35;
}

.sketch-mark {
  position: absolute;
}

.mark-cross::before,
.mark-cross::after {
  content: '';
  position: absolute;
  background: #4a4a4a;
  top: 50%;
  left: 50%;
}
.mark-cross::before {
  width: 32px;
  height: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.mark-cross::after {
  width: 32px;
  height: 2px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mark-circle {
  width: 28px;
  height: 28px;
  border: 2px solid #4a4a4a;
  border-radius: 50%;
  top: 24px;
  left: 24px;
}

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

/* ===== 正文内容样式 ===== */
.content-body h2 {
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: #1a1a1a;
  line-height: 1.25;
  margin-top: 64px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a1a1a;
  transform: rotate(-0.2deg);
  display: block;
}

.content-body h2:first-child { margin-top: 0; }

.content-body .subtitle,
.content-body .subhead,
.content-body .desc,
.content-body .lead,
.content-body h2 + p {
  font-size: 1rem;
  font-weight: 300;
  color: #4a4a4a;
  margin-bottom: 24px;
  line-height: 1.7;
}

.content-body h3 {
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: #1a1a1a;
  margin-top: 36px;
  margin-bottom: 10px;
}

.content-body p {
  font-size: 1rem;
  line-height: 1.75;
  color: #1a1a1a;
  margin-bottom: 16px;
  max-width: 72ch;
}

.content-body ul,
.content-body ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.content-body li {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.content-body a {
  color: #1a1a1a;
  border-bottom: 1px solid #4a4a4a;
}
.content-body a:hover {
  border-bottom-color: #1a1a1a;
}

/* div 区块分隔感 */
.content-body div,
.content-body > div {
  padding-top: 16px;
  margin-bottom: 48px;
  scroll-margin-top: 24px;
}

/* 玻璃拟态卡片（正文内若有） */
.content-body .card,
.card {
  background: rgba(250,250,248,0.7);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(74,74,74,0.2);
  border-radius: 28px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 4px 16px rgba(26,26,26,0.06);
  transform: rotate(0.2deg);
}

/* ===== div scroll-margin (单页) ===== */
div[id] {
  scroll-margin-top: 24px;
}

/* ===== 页脚 ===== */
.site-footer {
  background: #1a1a1a;
  border-top: 2px solid #4a4a4a;
  padding: 28px 40px;
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
}

.footer-dl {
  flex: 1;
  min-width: 140px;
  padding: 0 20px;
  border-right: 1px solid rgba(74,74,74,0.4);
}
.footer-dl:first-child { padding-left: 0; }
.footer-dl:last-child { border-right: none; }

.footer-dl dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #4a4a4a;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.footer-dl dd {
  font-size: 0.82rem;
  color: rgba(250,250,248,0.65);
  line-height: 1.6;
  margin-bottom: 4px;
}

.footer-keyword {
  font-size: 0.75rem;
  color: #4a4a4a;
}

/* ===== Scroll Reveal 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* Parallax hint for hero media */
  .hero-media-layer {
    will-change: transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .sketch-badge, .badge-dot { animation: none !important; }
}

/* ===== 响应式 ===== */

/* 平板 */
@media (max-width: 1024px) {
  .side-nav {
    width: 200px;
  }
  .main-content {
    margin-left: 200px;
  }
  .content-section {
    grid-template-columns: 180px 1fr;
  }
}

/* 移动端 */
@media (max-width: 768px) {
  .side-nav {
    position: fixed;
    width: 100%;
    height: auto;
    max-height: 100vh;
    overflow-y: auto;
    border-right: none;
    border-bottom: 2px solid #4a4a4a;
    box-shadow: 0 4px 0 rgba(74,74,74,0.2);
    flex-direction: column;
  }

  .side-nav:not([open]) {
    height: auto;
  }

  .side-nav__toggle {
    padding: 14px 16px;
    min-height: 56px;
  }

  .hamburger {
    display: flex;
  }

  .side-nav__menu {
    padding: 8px 0 24px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .nav-cta-wrap {
    margin-top: 8px;
  }

  .main-content {
    margin-left: 0;
    margin-top: 56px;
  }

  /* Hero mobile */
  .hero-section {
    min-height: 100vh;
  }

  .hero-inner {
    min-height: 100vh;
  }

  .hero-text-layer {
    padding: 48px 24px 40px;
    min-height: 52vh;
  }

  .hero-h1 {
    font-size: clamp(1.6rem, 7vw, 2.5rem);
  }

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

  .btn-hero-cta {
    min-height: 48px;
    padding: 14px 24px;
  }

  /* 正文布局 mobile */
  .content-section {
    display: block;
    padding: 0 16px;
  }

  .content-aside {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(74,74,74,0.2);
    padding: 24px 0 20px;
    box-shadow: none;
    display: block;
  }

  .content-figure {
    display: none;
  }

  .content-body {
    padding: 24px 0 60px;
  }

  .content-body h2 {
    font-size: 1.3rem;
    margin-top: 48px;
  }

  /* 页脚 mobile */
  .site-footer {
    flex-direction: column;
    padding: 24px 20px;
    gap: 16px;
  }

  .footer-dl {
    border-right: none;
    border-bottom: 1px solid rgba(74,74,74,0.3);
    padding: 0 0 16px;
    width: 100%;
    min-width: 0;
  }

  .footer-dl:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* nav link tap target */
  .nav-link {
    min-height: 44px;
    padding: 12px 20px;
  }

  .aside-nav-list a {
    min-height: 40px;
    padding: 8px 10px;
  }
}

/* 小屏确保无横滚 */
@media (max-width: 480px) {
  .hero-h1 { font-size: 1.6rem; }
  .sketch-badge { display: none; }
  .content-body p { max-width: 100%; }
}

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