:root {
  --bg: #f7fbfc;
  --fg: #1f2a36;
  --muted: #6f7c8a;
  --accent: #1f7a8c;
  --accent-soft: rgba(31, 122, 140, 0.10);
  --warm-1: #ef8f5a;
  --warm-2: #f2c879;
  --line: rgba(31, 122, 140, 0.14);
  --card-bg: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
  --radius: 18px;
  --butterfly: rgba(45, 156, 142, 0.32);
}

[data-theme="dark"] {
  --butterfly: rgba(94, 234, 212, 0.22);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --accent: #5eead4;
  --accent-soft: rgba(94, 234, 212, 0.14);
  --warm-1: #fb923c;
  --warm-2: #facc15;
  --line: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(17, 24, 39, 0.72);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.28s ease, color 0.28s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 26%, rgba(31, 122, 140, 0.16), transparent 32%),
    radial-gradient(circle at 82% 72%, rgba(239, 143, 90, 0.11), transparent 28%),
    radial-gradient(circle at 50% 8%, rgba(242, 200, 121, 0.09), transparent 24%);
  pointer-events: none;
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 18% 26%, rgba(31, 122, 140, 0.20), transparent 30%),
    radial-gradient(circle at 82% 72%, rgba(239, 143, 90, 0.10), transparent 26%),
    radial-gradient(circle at 50% 8%, rgba(242, 200, 121, 0.06), transparent 20%);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem clamp(1rem, 4vw, 2.5rem);
}

.section {
  margin-bottom: 4.5rem;
}

.section-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 1.4rem;
  letter-spacing: 0.06em;
}

.card {
  padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.14s ease, border-color 0.14s ease;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ---- Hero ---- */
.hero { padding-top: 2rem; }

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f7a8c, #ef8f5a, #f2c879);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
  font-weight: 700;
  font-family: "Noto Serif SC", Georgia, serif;
  box-shadow: 0 8px 24px rgba(31, 122, 140, 0.2);
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  padding: 0.3rem 1.1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---- Theme button ---- */
.theme-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--fg);
  transition: transform 0.14s ease, border-color 0.14s ease;
  z-index: 10;
}

.theme-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

/* ---- Card grid (generic) ---- */
.card-grid { display: grid; gap: 1rem; }

.card-grid h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--fg);
}

.card-grid p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

.card-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* ---- Book cards ---- */
.book-grid { gap: 1rem; margin-bottom: 1rem; }

.book-card { text-align: left; }

.book-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.book-meta {
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.book-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- Tags ---- */
.tag-row {
  margin-top: 0.2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ---- Timeline ---- */
.timeline-list {
  list-style: none;
  border-left: 2px solid var(--line);
  padding-left: 1.8rem;
  display: grid;
  gap: 2rem;
}

.timeline-entry { position: relative; }

.timeline-entry::before {
  content: '';
  position: absolute;
  left: calc(-1.8rem - 7px);
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.timeline-year {
  display: block;
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.timeline-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.15rem;
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- Quote ---- */
.quote-block {
  text-align: center;
  padding: 2.5rem 1rem;
}

.quote-text {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
  letter-spacing: 0.04em;
  position: relative;
}

.quote-text::before,
.quote-text::after {
  color: var(--accent);
  opacity: 0.3;
  font-size: 2rem;
  position: absolute;
}

.quote-text::before { content: '\201C'; left: -1.2rem; top: -0.3rem; }
.quote-text::after  { content: '\201D'; right: -1.2rem; bottom: -1rem; }

.quote-author {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.8rem;
}

/* ---- Divider ---- */
.section-divider {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 0 auto 3rem;
  max-width: 200px;
  opacity: 0.6;
}

/* ---- Text block ---- */
.text-block {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.9;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

/* ---- Footer ---- */
footer { opacity: 0.8; }

/* ---- Hero links ---- */
.hero-links { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ---- Butterflies (interactive SVG) ---- */
.butterflies {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* ---- Bamboo leaves background ---- */
.bamboo-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.bamboo-bg svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bfly-wrap {
  position: absolute;
  opacity: 0.85;
  will-change: transform;
}

.bfly {
  width: 100%;
}

.bfly svg { display: block; width: 100%; height: 100%; }

.bfly-wrap--right {
  top: 5vh;
  right: 3vw;
  width: min(280px, 24vw);
}
.bfly-wrap--left {
  top: 60vh;
  left: 3vw;
  width: min(220px, 18vw);
}

@media (max-width: 860px) {
  .bfly-wrap--right { width: 160px; right: 1vw; top: 4vh; }
  .bfly-wrap--left  { width: 120px; left: 1vw; top: 62vh; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr !important; }
  .book-grid { grid-template-columns: 1fr !important; }
  .quote-text { font-size: 1.1rem; }
}
