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

/* ===== 变量 ===== */
:root {
  --red: #C0392B;
  --dark: #1A1A2E;
  --cream: #F5F5F0;
  --red-dark: #96281B;
  --red-light: #E74C3C;
  --dark-mid: #2C2C4A;
  --dark-light: #3D3D5C;
  --cream-mid: #E8E8E2;
  --cream-dark: #C8C8C0;
  --text-main: #1A1A2E;
  --text-muted: #5A5A7A;
  --text-on-dark: #F5F5F0;
  --glass-bg: rgba(245,245,240,0.08);
  --glass-border: rgba(245,245,240,0.14);
  --nav-w: 240px;
  --radius-card: 28px;
  --radius-pill: 100px;
  --radius-sm: 4px;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  --font-sans: 'Fira Sans', system-ui, -apple-system, sans-serif;
  --trans: 160ms ease;
}

/* ===== 重置 ===== */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--dark);
  color: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--red-light); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--cream); }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
h1,h2,h3,h4 { font-family: var(--font-sans); font-weight: 700; line-height: 1.2; }

/* ===== 布局骨架 ===== */
.layout-wrap {
  display: flex;
  min-height: 100vh;
}

/* ===== 侧边导航 ===== */
.sidenav {
  width: var(--nav-w);
  background: var(--dark);
  border-right: 2px solid var(--red);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  padding-bottom: 1rem;
}

.sidenav-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--dark-mid);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cream);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.brand-link:hover { color: var(--red-light); }
.brand-logo { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.brand-text { line-height: 1.2; }

.sidenav-nav {
  flex: 1;
  padding: 1rem 0.75rem;
}

.sidenav-nav dl { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
}
.sidenav-nav dd { display: block; }
.sidenav-nav dd a {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--cream-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--trans), color var(--trans);
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}
.sidenav-nav dd a:hover,
.sidenav-nav dd a.nav-active {
  background: var(--red);
  color: var(--cream);
}

.sidenav-contact {
  padding: 0.75rem;
  border-top: 1px solid var(--dark-mid);
}
.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--dark-mid);
  color: var(--cream-mid);
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 40px;
  transition: background var(--trans), color var(--trans);
}
.contact-link:hover,
.contact-link.nav-active {
  background: var(--red);
  color: var(--cream);
}

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

/* ===== Hero - 首页 ===== */
.hero-block {
  position: relative;
  min-height: 70vh;
  background: var(--dark);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 4rem 3rem 3rem;
}

.hero-slash {
  position: absolute;
  top: 0;
  right: -5%;
  width: 55%;
  height: 100%;
  background: var(--red);
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 0;
}

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

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--cream-mid);
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 440px;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-decor {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}
.decor-num {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  color: rgba(26,26,46,0.4);
  letter-spacing: -0.05em;
  display: block;
}

/* ===== 按钮 ===== */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--cream);
  color: var(--red);
  border-color: var(--cream);
}
.btn-primary:hover { background: var(--red-light); color: var(--cream); border-color: var(--red-light); }
.btn-secondary {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
}
.btn-secondary:hover { background: var(--cream); color: var(--red); }
.btn-outline {
  background: transparent;
  color: var(--cream-mid);
  border-color: var(--dark-light);
}
.btn-outline:hover { background: var(--red); color: var(--cream); border-color: var(--red); }

/* ===== 文章主体 ===== */
.page-article {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1100px;
  width: 100%;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red-light);
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--red);
  display: inline-block;
}

/* ===== 正文区 ===== */
.content-section { margin-bottom: 3rem; }
.section-inner.prose {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--cream-mid);
  max-width: 760px;
}
.prose h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cream);
  margin: 2rem 0 0.75rem;
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cream);
  margin: 1.5rem 0 0.5rem;
}
.prose p { margin-bottom: 1rem; }
.prose a { color: var(--red-light); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--cream); }
.prose ul, .prose ol { margin: 0.75rem 0 0.75rem 1.25rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
.prose th, .prose td { padding: 0.55rem 0.75rem; border: 1px solid var(--dark-light); text-align: left; }
.prose th { background: var(--dark-mid); color: var(--cream); font-family: var(--font-mono); }
.prose-narrow { max-width: 640px; }

time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--red-light);
}

/* ===== 卡片网格（玻璃态）===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background var(--trans), border-color var(--trans);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.glass-card:hover {
  background: rgba(192,57,43,0.1);
  border-color: var(--red);
}

.card-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.badge-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--red);
  color: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.45rem;
  line-height: 1.5;
}
.badge-type {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.card-title a { color: var(--cream); }
.card-title a:hover { color: var(--red-light); }

.card-desc {
  font-size: 0.875rem;
  color: var(--cream-mid);
  line-height: 1.55;
  flex: 1;
}

/* ===== 子页列表 / 故事列表 ===== */
.child-list, .story-list, .related-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 760px;
}
.child-list dt, .story-list dt, .related-list dt {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 0 0.2rem;
  border-top: 1px solid var(--dark-mid);
}
.child-list dt:first-of-type, .story-list dt:first-of-type, .related-list dt:first-of-type {
  border-top: none;
}
.child-list dt a, .story-list dt a, .related-list dt a {
  color: var(--cream);
  font-weight: 600;
}
.child-list dt a:hover, .story-list dt a:hover, .related-list dt a:hover { color: var(--red-light); }
.child-list dd, .story-list dd, .related-list dd {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-bottom: 0.75rem;
  line-height: 1.5;
}
.story-desc { margin-left: 0.5rem; }

.empty-tip {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  padding: 1rem 0;
}

/* ===== 查看更多 ===== */
.view-more { margin-top: 1.5rem; }

/* ===== section 页 Hero ===== */
.section-hero {
  position: relative;
  min-height: 28vh;
  background: var(--dark);
  overflow: hidden;
  padding: 3rem 3rem 2rem;
  display: flex;
  align-items: flex-end;
}
.section-hero-slash {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--red);
}
.section-hero-content { position: relative; z-index: 1; }
.section-h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--cream);
  margin: 0.5rem 0;
}
.section-sub { color: var(--cream-mid); font-size: 1rem; margin-top: 0.5rem; }
.section-count {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--red);
  color: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.6rem;
  margin-top: 0.75rem;
  letter-spacing: 0.04em;
}

.section-article { padding-top: 2rem; }
.child-section { margin-top: 2rem; }

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--cream-mid); }
.breadcrumb a:hover { color: var(--red-light); }
.breadcrumb span[aria-hidden] { color: var(--dark-light); }

/* ===== story 页 ===== */
.story-hero-img {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  background: var(--dark-mid);
}
.story-hero-img .hero-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.story-article { padding-top: 1.5rem; }

.article-header { margin-bottom: 1.75rem; }
.story-h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  color: var(--cream);
  margin: 0.5rem 0 0.75rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.meta-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.article-footer-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dark-mid);
}

/* ===== related aside ===== */
.related-aside {
  padding: 1.5rem 3rem 2rem;
  max-width: 1100px;
  border-top: 2px solid var(--dark-mid);
}
.aside-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red-light);
  margin-bottom: 1rem;
}

/* ===== about 页 ===== */
.about-hero {
  position: relative;
  min-height: 30vh;
  background: var(--dark);
  overflow: hidden;
  padding: 3rem 3rem 2rem;
  display: flex;
  align-items: flex-end;
}
.about-hero-slash {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--red);
}
.about-hero-content { position: relative; z-index: 1; }
.about-h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--cream);
  margin-top: 0.5rem;
}

.about-article { padding-top: 2rem; }
.about-links-section { margin-top: 2.5rem; }
.about-nav-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ===== privacy 页 ===== */
.privacy-header {
  position: relative;
  min-height: 24vh;
  background: var(--dark);
  overflow: hidden;
  padding: 3rem 3rem 2rem;
  display: flex;
  align-items: flex-end;
}
.privacy-header-slash {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: var(--dark-mid);
  clip-path: polygon(25% 0, 100% 0, 100% 100%, 0% 100%);
}
.privacy-header-content { position: relative; z-index: 1; }
.privacy-h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  color: var(--cream);
  margin: 0.5rem 0;
}
.privacy-sub { color: var(--cream-mid); font-size: 0.95rem; }

.privacy-article { padding-top: 2rem; }
.privacy-back {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dark-mid);
}

/* ===== default 页 ===== */
.default-header { margin-bottom: 1.5rem; }
.default-h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  color: var(--cream);
  margin-bottom: 0.5rem;
}
.default-sub { color: var(--cream-mid); font-size: 1rem; }
.default-back { margin-top: 2rem; }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--dark-mid);
  border-top: 2px solid var(--red);
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 3rem 1.5rem;
  max-width: 1100px;
}
.footer-brand-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.5rem;
}
.footer-brand-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.footer-nav-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
}
.site-footer nav dl { display: flex; flex-direction: column; gap: 0.2rem; }
.site-footer nav dd a {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--cream-mid);
  padding: 0.2rem 0;
  min-height: 32px;
}
.site-footer nav dd a:hover { color: var(--red-light); }

.footer-bar {
  border-top: 1px solid var(--dark-light);
  padding: 0.9rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-bar a { color: var(--cream-mid); }
.footer-bar a:hover { color: var(--red-light); }

/* ===== 首页特殊区块 ===== */
.section-cards { margin-bottom: 3rem; }
.section-recent { margin-bottom: 2rem; }

/* ===== 移动端汉堡 ===== */
.nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cream);
  transition: transform var(--trans), opacity var(--trans);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  :root { --nav-w: 0px; }

  .sidenav {
    transform: translateX(-100%);
    transition: transform var(--trans);
    width: 260px;
    z-index: 150;
  }
  .sidenav.open {
    transform: translateX(0);
  }

  .main-wrap { margin-left: 0; }

  .nav-toggle { display: flex; }

  .hero-block {
    padding: 5rem 1.5rem 2.5rem;
    min-height: 60vh;
  }
  .hero-slash { right: -10%; width: 60%; clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%); }
  .hero-h1 { font-size: 1.75rem; }
  .decor-num { font-size: 4rem; }

  .page-article { padding: 1.5rem; }

  .section-hero { padding: 5rem 1.5rem 1.5rem; }
  .about-hero, .privacy-header { padding: 5rem 1.5rem 1.5rem; }

  .related-aside { padding: 1.5rem; }

  .footer-inner {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .footer-bar {
    padding: 0.75rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero-block { padding: 4.5rem 1rem 2rem; }
  .hero-sub { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; }
  .btn-pill { width: 100%; justify-content: center; }
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
