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

/* ============================================
   CSS 变量与基础重置
   ============================================ */
:root {
  --c-bg: #0D0D0D;
  --c-accent: #FF3D5A;
  --c-dark: #1A1A2E;
  --c-surface: #141428;
  --c-surface2: #1e1e38;
  --c-text: #E8E8F0;
  --c-text-muted: #9090B0;
  --c-border: #2A2A4A;
  --c-accent-hover: #ff6070;
  --nav-h: 64px;
  --font-head: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  --transition: 160ms ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body, .dark-theme {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
}

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

a {
  color: var(--c-accent);
  text-decoration: none;
}

a:hover {
  color: var(--c-accent-hover);
}

ul, ol, menu {
  list-style: none;
}

/* ============================================
   站点外框
   ============================================ */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   导航 — details > summary + menu > li > a
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--c-dark);
  border-bottom: 2px solid var(--c-accent);
  height: var(--nav-h);
}

.nav-details {
  width: 100%;
  height: 100%;
}

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

/* summary 在移动端显示品牌+汉堡，桌面端隐藏自身（menu 常显） */
.nav-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--nav-h);
  cursor: pointer;
}

.nav-brand-center {
  display: flex;
  align-items: center;
}

.brand-text {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--c-accent);
  letter-spacing: 2px;
}

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

.hamburger-icon span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-text);
}

/* menu — 桌面：flex 三栏 */
.nav-menu {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--nav-h);
  gap: 16px;
}

/* 桌面：details 保持 open，隐藏 summary 的移动按钮，显示 menu */
@media (min-width: 900px) {
  .nav-details[open] .nav-menu {
    display: flex;
  }

  .nav-summary {
    display: none;
  }

  /* 强制 details open 在桌面 */
  .nav-details {
    /* JS 处理 open 属性，CSS 兜底 */
  }
}

@media (max-width: 899px) {
  .nav-details[open] .nav-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--c-dark);
    padding: 16px 20px 24px;
    border-bottom: 2px solid var(--c-accent);
    z-index: 99;
    height: auto;
    gap: 12px;
  }

  .nav-brand-slot {
    display: none;
  }

  .nav-left, .nav-right {
    width: 100%;
  }

  .nav-left .nav-list,
  .nav-right .nav-list {
    flex-wrap: wrap;
    gap: 8px;
  }
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  flex: 1;
}

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

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-brand-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

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

/* 药丸胶囊导航按钮 */
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 999px;
  background: var(--c-surface2);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--c-border);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}

.nav-pill:hover,
.nav-pill:focus-visible {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}

/* ============================================
   Hero 区块
   ============================================ */
.hero-wrapper {
  position: relative;
  margin-top: var(--nav-h);
  min-height: 45vh;
  background: var(--c-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 点阵底纹 */
.hero-dot-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #FF3D5A22 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 24px 80px;
  max-width: 800px;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--c-accent);
  background: #FF3D5A18;
  border: 1px solid var(--c-accent);
  border-radius: 999px;
  padding: 4px 16px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 1.05;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.hero-lead {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--c-text-muted);
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 36px;
  background: var(--c-accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid var(--c-accent);
  transition: background var(--transition), color var(--transition);
}

.hero-cta:hover {
  background: transparent;
  color: var(--c-accent);
}

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

/* ============================================
   内容布局 — aside 左 + main 右
   ============================================ */
.content-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
  gap: 32px;
  width: 100%;
}

/* 侧边栏 aside 在内容左侧 */
.content-aside {
  flex-shrink: 0;
  width: 200px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: flex-start;
}

.aside-inner {
  border-left: 3px solid var(--c-accent);
  padding-left: 16px;
}

.aside-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-nav-list li a {
  display: block;
  padding: 6px 8px;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  border-radius: 2px;
  transition: color var(--transition), background var(--transition);
  line-height: 1.4;
}

.aside-nav-list li a:hover {
  color: var(--c-accent);
  background: #FF3D5A10;
}

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

.main-article {
  width: 100%;
}

.page-content-section {
  width: 100%;
}

/* ============================================
   正文内容样式（page.content 里的 HTML）
   ============================================ */
.page-content-section h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #fff;
  letter-spacing: 0.05em;
  margin-top: 56px;
  margin-bottom: 8px;
  line-height: 1.1;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

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

.page-content-section .subtitle,
.page-content-section .subhead,
.page-content-section .desc,
.page-content-section .lead {
  font-size: 1rem;
  color: var(--c-text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.page-content-section p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text);
  margin-bottom: 16px;
}

.page-content-section h3 {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-accent);
  margin-top: 28px;
  margin-bottom: 10px;
}

.page-content-section ul,
.page-content-section ol {
  margin-bottom: 16px;
  padding-left: 0;
  list-style: none;
}

.page-content-section ul li,
.page-content-section ol li {
  padding: 6px 0 6px 20px;
  position: relative;
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.6;
}

.page-content-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 2px;
  background: var(--c-accent);
}

.page-content-section ol {
  counter-reset: ol-counter;
}

.page-content-section ol li {
  counter-increment: ol-counter;
}

.page-content-section ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-accent);
  font-family: var(--font-head);
  letter-spacing: 0.05em;
}

.page-content-section strong, b {
  color: #fff;
  font-weight: 700;
}

.page-content-section em {
  color: var(--c-accent);
  font-style: normal;
  font-weight: 600;
}

.page-content-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.page-content-section th {
  background: var(--c-surface2);
  color: var(--c-accent);
  font-weight: 700;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 2px solid var(--c-accent);
}

.page-content-section td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: top;
}

.page-content-section tr:hover td {
  background: var(--c-surface);
}

/* 卡片风格 — 底部强调线，无圆角 */
.page-content-section .card,
.page-content-section div {
  background: var(--c-surface);
  border-bottom: 3px solid var(--c-accent);
  border-radius: 0;
  padding: 28px 24px;
  margin-bottom: 24px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* div 分隔 */
.page-content-section > div + div {
  margin-top: 8px;
}

/* div 内的 h2 不要额外 margin-top */
.page-content-section div > h2:first-child,
.page-content-section div > h3:first-child {
  margin-top: 0;
}

.page-content-section blockquote {
  border-left: 4px solid var(--c-accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--c-surface);
  color: var(--c-text-muted);
  font-style: italic;
}

.page-content-section code {
  background: var(--c-surface2);
  color: var(--c-accent);
  padding: 2px 6px;
  font-size: 0.9em;
  border-radius: 2px;
  font-family: 'Courier New', monospace;
}

.page-content-section pre {
  background: var(--c-surface2);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  border-left: 3px solid var(--c-accent);
}

.page-content-section a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-content-section a:hover {
  color: var(--c-accent-hover);
}

.page-content-section img {
  max-width: 100%;
  border-bottom: 3px solid var(--c-accent);
  margin-bottom: 16px;
}

.page-content-section time {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  font-family: var(--font-body);
}

/* div 内的 scroll-margin */
.page-content-section [id] {
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

/* ============================================
   页脚 — footer > div×n
   ============================================ */
.site-footer {
  background: var(--c-dark);
  border-top: 2px solid var(--c-accent);
  padding: 48px 24px 0;
  margin-top: auto;
}

.site-footer > .footer-brand-section,
.site-footer > .footer-nav-section,
.site-footer > .footer-info-section,
.site-footer > .footer-legal-section {
  /* 四个 div 在同一行（桌面） */
}

/* 四栏布局容器 — footer 直接子 div */
.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 32px;
  row-gap: 0;
}

.footer-brand-section {
  grid-column: 1;
  grid-row: 1;
  padding-bottom: 40px;
}

.footer-nav-section {
  grid-column: 2;
  grid-row: 1;
  padding-bottom: 40px;
}

.footer-info-section {
  grid-column: 3;
  grid-row: 1;
  padding-bottom: 40px;
}

.footer-legal-section {
  grid-column: 4;
  grid-row: 1;
  padding-bottom: 40px;
}

.footer-bottom {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--c-border);
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

.footer-brand-mega {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--c-accent);
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 12px;
}

.footer-brand-desc {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}

.footer-nav-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav-list li a {
  color: var(--c-text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color var(--transition);
  min-height: 32px;
  display: flex;
  align-items: center;
}

.footer-nav-list li a:hover {
  color: var(--c-accent);
}

.footer-info-section p,
.footer-legal-section p {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.footer-keyword {
  font-size: 0.8rem;
  color: #606080;
}

.footer-copyright {
  font-size: 0.85rem;
}

.footer-bottom-right {
  font-size: 0.85rem;
}

/* ============================================
   动效 — Hover Micro-interaction
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
  .nav-pill,
  .hero-cta,
  .aside-nav-list li a,
  .footer-nav-list li a {
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), opacity var(--transition);
  }

  /* Stagger list for aside */
  .aside-nav-list li {
    animation: fadeSlideIn 0.3s ease both;
  }

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

  @keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  .page-content-section div {
    transition: border-color var(--transition);
  }

  .page-content-section div:hover {
    border-color: var(--c-accent-hover);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   响应式 — 平板
   ============================================ */
@media (max-width: 1024px) {
  .content-aside {
    width: 160px;
  }

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

  .footer-brand-section { grid-column: 1; grid-row: 1; }
  .footer-nav-section   { grid-column: 2; grid-row: 1; }
  .footer-info-section  { grid-column: 1; grid-row: 2; }
  .footer-legal-section { grid-column: 2; grid-row: 2; }
  .footer-bottom        { grid-column: 1 / -1; grid-row: 3; }
}

/* ============================================
   响应式 — 移动端
   ============================================ */
@media (max-width: 768px) {
  .content-layout {
    flex-direction: column;
    padding: 32px 16px;
    gap: 24px;
  }

  .content-aside {
    width: 100%;
    position: static;
    border-left: none;
    border-top: 3px solid var(--c-accent);
    padding-top: 16px;
  }

  .aside-inner {
    border-left: none;
    padding-left: 0;
  }

  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .aside-nav-list li a {
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    white-space: nowrap;
  }

  .hero-inner {
    padding: 48px 16px 72px;
  }

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

  .site-footer {
    grid-template-columns: 1fr;
    padding: 32px 16px 0;
  }

  .footer-brand-section { grid-column: 1; grid-row: 1; }
  .footer-nav-section   { grid-column: 1; grid-row: 2; }
  .footer-info-section  { grid-column: 1; grid-row: 3; }
  .footer-legal-section { grid-column: 1; grid-row: 4; }
  .footer-bottom        { grid-column: 1; grid-row: 5; flex-direction: column; gap: 8px; text-align: center; }

  .footer-brand-mega {
    font-size: 3rem;
  }

  .page-content-section div {
    padding: 20px 16px;
  }

  .page-content-section h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .nav-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .hero-cta {
    padding: 10px 28px;
    font-size: 0.95rem;
  }
}

/* ============================================
   焦点可访问性
   ============================================ */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

/* ============================================
   工具类
   ============================================ */
.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;
}
