@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

/* ============================================================
   CSS 自定义属性
   ============================================================ */
:root {
  --c-bg: #fafaf8;
  --c-mid: #4a4a4a;
  --c-ink: #1a1a1a;
  --c-accent: #d64f3a;
  --c-accent2: #e8a020;
  --c-surface: #f0eeeb;
  --c-border: #c8c4be;
  --c-white: #ffffff;
  --nav-w: 220px;
  --radius: 4px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --shadow-card: 2px 4px 12px rgba(26,26,26,0.10);
  --shadow-hover: 3px 6px 18px rgba(26,26,26,0.18);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-bg);
}

body.body-root {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-bg);
  overflow-x: hidden;
}

/* 给锚点留出固定导航的空间（移动端顶栏高度） */
article[id] { scroll-margin-top: 80px; }

a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
ul, menu { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 800; line-height: 1.25; color: var(--c-ink); }

/* ============================================================
   纸张质感 & 涂鸦装饰
   ============================================================ */
/* 用 SVG 数据URI生成手绘纹理底 */
body.body-root::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 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.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.6;
}

/* ============================================================
   页面骨架
   ============================================================ */
.page-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ============================================================
   左侧固定竖排导航  details > summary + menu > li > a
   ============================================================ */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-ink);
  color: var(--c-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  border-right: 3px solid var(--c-accent);
  /* 轻微的手绘歪斜感用内阴影模拟 */
  box-shadow: 4px 0 0 0 var(--c-accent2);
}

/* 隐藏 details 的默认三角 */
.sidebar-nav > summary { list-style: none; }
.sidebar-nav > summary::-webkit-details-marker { display: none; }

.sidebar-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 16px 12px;
  border-bottom: 2px dashed var(--c-mid);
  cursor: default;
  user-select: none;
}

.nav-toggle-label { display: none; }

.brand-link {
  display: block;
  text-decoration: none;
  margin-bottom: 6px;
}

.logo-text {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  color: var(--c-bg);
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-all;
}

.site-logo-img {
  max-width: 160px;
  max-height: 48px;
  object-fit: contain;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}

.sidebar-menu li { width: 100%; }

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-bg);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
  min-height: 44px;
  letter-spacing: 0.01em;
}

.sidebar-menu li a:hover {
  background: rgba(250,250,248,0.08);
  border-left-color: var(--c-accent);
  color: var(--c-accent2);
  text-decoration: none;
  /* 微抖动效果 */
  transform: translateX(2px);
}

.sidebar-slogan {
  padding: 12px 16px 20px;
  font-size: 11px;
  color: var(--c-mid);
  font-style: italic;
  border-top: 1px dashed var(--c-mid);
  margin-top: auto;
  line-height: 1.5;
}

/* ============================================================
   主内容区
   ============================================================ */
.main-wrapper {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Hero 区块 —— 右图左文，约 45vh，斜切色带
   ============================================================ */
.hero-band {
  position: relative;
  min-height: 45vh;
  background: var(--c-surface);
  overflow: hidden;
  border-bottom: 3px solid var(--c-ink);
}

/* 斜切色带装饰 */
.hero-slash {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--c-bg);
  clip-path: polygon(0 60px, 100% 0, 100% 60px);
  z-index: 2;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 45vh;
  position: relative;
  z-index: 1;
}

.hero-text-col {
  flex: 1 1 50%;
  padding: 48px 40px 72px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero-h1 {
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--c-ink);
  /* 轻微手绘感：文字阴影偏移 */
  text-shadow: 2px 2px 0 var(--c-accent2);
}

.hero-sub {
  font-size: 15px;
  color: var(--c-mid);
  margin-bottom: 28px;
  max-width: 380px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-block;
  background: var(--c-accent);
  color: var(--c-white);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border: 2px solid var(--c-ink);
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: 0.02em;
  /* 手绘微旋转 */
  transform: rotate(-0.8deg);
  box-shadow: 3px 3px 0 var(--c-ink);
  transition: transform 0.12s, box-shadow 0.12s;
  min-height: 44px;
}

.hero-cta:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 5px 5px 0 var(--c-ink);
  text-decoration: none;
  background: var(--c-accent2);
  color: var(--c-ink);
}

.hero-img-col {
  flex: 1 1 45%;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-ink);
  overflow: hidden;
  position: relative;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.88;
  filter: contrast(1.05);
}

.hero-img-placeholder {
  background: repeating-linear-gradient(
    -45deg,
    var(--c-ink) 0,
    var(--c-ink) 2px,
    transparent 2px,
    transparent 12px
  );
}

.sketch-deco {
  font-size: 80px;
  color: rgba(250,250,248,0.15);
  font-weight: 800;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-12deg);
  user-select: none;
}

/* ============================================================
   正文主容器  main > div.wrap > article > section
   ============================================================ */
.content-main {
  flex: 1;
  padding: 48px 0 64px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.content-section {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.content-article {
  flex: 1 1 0;
  min-width: 0;
}

/* ============================================================
   正文内容样式（page.content 里的 HTML）
   ============================================================ */
.content-article h2 {
  font-size: 22px;
  font-weight: 800;
  margin-top: 48px;
  margin-bottom: 6px;
  color: var(--c-ink);
  position: relative;
}

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

.content-article h2 + hr {
  border: none;
  border-top: 3px solid var(--c-accent);
  margin-bottom: 20px;
  width: 60px;
  /* 手绘感 */
  transform: rotate(-0.5deg);
}

.content-article h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 8px;
  color: var(--c-ink);
}

.content-article h3 + hr {
  border: none;
  border-top: 2px dashed var(--c-mid);
  margin-bottom: 16px;
  width: 48px;
}

.content-article p {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-ink);
}

.content-article ul,
.content-article ol {
  margin: 12px 0 20px 20px;
  list-style: disc;
}

.content-article ol { list-style: decimal; }

.content-article li {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.7;
}

.content-article a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.content-article a:hover { color: var(--c-accent2); }

.content-article strong { font-weight: 700; color: var(--c-ink); }
.content-article em { font-style: italic; color: var(--c-mid); }

.content-article blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 4px solid var(--c-accent);
  background: var(--c-surface);
  border-radius: var(--radius);
  font-style: italic;
  color: var(--c-mid);
}

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

.content-article th,
.content-article td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  text-align: left;
}

.content-article th {
  background: var(--c-ink);
  color: var(--c-bg);
  font-weight: 700;
}

.content-article tr:nth-child(even) td { background: var(--c-surface); }

/* article 区块 */
.content-article article {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 2px dashed var(--c-border);
}

.content-article article:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* ============================================================
   侧边栏 aside（右侧）
   ============================================================ */
.content-aside {
  flex: 0 0 220px;
  position: sticky;
  top: 32px;
}

.aside-inner {
  background: var(--c-surface);
  border: 2px solid var(--c-ink);
  border-radius: var(--radius);
  padding: 20px 18px;
  /* 手绘微旋转 */
  transform: rotate(0.4deg);
  box-shadow: 4px 4px 0 var(--c-ink);
}

.aside-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--c-ink);
  margin-bottom: 6px;
}

.aside-inner > hr {
  border: none;
  border-top: 2px solid var(--c-accent);
  margin-bottom: 14px;
  width: 40px;
}

.aside-links {
  margin-bottom: 18px;
}

.aside-links li { margin-bottom: 4px; }

.aside-links li a {
  font-size: 13px;
  color: var(--c-ink);
  font-weight: 600;
  text-decoration: none;
  display: block;
  padding: 5px 0;
  border-bottom: 1px dashed var(--c-border);
  transition: color 0.12s, padding-left 0.12s;
  min-height: 32px;
  line-height: 1.5;
}

.aside-links li a:hover {
  color: var(--c-accent);
  padding-left: 4px;
  text-decoration: none;
}

.aside-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--c-ink);
  color: var(--c-bg);
  border-radius: 2px;
  letter-spacing: 0.03em;
  transform: rotate(-0.5deg);
}

/* ============================================================
   页脚  footer > article×n
   ============================================================ */
.site-footer {
  background: var(--c-ink);
  color: var(--c-bg);
  border-top: 3px solid var(--c-accent);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  position: relative;
}

.footer-brand {
  padding: 40px 40px 32px;
  border-right: 1px dashed rgba(250,250,248,0.15);
}

.footer-logo {
  margin-bottom: 14px;
}

.footer-logo .logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-bg);
}

.footer-desc {
  font-size: 13px;
  color: rgba(250,250,248,0.6);
  line-height: 1.7;
  max-width: 300px;
}

.footer-links {
  padding: 40px 40px 32px;
}

.footer-links-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--c-accent2);
  margin-bottom: 14px;
  text-transform: uppercase;
  font-family: var(--font);
}

.footer-nav-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}

.footer-nav-list li a {
  font-size: 13px;
  color: rgba(250,250,248,0.7);
  text-decoration: none;
  padding: 5px 0;
  display: block;
  min-height: 32px;
  line-height: 1.5;
  border-bottom: 1px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}

.footer-nav-list li a:hover {
  color: var(--c-bg);
  border-bottom-color: var(--c-accent);
  text-decoration: none;
}

.footer-bottom {
  grid-column: 1 / -1;
  text-align: center;
  padding: 18px 24px;
  border-top: 1px dashed rgba(250,250,248,0.12);
  font-size: 12px;
  color: rgba(250,250,248,0.4);
  line-height: 1.6;
}

/* ============================================================
   Stagger 动效（进场）
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .content-article article {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }

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

  .sidebar-menu li {
    opacity: 0;
    transform: translateX(-12px);
    animation: navSlideIn 0.35s ease forwards;
  }

  .sidebar-menu li:nth-child(1) { animation-delay: 0.05s; }
  .sidebar-menu li:nth-child(2) { animation-delay: 0.10s; }
  .sidebar-menu li:nth-child(3) { animation-delay: 0.15s; }
  .sidebar-menu li:nth-child(4) { animation-delay: 0.20s; }
  .sidebar-menu li:nth-child(5) { animation-delay: 0.25s; }
  .sidebar-menu li:nth-child(6) { animation-delay: 0.30s; }
  .sidebar-menu li:nth-child(7) { animation-delay: 0.35s; }

  @keyframes navSlideIn {
    to { opacity: 1; transform: none; }
  }

  /* Hero 文字进场 */
  .hero-h1 {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.5s 0.1s ease forwards;
  }

  .hero-sub {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.5s 0.22s ease forwards;
  }

  .hero-cta {
    opacity: 0;
    transform: translateY(10px) rotate(-0.8deg);
    animation: fadeUpCta 0.5s 0.34s ease forwards;
  }

  @keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes fadeUpCta {
    to { opacity: 1; transform: translateY(0) rotate(-0.8deg); }
  }
}

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

  .hero-text-col { padding: 36px 28px 64px 28px; }

  .wrap { padding: 0 20px; }

  .content-section {
    flex-direction: column;
    gap: 32px;
  }

  .content-aside {
    flex: none;
    width: 100%;
    position: static;
  }

  .aside-inner { transform: none; }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-brand { border-right: none; border-bottom: 1px dashed rgba(250,250,248,0.12); }
}

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

  html { scroll-behavior: smooth; }

  /* 移动端导航折叠为顶栏 */
  .sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 100vh;
    overflow-y: auto;
    border-right: none;
    border-bottom: 3px solid var(--c-accent);
    box-shadow: 0 3px 0 0 var(--c-accent2);
    z-index: 200;
    flex-direction: column;
  }

  .sidebar-summary {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
  }

  .nav-toggle-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-bg);
    padding: 8px 12px;
    border: 1px solid rgba(250,250,248,0.3);
    border-radius: var(--radius);
    min-height: 40px;
    line-height: 1.4;
  }

  /* details 未打开时隐藏 menu */
  .sidebar-nav:not([open]) .sidebar-menu,
  .sidebar-nav:not([open]) .sidebar-slogan {
    display: none;
  }

  .sidebar-menu {
    padding: 8px 0 12px;
    border-top: 1px dashed rgba(250,250,248,0.2);
  }

  .sidebar-menu li a {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 15px;
  }

  .sidebar-slogan { padding: 8px 16px 12px; }

  .main-wrapper {
    margin-left: 0;
    margin-top: 64px;
  }

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

  .hero-inner {
    flex-direction: column-reverse;
    min-height: auto;
  }

  .hero-text-col {
    padding: 28px 20px 52px;
    width: 100%;
  }

  .hero-h1 { font-size: 26px; }

  .hero-img-col {
    width: 100%;
    height: 200px;
    flex: none;
  }

  .hero-cta {
    min-height: 44px;
    padding: 12px 22px;
    font-size: 14px;
  }

  .content-main { padding: 32px 0 48px; }

  .wrap { padding: 0 16px; }

  .content-section {
    flex-direction: column;
    gap: 24px;
  }

  .content-aside { display: none; }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-brand { padding: 28px 20px 20px; }
  .footer-links { padding: 20px 20px 24px; }

  .footer-nav-list {
    grid-template-columns: 1fr 1fr;
  }

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

  article[id] { scroll-margin-top: 70px; }
}

/* ============================================================
   移动端 375px 修正
   ============================================================ */
@media (max-width: 400px) {
  .hero-h1 { font-size: 22px; }
  .footer-nav-list { grid-template-columns: 1fr; }
  .footer-brand, .footer-links { padding-left: 16px; padding-right: 16px; }
}

/* ============================================================
   卡片（正文内可能用到）
   ============================================================ */
.content-article .card {
  background: var(--c-white);
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, transform 0.15s;
}

.content-article .card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* ============================================================
   HR 全局样式
   ============================================================ */
hr {
  border: none;
  border-top: 2px solid var(--c-border);
  margin: 20px 0;
}
