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

/* =============================================
   CSS 变量 & 基础重置
============================================= */
:root {
  --c-bg: #000000;
  --c-surface: #111111;
  --c-surface2: #1a1a1a;
  --c-border: #2a2a2a;
  --c-text: #ffffff;
  --c-text-muted: #888888;
  --c-text-dim: #555555;
  --c-accent: #ffffff;
  --c-accent-hover: #cccccc;
  --c-glass-bg: rgba(255,255,255,0.04);
  --c-glass-border: rgba(255,255,255,0.10);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --base: 8px;
  --sp1: 8px;
  --sp2: 16px;
  --sp3: 24px;
  --sp4: 32px;
  --sp5: 40px;
  --sp6: 48px;
  --sp8: 64px;
  --sp10: 80px;
  --sp12: 96px;

  --radius: 10px;
  --nav-h: 60px;

  --max-w: 1200px;
  --content-w: 780px;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  padding-bottom: var(--nav-h);
  overflow-x: hidden;
}

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

a {
  color: var(--c-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
a:hover {
  color: var(--c-accent-hover);
}

ul, ol {
  list-style: none;
}

/* =============================================
   底部固定导航
============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  height: var(--nav-h);
  background: rgba(0,0,0,0.92);
  border-top: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bottom-nav > ol {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp3);
  gap: var(--sp1);
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav > ol::-webkit-scrollbar { display: none; }

.bottom-nav > ol > li > a {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 var(--sp2);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--c-text-muted);
  letter-spacing: 0.03em;
  transition: color 0.2s;
  min-height: 40px;
}
.bottom-nav > ol > li > a:hover {
  color: var(--c-text);
}
.bottom-nav > ol > li[aria-current] > a,
.bottom-nav > ol > li > a[aria-current="page"] {
  color: var(--c-text);
}

.brand-item > a.brand-link {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text) !important;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  margin-right: var(--sp2);
}

.nav-cta-item {
  margin-left: auto;
  flex-shrink: 0;
}
.nav-cta {
  display: flex !important;
  align-items: center;
  background: var(--c-text);
  color: var(--c-bg) !important;
  padding: 0 var(--sp2) !important;
  height: 36px !important;
  min-height: 40px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8125rem !important;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover {
  background: #dddddd;
  color: var(--c-bg) !important;
}

/* =============================================
   通用布局容器
============================================= */
.site-wrap {
  min-height: 100vh;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp3);
}

/* =============================================
   英雄区（首页）
============================================= */
.hero-section {
  width: 100%;
  height: 45vh;
  min-height: 280px;
  max-height: 520px;
  position: relative;
  overflow: hidden;
  background: var(--c-surface);
}

.hero-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.75) 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--sp5) var(--sp5);
  text-align: right;
}

.hero-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--sp1);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
  margin-bottom: var(--sp2);
  max-width: 600px;
}

.hero-sub {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.75);
  max-width: 400px;
  margin-bottom: var(--sp3);
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  background: var(--c-text);
  color: var(--c-bg);
  padding: 12px var(--sp3);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.2s;
  min-height: 44px;
}
.hero-btn:hover {
  background: #cccccc;
  color: var(--c-bg);
}

/* =============================================
   页面横幅（非首页）
============================================= */
.page-banner {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp8) 0 var(--sp5);
}

.banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp3);
}

.banner-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--sp2);
}

.banner-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-text);
  margin-bottom: var(--sp2);
}

.banner-desc {
  font-size: 1rem;
  color: var(--c-text-muted);
  max-width: 640px;
}

/* 文章专属横幅 */
.article-banner {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
}

.article-hero-media {
  width: 100%;
  height: 240px;
  overflow: hidden;
}

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

.article-banner-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp4) var(--sp3);
}

.breadcrumb-link {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: var(--sp2);
  transition: color 0.2s;
}
.breadcrumb-link:hover { color: var(--c-text); }

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 3vw, 2.125rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-text);
  margin-bottom: var(--sp2);
}

.article-meta {
  display: flex;
  gap: var(--sp3);
  flex-wrap: wrap;
}

.article-date,
.article-mod {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  font-weight: 500;
}

/* =============================================
   主内容区 + 侧边栏布局
============================================= */
.content-with-aside {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp6);
  padding: var(--sp6) 0;
  align-items: start;
}

/* 侧边栏在左 */
.page-aside {
  position: sticky;
  top: var(--sp3);
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

.aside-block {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  padding: var(--sp3);
}

.aside-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--sp2);
}

.aside-nav li {
  border-bottom: 1px solid var(--c-border);
}
.aside-nav li:last-child { border-bottom: none; }
.aside-nav li a {
  display: block;
  padding: var(--sp1) 0;
  font-size: 0.875rem;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.aside-nav li a:hover,
.aside-nav li a[aria-current="page"] {
  color: var(--c-text);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp1);
}
.tag-list li a {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--c-text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.tag-list li a:hover,
.tag-list li a[aria-current="page"] {
  border-color: var(--c-text);
  color: var(--c-text);
}

.content-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp6);
}

/* =============================================
   玻璃拟态卡片
============================================= */
.glass-card {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.glass-card:hover {
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.card-media {
  width: 100%;
  height: 180px;
  overflow: hidden;
}
.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.glass-card:hover .card-thumb {
  transform: scale(1.04);
}

.card-body {
  padding: var(--sp3);
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text);
}

.card-desc {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

.article-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}

.card-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 2px;
  width: fit-content;
  transition: border-color 0.2s;
}
.card-link:hover { border-color: var(--c-text); }

/* =============================================
   区块标题
============================================= */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--c-text);
  padding-bottom: var(--sp2);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp4);
}

/* =============================================
   首页 — 专区网格
============================================= */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp3);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp3);
}

/* =============================================
   话题页 — 子页文章列表（直接子元素 article）
============================================= */
.children-section > .glass-card {
  margin-bottom: var(--sp3);
}

/* div > article×n 满足契约 */
.children-section {
  display: flex;
  flex-direction: column;
}

/* =============================================
   文章正文
============================================= */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  margin-top: var(--sp5);
  margin-bottom: var(--sp2);
  color: var(--c-text);
}
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.0625rem; }

.prose p { margin-bottom: var(--sp3); }

.prose ul,
.prose ol {
  margin-bottom: var(--sp3);
  padding-left: var(--sp3);
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: var(--sp1); }

.prose a {
  color: var(--c-text);
  font-weight: 500;
  text-underline-offset: 3px;
}

.prose blockquote {
  border-left: 3px solid var(--c-border);
  padding-left: var(--sp3);
  margin: var(--sp4) 0;
  color: var(--c-text-muted);
  font-style: italic;
}

.prose strong { font-weight: 700; }
.prose em { font-style: italic; }

.prose img {
  border-radius: var(--radius);
  margin: var(--sp4) 0;
  width: 100%;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp4) 0;
  font-size: 0.9rem;
}
.prose th,
.prose td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  text-align: left;
}
.prose th {
  background: var(--c-surface2);
  font-weight: 600;
}

/* =============================================
   相关文章（article 布局）
============================================= */
.related-section {
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp4);
}

.related-item {
  padding: var(--sp3) 0;
  border-bottom: 1px solid var(--c-border);
}
.related-item:last-child { border-bottom: none; }

.related-item h3 {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--sp1);
  color: var(--c-text);
}

.related-item p {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-bottom: var(--sp1);
}

.related-item a {
  font-size: 0.8125rem;
  font-weight: 600;
}

/* =============================================
   标签页文章网格
============================================= */
.tag-articles-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

/* =============================================
   关于页 / 隐私页
============================================= */
.about-quick-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}
.about-quick-nav li a {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* =============================================
   页脚
============================================= */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  margin-top: var(--sp10);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp8) var(--sp3) var(--sp4);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp6);
  padding-bottom: var(--sp6);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp5);
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  display: block;
  margin-bottom: var(--sp2);
  color: var(--c-text);
}

.footer-addr {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--c-text-muted);
  line-height: 1.7;
}
.footer-addr a {
  color: var(--c-text-muted);
  font-weight: 500;
}
.footer-addr a:hover { color: var(--c-text); }

.footer-links h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--sp2);
}

.footer-links ul li {
  border-bottom: 1px solid var(--c-border);
}
.footer-links ul li:last-child { border-bottom: none; }
.footer-links ul li a {
  display: block;
  padding: 8px 0;
  font-size: 0.875rem;
  color: var(--c-text-muted);
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.footer-links ul li a:hover { color: var(--c-text); }

.footer-subscribe {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: var(--sp4) 0;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp4);
}

.subscribe-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-text);
  flex: 1;
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  background: var(--c-text);
  color: var(--c-bg);
  padding: 10px var(--sp3);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  transition: background 0.2s;
}
.subscribe-btn:hover {
  background: #cccccc;
  color: var(--c-bg);
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp2);
  font-size: 0.8125rem;
  color: var(--c-text-muted);
}
.footer-bar a {
  color: var(--c-text-muted);
  text-decoration: none;
}
.footer-bar a:hover { color: var(--c-text); }

/* =============================================
   首页 sections
============================================= */
.content-section,
.topics-section,
.articles-section {
  padding: var(--sp6) 0;
  border-bottom: 1px solid var(--c-border);
}
.articles-section { border-bottom: none; }

/* =============================================
   stagger 动效
============================================= */
@media (prefers-reduced-motion: no-preference) {
  .glass-card {
    animation: fadeUp 0.45s ease both;
  }
  .topics-grid .glass-card:nth-child(1) { animation-delay: 0.05s; }
  .topics-grid .glass-card:nth-child(2) { animation-delay: 0.10s; }
  .topics-grid .glass-card:nth-child(3) { animation-delay: 0.15s; }
  .topics-grid .glass-card:nth-child(4) { animation-delay: 0.20s; }
  .articles-grid .glass-card:nth-child(1) { animation-delay: 0.08s; }
  .articles-grid .glass-card:nth-child(2) { animation-delay: 0.16s; }
  .articles-grid .glass-card:nth-child(3) { animation-delay: 0.24s; }
  .articles-grid .glass-card:nth-child(4) { animation-delay: 0.32s; }
  .articles-grid .glass-card:nth-child(5) { animation-delay: 0.40s; }
  .articles-grid .glass-card:nth-child(6) { animation-delay: 0.48s; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .related-item {
    animation: fadeUp 0.35s ease both;
  }
  .related-item:nth-child(2) { animation-delay: 0.08s; }
  .related-item:nth-child(3) { animation-delay: 0.16s; }
  .related-item:nth-child(4) { animation-delay: 0.24s; }
}

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

/* =============================================
   响应式
============================================= */
@media (max-width: 900px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .content-with-aside {
    grid-template-columns: 1fr;
    gap: var(--sp4);
  }

  /* 侧边栏移至内容下方（移动端仍存在，契约只检测存在） */
  .page-aside {
    position: static;
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp2);
  }

  .content-main {
    order: 1;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp4);
  }

  .footer-subscribe {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-content {
    padding: var(--sp4) var(--sp3);
    align-items: flex-start;
    text-align: left;
  }

  .page-aside {
    grid-template-columns: 1fr;
  }

  .article-meta {
    flex-direction: column;
    gap: var(--sp1);
  }
}

@media (max-width: 480px) {
  .bottom-nav > ol {
    padding: 0 var(--sp2);
    gap: 0;
  }

  .bottom-nav > ol > li > a {
    padding: 0 10px;
    font-size: 0.75rem;
  }

  .brand-item > a.brand-link {
    font-size: 0.875rem;
  }

  .banner-title {
    font-size: 1.375rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.125rem;
  }
}
