@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700&family=Comic+Neue:wght@300;400;700&display=swap');

/* ===========================
   CSS 自定义属性
=========================== */
:root {
  --c-bg: #0D1B2A;
  --c-accent: #7B2FBE;
  --c-gold: #F5A623;
  --c-text: #e8eaf0;
  --c-muted: #9ba5b4;
  --c-surface: #131f30;
  --c-surface2: #1a2a3e;
  --c-border: rgba(123,47,190,0.35);
  --c-glow: rgba(123,47,190,0.55);
  --c-gold-glow: rgba(245,166,35,0.4);
  --font-main: 'Baloo 2', 'Comic Neue', system-ui, sans-serif;
  --nav-h: 64px;
  --sticky-h: 44px;
  --radius-pill: 999px;
  --transition: 0.25s ease;
}

/* ===========================
   Reset & Base
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--sticky-h) + 8px);
  font-size: 17px;
  background: var(--c-bg);
  color: var(--c-text);
}

body {
  font-family: var(--font-main);
  line-height: 1.7;
  overflow-x: hidden;
  background: var(--c-bg);
}

a { color: var(--c-gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: #ffd27a; }

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

ul { list-style: none; }

/* ===========================
   Scrollbar
=========================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-accent); border-radius: 3px; }

/* ===========================
   顶部导航栏 .topbar
=========================== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13,27,42,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  z-index: 1000;
  will-change: transform;
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo-img { height: 36px; width: auto; }

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-gold);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.top-nav { margin-left: auto; }

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  min-height: 40px;
}

.nav-pill:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
  box-shadow: 0 0 14px var(--c-glow);
}

/* 汉堡按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--c-gold);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   粘性锚点条 .sticky-bar
=========================== */
.sticky-bar {
  position: sticky;
  top: var(--nav-h);
  height: var(--sticky-h);
  background: var(--c-surface);
  border-bottom: 2px solid var(--c-accent);
  z-index: 900;
  overflow-x: auto;
  scrollbar-width: none;
}

.sticky-bar::-webkit-scrollbar { display: none; }

.sticky-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  padding: 0 16px;
  min-width: max-content;
}

.sticky-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  color: var(--c-muted);
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  border-right: 1px solid var(--c-border);
  transition: color var(--transition), background var(--transition);
  min-height: 40px;
}

.sticky-link:first-child { border-left: 1px solid var(--c-border); }

.sticky-link:hover {
  color: var(--c-gold);
  background: rgba(245,166,35,0.08);
}

/* ===========================
   Hero
=========================== */
.hero-wrap {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: calc(var(--nav-h) + var(--sticky-h));
  background: var(--c-bg);
}

/* 视差层 */
.hero-bg-layer {
  position: absolute;
  inset: -30% 0;
  pointer-events: none;
  will-change: transform;
}

.layer-1 {
  background: radial-gradient(ellipse 80% 60% at 20% 40%, rgba(123,47,190,0.45) 0%, transparent 70%);
  z-index: 1;
}

.layer-2 {
  background: radial-gradient(ellipse 60% 50% at 80% 60%, rgba(245,166,35,0.25) 0%, transparent 65%);
  z-index: 2;
}

.layer-3 {
  background: radial-gradient(ellipse 40% 40% at 50% 20%, rgba(123,47,190,0.2) 0%, transparent 60%);
  z-index: 3;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 56px 24px 80px;
  max-width: 800px;
}

.hero-h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 0 40px rgba(123,47,190,0.7), 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--c-muted);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 32px;
  border-radius: var(--radius-pill);
  background: var(--c-gold);
  color: #0D1B2A;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  transition: box-shadow var(--transition), transform var(--transition);
}

.hero-cta:hover {
  color: #0D1B2A;
  box-shadow: 0 0 24px var(--c-gold-glow), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

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

/* ===========================
   正文区域
=========================== */
.main-body {
  background: var(--c-surface);
  min-height: 60vh;
}

.content-article {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

/* ===========================
   侧边栏 aside（内容左侧）
=========================== */
.side-nav {
  position: sticky;
  top: calc(var(--nav-h) + var(--sticky-h) + 16px);
  background: var(--c-surface2);
  border-left: 3px solid var(--c-accent);
  padding: 20px 16px;
  border-radius: 0 8px 8px 0;
}

.aside-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  font-weight: 700;
  margin-bottom: 14px;
}

.aside-list li { margin-bottom: 2px; }

.aside-list a {
  display: block;
  padding: 6px 10px;
  font-size: 0.88rem;
  color: var(--c-muted);
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
  line-height: 1.5;
}

.aside-list a:hover {
  background: rgba(123,47,190,0.18);
  color: var(--c-gold);
}

/* ===========================
   内容 sections（page.content 注入）
=========================== */
.content-sections {
  min-width: 0;
}

/* 给 page.content 里的 section 提供视差展示效果 */
.content-sections section {
  background: var(--c-surface2);
  border-radius: 0;
  margin-bottom: 56px;
  padding: 40px 36px;
  border-top: 3px solid var(--c-accent);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-sections section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.content-sections section::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(123,47,190,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* 斜切装饰带（每隔一个） */
.content-sections section:nth-child(even) {
  border-top-color: var(--c-gold);
}

.content-sections section:nth-child(even)::before {
  background: radial-gradient(circle, rgba(245,166,35,0.1) 0%, transparent 70%);
}

/* section 内排版 */
.content-sections h2 {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.content-sections h2 + p,
.content-sections .subtitle,
.content-sections .subhead,
.content-sections .desc,
.content-sections .lead {
  color: var(--c-gold);
  font-size: 0.95rem;
  margin-bottom: 18px;
  font-weight: 500;
}

.content-sections h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-gold);
  margin: 24px 0 10px;
}

.content-sections p {
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 14px;
}

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

.content-sections li {
  color: var(--c-text);
  line-height: 1.7;
  margin-bottom: 6px;
  list-style: disc;
}

.content-sections a {
  color: var(--c-gold);
  border-bottom: 1px solid rgba(245,166,35,0.35);
  transition: border-color var(--transition), color var(--transition);
}

.content-sections a:hover {
  color: #ffd27a;
  border-color: #ffd27a;
}

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

.content-sections blockquote {
  border-left: 3px solid var(--c-accent);
  padding: 12px 20px;
  background: rgba(123,47,190,0.1);
  margin: 16px 0;
  color: var(--c-muted);
  font-style: italic;
}

.content-sections table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.content-sections th {
  background: var(--c-accent);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
}

.content-sections td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
}

.content-sections tr:hover td {
  background: rgba(123,47,190,0.08);
}

/* ===========================
   斜切分割带（section 间）
=========================== */
.content-sections section + section {
  position: relative;
}

/* ===========================
   页脚 footer 极简
=========================== */
.site-footer {
  background: var(--c-bg);
  border-top: 2px solid var(--c-border);
  padding: 48px 24px 32px;
  text-align: center;
}

.footer-brand {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--c-accent);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  text-shadow: 0 0 30px var(--c-glow);
}

.site-footer small {
  display: block;
  color: var(--c-muted);
  font-size: 0.84rem;
  line-height: 1.8;
}

/* footer 内 nav > dl */
.footer-nav-dl {
  display: inline-block;
  margin-top: 16px;
}

.footer-nav-dl dl {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 0;
}

.footer-nav-dl dt,
.footer-nav-dl dd {
  display: inline;
}

.footer-nav-dl dt::after {
  content: '';
}

.footer-nav-dl dt a,
.footer-nav-dl dd a {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  min-height: 40px;
  color: var(--c-muted);
  font-size: 0.82rem;
  border-right: 1px solid var(--c-border);
  transition: color var(--transition);
}

.footer-nav-dl dd:last-child a { border-right: none; }

.footer-nav-dl dt a:hover,
.footer-nav-dl dd a:hover { color: var(--c-gold); }

/* ===========================
   Scroll Reveal（Intersection Observer）
=========================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   Hover Micro-interactions
=========================== */
.nav-pill,
.sticky-link,
.hero-cta,
.aside-list a {
  will-change: transform;
}

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

  .side-nav {
    position: static;
    border-left: none;
    border-top: 3px solid var(--c-accent);
    border-radius: 0 0 8px 8px;
    margin-bottom: 32px;
  }

  .aside-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .aside-list a {
    padding: 6px 12px;
    background: var(--c-surface);
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
  }
}

@media (max-width: 680px) {
  :root { --nav-h: 56px; }

  .menu-toggle { display: flex; }

  .top-nav {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(13,27,42,0.97);
    backdrop-filter: blur(16px);
    padding: 20px 20px 28px;
    border-bottom: 1px solid var(--c-border);
    z-index: 999;
  }

  .top-nav.open { display: block; }

  .pill-group {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-pill {
    justify-content: center;
    height: 48px;
    font-size: 0.95rem;
  }

  .hero-content { padding: 44px 20px 72px; }

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

  .content-article { padding: 32px 16px 60px; }

  .content-sections section { padding: 28px 20px; }

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

  .footer-nav-dl dl { flex-direction: column; align-items: center; }

  .footer-nav-dl dt a,
  .footer-nav-dl dd a {
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
  }
}

/* ===========================
   prefers-reduced-motion
=========================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .content-sections section,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-cta:hover { transform: none; }
}

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