@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

/* ===== 变量 ===== */
:root {
  --c-bg: #0D0D0D;
  --c-surface: #131313;
  --c-surface2: #1a1a1a;
  --c-fg: #F5F5F0;
  --c-fg-muted: #9a9a94;
  --c-accent: #C8A96E;
  --c-accent-dim: rgba(200,169,110,0.15);
  --c-border: rgba(245,245,240,0.08);
  --c-border-accent: rgba(200,169,110,0.35);
  --r-card: 10px;
  --nav-h: 64px;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --max-w: 1200px;
  --prose-w: 720px;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.15; }

/* ===== 包裹层 ===== */
.site-wrapper {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ===== 底部固定导航条 ===== */
.pill-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13,13,13,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pill-nav::-webkit-scrollbar { display: none; }

.pill-nav ol {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.pill-nav ol li { flex-shrink: 0; }
.pill-nav ol li a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  color: var(--c-fg-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pill-nav ol li a:hover,
.pill-nav ol li a:focus {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-accent-dim);
  text-decoration: none;
}

.nav-brand {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--c-border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent);
  margin-left: 8px;
  transition: background 0.2s;
}
.nav-brand:hover { background: var(--c-accent-dim); text-decoration: none; }
.brand-glyph {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-accent);
  line-height: 1;
}
.brand-icon { width: 28px; height: 28px; object-fit: contain; }

/* ===== 主布局 ===== */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.layout-with-aside {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

/* ===== 侧边栏（内容左侧） ===== */
.content-aside {
  position: sticky;
  top: 24px;
  padding-top: 48px;
}
.global-aside {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px 40px;
}
.aside-inner {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 20px;
  margin-bottom: 16px;
}
.aside-h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-fg);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}
.aside-links {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aside-links li a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--c-fg-muted);
  font-size: 14px;
  font-family: var(--font-mono);
  transition: color 0.15s, background 0.15s;
  min-height: 36px;
  line-height: 1.4;
}
.aside-links li a:hover {
  color: var(--c-accent);
  background: var(--c-accent-dim);
  text-decoration: none;
}
.aside-label {
  font-size: 12px;
  color: var(--c-fg-muted);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.aside-tags {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.aside-tags a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--c-border-accent);
  color: var(--c-accent);
  font-size: 12px;
  font-family: var(--font-mono);
  transition: background 0.15s;
}
.aside-tags a:hover { background: var(--c-accent-dim); text-decoration: none; }

/* ===== Kinetic 动画 ===== */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes typeIn {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}
@keyframes accentLine {
  from { width: 0; }
  to   { width: 60px; }
}
@keyframes revealBadge {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.kinetic-h1 {
  animation: slideInUp 0.7s cubic-bezier(0.22,1,0.36,1) both;
}

.js-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .kinetic-h1 { animation: none; }
  .js-reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== 药丸徽章 ===== */
.pill-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  color: var(--c-fg-muted);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  animation: revealBadge 0.5s ease both;
}
.pill-badge.accent {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-accent-dim);
}

.eyebrow-row, .hero-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ===== 首页 Hero ===== */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 0;
}
.hero-article {
  text-align: right;
  max-width: 900px;
  margin-left: auto;
}
.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 7rem);
  font-weight: 900;
  color: var(--c-fg);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--c-fg) 60%, var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lead {
  font-size: 1.1rem;
  color: var(--c-fg-muted);
  max-width: 560px;
  margin-left: auto;
  margin-bottom: 32px;
  font-style: italic;
}
.hero-cta-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--c-accent);
  color: var(--c-bg);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); text-decoration: none; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--c-border-accent);
  color: var(--c-accent);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: background 0.2s;
}
.btn-ghost:hover { background: var(--c-accent-dim); text-decoration: none; }
.btn-ghost.small { height: 40px; padding: 0 18px; font-size: 13px; }

/* ===== 通用 article/section 间距 ===== */
.content-section,
.topics-section,
.latest-section,
.children-section,
.related-section,
.tag-list-section,
.about-links-section,
.privacy-nav-section,
.hero-img-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--c-border);
}

/* ===== section-h2 样式 ===== */
.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--c-fg);
  margin-bottom: 6px;
  position: relative;
  padding-bottom: 16px;
}
.section-h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 60px;
  background: var(--c-accent);
  animation: accentLine 0.6s ease both;
}

p.subtitle {
  color: var(--c-fg-muted);
  font-size: 15px;
  margin-bottom: 28px;
  font-style: italic;
}

/* ===== 正文 ===== */
.prose-body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  color: var(--c-fg);
  max-width: var(--prose-w);
}
.prose-body h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 2em 0 0.5em; color: var(--c-fg); }
.prose-body h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 1.6em 0 0.4em; }
.prose-body p { margin-bottom: 1.2em; }
.prose-body ul, .prose-body ol { margin: 1em 0 1.2em 1.4em; list-style: disc; }
.prose-body ol { list-style: decimal; }
.prose-body li { margin-bottom: 0.4em; }
.prose-body a { color: var(--c-accent); border-bottom: 1px solid var(--c-border-accent); }
.prose-body a:hover { border-color: var(--c-accent); }
.prose-body strong { font-weight: 600; color: var(--c-fg); }
.prose-body blockquote { border-left: 3px solid var(--c-accent); padding-left: 16px; color: var(--c-fg-muted); font-style: italic; margin: 1.5em 0; }
.prose-body code { font-family: var(--font-mono); font-size: 0.88em; background: var(--c-surface2); padding: 2px 6px; border-radius: 4px; }
.prose-body time { font-family: var(--font-mono); font-size: 0.85em; color: var(--c-fg-muted); }

/* ===== 主题卡片（首页） ===== */
.topic-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.topic-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  border-bottom: 3px solid var(--c-accent);
  color: var(--c-fg);
  transition: transform 0.2s, border-color 0.2s;
}
.topic-card:hover { transform: translateY(-3px); border-bottom-color: var(--c-accent); text-decoration: none; }
.topic-card > strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-fg);
}
.card-desc {
  font-size: 14px;
  color: var(--c-fg-muted);
  line-height: 1.5;
}
.card-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-accent);
  align-self: flex-start;
  padding: 2px 8px;
  border: 1px solid var(--c-border-accent);
  border-radius: 999px;
}

/* ===== 文章列表行（首页最近文章） ===== */
.article-list { display: flex; flex-direction: column; gap: 0; }
.article-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-fg);
  transition: color 0.15s;
}
.article-row:hover { color: var(--c-accent); text-decoration: none; }
.article-row > strong { font-family: var(--font-body); font-weight: 600; font-size: 15px; flex: 1; }
.article-row-meta { font-family: var(--font-mono); font-size: 12px; color: var(--c-fg-muted); white-space: nowrap; }

/* ===== 栏目页 Hero ===== */
.topic-hero-section,
.tag-hero-section,
.about-hero-section,
.privacy-hero-section,
.article-header-section {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--c-border);
}
.topic-h1, .tag-h1, .about-h1, .privacy-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--c-fg);
  margin-bottom: 16px;
}
.topic-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-fg-muted);
}
.tag-desc {
  font-size: 1rem;
  color: var(--c-fg-muted);
  font-style: italic;
  margin-top: 12px;
}

/* ===== 子页卡片（栏目页） ===== */
.child-link-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.child-link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  border-bottom: 3px solid var(--c-accent);
  color: var(--c-fg);
  transition: transform 0.2s;
}
.child-link-card:hover { transform: translateY(-2px); text-decoration: none; }
.child-link-card > strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-fg);
}
.child-link-desc { font-size: 13px; color: var(--c-fg-muted); line-height: 1.5; }
.child-link-date { font-family: var(--font-mono); font-size: 12px; color: var(--c-accent); margin-top: 4px; }

/* ===== 文章页 ===== */
.article-h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--c-fg);
  margin: 16px 0 20px;
  line-height: 1.1;
}
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-fg-muted);
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--c-fg-muted); }
.breadcrumb a:hover { color: var(--c-accent); }
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.pub-date, .mod-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-fg-muted);
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
}
.article-hero-img {
  width: 100%;
  border-radius: var(--r-card);
  object-fit: cover;
  max-height: 420px;
}

/* ===== 相关文章（文章页） ===== */
.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  border-bottom: 3px solid var(--c-accent);
  color: var(--c-fg);
  transition: transform 0.2s;
}
.related-card:hover { transform: translateY(-2px); text-decoration: none; }
.related-card > strong { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; }
.related-card > span { font-size: 13px; color: var(--c-fg-muted); }

/* ===== 标签页文章列表 ===== */
.tag-article-list { display: flex; flex-direction: column; gap: 0; }
.tag-article-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-fg);
  transition: color 0.15s;
}
.tag-article-row:hover { color: var(--c-accent); text-decoration: none; }
.tag-article-row > strong { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.tag-article-desc { font-size: 14px; color: var(--c-fg-muted); }
.tag-article-row time { font-family: var(--font-mono); font-size: 12px; color: var(--c-accent); }

/* ===== About 页快速跳转 ===== */
.about-link-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.about-link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  border-bottom: 3px solid var(--c-accent);
  color: var(--c-fg);
  transition: transform 0.2s;
}
.about-link-card:hover { transform: translateY(-2px); text-decoration: none; }
.about-link-card > strong { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.about-link-card > span { font-size: 13px; color: var(--c-fg-muted); }

/* ===== Privacy 页 ===== */
.privacy-nav-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.privacy-nav-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  border-bottom: 3px solid var(--c-accent);
  color: var(--c-fg);
  transition: transform 0.2s;
}
.privacy-nav-card:hover { transform: translateY(-2px); text-decoration: none; }
.privacy-nav-card > strong { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.privacy-nav-card > span { font-size: 13px; color: var(--c-fg-muted); }
.privacy-prose { max-width: var(--prose-w); }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  margin-top: 0;
  padding-bottom: calc(var(--nav-h) + 16px);
}
.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 20px 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--c-accent);
  margin-bottom: 8px;
}
.footer-col-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--c-fg-muted);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 6px; }
.footer-col ul li a {
  font-size: 14px;
  color: var(--c-fg-muted);
  transition: color 0.15s;
  display: inline-block;
  min-height: 28px;
  line-height: 1.5;
}
.footer-col ul li a:hover { color: var(--c-accent); text-decoration: none; }
.footer-contact address {
  font-style: normal;
  margin-bottom: 14px;
}
.footer-contact address p {
  font-size: 14px;
  color: var(--c-fg-muted);
  margin-bottom: 10px;
}
.footer-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 20px;
  border-top: 1px solid var(--c-border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-fg-muted);
}

/* ===== main-content 的 aside-less 时全宽 ===== */
.main-content {
  min-width: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .layout-with-aside {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .content-aside {
    position: static;
    padding-top: 24px;
    order: 2;
  }
  .main-content {
    order: 1;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    padding: 40px 16px 24px;
    gap: 28px;
  }
  .hero-section {
    min-height: 70vh;
    padding: 40px 0 32px;
  }
  .hero-article { text-align: left; }
  .hero-cta-row { justify-content: flex-start; }
  .hero-h1 { font-size: clamp(2.2rem, 9vw, 4rem); }
  .wrap { padding: 0 16px; }
  .topic-cards, .child-link-group, .related-list,
  .about-link-group, .privacy-nav-links {
    grid-template-columns: 1fr;
  }
  .pill-nav ol li a { height: 44px; padding: 0 12px; }
  .nav-brand { width: 44px; height: 44px; }
  .aside-tags { display: none; }
  .article-h1 { font-size: clamp(1.6rem, 6vw, 2.5rem); }
}

@media (max-width: 400px) {
  .pill-nav { padding: 0 8px; gap: 4px; }
  .pill-nav ol { gap: 4px; }
  .pill-nav ol li a { padding: 0 10px; font-size: 12px; }
}
