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

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

:root {
  --bg: #fafaf8;
  --ink-mid: #4a4a4a;
  --ink-dark: #1a1a1a;
  --ink-faint: #d0cfc8;
  --ink-pale: #e8e7e1;
  --accent: #1a1a1a;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --font-body: 'Exo', system-ui, -apple-system, sans-serif;
  --sidebar-w: 280px;
  --header-h: 56px;
  --radius-card: 18px;
  --shadow-raw: 3px 3px 0 var(--ink-dark);
  --shadow-hover: 5px 5px 0 var(--ink-dark);
  --transition-raw: none;
}

html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--ink-dark);
  overflow-x: hidden;
}

/* ===== 纸张纹理背景 ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(74,74,74,0.04) 31px, rgba(74,74,74,0.04) 32px),
    repeating-linear-gradient(90deg, transparent, transparent 31px, rgba(74,74,74,0.03) 31px, rgba(74,74,74,0.03) 32px);
  pointer-events: none;
  z-index: 0;
}

/* ===== 链接 ===== */
a { color: var(--ink-dark); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ink-mid); }

/* ===== 屏幕阅读器辅助 ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== 页面骨架 ===== */
.page-wrapper { position: relative; min-height: 100vh; }
.main-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ===== 侧边导航（全屏遮罩菜单）===== */
.sidebar-nav {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--ink-dark);
  color: var(--bg);
  z-index: 900;
  transform: translateX(-100%);
  transition: transform 0.01s step-start;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  overflow-y: auto;
  border-right: 2px solid var(--ink-mid);
}
.sidebar-nav.is-open {
  transform: translateX(0);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0 20px 20px;
  border-bottom: 1px dashed rgba(250,250,248,0.2);
  margin-bottom: 16px;
}
.nav-brand a {
  color: var(--bg);
  text-decoration: none;
  display: block;
  padding: 8px 0;
}

.nav-menu { padding: 0 0 80px; }
.nav-menu dl { list-style: none; }

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(250,250,248,0.4);
  text-transform: uppercase;
  padding: 8px 20px 4px;
  display: block;
}

.nav-menu dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(250,250,248,0.4);
  padding: 12px 20px 2px;
}

.nav-menu dd { padding: 0; }
.nav-menu dd a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(250,250,248,0.85);
  text-decoration: none;
  border-left: 3px solid transparent;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: var(--transition-raw);
}
.nav-menu dd a:hover,
.nav-menu dd a.active {
  color: var(--bg);
  border-left-color: var(--bg);
  background: rgba(250,250,248,0.07);
}

.nav-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: 1px solid rgba(250,250,248,0.3);
  color: var(--bg);
  font-size: 18px;
  cursor: pointer;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
}

/* ===== 遮罩层 ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.7);
  z-index: 800;
}
.overlay.is-visible { display: block; }

/* ===== 顶部 Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 700;
  background: var(--ink-dark);
  border-bottom: 2px solid var(--ink-mid);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: var(--header-h);
}

.hamburger {
  background: none;
  border: 1px solid rgba(250,250,248,0.4);
  cursor: pointer;
  width: 44px; height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--bg);
}

.header-brand {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  text-decoration: none;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.header-slogan {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(250,250,248,0.45);
  letter-spacing: 0.05em;
  flex: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Hero（首页）===== */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 2px solid var(--ink-dark);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26,26,26,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,26,26,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text { display: flex; flex-direction: column; gap: 20px; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--ink-mid);
  text-transform: uppercase;
  border-left: 3px solid var(--ink-dark);
  padding-left: 10px;
}

.hero-h1 {
  font-family: var(--font-mono);
  font-size: clamp(22px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-dark);
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-mid);
  max-width: 480px;
}

.btn-primary {
  display: inline-block;
  background: var(--ink-dark);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 28px;
  text-decoration: none;
  border: 2px solid var(--ink-dark);
  box-shadow: var(--shadow-raw);
  transform: rotate(-0.5deg);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
}
.btn-primary:hover {
  box-shadow: var(--shadow-hover);
  transform: rotate(-0.5deg) translate(-1px, -1px);
  color: var(--bg);
}

.hero-media {
  position: relative;
}
.hero-media--empty {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-deco {
  width: 100%;
  height: 280px;
  border: 2px dashed var(--ink-mid);
  transform: rotate(1.2deg);
  background-image:
    linear-gradient(rgba(74,74,74,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,74,74,0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--ink-dark);
  transform: rotate(0.8deg);
  box-shadow: var(--shadow-raw);
}

/* ===== 内页 Hero ===== */
.page-hero {
  position: relative;
  padding: 48px 40px;
  border-bottom: 2px solid var(--ink-dark);
  background: var(--bg);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(26,26,26,0.04) 79px, rgba(26,26,26,0.04) 80px);
  pointer-events: none;
}

.page-hero-inner { position: relative; z-index: 2; max-width: 760px; }

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-mid);
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 8px;
}

.page-hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-dark);
  letter-spacing: -0.01em;
}

.page-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.page-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mid);
  letter-spacing: 0.04em;
}

/* 各类型装饰 */
.sketch-deco {
  position: absolute;
  right: 40px; top: 50%;
  transform: translateY(-50%) rotate(-2deg);
  width: 120px; height: 80px;
  border: 2px dashed var(--ink-faint);
  opacity: 0.5;
}
.sketch-deco::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--ink-faint);
}

.rank-badge {
  position: absolute;
  right: 40px; top: 50%;
  transform: translateY(-50%) rotate(3deg);
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 700;
  color: var(--ink-faint);
  line-height: 1;
  letter-spacing: -0.05em;
  user-select: none;
}

.about-deco {
  position: absolute;
  right: 40px; top: 20px;
  display: flex;
  gap: 8px;
}
.deco-char {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-faint);
  border: 1px solid var(--ink-faint);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-1deg);
}
.deco-char:nth-child(2) { transform: rotate(1.5deg); }
.deco-char:nth-child(3) { transform: rotate(-0.8deg); }
.deco-char:nth-child(4) { transform: rotate(2deg); }

/* ===== 内容区布局 ===== */
.content-section {
  display: flex;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  align-items: flex-start;
}

/* ===== 左侧边栏 ===== */
.sidebar-left {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 32px 0 32px 32px;
  align-self: flex-start;
}

.aside-inner {
  border: 1px solid var(--ink-faint);
  padding: 20px;
  transform: rotate(-0.3deg);
  background: var(--bg);
}

.aside-inner .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-mid);
  text-transform: uppercase;
  display: block;
  margin-top: 16px;
  margin-bottom: 4px;
}
.aside-inner .eyebrow:first-child { margin-top: 0; }

.aside-inner h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink-dark);
}

.aside-nav dl { list-style: none; }
.aside-nav dt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mid);
  letter-spacing: 0.1em;
  margin-top: 8px;
  margin-bottom: 2px;
}
.aside-nav dd { padding: 0; }
.aside-nav dd a {
  display: flex;
  align-items: center;
  min-height: 36px;
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 0;
  text-decoration: none;
  color: var(--ink-mid);
  border-bottom: 1px dashed transparent;
}
.aside-nav dd a:hover,
.aside-nav dd a.active {
  color: var(--ink-dark);
  border-bottom-color: var(--ink-faint);
}

/* ===== 主要内容 ===== */
.content-main {
  flex: 1;
  min-width: 0;
  padding: 40px 40px 60px 40px;
  border-left: 2px solid var(--ink-faint);
}

/* ===== Prose（正文）===== */
.prose { max-width: 720px; }
.prose h2 {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 12px;
  color: var(--ink-dark);
  border-bottom: 2px solid var(--ink-dark);
  padding-bottom: 6px;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--ink-dark);
}
.prose h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 6px;
}
.prose p {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-dark);
}
.prose ul, .prose ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.prose li {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.7;
}
.prose strong { font-weight: 600; }
.prose em { font-style: italic; color: var(--ink-mid); }
.prose a { color: var(--ink-dark); font-weight: 500; }
.prose blockquote {
  border-left: 3px solid var(--ink-dark);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(74,74,74,0.04);
  transform: rotate(-0.3deg);
  font-style: italic;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  font-family: var(--font-mono);
}
.prose th {
  background: var(--ink-dark);
  color: var(--bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
}
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-faint);
}
.prose tr:hover td { background: rgba(74,74,74,0.04); }
.prose time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mid);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--ink-pale);
  padding: 2px 6px;
  border: 1px solid var(--ink-faint);
}
.prose pre {
  background: var(--ink-pale);
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--ink-faint);
  border-left: 3px solid var(--ink-dark);
  margin: 20px 0;
}

/* ===== Eyebrow + h2/h3（并列装饰）===== */
small.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-mid);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ===== 卡片列表 ===== */
.card-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 32px 0;
  padding: 0;
}

.card {
  background: var(--ink-pale);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid transparent;
}
.card a {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: var(--ink-dark);
  min-height: 100px;
}
.card a:hover { background: rgba(26,26,26,0.04); color: var(--ink-dark); }

.card-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.card-desc {
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.5;
}

/* ===== 索引列表 ===== */
.index-group {
  margin: 40px 0;
}

.index-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  border-top: 2px solid var(--ink-dark);
  counter-reset: idx;
}

.index-list li {
  counter-increment: idx;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--ink-faint);
  position: relative;
  padding-left: 48px;
}
.index-list li::before {
  content: counter(idx, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mid);
  letter-spacing: 0.05em;
}

.index-list li a {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink-dark);
}
.index-list li a:hover { text-decoration: underline; }

.index-list li small {
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.5;
  font-family: var(--font-mono);
}

/* ===== 相关内容区 ===== */
.related-section {
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px dashed var(--ink-faint);
}
.related-section h2 {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--ink-dark);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--ink-dark);
  color: var(--bg);
  margin-top: auto;
  border-top: 2px solid var(--ink-mid);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: clamp(18px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bg);
  opacity: 0.9;
  flex-shrink: 0;
}

.footer-nav dl {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  list-style: none;
}
.footer-nav dt { display: none; }
.footer-nav dd { padding: 0; }
.footer-nav dd a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(250,250,248,0.6);
  text-decoration: none;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.footer-nav dd a:hover { color: var(--bg); }

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(250,250,248,0.4);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ===== Reveal 动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s step-end, transform 0.4s step-end;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== 评测封面图 ===== */
.review-thumb {
  margin-top: 16px;
}
.review-hero-img {
  max-width: 320px;
  height: auto;
  border: 2px solid var(--ink-dark);
  transform: rotate(0.5deg);
}

/* ===== About Prose ===== */
.about-prose { max-width: 680px; }

/* ===== 桌面端（≥1024px）===== */
@media (min-width: 1024px) {
  .hero-inner { padding: 80px 60px; }
}

/* ===== 平板（768px ~ 1023px）===== */
@media (max-width: 1023px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 48px 24px;
    gap: 32px;
  }
  .hero-media { display: none; }
  .content-section { flex-direction: row; }
  .sidebar-left { width: 200px; padding: 24px 0 24px 20px; }
  .content-main { padding: 32px 24px; }
}

/* ===== 移动端（≤767px）===== */
@media (max-width: 767px) {
  .hero {
    min-height: auto;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 40px 20px;
    gap: 24px;
  }
  .hero-h1 { font-size: 22px; }
  .hero-media { display: none; }

  .page-hero { padding: 32px 20px; }
  .page-hero h1 { font-size: 20px; }
  .sketch-deco, .rank-badge, .about-deco { display: none; }

  .content-section { flex-direction: column; }
  .sidebar-left {
    position: static;
    width: 100%;
    padding: 24px 20px 0;
    order: 2;
  }
  .aside-inner { transform: none; }
  .content-main {
    padding: 24px 20px 40px;
    border-left: none;
    border-top: 2px solid var(--ink-faint);
    order: 1;
  }

  .header-slogan { display: none; }
  .header-bar { padding: 0 16px; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px;
  }
  .footer-nav dl { gap: 0; }
  .footer-nav dd a { padding: 8px 10px 8px 0; }

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

  .rank-badge { display: none; }
}

/* ===== 小屏额外修正 ===== */
@media (max-width: 400px) {
  body { font-size: 15px; }
  .hero-h1 { font-size: 19px; }
  .index-list li { padding-left: 36px; }
}
