/* weread/web/css/app.css —— 微信读书网页版复刻的视觉系统（手写 CSS，零外部依赖） */

/* ---------------------------------------------------------------- tokens */
:root {
  --blue: #1b88ee;
  --blue-600: #0f7ae0;
  --blue-700: #0b66bd;
  --blue-050: #eaf4ff;
  --blue-100: #d9ecff;
  --ink: #212832;
  --text: #353c46;
  --muted: #858c96;
  --faint: #adb4be;
  --line: #edeef0;
  --line-strong: #e2e5e8;
  --soft: #f4f5f7;
  --soft-2: #fafafa;
  --white: #fff;
  --gold: #d88f02;
  --gold-soft: #fff6e2;
  --red: #fa3a3a;
  --red-soft: #fff0f0;
  --green: #00a870;
  --green-soft: #e9f8f2;
  --purple: #7a6bd8;
  --shadow-sm: 0 2px 8px rgba(27, 40, 56, .06);
  --shadow-md: 0 10px 30px rgba(27, 40, 56, .10);
  --shadow-lg: 0 24px 70px rgba(17, 28, 44, .18);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --header-h: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --reader-bg: #ffffff;
  --reader-text: #2b2b2b;
  --reader-muted: #8b8b8b;
  --reader-line: #eeeeee;
  --reader-accent: #1b88ee;
  --reader-font-size: 19px;
  --reader-line-height: 1.9;
  --reader-width: 720px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
img, svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
::selection { background: rgba(27, 136, 238, .18); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.icon { flex: none; }
.brand-logo { flex: none; }

/* ---------------------------------------------------------------- boot */
.boot-splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(60% 50% at 50% 30%, #f4f9ff 0%, #fff 70%);
}
.boot-logo {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  color: #fff; font-size: 26px; font-weight: 700;
  background: linear-gradient(135deg, #39a4ff, #0b6fd0);
  box-shadow: 0 12px 30px rgba(27, 136, 238, .28);
}
.boot-title { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.boot-sub { font-size: 13px; color: var(--muted); }
.boot-bar { width: 160px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 18px; }
.boot-bar span { display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--blue); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
.noscript { padding: 40px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- shell */
#app { min-height: 100vh; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; }
.container { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.narrow { width: min(980px, calc(100% - 48px)); margin: 0 auto; }

.app-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 30px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: .5px; color: var(--ink); white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--blue); }
.nav { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.nav a {
  position: relative; height: 100%; display: inline-flex; align-items: center;
  padding: 0 17px; font-size: 15px; color: var(--text);
  transition: color .18s var(--ease);
}
.nav a:hover { color: var(--blue); }
.nav a.active { color: var(--blue); font-weight: 600; }
.nav a.active::after {
  content: ""; position: absolute; left: 17px; right: 17px; bottom: 0;
  height: 3px; border-radius: 3px 3px 0 0; background: var(--blue);
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-trigger {
  width: 300px; height: 38px; border-radius: 999px; background: var(--soft);
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  color: var(--faint); font-size: 13px; text-align: left;
  transition: background .18s, box-shadow .18s;
}
.search-trigger:hover { background: #eef1f4; box-shadow: inset 0 0 0 1px var(--line-strong); }
.search-trigger .kbd { margin-left: auto; font-size: 11px; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px; background: #fff; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text);
  transition: background .18s, color .18s;
}
.icon-btn:hover { background: var(--soft); color: var(--blue); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, #6fb8ff, #1b88ee);
  box-shadow: 0 2px 8px rgba(27, 136, 238, .25);
  border: 2px solid #fff;
}
.avatar.big { width: 72px; height: 72px; font-size: 26px; border-width: 3px; }
.header-avatar { padding: 0; }

.mobile-tabbar { display: none; }

/* ---------------------------------------------------------------- generic */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--soft); border: 1px solid transparent;
  transition: transform .14s var(--ease), background .18s, color .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn:hover { background: #eceff2; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(27, 136, 238, .24); }
.btn-primary:hover { background: var(--blue-600); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-050); }
.btn-soft { background: var(--blue-050); color: var(--blue-600); }
.btn-soft:hover { background: var(--blue-100); }
.btn-white { background: #fff; color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.btn-white:hover { background: #f5f8fb; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 15px; border-radius: 11px; }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-danger:hover { background: #ffe3e3; }
.link-btn { color: var(--blue); font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.link-btn:hover { color: var(--blue-700); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: 6px; background: var(--soft); color: var(--muted);
  font-size: 12px; white-space: nowrap;
}
.tag.blue { background: var(--blue-050); color: var(--blue-600); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px;
  border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 12px;
  backdrop-filter: blur(6px);
}
.section { margin: 58px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-title { font-size: 22px; font-weight: 650; letter-spacing: -.2px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.section-title .dot { width: 5px; height: 18px; border-radius: 3px; background: var(--blue); }
.section-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.section-more { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.section-more:hover { color: var(--blue); }
.divider { height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- cover */
.cover {
  position: relative; aspect-ratio: 3 / 4; width: 100%;
  border-radius: 4px; overflow: hidden;
  background: linear-gradient(145deg, var(--c1, #31527a), var(--c2, #7aa6cc));
  box-shadow: 0 8px 18px rgba(20, 31, 46, .20), inset -7px 0 14px rgba(0, 0, 0, .16);
  color: #fff; isolation: isolate;
  transform: translateZ(0);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.cover::before {
  content: ""; position: absolute; inset: 0 0 0 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.26), transparent 8%, transparent 92%, rgba(255,255,255,.08)),
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 24%, transparent 76%, rgba(0,0,0,.18));
}
.cover::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  top: -30%; left: -60%; width: 70%; height: 160%;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.15) 42%, transparent 62%);
  transform: rotate(8deg);
}
.cover-inner {
  position: relative; z-index: 3; height: 100%; padding: 12px 11px 10px;
  display: flex; flex-direction: column;
}
.cover-mark {
  align-self: flex-start; font-size: 8px; letter-spacing: .8px;
  border: 1px solid rgba(255,255,255,.45); border-radius: 2px;
  padding: 1px 4px; opacity: .9;
}
.cover-title {
  font-family: var(--font-serif); font-weight: 700; letter-spacing: .12em;
  text-shadow: 0 1px 4px rgba(0,0,0,.18); overflow: hidden;
}
.cover-author { margin-top: auto; font-size: 9px; opacity: .8; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover-seal {
  position: absolute; right: 10px; bottom: 10px; z-index: 4;
  width: 20px; height: 20px; border: 1px solid rgba(255,255,255,.65);
  display: grid; place-items: center; font-size: 9px; font-family: var(--font-serif);
  color: rgba(255,255,255,.9); border-radius: 2px;
}
.cover--classic .cover-title {
  writing-mode: vertical-rl; align-self: flex-end; max-height: 74%;
  font-size: clamp(16px, 1.35vw, 23px); line-height: 1.18; margin-right: 3px;
}
.cover--classic .cover-author { writing-mode: horizontal-tb; }
.cover--modern .cover-inner { padding: 13px 12px 11px; }
.cover--modern .cover-title {
  font-family: var(--font-sans); writing-mode: horizontal-tb;
  font-size: clamp(15px, 1.25vw, 21px); line-height: 1.18; letter-spacing: .02em;
  max-height: 58%; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  margin-top: 10px;
}
.cover--modern .cover-author { font-size: 9.5px; }
.cover--modern .cover-seal { border-radius: 50%; width: 24px; height: 24px; }
.cover--poetry {
  background: linear-gradient(150deg, var(--c1, #f2ead8), var(--c2, #d8c6a1));
  color: #30281d;
  box-shadow: 0 8px 18px rgba(60, 45, 25, .14), inset -7px 0 14px rgba(0,0,0,.06);
}
.cover--poetry::before { background: linear-gradient(90deg, rgba(0,0,0,.07), transparent 8%, transparent 92%, rgba(0,0,0,.05)); }
.cover--poetry .cover-mark { border-color: rgba(50,40,25,.35); }
.cover--poetry .cover-title {
  writing-mode: vertical-rl; align-self: center; margin-top: 8%;
  font-size: clamp(17px, 1.5vw, 25px); letter-spacing: .18em;
}
.cover--poetry .cover-seal { color: #a33a2c; border-color: #a33a2c; }
.cover--minimal { background: linear-gradient(150deg, var(--c1, #161616), var(--c2, #3d3d3d)); }
.cover--minimal .cover-title {
  writing-mode: vertical-rl; align-self: center; margin-top: 6%;
  font-size: clamp(18px, 1.6vw, 28px); letter-spacing: .25em;
}
.cover--minimal .cover-seal { border-radius: 50%; color: #ff8b7a; border-color: #ff8b7a; }
.cover--xs { width: 44px; border-radius: 3px; box-shadow: 0 3px 8px rgba(20,31,46,.18); }
.cover--xs .cover-inner { padding: 5px 5px 4px; }
.cover--xs .cover-mark, .cover--xs .cover-author, .cover--xs .cover-seal { display: none; }
.cover--xs .cover-title { font-size: 8px !important; letter-spacing: .04em; max-height: 92%; }
.cover--sm { width: 68px; border-radius: 3px; }
.cover--sm .cover-inner { padding: 7px 6px 6px; }
.cover--sm .cover-mark, .cover--sm .cover-author, .cover--sm .cover-seal { display: none; }
.cover--sm .cover-title { font-size: 9px !important; letter-spacing: .04em; max-height: 92%; }
.cover-hover:hover .cover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 0 18px 32px rgba(20,31,46,.24); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(80% 120% at 88% 20%, rgba(64, 194, 214, .34) 0%, transparent 55%),
    radial-gradient(80% 120% at 10% 110%, rgba(43, 123, 251, .36) 0%, transparent 58%),
    linear-gradient(118deg, #082a49 0%, #0a3d66 48%, #0d5b73 100%);
  color: #fff;
  padding: 46px 52px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px;
  min-height: 336px;
  box-shadow: 0 20px 50px rgba(8, 42, 73, .16);
}
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .35;
  mask-image: linear-gradient(90deg, #000 0%, transparent 68%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; width: 460px; height: 460px;
  right: -140px; top: -190px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 60px rgba(255,255,255,.03), 0 0 0 120px rgba(255,255,255,.02);
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; z-index: 2; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #c8e9f5; letter-spacing: .08em; }
.hero h1 {
  margin: 16px 0 12px; font-size: clamp(32px, 3.5vw, 46px); line-height: 1.18;
  font-weight: 650; letter-spacing: -.5px; max-width: 560px;
  text-shadow: 0 2px 24px rgba(0,0,0,.12);
}
.hero h1 span { color: #7fd8ff; }
.hero-desc { font-size: 14px; line-height: 1.8; color: rgba(255,255,255,.72); max-width: 480px; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; }
.hero-actions .btn-white { height: 44px; padding: 0 24px; font-size: 15px; }
.hero-actions .btn { height: 44px; padding: 0 22px; font-size: 15px; }
.hero-stats { display: flex; gap: 30px; margin-top: 30px; }
.hero-stat b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.3px; }
.hero-stat span { font-size: 11px; color: rgba(255,255,255,.55); }
.hero-books { position: relative; min-height: 250px; z-index: 1; }
.hero-book {
  position: absolute; width: 126px;
  filter: drop-shadow(0 24px 28px rgba(0,0,0,.32));
  transition: transform .5s var(--ease);
}
.hero-book .cover { box-shadow: 0 16px 30px rgba(0,0,0,.28), inset -7px 0 14px rgba(0,0,0,.18); }
.hero-book.b1 { left: 8%; top: 18px; transform: rotate(-8deg); z-index: 3; }
.hero-book.b2 { left: 39%; top: -12px; transform: rotate(3deg) scale(1.08); z-index: 4; }
.hero-book.b3 { left: 71%; top: 34px; transform: rotate(10deg); z-index: 2; }
.hero:hover .b1 { transform: rotate(-10deg) translateY(-4px); }
.hero:hover .b2 { transform: rotate(2deg) scale(1.1) translateY(-5px); }
.hero:hover .b3 { transform: rotate(12deg) translateY(-3px); }
.hero-badge {
  position: absolute; right: 2%; bottom: 8px; z-index: 6;
  background: rgba(255,255,255,.94); color: var(--ink);
  border-radius: 12px; padding: 9px 12px; box-shadow: 0 12px 28px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: 9px; font-size: 11px;
}
.hero-badge b { display: block; font-size: 13px; }
.hero-badge .mini-ring {
  width: 34px; height: 34px; border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--p, 46) * 1%), #e9eef4 0);
  display: grid; place-items: center;
}
.hero-badge .mini-ring::after { content: ""; width: 26px; height: 26px; border-radius: 50%; background: #fff; }
.hero-badge .mini-ring span { position: absolute; font-size: 9px; font-weight: 700; color: var(--blue); }

/* ---------------------------------------------------------------- book card */
.book-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 22px; }
.book-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.book-card { display: flex; flex-direction: column; gap: 9px; min-width: 0; cursor: pointer; }
.book-card .cover-wrap { position: relative; border-radius: 4px; }
.book-card .book-title {
  font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card .book-author { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card .book-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--faint); }
.rating { color: var(--gold); font-weight: 650; display: inline-flex; align-items: center; gap: 2px; }
.rating .icon { width: 12px; height: 12px; }
.book-card .progress-line { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.book-card .progress-line span { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.book-badge {
  position: absolute; left: 8px; top: 8px; z-index: 5;
  background: rgba(255,255,255,.92); color: var(--blue-600);
  border-radius: 5px; padding: 2px 6px; font-size: 10px; font-weight: 650;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.book-cover-wrap { position: relative; }
.book-hover-actions {
  position: absolute; inset: auto 8px 8px; z-index: 6;
  display: flex; justify-content: center; opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s;
}
.book-card:hover .book-hover-actions { opacity: 1; transform: none; }
.book-hover-actions .btn { height: 30px; padding: 0 12px; font-size: 12px; background: rgba(255,255,255,.94); color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.book-hover-actions .btn:hover { background: #fff; color: var(--blue); }

/* horizontal book row */
.book-row { display: grid; grid-auto-flow: column; grid-auto-columns: 138px; gap: 20px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.book-row::-webkit-scrollbar { display: none; }
.book-row .cover-title { font-size: 17px; }

/* ---------------------------------------------------------------- home */
.home-wrap { padding: 26px 0 0; }
.home-section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.home-section-head h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.home-section-head h2 .accent { width: 4px; height: 17px; border-radius: 3px; background: var(--blue); }
.home-section-head p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.home-section-head .more { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 1px; }
.home-section-head .more:hover { color: var(--blue); }

.category-band { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.category-tile {
  position: relative; overflow: hidden; border-radius: 14px; padding: 18px 16px;
  min-height: 96px; display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--line); background: #fff;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.category-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.category-tile .cat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-050); color: var(--blue); }
.category-tile b { font-size: 14px; font-weight: 600; }
.category-tile span { font-size: 11px; color: var(--muted); }
.category-tile::after {
  content: ""; position: absolute; right: -20px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: var(--cat, #eaf4ff); opacity: .65;
}

.rank-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.rank-panel { border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 8px; background: #fff; }
.rank-panel-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--soft); }
.rank-panel-head b { font-size: 15px; display: flex; align-items: center; gap: 7px; }
.rank-panel-head .icon { color: var(--gold); }
.rank-panel-head a { font-size: 12px; color: var(--muted); }
.rank-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--soft); cursor: pointer; }
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover .rank-title { color: var(--blue); }
.rank-num { width: 18px; text-align: center; font-size: 13px; font-weight: 700; color: var(--faint); font-style: italic; }
.rank-num.top1 { color: #e5484d; }
.rank-num.top2 { color: #e08a00; }
.rank-num.top3 { color: #b07a2a; }
.rank-info { min-width: 0; flex: 1; }
.rank-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.rank-author { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-score { font-size: 11px; color: var(--gold); font-weight: 600; }

.home-footer { margin-top: 64px; padding: 30px 0 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.home-footer .foot-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.home-footer .foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.home-footer a:hover { color: var(--blue); }

/* ---------------------------------------------------------------- shelf */
.page-head { padding: 34px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.4px; }
.page-head .sub { margin-top: 7px; color: var(--muted); font-size: 13px; }
.page-head .head-actions { display: flex; gap: 10px; align-items: center; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.tab-pills { display: flex; gap: 4px; background: var(--soft); border-radius: 9px; padding: 3px; }
.tab-pills button { height: 30px; padding: 0 13px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.tab-pills button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.toolbar .spacer { flex: 1; }
.select {
  height: 32px; padding: 0 28px 0 11px; border-radius: 7px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text); font-size: 12px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23858c96' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.continue-card {
  position: relative; overflow: hidden; border-radius: 18px;
  background: linear-gradient(115deg, #eaf5ff 0%, #f7fbff 55%, #eff8f5 100%);
  border: 1px solid #e1eefb; padding: 24px 28px;
  display: flex; align-items: center; gap: 24px; margin-bottom: 30px;
}
.continue-card::after {
  content: ""; position: absolute; right: -60px; top: -90px; width: 260px; height: 260px;
  border-radius: 50%; background: rgba(27,136,238,.08);
}
.continue-card .cover { width: 92px; flex: none; }
.continue-info { min-width: 0; flex: 1; }
.continue-kicker { font-size: 11px; letter-spacing: .12em; color: var(--blue); font-weight: 600; }
.continue-info h3 { margin: 6px 0 3px; font-size: 21px; font-weight: 650; }
.continue-info .by { color: var(--muted); font-size: 12px; }
.continue-progress { margin-top: 16px; max-width: 440px; }
.continue-progress .bar { height: 5px; border-radius: 5px; background: #dbe9f6; overflow: hidden; }
.continue-progress .bar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #4aa8ff, #1b88ee); }
.continue-progress .meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 7px; }
.continue-card .btn { flex: none; margin-left: auto; position: relative; z-index: 2; }
.shelf-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 30px 22px; }
.shelf-card { position: relative; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.shelf-card .cover-wrap { position: relative; cursor: pointer; }
.shelf-progress {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 7px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 10px; display: flex; justify-content: space-between; align-items: center;
  border-radius: 0 0 4px 4px;
}
.shelf-progress .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.25); }
.shelf-progress .bar span { display: block; height: 100%; background: #7fd2ff; }
.shelf-card .remove-btn {
  position: absolute; right: 6px; top: 6px; z-index: 8; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; display: none; place-items: center;
}
.shelf-grid.manage .remove-btn { display: grid; }
.shelf-card .book-title { font-size: 13.5px; }
.shelf-card .book-author { font-size: 11.5px; }
.shelf-empty { padding: 80px 0; text-align: center; color: var(--muted); }
.shelf-empty .big { font-size: 42px; color: var(--line-strong); margin-bottom: 14px; display: grid; place-items: center; }
.shelf-empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 18px; }
.shelf-empty p { margin: 0 0 18px; font-size: 13px; }

/* ---------------------------------------------------------------- ranking page */
.ranking-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 42px; padding-bottom: 70px; }
.ranking-side h3 { font-size: 12px; color: var(--muted); letter-spacing: .12em; font-weight: 600; margin: 6px 0 12px; }
.ranking-side a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 9px; color: var(--text); font-size: 14px; }
.ranking-side a:hover { background: var(--soft); }
.ranking-side a.on { background: var(--blue-050); color: var(--blue-600); font-weight: 600; }
.ranking-side a .count { font-size: 11px; color: var(--faint); }
.ranking-list { border-top: 1px solid var(--line); }
.ranking-item { display: flex; gap: 18px; align-items: center; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.ranking-item .rank-big { width: 42px; font-size: 20px; font-weight: 700; color: var(--faint); font-style: italic; text-align: center; flex: none; }
.ranking-item .rank-big.top { color: var(--red); }
.ranking-item .cover { width: 58px; flex: none; }
.ranking-item .info { flex: 1; min-width: 0; }
.ranking-item h3 { margin: 0 0 3px; font-size: 16px; font-weight: 600; }
.ranking-item h3 a:hover { color: var(--blue); }
.ranking-item .author { font-size: 12px; color: var(--muted); }
.ranking-item .intro { margin-top: 7px; font-size: 12px; color: var(--faint); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ranking-item .score { width: 62px; text-align: right; font-size: 18px; font-weight: 700; color: var(--gold); }
.ranking-item .score small { display: block; font-size: 10px; font-weight: 400; color: var(--faint); }

/* ---------------------------------------------------------------- category page */
.category-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 40px; padding-bottom: 70px; }
.category-side { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.category-side h3 { font-size: 12px; letter-spacing: .12em; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.category-side a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 9px; font-size: 14px; color: var(--text); }
.category-side a:hover { background: var(--soft); }
.category-side a.on { background: var(--blue-050); color: var(--blue-600); font-weight: 600; }
.category-side a span { font-size: 11px; color: var(--faint); }
.category-main .cat-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.category-main .cat-head h2 { margin: 0; font-size: 24px; }
.category-main .cat-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.mobile-chips { display: none; }

/* ---------------------------------------------------------------- search */
.search-page { max-width: 860px; margin: 0 auto; padding: 42px 0 80px; }
.search-box {
  display: flex; align-items: center; gap: 10px; height: 52px; border-radius: 14px;
  background: var(--soft); border: 1px solid transparent; padding: 0 18px;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.search-box:focus-within { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(27,136,238,.10); }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.search-box input::placeholder { color: var(--faint); }
.search-box .icon { color: var(--faint); }
.search-hint { font-size: 12px; color: var(--faint); margin: 10px 2px 0; }
.hot-search { margin-top: 34px; }
.hot-search h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.hot-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.hot-chips button { height: 32px; padding: 0 14px; border-radius: 999px; background: var(--soft); font-size: 12px; color: var(--text); }
.hot-chips button:hover { background: var(--blue-050); color: var(--blue); }
.search-results { margin-top: 30px; }
.search-count { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.search-book-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.search-book-row .cover { width: 46px; flex: none; }
.search-book-row .info { flex: 1; min-width: 0; }
.search-book-row h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.search-book-row p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-book-row .tag { flex: none; }
.author-row { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 24px; }
.author-chip { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--soft); font-size: 12px; }
.author-chip b { font-weight: 600; }
.search-empty { text-align: center; color: var(--muted); padding: 70px 0; }

/* ---------------------------------------------------------------- book detail */
.detail-hero {
  position: relative; overflow: hidden; border-radius: 0 0 26px 26px;
  background: #f7f8fa; padding: 34px 0 30px; margin-bottom: 30px;
}
.detail-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 420px;
  background: radial-gradient(50% 70% at 25% 30%, var(--c1, #cfe3f8) 0%, transparent 70%),
              radial-gradient(60% 80% at 80% 10%, var(--c2, #e6f1fb) 0%, transparent 72%);
  opacity: .55; filter: blur(22px);
}
.detail-hero-inner { position: relative; display: flex; gap: 32px; align-items: center; }
.detail-cover { width: 176px; flex: none; }
.detail-cover .cover { box-shadow: 0 22px 44px rgba(20,31,46,.26); }
.detail-info { min-width: 0; flex: 1; }
.detail-breadcrumb { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.detail-breadcrumb a:hover { color: var(--blue); }
.detail-info h1 { margin: 0 0 7px; font-size: clamp(26px, 3vw, 34px); line-height: 1.25; font-weight: 700; letter-spacing: -.4px; }
.detail-author { font-size: 14px; color: var(--text); }
.detail-author a:hover { color: var(--blue); }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.detail-score { display: flex; align-items: baseline; gap: 7px; margin-top: 18px; }
.detail-score b { font-size: 30px; color: var(--gold); font-weight: 700; letter-spacing: -.5px; }
.detail-score span { font-size: 12px; color: var(--muted); }
.detail-intro { margin-top: 14px; max-width: 660px; color: var(--text); font-size: 13px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.detail-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 46px; padding-bottom: 60px; }
.detail-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.detail-tabs button { position: relative; height: 44px; font-size: 14px; color: var(--muted); }
.detail-tabs button.on { color: var(--ink); font-weight: 600; }
.detail-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; }
.detail-about p { font-size: 14px; line-height: 1.95; color: var(--text); margin: 0 0 14px; text-align: justify; }
.detail-excerpt {
  margin: 0 0 20px; padding: 16px 18px; border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0; background: var(--soft-2);
  font-family: var(--font-serif); font-size: 15px; line-height: 1.9; color: #5a5147;
}
.chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 28px; }
.chapter-row { display: flex; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid var(--soft); cursor: pointer; }
.chapter-row:hover .chapter-name { color: var(--blue); }
.chapter-no { width: 24px; font-size: 11px; color: var(--faint); text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.chapter-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-len { margin-left: auto; font-size: 10px; color: var(--faint); flex: none; }
.chapter-read { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex: none; }
.review-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-head { display: flex; align-items: center; gap: 9px; }
.review-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.review-name { font-size: 12px; font-weight: 600; }
.review-time { margin-left: auto; font-size: 11px; color: var(--faint); }
.review-text { margin: 9px 0 0 37px; font-size: 13px; line-height: 1.75; color: var(--text); }
.review-stars { display: flex; gap: 1px; color: var(--gold); }
.review-stars .icon { width: 12px; height: 12px; }
.detail-side { align-self: start; position: sticky; top: calc(var(--header-h) + 20px); }
.side-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.side-card h3 { margin: 0 0 13px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.side-book { display: flex; gap: 10px; padding: 8px 0; cursor: pointer; }
.side-book .cover { width: 38px; flex: none; }
.side-book .t { font-size: 12px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-book .a { margin-top: 3px; font-size: 10px; color: var(--muted); }
.side-book:hover .t { color: var(--blue); }
.side-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side-stat div { background: var(--soft); border-radius: 9px; padding: 10px 12px; }
.side-stat b { display: block; font-size: 16px; }
.side-stat span { font-size: 10px; color: var(--muted); }

/* ---------------------------------------------------------------- notes */
.notes-page { padding-bottom: 70px; }
.notes-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 8px 0 26px; }
.stat-card { border: 1px solid var(--line); border-radius: 14px; padding: 17px 19px; background: #fff; }
.stat-card .k { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.stat-card .v { margin-top: 7px; font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat-card .v small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.notes-list { display: flex; flex-direction: column; gap: 14px; }
.note-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: #fff; position: relative; }
.note-card:hover { border-color: #dbe6f2; }
.note-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.note-book { font-size: 12px; font-weight: 600; color: var(--text); }
.note-book:hover { color: var(--blue); }
.note-chapter { font-size: 11px; color: var(--faint); }
.note-time { margin-left: auto; font-size: 11px; color: var(--faint); }
.note-quote { position: relative; padding-left: 14px; font-family: var(--font-serif); font-size: 14px; line-height: 1.8; color: #4a4f57; }
.note-quote::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: var(--hl, #ffd75e); }
.note-text { margin-top: 9px; font-size: 13px; line-height: 1.7; color: var(--text); background: var(--soft-2); border-radius: 8px; padding: 10px 12px; }
.note-actions { position: absolute; right: 12px; bottom: 10px; opacity: 0; transition: opacity .15s; }
.note-card:hover .note-actions { opacity: 1; }
.notes-empty { padding: 70px 0; text-align: center; color: var(--muted); }
.notes-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 5px; }

/* ---------------------------------------------------------------- profile */
.profile-page { padding-bottom: 70px; }
.profile-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 34px 36px;
  background: linear-gradient(115deg, #0e2f50, #12506a 55%, #176b6d);
  color: #fff; display: flex; align-items: center; gap: 24px;
  box-shadow: 0 18px 44px rgba(8, 42, 73, .16);
}
.profile-hero::after { content: ""; position: absolute; right: -80px; top: -100px; width: 320px; height: 320px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 0 0 50px rgba(255,255,255,.03); }
.profile-hero .avatar { background: linear-gradient(135deg, #8ac6ff, #2d8ff0); }
.profile-info h1 { margin: 0 0 4px; font-size: 26px; font-weight: 650; }
.profile-info .handle { font-size: 12px; color: rgba(255,255,255,.6); }
.profile-info .bio { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.78); }
.profile-hero .profile-actions { margin-left: auto; position: relative; z-index: 2; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 26px; }
.profile-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px 19px; }
.profile-stat b { display: block; font-size: 26px; letter-spacing: -.5px; }
.profile-stat span { font-size: 11px; color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; }
.profile-card { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: #fff; }
.profile-card h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.profile-card h3 span { font-size: 11px; color: var(--muted); font-weight: 400; }
.week-chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 12px; }
.week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.week-bar .bar { width: 100%; max-width: 28px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #65b6ff, #1b88ee); min-height: 4px; transition: height .6s var(--ease); }
.week-bar .bar.zero { background: var(--line); }
.week-bar span { font-size: 10px; color: var(--faint); }
.week-bar b { font-size: 9px; color: var(--muted); font-weight: 500; }
.menu-list { display: flex; flex-direction: column; }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--soft); font-size: 13px; color: var(--text); cursor: pointer; }
.menu-row:last-child { border-bottom: 0; }
.menu-row .icon { color: var(--muted); }
.menu-row .chev { margin-left: auto; color: var(--faint); }
.menu-row:hover { color: var(--blue); }
.checkin-card { background: linear-gradient(135deg, #fff8e8, #fffdf6); border-color: #f2e3c4; }
.checkin-card h3 { color: #8a5a00; }
.checkin-days { display: flex; gap: 7px; margin: 8px 0 16px; flex-wrap: wrap; }
.checkin-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid #f0dfbc; color: #c08a31; font-size: 10px; }
.checkin-dot.on { background: #f6b73c; border-color: #f6b73c; color: #fff; }
.heatmap { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 8px; }
.heatmap i { aspect-ratio: 1; border-radius: 3px; background: var(--soft); }
.heatmap i.l1 { background: #d9ecff; }
.heatmap i.l2 { background: #9ed0ff; }
.heatmap i.l3 { background: #5fb0ff; }
.heatmap i.l4 { background: #1b88ee; }

/* ---------------------------------------------------------------- reader */
body.reader-mode { overflow: hidden; background: var(--reader-bg); }
body.reader-mode #app { display: none; }
#reader-root { display: none; }
body.reader-mode #reader-root { display: block; }
.reader {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background: var(--reader-bg); color: var(--reader-text);
  font-family: var(--font-sans);
  transition: background .25s, color .25s;
}
.reader[data-theme="sepia"] { --reader-bg: #f5efe0; --reader-text: #4f4436; --reader-muted: #8e8270; --reader-line: #e3d9c5; }
.reader[data-theme="green"] { --reader-bg: #e8f0e8; --reader-text: #2f3a33; --reader-muted: #7c8a80; --reader-line: #d3dfd5; }
.reader[data-theme="dark"] { --reader-bg: #1a1a1a; --reader-text: #b8b8b8; --reader-muted: #777; --reader-line: #2c2c2c; }
.reader-top {
  flex: none; height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--reader-line);
  background: var(--reader-bg); z-index: 20;
}
.reader-top .icon-btn { color: var(--reader-text); width: 36px; height: 36px; }
.reader-top .icon-btn:hover { background: rgba(127,127,127,.12); }
.reader-title { min-width: 0; flex: 1; text-align: center; }
.reader-title b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-title span { display: block; font-size: 10px; color: var(--reader-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-tools { display: flex; align-items: center; gap: 2px; }
.reader-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.reader-content { width: min(var(--reader-width), calc(100% - 56px)); margin: 0 auto; padding: 58px 0 120px; }
.reader-chapter-no { font-size: 11px; letter-spacing: .16em; color: var(--reader-muted); text-align: center; margin-bottom: 18px; }
.reader-chapter-title {
  margin: 0 0 40px; text-align: center; font-family: var(--font-serif);
  font-size: 27px; line-height: 1.5; font-weight: 600; letter-spacing: .04em;
}
.reader-body { font-family: var(--font-serif); font-size: var(--reader-font-size); line-height: var(--reader-line-height); }
.reader-body p {
  margin: 0 0 .85em; text-indent: 2em; text-align: justify;
  word-break: break-word; letter-spacing: .015em;
}
.reader-body p.no-indent { text-indent: 0; }
.reader-body p.center { text-indent: 0; text-align: center; }
.reader-body mark { color: inherit; background: transparent; border-radius: 2px; padding: 0 .05em; }
.reader-body mark.hl-yellow { background: linear-gradient(transparent 52%, rgba(255, 215, 94, .72) 52%); }
.reader-body mark.hl-red { background: linear-gradient(transparent 52%, rgba(255, 154, 154, .55) 52%); }
.reader-body mark.hl-blue { background: linear-gradient(transparent 52%, rgba(146, 199, 255, .58) 52%); }
.reader-body mark.hl-green { background: linear-gradient(transparent 52%, rgba(152, 221, 176, .58) 52%); }
.reader[data-theme="dark"] .reader-body mark.hl-yellow { background: rgba(255, 215, 94, .18); }
.reader[data-theme="dark"] .reader-body mark.hl-red { background: rgba(255, 154, 154, .16); }
.reader[data-theme="dark"] .reader-body mark.hl-blue { background: rgba(146, 199, 255, .17); }
.reader[data-theme="dark"] .reader-body mark.hl-green { background: rgba(152, 221, 176, .16); }
.reader-end { margin: 56px 0 0; padding-top: 22px; border-top: 1px solid var(--reader-line); text-align: center; color: var(--reader-muted); font-size: 12px; }
.reader-nav { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.reader-nav .btn { background: transparent; border: 1px solid var(--reader-line); color: var(--reader-text); }
.reader-nav .btn:hover { border-color: var(--reader-accent); color: var(--reader-accent); }
.reader-progress { flex: none; height: 3px; background: var(--reader-line); }
.reader-progress span { display: block; height: 100%; width: 0; background: var(--reader-accent); transition: width .12s linear; }
.reader-bottom {
  flex: none; height: 62px; padding: 0 20px; border-top: 1px solid var(--reader-line);
  display: flex; align-items: center; gap: 12px; background: var(--reader-bg); z-index: 20;
}
.reader-bottom .chapter-nav { display: flex; align-items: center; gap: 4px; }
.reader-bottom .chapter-nav button { height: 34px; padding: 0 10px; border-radius: 7px; font-size: 12px; color: var(--reader-muted); display: flex; align-items: center; gap: 3px; }
.reader-bottom .chapter-nav button:hover { background: rgba(127,127,127,.1); color: var(--reader-text); }
.reader-bottom .progress-text { flex: 1; text-align: center; font-size: 11px; color: var(--reader-muted); font-variant-numeric: tabular-nums; }
.reader-bottom .reader-controls { display: flex; align-items: center; gap: 2px; }
.reader-bottom .reader-controls button { height: 34px; min-width: 34px; border-radius: 7px; display: grid; place-items: center; color: var(--reader-muted); }
.reader-bottom .reader-controls button:hover { background: rgba(127,127,127,.1); color: var(--reader-text); }
.reader-bottom .reader-controls .font-size { font-size: 12px; width: auto; padding: 0 8px; display: flex; gap: 2px; align-items: center; }
.reader-bottom .reader-controls .font-size b { font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; }

/* drawers */
.drawer {
  position: fixed; top: 0; bottom: 0; z-index: 120; width: 330px;
  background: var(--reader-bg, #fff); color: var(--reader-text, #212832);
  box-shadow: 0 0 60px rgba(0,0,0,.18); display: flex; flex-direction: column;
  transition: transform .3s var(--ease);
}
.drawer-left { left: 0; transform: translateX(-105%); border-right: 1px solid var(--reader-line, #eee); }
.drawer-right { right: 0; transform: translateX(105%); border-left: 1px solid var(--reader-line, #eee); }
.drawer.open { transform: translateX(0); }
.drawer-head { flex: none; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--reader-line, #eee); }
.drawer-head b { font-size: 14px; flex: 1; }
.drawer-head .drawer-close { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; color: var(--reader-muted, #888); }
.drawer-head .drawer-close:hover { background: rgba(127,127,127,.1); }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 0 30px; }
.toc-item { display: flex; gap: 10px; padding: 10px 18px; font-size: 13px; color: var(--reader-muted, #666); cursor: pointer; border-left: 2px solid transparent; }
.toc-item:hover { background: rgba(127,127,127,.06); color: var(--reader-text, #222); }
.toc-item.active { background: rgba(27,136,238,.08); color: var(--reader-accent, #1b88ee); border-left-color: var(--reader-accent, #1b88ee); font-weight: 600; }
.toc-item .num { width: 20px; text-align: right; font-size: 10px; opacity: .7; flex: none; font-variant-numeric: tabular-nums; }
.toc-item .name { flex: 1; line-height: 1.5; }
.toc-item .read-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--reader-accent, #1b88ee); margin-top: 5px; flex: none; }
.drawer-note { padding: 13px 18px; border-bottom: 1px solid var(--reader-line, #eee); cursor: pointer; }
.drawer-note:hover { background: rgba(127,127,127,.05); }
.drawer-note .q { font-family: var(--font-serif); font-size: 13px; line-height: 1.65; color: var(--reader-text, #333); border-left: 3px solid var(--hl, #ffd75e); padding-left: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.drawer-note .m { margin-top: 7px; font-size: 10px; color: var(--reader-muted, #999); display: flex; gap: 8px; }
.drawer-note .m .del { margin-left: auto; color: var(--red, #fa3a3a); }
.drawer-empty { padding: 50px 20px; text-align: center; color: var(--reader-muted, #999); font-size: 12px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* theme popover */
.theme-popover {
  position: fixed; z-index: 130; right: 20px; bottom: 76px; width: 286px;
  background: var(--reader-bg, #fff); color: var(--reader-text, #222);
  border: 1px solid var(--reader-line, #eee); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22); padding: 16px;
  transform: translateY(8px) scale(.98); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.theme-popover.open { opacity: 1; pointer-events: auto; transform: none; }
.theme-popover h4 { margin: 0 0 10px; font-size: 11px; color: var(--reader-muted, #888); font-weight: 600; letter-spacing: .08em; }
.theme-row { display: flex; gap: 9px; margin-bottom: 16px; }
.theme-swatch { flex: 1; height: 34px; border-radius: 8px; border: 2px solid transparent; position: relative; font-size: 10px; color: #666; display: grid; place-items: center; }
.theme-swatch[data-theme="white"] { background: #fff; border-color: #e5e5e5; }
.theme-swatch[data-theme="sepia"] { background: #f5efe0; color: #7d6a4f; }
.theme-swatch[data-theme="green"] { background: #e8f0e8; color: #4d6555; }
.theme-swatch[data-theme="dark"] { background: #1a1a1a; color: #bbb; }
.theme-swatch.on { border-color: var(--reader-accent, #1b88ee); }
.theme-swatch.on::after { content: "✓"; position: absolute; right: 4px; top: 1px; font-size: 9px; color: var(--reader-accent, #1b88ee); }
.stepper { display: flex; align-items: center; justify-content: space-between; margin: 11px 0; font-size: 12px; color: var(--reader-text, #333); }
.stepper .ctl { display: flex; align-items: center; gap: 2px; background: rgba(127,127,127,.08); border-radius: 7px; padding: 2px; }
.stepper .ctl button { width: 28px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: var(--reader-text, #333); }
.stepper .ctl button:hover { background: rgba(127,127,127,.12); }
.stepper .ctl b { min-width: 28px; text-align: center; font-size: 11px; font-weight: 600; }
.theme-popover .font-switch { display: flex; gap: 6px; }
.theme-popover .font-switch button { flex: 1; height: 30px; border-radius: 7px; background: rgba(127,127,127,.08); font-size: 11px; }
.theme-popover .font-switch button.on { background: var(--reader-accent, #1b88ee); color: #fff; }

/* selection menu */
.selection-menu {
  position: fixed; z-index: 200; display: flex; align-items: center; gap: 2px;
  background: #2b2b2b; color: #fff; border-radius: 9px; padding: 5px;
  box-shadow: 0 12px 34px rgba(0,0,0,.3);
  transform: translate(-50%, -100%); opacity: 0; pointer-events: none;
  transition: opacity .12s;
}
.selection-menu.open { opacity: 1; pointer-events: auto; }
.selection-menu::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #2b2b2b; transform: translateX(-50%) rotate(45deg); }
.selection-menu button { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 11px; }
.selection-menu button:hover { background: rgba(255,255,255,.12); }
.selection-menu .dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.5); }
.selection-menu .dot.yellow { background: #ffd75e; }
.selection-menu .dot.red { background: #ff9a9a; }
.selection-menu .dot.blue { background: #92c7ff; }
.selection-menu .dot.green { background: #98ddb0; }
.selection-menu .sep { width: 1px; height: 18px; background: rgba(255,255,255,.2); margin: 0 3px; }

/* reader mobile */
@media (max-width: 760px) {
  .reader-top { padding: 0 8px; gap: 4px; }
  .reader-top .icon-btn { width: 34px; height: 34px; }
  .reader-tools .hide-mobile { display: none; }
  .reader-content { width: calc(100% - 36px); padding: 36px 0 100px; }
  .reader-chapter-title { font-size: 22px; margin-bottom: 28px; }
  .reader-body { font-size: calc(var(--reader-font-size) - 1px); }
  .reader-bottom { height: 56px; padding: 0 10px; }
  .reader-bottom .chapter-nav span { display: none; }
  .reader-bottom .progress-text { font-size: 10px; }
  .drawer { width: min(86vw, 330px); }
  .theme-popover { right: 10px; left: 10px; width: auto; bottom: 68px; }
}

/* ---------------------------------------------------------------- modal / toast */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 39, .46); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .18s; padding: 20px;
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: min(420px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 28px; transform: translateY(10px) scale(.98); transition: transform .22s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal.wide { width: min(560px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 19px; font-weight: 650; }
.modal-head p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: var(--soft); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.field { margin: 14px 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff;
  padding: 10px 12px; font-size: 13px; color: var(--ink); outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,136,238,.10); }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.field .hint { font-size: 11px; color: var(--faint); margin-top: 5px; }
.quote-preview { background: var(--soft-2); border-left: 3px solid var(--gold); padding: 11px 13px; border-radius: 0 7px 7px 0; font-family: var(--font-serif); font-size: 13px; line-height: 1.7; color: var(--text); margin: 12px 0; max-height: 130px; overflow-y: auto; }
.login-modal { text-align: center; }
.login-modal h3 { margin: 0 0 6px; font-size: 22px; }
.login-modal .sub { font-size: 12px; color: var(--muted); }
.qr-wrap { display: flex; justify-content: center; margin: 24px 0 18px; }
.qr {
  width: 196px; height: 196px; padding: 10px; background: #fff; border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(20,31,46,.10);
  display: grid; grid-template-columns: repeat(21, 1fr); grid-template-rows: repeat(21, 1fr);
  gap: 0; position: relative;
}
.qr i { display: block; }
.qr i.on { background: #1d232b; }
.qr i.finder { background: #1d232b; }
.qr-center {
  position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%);
  border-radius: 9px; background: linear-gradient(135deg, #39a4ff, #0b6fd0);
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 700;
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.login-note { font-size: 11px; color: var(--faint); line-height: 1.7; margin: 14px 0 0; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11px; margin: 18px 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.toast-root { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(32, 38, 46, .94); color: #fff; border-radius: 9px; padding: 9px 16px;
  font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.22);
  animation: toast-in .22s var(--ease); max-width: 80vw; text-align: center;
}
.toast.ok { background: rgba(0, 128, 88, .95); }
.toast.err { background: rgba(190, 38, 38, .95); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- empty / skeleton */
.empty-state { padding: 80px 20px; text-align: center; color: var(--muted); }
.empty-state .icon-wrap { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; margin: 0 auto 16px; color: var(--faint); }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 17px; }
.empty-state p { margin: 0 0 18px; font-size: 13px; }
.skeleton { background: linear-gradient(90deg, #f2f3f5 25%, #e9ebee 37%, #f2f3f5 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .container { width: calc(100% - 40px); }
  .book-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .shelf-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .category-band { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 38px 40px; }
  .hero-book { width: 112px; }
  .detail-body { grid-template-columns: minmax(0, 1fr) 290px; gap: 30px; }
}
@media (max-width: 980px) {
  .nav a { padding: 0 11px; font-size: 14px; }
  .search-trigger { width: 210px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-books { min-height: 190px; margin-top: 6px; }
  .hero-book { width: 100px; }
  .hero-book.b1 { left: 12%; top: 6px; }
  .hero-book.b2 { left: 41%; top: -10px; }
  .hero-book.b3 { left: 70%; top: 14px; }
  .hero-badge { display: none; }
  .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shelf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rank-columns { grid-template-columns: 1fr; }
  .ranking-layout, .category-layout { grid-template-columns: 1fr; gap: 22px; }
  .ranking-side { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .ranking-side h3 { display: none; }
  .ranking-side a { white-space: nowrap; border: 1px solid var(--line); }
  .category-side { display: none; }
  .mobile-chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 14px; }
  .mobile-chips button { white-space: nowrap; height: 32px; padding: 0 13px; border-radius: 999px; background: var(--soft); font-size: 12px; }
  .mobile-chips button.on { background: var(--blue); color: #fff; }
  .detail-body { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .profile-grid { grid-template-columns: 1fr; }
  .notes-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  .container { width: calc(100% - 28px); }
  .app-header { height: 56px; }
  .nav, .search-trigger .kbd { display: none; }
  .brand-name { font-size: 19px; }
  .search-trigger { width: 40px; height: 40px; padding: 0; justify-content: center; background: transparent; }
  .search-trigger span { display: none; }
  .header-actions { gap: 2px; }
  .header-actions .icon-btn { width: 36px; height: 36px; }
  .app-main { padding-bottom: 64px; }
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.95); border-top: 1px solid var(--line);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .mobile-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint); font-size: 10px; }
  .mobile-tabbar a.active { color: var(--blue); }
  .mobile-tabbar .icon { width: 20px; height: 20px; }
  .hero { padding: 28px 22px; border-radius: 18px; }
  .hero h1 { font-size: 30px; margin-top: 12px; }
  .hero-desc { font-size: 12px; }
  .hero-stats { gap: 22px; margin-top: 22px; }
  .hero-stat b { font-size: 17px; }
  .hero-books { min-height: 165px; }
  .hero-book { width: 88px; }
  .hero-book.b1 { left: 8%; }
  .hero-book.b2 { left: 40%; }
  .hero-book.b3 { left: 72%; }
  .hero-actions .btn { height: 40px; padding: 0 16px; font-size: 13px; }
  .section { margin: 38px 0; }
  .section-head { margin-bottom: 16px; }
  .section-title { font-size: 19px; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .book-card .book-title { font-size: 13px; }
  .book-card .book-author { font-size: 11px; }
  .book-card .book-meta { font-size: 10px; }
  .shelf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .category-band { grid-template-columns: repeat(2, 1fr); }
  .category-tile { min-height: 84px; padding: 14px; }
  .page-head { padding: 22px 0 16px; }
  .page-head h1 { font-size: 24px; }
  .page-head .head-actions .btn span { display: none; }
  .continue-card { padding: 18px; gap: 16px; }
  .continue-card .cover { width: 72px; }
  .continue-info h3 { font-size: 17px; }
  .continue-progress { margin-top: 10px; }
  .continue-card .btn { display: none; }
  .toolbar { gap: 6px; }
  .tab-pills { overflow-x: auto; max-width: 100%; }
  .toolbar .spacer { display: none; }
  .detail-hero { padding: 20px 0; border-radius: 0 0 18px 18px; }
  .detail-hero-inner { gap: 18px; align-items: flex-start; }
  .detail-cover { width: 112px; }
  .detail-info h1 { font-size: 22px; }
  .detail-intro { display: none; }
  .detail-score b { font-size: 24px; }
  .detail-actions .btn { height: 34px; padding: 0 13px; font-size: 12px; }
  .detail-actions .btn .icon { width: 15px; height: 15px; }
  .chapter-grid { grid-template-columns: 1fr; }
  .search-page { padding: 24px 0 60px; }
  .search-box { height: 46px; }
  .profile-hero { padding: 22px; gap: 16px; border-radius: 18px; }
  .profile-hero .avatar.big { width: 58px; height: 58px; font-size: 21px; }
  .profile-info h1 { font-size: 21px; }
  .profile-info .bio { display: none; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .profile-stat b { font-size: 22px; }
  .notes-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card .v { font-size: 22px; }
  .note-text { font-size: 12px; }
  .modal { padding: 22px; border-radius: 16px; }
  .hero-badge { display: none; }
  .home-footer { margin-top: 40px; }
  .home-footer .foot-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 420px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-books { min-height: 140px; }
  .hero-book { width: 76px; }
  .hero-book.b1 { left: 4%; }
  .hero-book.b2 { left: 38%; }
  .hero-book.b3 { left: 72%; }
  .profile-hero .profile-actions .btn { padding: 0 11px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
