/* =============================================
   小妇人小说导航站 — E-Ink Paper 风格主题
   ============================================= */

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

/* ── 变量 ── */
:root {
  --paper: #fdfbf7;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --ink-60: rgba(26,26,26,0.6);
  --ink-30: rgba(26,26,26,0.3);
  --ink-10: rgba(26,26,26,0.1);
  --ink-05: rgba(26,26,26,0.05);
  --border: #e0e0e0;
  --border-dark: #c8c8c8;
  --header-h: 64px;
  --max-w: 1200px;
  --reading-w: 720px;
  --radius: 18px;
  --radius-sm: 8px;
  --glass-bg: rgba(253,251,247,0.72);
  --glass-border: rgba(26,26,26,0.12);
  --shadow: 0 2px 12px rgba(26,26,26,0.08);
  --shadow-hover: 0 6px 24px rgba(26,26,26,0.14);
  --font-title: 'Cinzel', Georgia, serif;
  --font-body: 'Josefin Sans', system-ui, -apple-system, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: auto; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* 纸感噪点纹理 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ── 通用容器 ── */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.7; }
ul, ol { list-style: none; }

/* ── 导航 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.site-logo-img { width: 32px; height: 32px; object-fit: contain; }

.header-nav {
  flex: 1;
  overflow: hidden;
}
.header-nav p {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav p::-webkit-scrollbar { display: none; }
.header-nav a {
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-60);
  padding: 6px 10px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}
.header-nav a:hover { color: var(--ink); background: var(--ink-05); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.btn-cta {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.btn-cta:hover { background: transparent; color: var(--ink); opacity: 1; }

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 10px 12px;
  min-height: 40px;
  min-width: 40px;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

/* ── 全屏遮罩菜单 ── */
.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: none;
}
.overlay-menu.is-open {
  opacity: 1;
  pointer-events: all;
}
.overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  padding: 10px 14px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  color: var(--ink);
}
.overlay-nav p {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.overlay-nav a {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
}
.overlay-nav a:hover { background: var(--ink-05); opacity: 1; }

/* ── Hero ── */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 24px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  position: relative;
}
.hero-deco {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-title);
  font-size: clamp(120px, 20vw, 280px);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--border);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.hero-content {
  max-width: 560px;
  text-align: right;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 16px;
}
.hero-h1 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}
.hero-lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-60);
  margin-bottom: 32px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  min-height: 48px;
}
.btn-primary:hover { background: transparent; color: var(--ink); opacity: 1; }

/* ── 栏目 Hero ── */
.topic-hero {
  border-bottom: 1px solid var(--border);
  background: var(--paper-2);
  padding: 80px 24px 60px;
  overflow: hidden;
  position: relative;
}
.topic-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  position: relative;
}
.topic-deco {
  position: absolute;
  left: -10px;
  top: -30px;
  font-family: var(--font-title);
  font-size: clamp(100px, 18vw, 220px);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-dark);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.topic-hero-content { position: relative; z-index: 1; max-width: 600px; }
.topic-hero-content h1 {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.topic-hero-content .lead {
  font-size: 1rem;
  color: var(--ink-60);
  line-height: 1.7;
}

/* ── 普通页面 Hero ── */
.page-hero {
  border-bottom: 1px solid var(--border);
  padding: 60px 24px 48px;
  background: var(--paper-2);
}
.page-hero-inner {
  max-width: var(--reading-w);
  margin: 0 auto;
}
.page-hero-inner h1 {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.page-hero-inner .lead { font-size: 1rem; color: var(--ink-60); }

/* ── 主区布局 ── */
.site-main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 64px;
  width: 100%;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

/* ── 侧边栏（左侧）── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sidebar h2 {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sidebar .subtitle,
.sidebar h3 {
  font-size: 0.75rem;
  color: var(--ink-60);
  margin-bottom: 12px;
  font-weight: 400;
}
.sidebar h3 {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 20px;
  margin-bottom: 8px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav li a {
  display: block;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
}
.sidebar-nav li a:hover { border-color: var(--border); background: var(--ink-05); opacity: 1; }
.sidebar-parent { font-size: 0.82rem; margin-bottom: 12px; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── 主文章 ── */
.main-article {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ── 内容段落 ── */
.content-section { }
.prose h2 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-top: 2.5em;
  margin-bottom: 0.5em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.prose p { margin-bottom: 1.2em; font-size: 1rem; line-height: 1.75; }
.prose ul, .prose ol { margin: 1em 0 1.2em 1.5em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.5em; line-height: 1.7; }
.prose a { color: var(--ink); font-weight: 500; }
.prose blockquote {
  border-left: 3px solid var(--ink);
  padding-left: 20px;
  margin: 1.5em 0;
  color: var(--ink-60);
  font-style: italic;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.prose th { background: var(--paper-2); font-weight: 600; }

/* h2 + subtitle 模式 */
.prose h2 + .subtitle,
h2 + .subtitle,
h2 + p.subtitle {
  font-size: 0.9rem;
  color: var(--ink-60);
  margin-top: -0.2em;
  margin-bottom: 1.2em;
}

/* ── section 标题样式 ── */
section > h2 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
section > .subtitle {
  font-size: 0.88rem;
  color: var(--ink-60);
  margin-bottom: 24px;
}

/* ── 眉标 ── */
.eyebrow, .hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 12px;
}

/* ── 玻璃拟态卡片 ── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.glass-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--ink-30);
}

/* ── 主题网格 ── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.topics-grid .glass-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topics-grid .glass-card a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topics-grid .glass-card a strong {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.topics-grid .glass-card a small {
  font-size: 0.8rem;
  color: var(--ink-60);
  line-height: 1.5;
}
.topics-grid .child-count {
  font-size: 0.72rem;
  color: var(--ink-60);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

/* ── 文章网格 ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.article-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-card a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title {
  font-family: var(--font-title);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.article-card a small {
  font-size: 0.8rem;
  color: var(--ink-60);
  line-height: 1.5;
}
.card-date {
  font-size: 0.72rem;
  color: var(--ink-60);
  letter-spacing: 0.04em;
}

/* ── 子页列表（ol > li > a + small）── */
.children-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: child-counter;
}
.children-list li.child-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
}
.children-list li a {
  text-decoration: none;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex: 1;
}
.item-num {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-30);
  flex-shrink: 0;
  min-width: 28px;
  line-height: 1;
  padding-top: 2px;
}
.item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.item-body strong {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.item-body small {
  font-size: 0.82rem;
  color: var(--ink-60);
  line-height: 1.5;
}
.children-list time {
  font-size: 0.72rem;
  color: var(--ink-60);
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 2px;
}

/* ── 文章页 ── */
.article-header-section { margin-bottom: 0; }
.breadcrumb {
  font-size: 0.78rem;
  color: var(--ink-60);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.breadcrumb a { color: var(--ink-60); }
.article-header-section h1 {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.article-desc {
  font-size: 1rem;
  color: var(--ink-60);
  line-height: 1.65;
  margin-bottom: 16px;
  max-width: 600px;
}
.article-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--ink-60);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.hero-figure { margin: 24px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.article-hero-img { width: 100%; height: 320px; object-fit: cover; }

/* ── 相关阅读网格 ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.rel-card a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rel-card a strong {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}
.rel-card a small {
  font-size: 0.78rem;
  color: var(--ink-60);
  line-height: 1.5;
}

/* ── About 统计 ── */
.stats-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.stats-list .glass-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 36px;
  text-align: center;
  min-width: 140px;
}
.stats-list strong {
  font-family: var(--font-title);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}
.stats-list small {
  font-size: 0.78rem;
  color: var(--ink-60);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── 页脚 ── */
.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 0;
  position: relative;
}
.site-footer::after {
  content: '';
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin-top: 8px;
}
.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 32px;
  font-size: 0.78rem;
  color: var(--ink-60);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: var(--ink-60); }
.footer-logo {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 12px;
}
.site-footer div > h3 {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--ink);
}
.site-footer div p {
  font-size: 0.85rem;
  color: var(--ink-60);
  line-height: 1.65;
  margin-bottom: 12px;
}
.site-footer div ul li { margin-bottom: 6px; }
.site-footer div ul a {
  font-size: 0.85rem;
  color: var(--ink-60);
  text-decoration: none;
}
.site-footer div ul a:hover { color: var(--ink); opacity: 1; }

/* ── 响应式 ── */
@media (max-width: 900px) {
  .site-main { flex-direction: column; gap: 32px; }
  .sidebar {
    width: 100%;
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .sidebar h2, .sidebar .subtitle { grid-column: 1 / -1; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  :root { --header-h: 56px; }
  .header-nav { display: none; }
  .hero-section { min-height: 70vh; }
  .hero-inner { padding: 60px 20px; justify-content: center; }
  .hero-content { text-align: center; max-width: 100%; }
  .hero-deco { font-size: clamp(80px, 30vw, 160px); left: -10px; }
  .topic-hero-inner { align-items: flex-start; text-align: left; }
  .topic-deco { display: none; }
  .topics-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .stats-list { flex-direction: row; }
  .site-footer { grid-template-columns: 1fr; gap: 24px; padding: 36px 20px 0; }
  .footer-brand { grid-column: auto; }
  .site-main { padding: 32px 20px 48px; }
  .btn-cta { display: none; }
  .sidebar { display: none; }
  .children-list li.child-item { flex-direction: column; }
}

/* ── Hover 微交互 ── */
@media (prefers-reduced-motion: no-preference) {
  .glass-card {
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
  }
  .btn-primary, .btn-cta {
    transition: background 0.15s ease, color 0.15s ease;
  }
  .sidebar-nav li a {
    transition: background 0.12s ease, border-color 0.12s ease;
  }
  .overlay-menu {
    transition: opacity 0.18s ease;
  }
}

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