@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&family=Patrick+Hand&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: #192617;
  color: #f0ffe8;
}

body, .memphis-body {
  font-family: 'Patrick Hand', 'Kalam', 'Comic Sans MS', cursive, sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  background: #192617;
  color: #f0ffe8;
  min-height: 100vh;
  overflow-x: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

a { color: #87ff71; text-decoration: none; transition: color 0.2s; }
a:hover, a:focus { color: #ffce5c; text-decoration: underline; }
a:focus-visible { outline: 2px dashed #ffce5c; outline-offset: 3px; }

img { display: block; max-width: 100%; height: auto; }

ul, menu { list-style: none; }

/* ===== 装饰背景纹样 ===== */
.memphis-body {
  background-image:
    radial-gradient(circle, #87ff71 1px, transparent 1px),
    radial-gradient(circle, #ffce5c 1px, transparent 1px);
  background-size: 40px 40px, 80px 80px;
  background-position: 0 0, 20px 20px;
  background-attachment: fixed;
}

.page-wrap {
  position: relative;
  background: rgba(25, 38, 23, 0.93);
  min-height: 100vh;
}

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #192617;
  border-bottom: 3px dashed #87ff71;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0 12px;
  padding: 0 20px;
  min-height: 64px;
  position: relative;
}

/* 桌面导航 */
.site-nav {
  display: contents;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-menu--left { justify-content: flex-end; }
.nav-menu--right { justify-content: flex-start; }

.nav-menu li a {
  display: flex;
  align-items: center;
  padding: 10px 10px;
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 0.88rem;
  color: #f0ffe8;
  border-radius: 6px;
  white-space: nowrap;
  min-height: 40px;
  transition: background 0.2s, color 0.2s;
}

.nav-menu li a:hover,
.nav-menu li a:focus {
  background: #87ff71;
  color: #192617;
  text-decoration: none;
}

/* 品牌居中 */
.brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 48px;
  text-decoration: none;
}

.brand-text {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 1.25rem;
  color: #87ff71;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-logo-img { width: auto; height: 40px; object-fit: contain; }

/* 搜索框 */
.nav-search {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-search form {
  display: flex;
  align-items: center;
  background: rgba(135,255,113,0.1);
  border: 2px solid #87ff71;
  border-radius: 20px;
  overflow: hidden;
}

.nav-search input {
  background: transparent;
  border: none;
  color: #f0ffe8;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 6px 10px;
  width: 120px;
  outline: none;
}

.nav-search input::placeholder { color: rgba(240,255,232,0.5); }

.nav-search button {
  background: transparent;
  border: none;
  color: #87ff71;
  cursor: pointer;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  min-height: 40px;
  transition: color 0.2s;
}

.nav-search button:hover { color: #ffce5c; }

/* 汉堡/details 导航（移动端） */
.nav-details {
  display: none;
}

.nav-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 10px;
  min-height: 44px;
  color: #87ff71;
  font-family: 'Kalam', cursive;
  font-weight: 700;
}

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

.nav-burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}

.nav-burger span {
  display: block;
  height: 2px;
  background: #87ff71;
  border-radius: 2px;
  transition: transform 0.2s;
}

.nav-menu--mobile {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: #192617;
  border-bottom: 3px dashed #ffce5c;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
  z-index: 200;
}

.nav-menu--mobile li a {
  display: block;
  padding: 12px 24px;
  font-size: 1rem;
  min-height: 44px;
  border-bottom: 1px dotted rgba(135,255,113,0.2);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px 24px 36px;
  border-bottom: 4px solid #87ff71;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 18px,
    rgba(135,255,113,0.04) 18px,
    rgba(135,255,113,0.04) 20px
  );
  pointer-events: none;
}

.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.deco-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: clamp(5rem, 18vw, 14rem);
  color: rgba(135,255,113,0.06);
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.1em;
  mix-blend-mode: screen;
}

.deco-triangle--1 {
  position: absolute;
  top: -20px;
  right: 5%;
  width: 120px;
  height: 120px;
  fill: #ffce5c;
  opacity: 0.22;
  transform: rotate(15deg);
}

.deco-triangle--2 {
  position: absolute;
  bottom: -10px;
  left: 3%;
  width: 80px;
  height: 80px;
  fill: #87ff71;
  opacity: 0.18;
  transform: rotate(-20deg);
}

.deco-squiggle {
  position: absolute;
  bottom: 20px;
  right: 10%;
  width: 140px;
  opacity: 0.6;
}

.deco-dot-grid {
  position: absolute;
  top: 10px;
  left: 8%;
  width: 80px;
  height: 80px;
  background-image: radial-gradient(circle, #ffce5c 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 700px;
}

.hero-h1 {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: #87ff71;
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 3px 3px 0 #192617, 5px 5px 0 rgba(255,206,92,0.3);
}

.hero-desc {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #f0ffe8;
  margin-bottom: 28px;
  line-height: 1.6;
  opacity: 0.9;
}

.hero-cta {
  display: inline-block;
  background: #87ff71;
  color: #192617;
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px 32px;
  border-radius: 28px;
  border: 3px solid #192617;
  box-shadow: 4px 4px 0 #ffce5c;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 44px;
  text-decoration: none;
}

.hero-cta:hover, .hero-cta:focus {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #ffce5c;
  color: #192617;
  text-decoration: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.12;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 内容区布局 ===== */
.content-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: 60vh;
}

/* ===== 侧边栏（左侧） ===== */
.sidebar {
  border-right: 3px dashed #87ff71;
  padding: 40px 20px 40px 24px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  align-self: start;
}

.sidebar-inner { position: relative; }

.sidebar-eyebrow {
  display: block;
  font-family: 'Kalam', cursive;
  font-size: 0.78rem;
  color: #ffce5c;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  border-bottom: 2px dotted #ffce5c;
  padding-bottom: 6px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar-nav li a {
  display: block;
  padding: 9px 12px;
  color: #f0ffe8;
  font-size: 0.9rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  min-height: 40px;
  line-height: 1.4;
}

.sidebar-nav li a:hover,
.sidebar-nav li a:focus {
  background: rgba(135,255,113,0.12);
  border-left-color: #87ff71;
  color: #87ff71;
  text-decoration: none;
}

.sidebar-deco {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.sidebar-zigzag { width: 30px; opacity: 0.5; }

/* ===== 主内容区 ===== */
.main-content {
  padding: 48px 40px 64px;
}

.page-article {}

.content-body {
  max-width: 800px;
}

/* 正文内容样式 */
.content-body h2 {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #87ff71;
  margin-top: 56px;
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 5px solid #ffce5c;
  position: relative;
}

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

.content-body h3 {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: #ffce5c;
  margin-top: 36px;
  margin-bottom: 12px;
}

.content-body p {
  margin-bottom: 18px;
  color: #e8f5e3;
  font-size: 1.05rem;
  line-height: 1.75;
}

.content-body ul, .content-body ol {
  margin: 0 0 18px 20px;
  color: #e8f5e3;
}

.content-body li {
  margin-bottom: 8px;
  line-height: 1.65;
  list-style: disc;
}

.content-body ol li { list-style: decimal; }

.content-body strong { color: #87ff71; }

.content-body em { color: #ffce5c; font-style: italic; }

.content-body a {
  color: #87ff71;
  text-decoration: underline dotted;
}

.content-body a:hover { color: #ffce5c; }

.content-body blockquote {
  border-left: 4px solid #ffce5c;
  background: rgba(255,206,92,0.08);
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #ffe9a0;
}

.content-body div {
  scroll-margin-top: 80px;
  padding-top: 8px;
  border-bottom: 2px dotted rgba(135,255,113,0.2);
  padding-bottom: 40px;
  margin-bottom: 8px;
  position: relative;
}

.content-body div:last-child { border-bottom: none; }

.content-body div::before {
  content: '';
  display: block;
  position: absolute;
  right: 0;
  top: 20px;
  width: 32px;
  height: 32px;
  background: #87ff71;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  opacity: 0.12;
}

/* 问答常见布局 */
.content-body dt {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  color: #ffce5c;
  font-size: 1.05rem;
  margin-top: 20px;
  margin-bottom: 6px;
}

.content-body dd {
  margin-left: 0;
  padding-left: 16px;
  border-left: 3px solid rgba(135,255,113,0.3);
  color: #e8f5e3;
  margin-bottom: 14px;
}

/* 滚动 margin for all sections */
div { scroll-margin-top: 80px; }

/* ===== 页脚 ===== */
.site-footer {
  background: #0d1a0c;
  border-top: 4px solid #87ff71;
  text-align: center;
  padding: 48px 24px 32px;
  position: relative;
  overflow: hidden;
}

.footer-cta-block {
  position: relative;
  margin-bottom: 32px;
}

.footer-cta-text {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  color: #87ff71;
  display: block;
  letter-spacing: 0.05em;
  text-shadow: 3px 3px 0 rgba(255,206,92,0.25);
  position: relative;
  z-index: 1;
}

.footer-triangle {
  position: absolute;
  width: 180px;
  height: 90px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.footer-copy {
  font-size: 0.9rem;
  color: rgba(240,255,232,0.7);
  margin-bottom: 10px;
  line-height: 1.6;
}

.footer-note {
  font-size: 0.8rem;
  color: rgba(240,255,232,0.45);
  display: block;
  line-height: 1.5;
}

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

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

  .reveal-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

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

/* ===== Memphis 几何装饰补充 ===== */
.content-body div:nth-child(2n) h2 { border-left-color: #87ff71; color: #ffce5c; }
.content-body div:nth-child(3n)::before { clip-path: polygon(50% 100%, 0 0, 100% 0); background: #ffce5c; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

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

  .nav-details {
    display: block;
    position: relative;
  }

  .site-nav {
    display: none;
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    justify-items: start;
  }

  .brand-center {
    justify-self: center;
  }

  .nav-search {
    position: static;
    transform: none;
    grid-column: 3;
    justify-self: end;
  }

  .nav-search input { width: 80px; }
}

@media (max-width: 600px) {
  .hero { padding: 36px 16px 28px; min-height: 40vh; }

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

  .main-content { padding: 24px 14px 40px; }

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

  .nav-search { display: none; }

  .header-inner { grid-template-columns: auto 1fr; }

  .brand-center { padding: 8px 10px; }

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

@media (max-width: 375px) {
  body { font-size: 16px; }
  .hero-h1 { font-size: 1.5rem; }
  .content-body p { font-size: 1rem; }
}
