/* jajareads · 家家读书 —— 纸书水墨 */

/* 英文字体自托管 */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/space-grotesk-latin-400.woff2) format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(assets/fonts/space-grotesk-latin-600.woff2) format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/space-grotesk-latin-700.woff2) format("woff2");
}

:root {
  /* 纸书配色 */
  --paper: #FBF7F0;
  --ink: #2B2B2B;
  --seal: #8B5A2B;
  --ink-soft: #6B675F;

  /* 8 倍数间距体系 */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;
  --space-96: 96px;
  --space-128: 128px;

  --font-sans: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  --font-display: "Space Grotesk", -apple-system, "PingFang SC", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--paper);
  /* 纸纤维纹理（SVG 噪点，自生成，无外部资源） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.11'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--seal);
  text-decoration: none;
}

/* ---- 淡墨背景 ---- */

.ink-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main,
.page-nav,
.site-footer {
  position: relative;
  z-index: 1;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-24);
}

/* ---- 右侧圆点导航 ---- */

.page-nav {
  position: fixed;
  right: var(--space-32);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  z-index: 10;
}

.page-dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--seal);
  border-radius: 50%;
  position: relative;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-dot span {
  position: absolute;
  right: var(--space-24);
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--seal);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.page-dot:hover span,
.page-dot.active span {
  opacity: 1;
}

.page-dot.active {
  background: var(--seal);
  transform: scale(1.3);
}

/* ---- 首屏 ---- */

.section-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: var(--space-64) var(--space-48);
  position: relative;
}

.hero-content {
  max-width: 520px;
}

.hero-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
  margin-bottom: var(--space-48);
  animation: fadeUp 0.6s ease both;
}

.logo-en {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.logo-cn {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--paper);
  background: var(--seal);
  padding: var(--space-8) var(--space-24);
  border-radius: var(--space-8);
  letter-spacing: 0.26em;
  box-shadow: 0 8px 16px rgba(139, 90, 43, 0.2);
}

.hero-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-32);
  /* 墨水渐变：墨黑晕到赭褐 */
  background: linear-gradient(115deg, var(--ink) 20%, var(--seal) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: fadeUp 0.7s ease 0.1s both;
}

.hero-subtitle {
  font-size: 19px;
  color: var(--seal);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-48);
  animation: fadeUp 0.7s ease 0.2s both;
}

.hero-tags {
  display: flex;
  gap: var(--space-16);
  justify-content: flex-start;
  flex-wrap: wrap;
  animation: fadeUp 0.7s ease 0.3s both;
}

.hero-tag {
  font-size: 14px;
  color: var(--seal);
  border: 1px solid rgba(139, 90, 43, 0.4);
  border-radius: var(--space-8);
  padding: var(--space-8) var(--space-24);
}

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

.scroll-hint {
  position: absolute;
  bottom: var(--space-32);
  background: none;
  border: none;
  cursor: pointer;
  animation: fadeUp 0.7s ease 0.6s both;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--seal);
  border-bottom: 2px solid var(--seal);
  transform: rotate(45deg);
}

/* ---- 板块通用 ---- */

.section-about,
.section-books,
.section-follow {
  padding: var(--space-128) 0;
}

.section-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: var(--space-32);
  position: relative;
  padding-left: var(--space-24);
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 4px;
  background: var(--seal);
}

/* ---- 滚动渐入 ---- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---- 关于我 ---- */

.about-text {
  font-size: 18px;
  max-width: 620px;
  margin-bottom: var(--space-64);
}

.timeline {
  position: relative;
  padding-left: 56px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: rgba(139, 90, 43, 0.35);
}

.tl-node {
  position: relative;
  padding: 0 0 var(--space-48) 40px;
}

.tl-node:last-child {
  padding-bottom: 0;
}

.tl-dot {
  position: absolute;
  left: -40px;
  top: 12px;
  width: 12px;
  height: 12px;
  background: var(--seal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(139, 90, 43, 0.12);
}

.tl-period {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: var(--space-8);
}

.tl-text {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 480px;
}

/* ---- 读书卡片 ---- */

.book-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
}

.book-card {
  display: flex;
  gap: var(--space-32);
  align-items: flex-start;
  color: inherit;
}

.book-cover {
  width: 132px;
  flex-shrink: 0;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #6b4a2b, #8B5A2B 55%, #4a3220);
  border-radius: 4px 12px 12px 4px;
  box-shadow: 0 12px 24px rgba(43, 43, 43, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  position: relative;
  padding: var(--space-16);
  text-align: center;
}

/* 书脊线 */
.book-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(251, 247, 240, 0.28);
}

.book-cover-cn {
  color: var(--paper);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.book-cover-en {
  color: rgba(251, 247, 240, 0.75);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.book-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--space-8);
}

.book-name-en {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: var(--space-4);
}

.book-problem {
  color: var(--ink);
  font-weight: 500;
  margin-bottom: var(--space-8);
}

.book-story {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: var(--space-16);
}

.book-link {
  font-size: 15px;
  color: var(--seal);
}

.book-card:hover .book-link {
  text-decoration: underline;
}

.book-card:hover .book-cover {
  box-shadow: 0 16px 32px rgba(43, 43, 43, 0.24);
}

/* ---- 关注我 ---- */

.follow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-24);
}

.follow-card {
  border: 1px solid rgba(139, 90, 43, 0.4);
  border-radius: var(--space-12);
  padding: var(--space-32);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.follow-card-title {
  font-size: 20px;
  font-weight: 600;
}

.follow-card-text {
  color: var(--ink-soft);
  font-size: 15px;
}

.follow-qr {
  width: 96px;
  height: 96px;
  border: 1px dashed var(--seal);
  border-radius: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--seal);
  font-size: 14px;
  letter-spacing: 0.1em;
}

.follow-badge {
  align-self: flex-start;
  border: 1px solid var(--seal);
  color: var(--seal);
  border-radius: var(--space-8);
  padding: var(--space-4) var(--space-16);
  font-size: 13px;
}

/* ---- 页脚 ---- */

.site-footer {
  text-align: center;
  padding: var(--space-64) 0 var(--space-48);
  color: var(--ink-soft);
  font-size: 14px;
}

.footer-tag {
  color: var(--seal);
  letter-spacing: 0.12em;
  font-size: 13px;
  margin-bottom: var(--space-8);
}

.footer-logo {
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---- 404 页 ---- */

.page-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-48);
}

.page-title {
  font-size: 40px;
  font-weight: 600;
  margin-bottom: var(--space-24);
}

.page-text {
  color: var(--ink-soft);
  margin-bottom: var(--space-32);
}

.page-link {
  color: var(--seal);
  font-size: 16px;
}

.page-link:hover {
  text-decoration: underline;
}

/* ---- 手机适配 ---- */

@media (max-width: 720px) {
  .page-nav {
    right: var(--space-16);
    gap: var(--space-16);
  }

  .page-dot span {
    display: none;
  }

  .section-hero {
    flex-direction: column;
    text-align: left;
    padding-top: var(--space-96);
    gap: var(--space-48);
  }

  .hero-content {
    max-width: 100%;
  }

  .section-about,
  .section-books,
  .section-follow {
    padding: var(--space-96) 0;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .section-title {
    font-size: 26px;
  }

  .about-text {
    font-size: 17px;
  }

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

  .follow-card {
    padding: var(--space-24);
  }

  .book-card {
    flex-direction: column;
  }

  .book-cover {
    width: 110px;
  }
}
