@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #000000;
  --bg2: #0a0a0a;
  --card-bg: #111111;
  --border: #1e1e1e;
  --border-bright: #2a2a2a;
  --text: #e8e8e8;
  --text-muted: #888888;
  --text-dim: #555555;
  --accent: #c8ff00;
  --accent2: #00c8ff;
  --accent3: #ff6b6b;
  --glow: 0 0 10px rgba(200,255,0,0.3);
  --radius: 28px;
  --radius-sm: 12px;
  --font-main: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  --nav-h: 64px;
  --announce-h: 36px;
}

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
ul, ol { list-style: none; }
button { cursor: pointer; background: none; border: none; }

/* ===== 公告条 ===== */
.announce-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--announce-h);
  background: #0d0d0d;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  overflow: hidden;
}
.announce-inner {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ===== 导航 ===== */
.site-header {
  position: fixed;
  top: var(--announce-h);
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

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

.nav-brand { flex-shrink: 0; }
.nav-brand a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-brand a:hover { border-color: var(--accent); box-shadow: var(--glow); }
.nav-logo-mark { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
.nav-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}
.nav-list li a {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}
.nav-list li a:hover { color: var(--text); background: var(--card-bg); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
  min-height: 40px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 页面顶部间距补偿 ===== */
body > section.announce-bar + header + main,
body > .announce-bar ~ main {
  padding-top: calc(var(--announce-h) + var(--nav-h));
}
main { padding-top: calc(var(--announce-h) + var(--nav-h)); }

/* ===== 布局容器 ===== */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Hero（首页） ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  margin-top: calc(-1 * (var(--announce-h) + var(--nav-h)));
  padding-top: calc(var(--announce-h) + var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-article {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 80px 0 72px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.3) 100%);
  z-index: 1;
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5) saturate(0.8);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero-h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 28px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  letter-spacing: 0.03em;
  transition: box-shadow 0.2s, transform 0.15s;
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(200,255,0,0.4); transform: translateY(-1px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 28px;
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--accent2); color: var(--accent2); }

.hero-deco-text {
  position: absolute;
  bottom: -10px;
  right: -20px;
  font-size: clamp(6rem, 15vw, 18rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.04);
  letter-spacing: -0.05em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* ===== 内容区双栏（story / article / tag / about / privacy） ===== */
.content-section,
.section-body,
.story-body,
.tag-body,
.about-body,
.privacy-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding: 60px 0;
  align-items: start;
}

.content-section > div,
.section-body > div,
.story-body > div,
.tag-body > div,
.about-body > div,
.privacy-body > div {
  min-width: 0;
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: sticky;
  top: calc(var(--announce-h) + var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 8px;
}
.sidebar-title span { display: inline; }

.sidebar-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 24px;
  margin-bottom: 8px;
}
.sidebar-subtitle span { display: inline; }

.sidebar-links { display: flex; flex-direction: column; gap: 6px; }

.section-link-card {
  display: block;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.section-link-card strong {
  display: block;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 2px;
}
.section-link-card:hover { border-color: var(--accent); color: var(--text); }
.section-link-card span { font-size: 12px; color: var(--text-muted); }

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.sidebar-tags a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.sidebar-tags a:hover { border-color: var(--accent2); color: var(--accent2); }

.sidebar-empty { font-size: 13px; color: var(--text-dim); padding: 8px 0; }

/* ===== 栏目 Hero ===== */
.section-hero, .tag-hero {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.section-hero-article,
.tag-hero-article,
.about-hero-article,
.privacy-hero-article {
  max-width: 800px;
  position: relative;
}

.section-h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 16px 0 12px;
  letter-spacing: -0.01em;
}

.section-hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-deco-num {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.05);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.tag-count {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
}
.tag-count strong { color: var(--accent); }

/* ===== 故事/文章 Hero ===== */
.story-top { padding: 48px 0 24px; border-bottom: 1px solid var(--border); }
.story-header-article { max-width: 800px; }

.story-hero-wrap {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.story-hero-img { width: 100%; height: 340px; object-fit: cover; filter: brightness(0.85); }

.story-h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 20px 0 12px;
}

.story-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-dim); }

/* ===== 关于/隐私页 Hero ===== */
.about-hero, .privacy-hero {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
}
.about-h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin: 12px 0 10px;
}
.about-desc { font-size: 16px; color: var(--text-muted); line-height: 1.7; }

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-dim);
}
.breadcrumb a { color: var(--text-dim); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-hidden] { color: var(--text-dim); }

/* ===== 正文 ===== */
.prose {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}
.prose h2 { font-size: 1.4rem; font-weight: 700; margin: 36px 0 14px; color: #fff; }
.prose h2 span { display: inline; }
.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 28px 0 10px; color: var(--text); }
.prose h3 span { display: inline; }
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin: 12px 0 16px 20px; }
.prose li { margin-bottom: 6px; line-height: 1.7; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose strong { font-weight: 700; color: #fff; }
.prose a { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--card-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.prose th { background: var(--card-bg); font-weight: 600; }
.prose code { background: var(--card-bg); padding: 2px 7px; border-radius: 5px; font-size: 0.88em; }
.prose pre { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; overflow-x: auto; margin: 16px 0; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: var(--radius-sm); margin: 20px 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ===== 文章卡片列表 ===== */
.story-list { margin-top: 48px; }
.story-list-heading {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.story-list-heading span { display: inline; }

.story-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.story-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}
.story-card strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: block;
}
.story-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.story-card time { font-size: 12px; color: var(--text-dim); margin-top: auto; }
.story-card:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ===== 首页子页卡片 ===== */
.children-section { padding: 48px 0; }
.section-heading {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.section-heading span { display: inline; }

.child-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}
.child-card strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: block;
  line-height: 1.4;
}
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.child-card time { font-size: 12px; color: var(--text-dim); margin-top: auto; }
.child-card:hover { border-color: var(--accent2); transform: translateY(-2px); }

/* ===== 相关文章 ===== */
.related-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-heading {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.related-heading span { display: inline; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.related-card strong { font-size: 14px; font-weight: 600; color: var(--text); display: block; }
.related-card span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.related-card:hover { border-color: var(--accent3); }

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 0;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { flex-shrink: 0; }
.footer-logo {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: -0.02em;
  transition: color 0.2s;
}
.footer-logo:hover { color: var(--accent); }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}
.footer-nav a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  min-width: 40px;
  justify-content: center;
}
.footer-nav a:hover { color: var(--text); background: var(--card-bg); }

.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===== Scroll Reveal 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .story-card,
  .child-card,
  .related-card,
  .section-link-card {
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  }
  .story-card:hover,
  .child-card:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  }
}

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

/* ===== 移动端断点 ===== */
@media (max-width: 900px) {
  .content-section,
  .section-body,
  .story-body,
  .tag-body,
  .about-body,
  .privacy-body {
    grid-template-columns: 1fr;
  }
  .sidebar { position: static; }
  .hero-deco-num { display: none; }
}

@media (max-width: 768px) {
  .nav-list {
    display: none;
    position: fixed;
    top: calc(var(--announce-h) + var(--nav-h));
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    max-height: calc(100vh - var(--announce-h) - var(--nav-h));
    overflow-y: auto;
  }
  .nav-list.is-open { display: flex; }
  .nav-list li a {
    padding: 14px 16px;
    font-size: 15px;
    min-height: 48px;
    border-radius: 10px;
    width: 100%;
  }
  .nav-toggle { display: flex; }
  .hero-deco-text { display: none; }
  .hero-h1 { font-size: clamp(1.8rem, 8vw, 3rem); }
  .hero-article { padding: 60px 0 56px; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-outline { width: 100%; justify-content: center; }
  .story-cards-grid,
  .child-cards-grid,
  .related-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-copy { white-space: normal; }
  .section-h1 { font-size: 1.6rem; }
  .about-h1 { font-size: 1.6rem; }
  .story-h1 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .site-nav { padding: 0 16px; }
  .footer-inner { padding: 16px; }
  .story-card, .child-card { padding: 16px; border-radius: 18px; }
  .announce-inner { font-size: 11px; }
}
