@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* ===== 变量 ===== */
:root {
  --c-dark: #1A1A2E;
  --c-red: #E63946;
  --c-cream: #F1FAEE;
  --c-dark2: #16213E;
  --c-red-dim: #c0303c;
  --c-cream-dim: #d0e8d8;
  --c-text: #F1FAEE;
  --c-text-muted: #a8bfb0;
  --c-card: #22223a;
  --nav-w: 240px;
  --radius-pill: 999px;
  --radius-card: 28px;
  --radius-sm: 4px;
  --transition: 160ms ease;
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-dark);
  color: var(--c-text);
}
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  background: var(--c-dark);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
input, button { font-family: inherit; }
address { font-style: normal; }

/* ===== 辅助 ===== */
.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;
}

/* ===== 布局外壳 ===== */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===== 左侧固定导航 ===== */
.sidenav {
  position: fixed;
  top: 0; left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-dark2);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidenav-brand {
  padding: 24px 20px 16px;
  border-bottom: 2px solid var(--c-red);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo-img {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-red);
  letter-spacing: 0.02em;
}

/* 搜索框 */
.sidenav-search {
  padding: 16px 20px 8px;
}
.search-input {
  width: 100%;
  background: var(--c-card);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--c-text);
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.search-input::placeholder { color: var(--c-text-muted); }
.search-input:focus { border-color: var(--c-red); }

/* 导航列表：nav > ol > li > a */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  flex: 1;
}
.nav-list li { display: block; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-text-muted);
  background: transparent;
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
}
.nav-link:hover, .nav-link:focus-visible {
  background: var(--c-red);
  color: var(--c-cream);
  outline: none;
}
.nav-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-red);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  transition: color var(--transition);
}
.nav-link:hover .nav-num,
.nav-link:focus-visible .nav-num {
  color: var(--c-cream);
}
.nav-text { flex: 1; }

.sidenav-deco {
  text-align: center;
  font-size: 3rem;
  color: var(--c-red);
  opacity: 0.12;
  padding: 16px 0 24px;
  user-select: none;
}

/* ===== 主内容区 ===== */
.content-area {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 60px 48px 60px 40px;
  background: var(--c-dark2);
  overflow: hidden;
}
.hero-bg-text {
  position: absolute;
  right: -60px; top: 50%;
  transform: translateY(-50%);
  font-size: clamp(200px, 30vw, 380px);
  color: var(--c-red);
  opacity: 0.06;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}
.hero-media {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.hero-logo {
  width: clamp(160px, 22vw, 300px);
  height: auto;
  border-radius: var(--radius-card);
}
.hero-spade {
  font-size: clamp(48px, 8vw, 96px);
  color: var(--c-red);
  line-height: 1;
  user-select: none;
}
.hero-text {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 560px;
}
.hero-eyebrow {
  background: var(--c-red);
  color: var(--c-cream);
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}
.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--c-cream);
  line-height: 1.2;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--c-text-muted);
  line-height: 1.7;
  max-width: 460px;
}
.hero-cta {
  display: inline-block;
  background: var(--c-red);
  color: var(--c-cream);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: var(--radius-pill);
  transition: background var(--transition), transform var(--transition);
  min-height: 44px;
  line-height: 1.4;
}
.hero-cta:hover, .hero-cta:focus-visible {
  background: var(--c-red-dim);
  transform: translateY(-2px);
  outline: none;
}

/* ===== body-layout: aside 在左 ===== */
.body-layout {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 0;
}

/* ===== aside ===== */
.content-aside {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  padding: 32px 16px 32px 24px;
}
.aside-inner {
  background: var(--c-card);
  border-radius: var(--radius-card);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aside-title {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-red);
  letter-spacing: 0.06em;
  text-transform: none;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-red);
}
.aside-inner ul { display: flex; flex-direction: column; gap: 4px; }
.aside-inner ul li a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--c-text-muted);
  transition: background var(--transition), color var(--transition);
  min-height: 36px;
  line-height: 1.4;
}
.aside-inner ul li a:hover,
.aside-inner ul li a:focus-visible {
  background: var(--c-red);
  color: var(--c-cream);
  outline: none;
}
.aside-badge {
  text-align: center;
  font-size: 2rem;
  color: var(--c-red);
  opacity: 0.25;
  margin-top: 8px;
  user-select: none;
}

/* ===== main > section > article ===== */
.content-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 40px 24px;
}
.main-article {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.page-content-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ===== 正文内容排版 ===== */
.page-content-section article {
  padding: 56px 0 40px;
  scroll-margin-top: 32px;
  border-bottom: 2px solid var(--c-card);
}
.page-content-section article:last-child { border-bottom: none; }

.page-content-section h2 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--c-cream);
  margin-bottom: 12px;
  line-height: 1.25;
}
.page-content-section h2 + hr {
  border: none;
  border-top: 3px solid var(--c-red);
  width: 56px;
  margin-bottom: 24px;
}
.page-content-section h3 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-cream);
  margin: 28px 0 8px;
}
.page-content-section h3 + hr {
  border: none;
  border-top: 2px solid var(--c-red);
  width: 36px;
  margin-bottom: 16px;
  opacity: 0.6;
}
.page-content-section p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text-muted);
  margin-bottom: 16px;
  max-width: 72ch;
}
.page-content-section ul,
.page-content-section ol {
  padding-left: 0;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-content-section ul { list-style: none; }
.page-content-section ul li {
  padding-left: 20px;
  position: relative;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text-muted);
}
.page-content-section ul li::before {
  content: '♠';
  position: absolute;
  left: 0;
  color: var(--c-red);
  font-size: 0.75rem;
  top: 0.25em;
}
.page-content-section ol { list-style: decimal inside; }
.page-content-section ol li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text-muted);
}
.page-content-section strong { color: var(--c-cream); font-weight: 600; }
.page-content-section a {
  color: var(--c-red);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.page-content-section a:hover { border-bottom-color: var(--c-red); }
.page-content-section blockquote {
  background: var(--c-card);
  border-left: 4px solid var(--c-red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 24px 0;
  color: var(--c-text-muted);
  font-size: 1rem;
  line-height: 1.7;
}
.page-content-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
.page-content-section th {
  background: var(--c-red);
  color: var(--c-cream);
  padding: 10px 16px;
  text-align: left;
  font-family: var(--font-head);
  font-weight: 600;
}
.page-content-section td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-card);
  color: var(--c-text-muted);
}
.page-content-section tr:hover td { background: var(--c-card); }

/* 卡片（正文内生成的卡片） */
.page-content-section .card {
  background: var(--c-card);
  border-radius: var(--radius-card);
  padding: 24px 28px;
  margin: 20px 0;
  transition: background var(--transition), transform var(--transition);
}
.page-content-section .card:hover {
  background: #2a2a48;
  transform: translateY(-3px);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-dark2);
  border-top: 2px solid var(--c-red);
  padding: 0 48px 0 24px;
}
.footer-inner {
  display: flex;
  gap: 48px;
  padding: 40px 0 32px;
  align-items: flex-start;
}
.footer-brand-col { flex: 1; }
.footer-address {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-brand-name {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-red);
}
.footer-brand-desc {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  max-width: 320px;
}
.footer-address a {
  color: var(--c-red);
  font-size: 0.9rem;
  transition: opacity var(--transition);
}
.footer-address a:hover { opacity: 0.75; }

.footer-links-col { flex: 0 0 auto; }
.footer-links-col ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links-col ul li a {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  padding: 4px 0;
  display: block;
  min-height: 32px;
  line-height: 1.6;
  transition: color var(--transition);
}
.footer-links-col ul li a:hover { color: var(--c-red); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--c-card);
  padding: 16px 0;
  font-size: 0.82rem;
  color: var(--c-text-muted);
}
.footer-spade {
  font-size: 1.2rem;
  color: var(--c-red);
  opacity: 0.5;
  user-select: none;
}

/* ===== Scroll Reveal 动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-cta, .nav-link, .aside-inner ul li a,
  .page-content-section .card, .search-input { transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  :root { --nav-w: 200px; }
  .hero-section { padding: 40px 32px 40px 28px; gap: 28px; }
  .content-main { padding: 32px 32px 32px 16px; }
  .content-aside { width: 180px; padding: 24px 12px 24px 16px; }
}

@media (max-width: 768px) {
  :root { --nav-w: 0px; }

  .site-wrapper { flex-direction: column; }

  /* 顶部 bar 导航 */
  .sidenav {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: auto;
    flex-direction: column;
    overflow: visible;
    z-index: 200;
  }
  .sidenav-brand {
    padding: 12px 16px;
    border-bottom: 2px solid var(--c-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sidenav-search { padding: 8px 16px; }
  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px 12px;
    border-top: 1px solid var(--c-card);
  }
  .nav-link { padding: 8px 14px; font-size: 0.85rem; min-height: 40px; }
  .nav-num { display: none; }
  .sidenav-deco { display: none; }

  .content-area {
    margin-left: 0;
    margin-top: 160px;
  }

  .hero-section {
    flex-direction: column;
    min-height: auto;
    padding: 32px 20px;
    gap: 24px;
    text-align: left;
  }
  .hero-media { flex-direction: row; align-items: center; gap: 12px; }
  .hero-logo { width: 100px; }
  .hero-spade { font-size: 48px; }
  .hero-bg-text { font-size: 120px; right: -20px; }
  .hero-h1 { font-size: 1.9rem; }

  .body-layout { flex-direction: column; }
  .content-aside {
    width: 100%;
    position: static;
    padding: 16px 20px 0;
  }
  .aside-inner { flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }
  .aside-title { width: 100%; border-bottom: 2px solid var(--c-red); }
  .aside-inner ul { flex-direction: row; flex-wrap: wrap; }
  .aside-badge { display: none; }

  .content-main { padding: 24px 20px 24px; }

  .site-footer { padding: 0 20px; }
  .footer-inner { flex-direction: column; gap: 28px; padding: 28px 0 20px; }
  .footer-bottom { font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 1.5rem; }
  .nav-link { padding: 8px 10px; font-size: 0.8rem; }
  .page-content-section h2 { font-size: 1.3rem; }
  .content-main { padding: 16px; }
}

/* ===== article scroll-margin (单页锚点) ===== */
article[id] { scroll-margin-top: 40px; }

@media (max-width: 768px) {
  article[id] { scroll-margin-top: 170px; }
}

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