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

/* ===== 基础重置 & 自定义属性 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --bg2: #121212;
  --bg3: #1a1a1a;
  --bg4: #222222;
  --text: #e8e8e8;
  --text-muted: #999;
  --text-dim: #666;
  --accent: #3b82f6;
  --accent2: #1d4ed8;
  --accent-glow: #60a5fa;
  --accent-gold: #f59e0b;
  --accent-line: #3b82f6;
  --border: #2a2a2a;
  --border-bright: #3b82f6;
  --radius: 10px;
  --font-main: 'Outfit', 'Work Sans', system-ui, sans-serif;
  --transition: 0.22s ease;
  --header-h: 64px;
  --topbar-h: 36px;
  color-scheme: dark;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a:hover, a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

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

/* ===== 顶部公告条 ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 10px rgba(96,165,250,0.5);
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  z-index: 150;
  height: var(--header-h);
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.brand-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

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

.brand-logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(96,165,250,0.4);
  white-space: nowrap;
}

/* ===== 导航：aside > nav > ul > li > a ===== */
.site-aside-nav {
  display: flex;
  align-items: center;
}

.site-aside-nav nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-aside-nav nav ul li a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  min-height: 40px;
  line-height: 1.2;
  display: flex;
  align-items: center;
}

.site-aside-nav nav ul li a:hover,
.site-aside-nav nav ul li a:focus-visible,
.site-aside-nav nav ul li a[aria-current="page"] {
  color: var(--accent-glow);
  background: rgba(59,130,246,0.1);
  text-decoration: none;
}

/* ===== 站点容器 ===== */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Hero（首页）===== */
.hero {
  margin-top: calc(var(--topbar-h) + var(--header-h));
  min-height: 45vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.hero-images {
  position: relative;
  grid-column: 1 / 2;
  display: flex;
  align-items: stretch;
}

.hero-img {
  object-fit: cover;
  width: 50%;
  height: 100%;
  min-height: 45vh;
}

.hero-img-1 {
  transform: translateY(-16px);
  z-index: 2;
  border-right: 2px solid var(--accent-line);
}

.hero-img-2 {
  transform: translateY(16px);
  z-index: 1;
  opacity: 0.85;
}

.hero-slash {
  position: absolute;
  top: 0;
  right: -2px;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-line), transparent);
  z-index: 10;
}

.hero-copy {
  grid-column: 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 2.5rem 2rem 2.5rem 1.5rem;
  position: relative;
  z-index: 5;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-glow);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 10px rgba(96,165,250,0.6);
}

.hero-h1 {
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(59,130,246,0.3);
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 360px;
  line-height: 1.6;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  min-height: 44px;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 16px rgba(59,130,246,0.3);
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--accent-glow);
  box-shadow: 0 0 24px rgba(96,165,250,0.5);
  color: #000;
  text-decoration: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--accent);
  color: var(--accent-glow);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  min-height: 44px;
  transition: background var(--transition), color var(--transition);
}

.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ===== 页面主体布局 ===== */
.page-body {
  display: flex;
  flex: 1;
  margin-top: calc(var(--topbar-h) + var(--header-h));
  min-height: calc(100vh - var(--topbar-h) - var(--header-h) - 160px);
}

.home-body {
  margin-top: 0;
  display: block;
}

/* ===== 侧边栏（aside 在内容左侧）===== */
.side-panel {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 2rem 1rem;
  position: sticky;
  top: calc(var(--topbar-h) + var(--header-h));
  height: calc(100vh - var(--topbar-h) - var(--header-h));
  overflow-y: auto;
}

.side-panel nav ul {
  list-style: none;
}

.side-panel nav ul li {
  margin-bottom: 0.25rem;
}

.side-panel nav ul li a {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 6px;
  min-height: 40px;
  transition: color var(--transition), background var(--transition);
}

.side-panel nav ul li a:hover,
.side-panel nav ul li a:focus-visible {
  color: var(--accent-glow);
  background: rgba(59,130,246,0.1);
  text-decoration: none;
}

.side-panel nav ul li.side-parent a {
  color: var(--accent-glow);
  font-weight: 600;
  font-size: 0.82rem;
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 1.5rem 3rem;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

/* ===== 正文容器：main > div.wrap > section > article ===== */
.section-content {
  margin-bottom: 3rem;
}

.prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}

.prose h1,
.article-header h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

.prose p {
  margin-bottom: 1rem;
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose strong {
  color: #fff;
  font-weight: 600;
}

.prose a {
  color: var(--accent-glow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #fff;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(59,130,246,0.06);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
}

/* ===== 眉题（small 紧邻 h2 前）===== */
.eyebrow,
small.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-glow);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 8px rgba(96,165,250,0.4);
}

/* ===== 首页主体偏移 ===== */
.home-body .main-content {
  padding: 2.5rem 2rem 3rem;
}

/* ===== 话题卡片网格 ===== */
.section-topics {
  margin-bottom: 3rem;
}

.section-topics h2,
.section-articles h2,
.section-children h2,
.section-related h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.25rem;
}

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

.topic-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.topic-card:hover, .topic-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(59,130,246,0.15);
  text-decoration: none;
}

.topic-card-inner {
  padding: 1.25rem 1.25rem 1rem;
  flex: 1;
}

.topic-card-inner h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.topic-card-inner p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-accent-line {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-top: auto;
}

/* ===== 文章列表 ===== */
.section-articles {
  margin-bottom: 3rem;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
  gap: 1rem;
  min-height: 48px;
}

.article-row:hover, .article-row:focus-visible {
  border-color: var(--accent);
  background: var(--bg3);
  text-decoration: none;
}

.article-row-title {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.article-date {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== 话题页 Banner ===== */
.topic-hero {
  margin-top: calc(var(--topbar-h) + var(--header-h));
  position: relative;
  padding: 3rem 2rem 2.5rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.topic-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29,78,216,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.topic-hero-content {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.topic-hero-content h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin: 0.5rem 0 0.75rem;
}

.topic-hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: var(--accent-glow);
}

.breadcrumb span {
  margin: 0 0.35rem;
}

/* ===== 子页列表（dl > dt > a + dd）===== */
.child-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.child-list dt {
  padding: 0.85rem 1rem 0.3rem;
  border-top: 1px solid var(--border);
}

.child-list dt:first-child {
  border-top: none;
}

.child-list dt a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-glow);
  text-decoration: none;
  display: block;
  min-height: 40px;
  line-height: 2;
  transition: color var(--transition);
}

.child-list dt a:hover {
  color: #fff;
}

.child-list dd {
  padding: 0 1rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.child-list dd time {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===== 文章详情页 ===== */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.article-meta time {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.article-hero-wrap {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.article-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.article-body-content {
  margin-top: 1.5rem;
}

/* ===== 相关文章卡片 ===== */
.section-related {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

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

.related-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: border-color var(--transition), transform var(--transition);
}

.related-card:hover, .related-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: block;
  flex: 1;
}

.related-card time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ===== 关于页 / 隐私页 ===== */
.about-banner,
.privacy-banner {
  margin-top: calc(var(--topbar-h) + var(--header-h));
  padding: 2.5rem 2rem 2rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.about-banner h1,
.privacy-banner h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-top: 0.4rem;
}

.privacy-banner time {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.about-brand-block {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.about-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.about-brand-block h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0.25rem 0 0.5rem;
}

.about-brand-block p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== 页脚（仅 p + small）===== */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}

.footer-cta {
  margin-bottom: 1.25rem;
}

.site-footer small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.site-footer small a {
  color: var(--text-muted);
}

.site-footer small a:hover {
  color: var(--accent-glow);
}

/* ===== 话题页布局补正 ===== */
.topic-body,
.article-body,
.about-body,
.privacy-body {
  flex-direction: row;
}

/* ===== 滚动显现动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .topic-card,
  .article-row,
  .related-card {
    opacity: 0;
    transform: translateY(18px);
    animation: revealUp 0.45s ease forwards;
  }

  .topic-card:nth-child(1) { animation-delay: 0.05s; }
  .topic-card:nth-child(2) { animation-delay: 0.12s; }
  .topic-card:nth-child(3) { animation-delay: 0.19s; }
  .topic-card:nth-child(4) { animation-delay: 0.26s; }

  .article-row:nth-child(1) { animation-delay: 0.04s; }
  .article-row:nth-child(2) { animation-delay: 0.08s; }
  .article-row:nth-child(3) { animation-delay: 0.12s; }
  .article-row:nth-child(4) { animation-delay: 0.16s; }
  .article-row:nth-child(5) { animation-delay: 0.20s; }
  .article-row:nth-child(6) { animation-delay: 0.24s; }

  @keyframes revealUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .hero-copy {
    animation: fadeInRight 0.6s ease forwards;
  }

  @keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
  }
}

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

/* ===== 焦点可见性 ===== */
:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== 响应式：平板 ===== */
@media (max-width: 900px) {
  .site-header {
    padding: 0 1rem;
  }

  .side-panel {
    display: none;
  }

  .main-content {
    padding: 1.5rem 1rem 2.5rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-images {
    display: none;
  }

  .hero-copy {
    grid-column: 1;
    text-align: left;
    align-items: flex-start;
    padding: 2rem 1.5rem;
    min-height: 40vh;
    background: linear-gradient(135deg, rgba(29,78,216,0.12) 0%, transparent 70%);
  }

  .hero-sub {
    max-width: 100%;
  }

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

  .about-banner,
  .privacy-banner,
  .topic-hero {
    padding: 2rem 1.25rem 1.5rem;
  }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 600px) {
  :root {
    --header-h: 56px;
    --topbar-h: 32px;
  }

  .site-header {
    padding: 0 0.75rem;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .site-aside-nav nav ul {
    gap: 0.1rem;
  }

  .site-aside-nav nav ul li a {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .hero-copy {
    padding: 1.75rem 1.25rem;
  }

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

  .home-body .main-content {
    padding: 1.5rem 1rem 2.5rem;
  }

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

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

  .article-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.75rem;
  }

  .about-brand-block {
    flex-direction: column;
  }

  .topic-body,
  .article-body,
  .about-body,
  .privacy-body {
    flex-direction: column;
  }

  .wrap {
    max-width: 100%;
  }
}

/* ===== 选择文字颜色 ===== */
::selection {
  background: rgba(59,130,246,0.35);
  color: #fff;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent2);
}
