@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;
}

:root {
  --c-green: #69ff69;
  --c-cyan: #00ffff;
  --c-dark: #172617;
  --c-dark2: #0e1a0e;
  --c-dark3: #1f371f;
  --c-white: #f0fff0;
  --c-muted: #a0c8a0;
  --c-border: #69ff69;
  --nav-width: 220px;
  --nav-width-collapsed: 64px;
  --font-hand: 'Kalam', 'Patrick Hand', cursive, sans-serif;
  --font-body: 'Patrick Hand', 'Kalam', cursive, sans-serif;
  --radius-card: 28px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 17px;
  line-height: 1.7;
}

body.y2k-body {
  background: var(--c-dark);
  color: var(--c-white);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 布局根容器 ===== */
.layout-root {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ===== 左侧固定导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--c-dark2) 0%, var(--c-dark3) 100%);
  border-right: 2px solid var(--c-green);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition);
}

.sidenav-logo {
  padding: 18px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border-bottom: 1px solid rgba(105, 255, 105, 0.25);
}

.sidenav-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  min-width: 40px;
  min-height: 40px;
}

.site-logo-mark,
.site-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.site-logo-text {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--c-green);
  text-shadow: 0 0 12px var(--c-green), 0 0 24px rgba(105,255,105,0.5);
  line-height: 1;
}

/* details / summary 导航 */
.sidenav-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidenav-details[open] {
  overflow-y: auto;
}

.sidenav-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(105, 255, 105, 0.15);
  min-height: 48px;
  user-select: none;
}

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

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}

.hamburger-icon span {
  display: block;
  height: 2px;
  background: var(--c-cyan);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--c-cyan);
  transition: all var(--transition);
}

.sidenav-details[open] .hamburger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.sidenav-details[open] .hamburger-icon span:nth-child(2) {
  opacity: 0;
}
.sidenav-details[open] .hamburger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidenav-menu {
  list-style: none;
  padding: 8px 0;
}

.sidenav-menu li {
  display: block;
}

.sidenav-menu li a {
  display: block;
  padding: 12px 22px;
  color: var(--c-muted);
  text-decoration: none;
  font-family: var(--font-hand);
  font-size: 0.95rem;
  transition: color var(--transition), background var(--transition), padding-left var(--transition);
  border-left: 3px solid transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.sidenav-menu li a:hover,
.sidenav-menu li a:focus {
  color: var(--c-green);
  background: rgba(105, 255, 105, 0.07);
  border-left-color: var(--c-green);
  padding-left: 28px;
  text-shadow: 0 0 8px var(--c-green);
  outline: none;
}

/* ===== 主内容偏移 ===== */
.page-body {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Hero 区 ===== */
.hero-wrap {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-dark2) 0%, #0a2a1a 50%, var(--c-dark3) 100%);
}

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

.hero-media--empty {
  background: linear-gradient(135deg, #0d1f0d 0%, #091a12 60%, #172617 100%);
}

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

.hero-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(23, 38, 23, 0.88) 0%,
    rgba(23, 38, 23, 0.55) 55%,
    rgba(0, 0, 0, 0.25) 100%
  );
  z-index: 1;
}

/* 斜切底边 */
.hero-clip-bg {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--c-dark);
  clip-path: polygon(0 40px, 100% 0, 100% 100%, 0 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: right;
  padding: 60px 56px 120px 40px;
  max-width: 640px;
}

.hero-h1 {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.2;
  color: var(--c-green);
  text-shadow: 0 0 20px var(--c-green), 0 0 40px rgba(105,255,105,0.4);
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--c-cyan);
  text-shadow: 0 0 10px var(--c-cyan);
  margin-bottom: 2rem;
  opacity: 0.92;
}

.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--c-green) 0%, var(--c-cyan) 100%);
  color: var(--c-dark);
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: var(--radius-card);
  text-decoration: none;
  border: 2px solid transparent;
  transition: all var(--transition);
  min-height: 48px;
  line-height: 1.2;
  box-shadow: 0 0 18px rgba(105,255,105,0.35), 0 0 36px rgba(0,255,255,0.18);
}

.hero-cta:hover,
.hero-cta:focus {
  background: var(--c-dark);
  color: var(--c-green);
  border-color: var(--c-green);
  box-shadow: 0 0 28px rgba(105,255,105,0.6), 0 0 56px rgba(0,255,255,0.25);
  outline: none;
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  padding: 40px 0;
}

/* div 直接子元素布局 */
.content-section {
  position: relative;
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* aside 在内容左侧 */
.content-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: 32px;
  align-self: start;
}

.aside-inner {
  background: var(--c-dark3);
  border: 2px solid var(--c-green);
  border-radius: var(--radius-card);
  padding: 20px 16px;
}

.aside-title {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-green);
  text-shadow: 0 0 8px var(--c-green);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(105,255,105,0.3);
}

.aside-title span {
  display: inline;
}

.aside-links {
  list-style: none;
}

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

.aside-links li a {
  display: block;
  color: var(--c-muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 7px 10px;
  border-radius: 10px;
  min-height: 36px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.aside-links li a:hover,
.aside-links li a:focus {
  color: var(--c-cyan);
  background: rgba(0,255,255,0.07);
  border-color: var(--c-cyan);
  text-shadow: 0 0 6px var(--c-cyan);
  outline: none;
}

/* figure 装饰 */
.content-figure {
  grid-column: 1;
  grid-row: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
  opacity: 0.6;
}

.deco-circle {
  border-radius: 50%;
  border: 2px solid var(--c-green);
  animation: pulse-ring 3s ease-in-out infinite;
}

.deco-circle--lg {
  width: 80px;
  height: 80px;
  border-color: var(--c-cyan);
  animation-delay: 0s;
}

.deco-circle--sm {
  width: 44px;
  height: 44px;
  border-color: var(--c-green);
  animation-delay: 1.5s;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(105,255,105,0); transform: scale(1); }
  50% { box-shadow: 0 0 0 8px rgba(105,255,105,0.15); transform: scale(1.05); }
}

/* 正文主体 */
.content-body {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* ===== page.content 内部 div 样式 ===== */
.content-body div {
  margin-bottom: 48px;
  scroll-margin-top: 80px;
}

.content-body div:last-child {
  margin-bottom: 0;
}

/* 内容 div 之间分隔 */
.content-body div + div {
  padding-top: 40px;
  border-top: 1px solid rgba(105,255,105,0.15);
}

/* ===== 正文排版 ===== */
.content-body h2,
.content-body h3 {
  font-family: var(--font-hand);
  font-weight: 700;
  margin-bottom: 0.75em;
  margin-top: 1.5em;
}

.content-body h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--c-green);
  text-shadow: 0 0 10px rgba(105,255,105,0.45);
}

.content-body h2 span {
  display: inline;
}

.content-body h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--c-cyan);
  text-shadow: 0 0 8px rgba(0,255,255,0.4);
}

.content-body h3 span {
  display: inline;
}

.content-body p {
  margin-bottom: 1em;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-white);
  opacity: 0.93;
}

.content-body ul,
.content-body ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.content-body li {
  margin-bottom: 0.4em;
  line-height: 1.7;
}

.content-body a {
  color: var(--c-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition), text-shadow var(--transition);
}

.content-body a:hover,
.content-body a:focus {
  color: var(--c-green);
  text-shadow: 0 0 8px var(--c-green);
  outline: none;
}

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

.content-body em {
  color: var(--c-cyan);
  font-style: italic;
}

/* 卡片风格（描边无阴影，28px圆角） */
.content-body .card,
.content-body section,
.content-body .entry {
  border: 2px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-bottom: 20px;
  background: var(--c-dark3);
  transition: border-color var(--transition);
}

.content-body .card:hover,
.content-body section:hover {
  border-color: var(--c-cyan);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-dark2);
  border-top: 2px solid rgba(105,255,105,0.25);
  text-align: center;
  padding: 32px 24px 24px;
}

.footer-brand {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 4rem);
  color: transparent;
  background: linear-gradient(135deg, var(--c-green) 0%, var(--c-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
  text-shadow: none;
}

.footer-copy {
  display: block;
  font-size: 0.82rem;
  color: var(--c-muted);
  line-height: 1.5;
  opacity: 0.75;
}

/* ===== scroll-margin-top for sections ===== */
div[id] {
  scroll-margin-top: 24px;
}

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

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

  .stagger-list > * {
    opacity: 0;
    transform: translateX(-18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .stagger-list.is-visible > * {
    opacity: 1;
    transform: none;
  }

  .stagger-list.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
  .stagger-list.is-visible > *:nth-child(2) { transition-delay: 0.12s; }
  .stagger-list.is-visible > *:nth-child(3) { transition-delay: 0.19s; }
  .stagger-list.is-visible > *:nth-child(4) { transition-delay: 0.26s; }
  .stagger-list.is-visible > *:nth-child(5) { transition-delay: 0.33s; }
  .stagger-list.is-visible > *:nth-child(6) { transition-delay: 0.40s; }
  .stagger-list.is-visible > *:nth-child(7) { transition-delay: 0.47s; }

  .content-body div {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

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

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

/* ===== 荧光铬色装饰线 ===== */
.sidenav::after {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--c-green) 0%, var(--c-cyan) 50%, var(--c-green) 100%);
  animation: border-flow 4s linear infinite;
}

@keyframes border-flow {
  0% { background-position: 0 0; }
  100% { background-position: 0 200px; }
}

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

/* 平板 */
@media (max-width: 900px) {
  :root {
    --nav-width: 200px;
  }

  .content-section {
    grid-template-columns: 170px 1fr;
    padding: 0 20px;
    gap: 0 20px;
  }

  .hero-content {
    padding: 48px 36px 110px 24px;
  }
}

/* 移动端 */
@media (max-width: 680px) {
  :root {
    --nav-width: 0px;
  }

  html {
    font-size: 16px;
  }

  .sidenav {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 2px solid var(--c-green);
    z-index: 200;
    padding: 0;
  }

  .sidenav::after {
    width: 100%;
    height: 2px;
    top: auto;
    bottom: -1px;
    right: 0;
    background: linear-gradient(90deg, var(--c-green) 0%, var(--c-cyan) 50%, var(--c-green) 100%);
  }

  .sidenav-logo {
    border-bottom: none;
    border-right: 1px solid rgba(105,255,105,0.25);
    padding: 10px 14px;
    min-height: 52px;
  }

  .sidenav-details {
    position: relative;
    flex: 0;
  }

  .sidenav-details[open] {
    position: static;
  }

  .sidenav-summary {
    border-bottom: none;
    padding: 14px 18px;
    min-height: 52px;
  }

  .sidenav-menu {
    position: fixed;
    top: 54px;
    left: 0;
    right: 0;
    background: var(--c-dark2);
    border-bottom: 2px solid var(--c-cyan);
    padding: 8px 0 12px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 300;
  }

  .sidenav-menu li a {
    padding: 13px 24px;
    font-size: 1rem;
    min-height: 48px;
  }

  .page-body {
    margin-left: 0;
    padding-top: 54px;
  }

  .hero-wrap {
    min-height: 60vh;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .hero-content {
    padding: 32px 20px 90px;
    max-width: 100%;
  }

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

  .content-section {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 0 16px;
    gap: 24px 0;
  }

  .content-aside {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }

  .content-figure {
    grid-column: 1;
    grid-row: 3;
    display: none;
  }

  .content-body {
    grid-column: 1;
    grid-row: 1;
  }

  .content-body div {
    scroll-margin-top: 70px;
  }

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

  .footer-brand {
    font-size: 2.2rem;
  }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--c-dark2);
}
::-webkit-scrollbar-thumb {
  background: var(--c-green);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--c-cyan);
}

/* ===== 焦点可见性 ===== */
:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 2px;
}

/* ===== 选择高亮 ===== */
::selection {
  background: rgba(105,255,105,0.3);
  color: var(--c-white);
}
