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

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #e8eaf0;
  background: #0d0d1a;
  min-height: 100vh;
}

a { color: #7eb8f7; text-decoration: none; }
a:hover { color: #a8d4ff; text-decoration: underline; }
a:focus-visible { outline: 2px solid #7eb8f7; outline-offset: 2px; }

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

ul, ol { list-style: none; }

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

/* ===== 左侧固定导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #1A1A2E;
  border-right: 2px solid #0F3460;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 24px 16px;
  gap: 8px;
  z-index: 100;
  overflow-y: auto;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #0F3460;
  border-radius: 4px;
  margin-bottom: 16px;
  align-self: center;
  flex-shrink: 0;
}

.brand-icon:hover { background: #16213E; text-decoration: none; }

.brand-glyph {
  font-size: 1.5rem;
  font-weight: 800;
  color: #7eb8f7;
  line-height: 1;
}

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

.sidenav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: block;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b0b8d0;
  line-height: 1.3;
  transition: background 160ms ease, color 160ms ease;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  background: #16213E;
  color: #e8eaf0;
  text-decoration: none;
}

.nav-link.active {
  background: #0F3460;
  color: #7eb8f7;
}

.cta-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: #0F3460;
  color: #7eb8f7;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  min-height: 44px;
  margin-top: 8px;
  transition: background 160ms ease, color 160ms ease;
  flex-shrink: 0;
}

.cta-main:hover {
  background: #16213E;
  color: #a8d4ff;
  text-decoration: none;
}

/* ===== 主内容区 ===== */
.page-body {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

main { flex: 1; }

/* ===== 正文容器：main > div.wrap > section > article ===== */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #6b7499;
  padding: 20px 0 0;
  flex-wrap: wrap;
}

.breadcrumb a { color: #6b7499; }
.breadcrumb a:hover { color: #7eb8f7; }
.breadcrumb span[aria-hidden] { color: #3a4060; }

/* ===== Hero（首页）===== */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1A1A2E;
  border-bottom: 2px solid #0F3460;
  margin: 0 -24px;
  padding: 60px 24px;
  position: relative;
}

.hero-inner {
  text-align: center;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  background: #0F3460;
  color: #7eb8f7;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.hero-sub {
  font-size: 1.05rem;
  color: #8892b0;
  max-width: 540px;
  line-height: 1.6;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #16213E;
  color: #b0b8d0;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 40px;
  transition: background 160ms ease, color 160ms ease;
  border: 1px solid #0F3460;
}

.pill-btn:hover {
  background: #0F3460;
  color: #7eb8f7;
  text-decoration: none;
}

/* ===== 页面 Hero（非首页）===== */
.page-hero {
  padding: 32px 0 24px;
  border-bottom: 2px solid #16213E;
  margin-bottom: 32px;
}

.page-hero h1 {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #ffffff;
  margin-top: 12px;
  line-height: 1.25;
}

.page-desc {
  font-size: 1rem;
  color: #8892b0;
  margin-top: 10px;
  line-height: 1.6;
}

/* ===== 文章正文容器 ===== */
.content-body {
  padding: 0 0 48px;
}

/* section > article 结构已在 .wrap 内自然嵌套 */

/* ===== eyebrow 眉题 ===== */
small.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0F3460;
  background: #16213E;
  border: 1px solid #0F3460;
  border-radius: 4px;
  padding: 3px 10px;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  width: fit-content;
}

h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin: 36px 0 16px;
  line-height: 1.3;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8eaf0;
  line-height: 1.4;
}

/* ===== 文章标题区 ===== */
.article-header {
  padding: 24px 0 20px;
  border-bottom: 2px solid #16213E;
  margin-bottom: 28px;
}

.article-header h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: #ffffff;
  margin-top: 14px;
  line-height: 1.25;
}

.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.article-date, .article-modified {
  font-size: 0.8rem;
  color: #6b7499;
}

.article-hero-img {
  width: 100%;
  border-radius: 4px;
  margin: 16px 0;
  max-height: 360px;
  object-fit: cover;
}

/* ===== prose 正文 ===== */
.prose-section {
  font-size: 1rem;
  line-height: 1.75;
  color: #c8cfe0;
}

.prose-section h2 { margin-top: 32px; }
.prose-section h3 { margin-top: 24px; margin-bottom: 8px; }

.prose-section p { margin-bottom: 1em; }

.prose-section ul, .prose-section ol {
  list-style: disc;
  padding-left: 1.6em;
  margin-bottom: 1em;
}

.prose-section ol { list-style: decimal; }

.prose-section li { margin-bottom: 0.4em; }

.prose-section a { color: #7eb8f7; }
.prose-section a:hover { color: #a8d4ff; }

.prose-section strong { color: #e8eaf0; font-weight: 700; }

.prose-section code {
  background: #16213E;
  color: #7eb8f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'Courier New', monospace;
}

.prose-section pre {
  background: #16213E;
  border: 1px solid #0F3460;
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1em;
}

.prose-section blockquote {
  border-left: 4px solid #0F3460;
  padding-left: 16px;
  color: #8892b0;
  margin: 1em 0;
}

.prose-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: 0.9rem;
}

.prose-section th, .prose-section td {
  border: 1px solid #16213E;
  padding: 10px 14px;
  text-align: left;
}

.prose-section th {
  background: #16213E;
  color: #ffffff;
  font-weight: 700;
}

/* ===== 文章列表 ===== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.article-list li article {
  background: #1A1A2E;
  border: 1px solid #16213E;
  border-radius: 4px;
  padding: 16px 20px;
  transition: border-color 160ms ease, background 160ms ease;
}

.article-list li article:hover {
  border-color: #0F3460;
  background: #16213E;
}

.article-list li article h3 {
  margin-bottom: 6px;
}

.article-list li article h3 a {
  color: #e8eaf0;
  font-weight: 700;
}

.article-list li article h3 a:hover {
  color: #7eb8f7;
  text-decoration: none;
}

.article-list li article p {
  font-size: 0.88rem;
  color: #6b7499;
  line-height: 1.5;
  margin-bottom: 6px;
}

.article-list li article time {
  font-size: 0.78rem;
  color: #3a4060;
}

.article-list--compact li article { padding: 12px 16px; }

/* ===== 卡片列表（首页）===== */
.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.card {
  background: #1A1A2E;
  border: 1px solid #16213E;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  border-color: #0F3460;
  transform: translateY(-2px);
}

.card-title {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.card-title a {
  color: #e8eaf0;
  font-weight: 700;
}

.card-title a:hover {
  color: #7eb8f7;
  text-decoration: none;
}

.card-desc {
  font-size: 0.85rem;
  color: #6b7499;
  line-height: 1.5;
  margin-bottom: 8px;
}

.card-date {
  font-size: 0.75rem;
  color: #3a4060;
}

/* ===== 卡片区与子页区 ===== */
.cards-section { margin-top: 40px; }
.sub-pages { margin-top: 32px; }
.related-articles { margin-top: 40px; }
.about-links { margin-top: 40px; }
.privacy-nav { margin-top: 40px; }

/* ===== 页脚 ===== */
.site-footer {
  background: #1A1A2E;
  border-top: 2px solid #0F3460;
  padding: 48px 24px 0;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  gap: 40px;
  padding-bottom: 40px;
  flex-wrap: wrap;
}

.footer-col {
  flex: 1;
  min-width: 160px;
}

.footer-col dt {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0F3460;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #16213E;
}

.footer-col dd {
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #6b7499;
  line-height: 1.5;
}

.footer-col dd a {
  color: #6b7499;
  transition: color 160ms ease;
}

.footer-col dd a:hover {
  color: #7eb8f7;
  text-decoration: none;
}

.footer-desc {
  font-size: 0.78rem;
  color: #3a4060;
  margin-top: 12px;
  line-height: 1.5;
}

.footer-bottom {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 0;
  border-top: 1px solid #16213E;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #3a4060;
}

.footer-bottom a {
  color: #3a4060;
}

.footer-bottom a:hover {
  color: #7eb8f7;
  text-decoration: none;
}

/* ===== Scroll Reveal 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .card,
  .article-list li article {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 200ms ease, transform 200ms ease, box-shadow 160ms ease, border-color 160ms ease;
  }

  .card.revealed,
  .article-list li article.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .sidenav {
    position: fixed;
    width: 100%;
    height: auto;
    min-height: 56px;
    flex-direction: row;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
    border-right: none;
    border-bottom: 2px solid #0F3460;
    overflow-x: auto;
    overflow-y: hidden;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
  }

  .brand-icon {
    margin-bottom: 0;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
  }

  .sidenav nav {
    flex-direction: row;
    flex: 1;
    gap: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidenav nav::-webkit-scrollbar { display: none; }

  .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 10px 12px;
    min-height: 40px;
  }

  .cta-main {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.78rem;
    min-height: 40px;
    margin-top: 0;
  }

  .page-body {
    margin-left: 0;
    padding-top: 56px;
  }

  .hero-section {
    min-height: 70vh;
    margin: 0 -16px;
    padding: 40px 16px;
  }

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

  .wrap { padding: 0 16px; }

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

  .footer-inner {
    flex-direction: column;
    gap: 24px;
    padding-bottom: 24px;
  }

  .footer-col { min-width: 0; }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 1.35rem; }
  .hero-sub { font-size: 0.9rem; }
  .pill-btn { font-size: 0.78rem; padding: 8px 14px; }
  h2 { font-size: 1.15rem; }
}
