:root {
  --bg: #fbf7ef; --card: #ffffff; --ink: #2b2b2b; --muted: #8a857c;
  --accent: #378ADD; --line: rgba(0,0,0,.10);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink);
  font-family: -apple-system, "PingFang HK", "PingFang TC", sans-serif;
  -webkit-user-select: none; user-select: none; }
#app { min-height: 100%; }

.screen { padding: 22px; max-width: 1100px; margin: 0 auto; }
.title { text-align: center; font-size: 22px; color: var(--muted); margin: 18px 0 26px; }

.profiles { display: grid; gap: 18px; max-width: 560px; margin: 0 auto; }
.profile { display: flex; align-items: center; gap: 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 30px; color: #fff; flex: none; }
.profile .name { font-size: 26px; }
.profile .last { font-size: 15px; color: var(--muted); margin-top: 3px; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 16px;
  padding: 10px 16px; font-size: 17px; color: var(--ink); cursor: pointer; }
.btn:active { transform: scale(.97); }
.continue { width: 100%; background: var(--accent); color: #fff; border: 0;
  border-radius: 18px; padding: 16px; font-size: 19px; margin-bottom: 22px; cursor: pointer; }

.level-name { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 22px 0 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.books { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 720px){ .books { grid-template-columns: repeat(3, 1fr); } }
.book { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; cursor: pointer; position: relative; }
.book img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #eee; }
.book .ring { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92);
  border-radius: 20px; font-size: 13px; padding: 3px 9px; color: var(--muted); }
.book .ring.done { color: #fff; background: #1D9E75; }

.reader { display: flex; flex-direction: column; height: 100vh; padding: 12px; }
.reader .topbar { margin-bottom: 10px; }
.stage { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 0; }
.page-wrap { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; }
.page-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; }
.nav { width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); font-size: 34px; flex: none; cursor: pointer; }
.nav:active { transform: scale(.95); }
.nav:disabled { opacity: .3; }
.readbar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 0 4px; flex-wrap: wrap; }
.read { display: inline-flex; align-items: center; gap: 10px; background: var(--accent);
  color: #fff; border: 0; border-radius: 22px; padding: 14px 30px; font-size: 20px; cursor: pointer; }
.read:disabled { opacity: .35; }
.read.read-cmn { background: #D2703A; }
.progress { height: 7px; background: rgba(0,0,0,.08); border-radius: 4px; }
.progress > div { height: 7px; background: var(--accent); border-radius: 4px; width: 0; }
.hint { text-align: center; color: var(--muted); font-size: 13px; padding: 8px; }

/* dynamic profiles */
.empty { text-align: center; padding: 30px 0; }
.empty-emoji { font-size: 60px; }
.empty p { font-size: 18px; color: var(--muted); margin: 10px 0 24px; }
.profile.add { justify-content: center; color: var(--accent); background: transparent;
  border: 2px dashed var(--line); font-size: 19px; cursor: pointer; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); font-size: 20px; cursor: pointer; flex: none; margin-left: 6px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.danger { color: #c0392b; border-color: rgba(192,57,43,.4); }
.icon-btn.star { color: #e6a700; border-color: #e6a700; }

/* flag button */
.flag { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); font-size: 24px; color: var(--muted); cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center; }
.flag:active { transform: scale(.94); }
.flag.on { color: #e6a700; border-color: #e6a700; }
.review-btn { display: inline-flex; align-items: center; gap: 4px; }

/* scrubber */
.scrub { position: relative; padding: 22px 8px 6px; }
.scrub input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px;
  border-radius: 8px; background: rgba(0,0,0,.08); outline: none; cursor: pointer; margin: 0; }
.scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none;
  width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.scrub input[type=range]::-moz-range-thumb { width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.bubble { position: absolute; top: -2px; transform: translateX(-50%); background: var(--ink);
  color: #fff; font-size: 14px; padding: 4px 11px; border-radius: 13px; white-space: nowrap;
  opacity: 0; transition: opacity .12s; pointer-events: none; }
.bubble.show { opacity: 1; }

/* review list */
.rev-list { display: grid; gap: 10px; max-width: 640px; margin: 0 auto; }
.rev-row { display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; cursor: pointer; }
.rev-row:active { transform: scale(.99); }
.rev-thumb { width: 46px; height: 60px; object-fit: cover; border-radius: 6px; background: #eee; flex: none; }
.rev-label { flex: 1; font-size: 17px; }
