:root {
  --bg: #000;
  --bg-soft: #0a0a0c;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --text-2: #86868b;
  --accent: #2997ff;
  --radius: 18px;
  --nav-h: 52px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f7;
    --bg-soft: #fff;
    --card: #fff;
    --card-border: rgba(0, 0, 0, 0.08);
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --accent: #0071e3;
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ---------- nav ---------- */
#nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--card-border);
}
.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}
.brand { font-size: 17px; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }

/* ---------- hero ---------- */
.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 120px 22px 80px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--text-2);
  font-size: 19px;
  letter-spacing: -0.01em;
}
.stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 56px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { color: var(--text-2); font-size: 14px; }

/* ---------- sections ---------- */
main { max-width: 980px; margin: 0 auto; padding: 0 22px 80px; }
.section { margin-top: 88px; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.015em; }
.section-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; display: block; }

/* ---------- cards (currently reading) ---------- */
.cards-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 4px 24px;
  scrollbar-width: thin;
}
.cards-scroll::-webkit-scrollbar { height: 6px; }
.cards-scroll::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
.reading-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.reading-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.reading-card .cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 14px;
  display: block;
}
.rc-title { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-author { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { margin-top: 14px; }
.progress-track { height: 4px; background: var(--card-border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0; transition: width 0.8s ease; }
.progress-label { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* ---------- grid (finished / library) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}
.grid-dense { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.book-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 12px; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }
.book-card .cover { width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; object-fit: cover; display: block; margin-bottom: 10px; }
.bc-title { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- timeline (history) ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-day { margin-top: 26px; font-size: 14px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.tl-day:first-child { margin-top: 0; }
.tl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 14px;
}
.tl-row .cover { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; flex: none; }
.tl-info { flex: 1; min-width: 0; }
.tl-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-author { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-progress { width: 140px; flex: none; }
.tl-progress .progress-label { text-align: right; }

/* ---------- placeholder cover ---------- */
.placeholder {
  background: linear-gradient(135deg, #1d1d1f 0%, #3a3a3c 55%, #636366 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 0.02em;
}
@media (prefers-color-scheme: light) {
  .placeholder { background: linear-gradient(135deg, #e8e8ed 0%, #d2d2d7 100%); color: #1d1d1f; }
}

/* ---------- search ---------- */
.search {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 980px;
  color: var(--text);
  font-size: 15px;
  padding: 10px 20px;
  margin-bottom: 24px;
  outline: none;
}
.search:focus { border-color: var(--accent); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--card-border);
  padding: 40px 22px 60px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.foot-meta { margin-top: 4px; opacity: 0.7; }

/* ---------- empty / error ---------- */
.empty { color: var(--text-2); font-size: 15px; padding: 24px 4px; }
.error-banner {
  max-width: 640px;
  margin: 60px auto;
  text-align: center;
  padding: 40px 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

@media (max-width: 640px) {
  .stats { gap: 32px; }
  .tl-progress { width: 90px; }
  .hero { padding-top: 80px; }
}
