/* 海尼曼点读 — 复刻 App 横屏书本风格 */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body {
  font-family: "LexendDeca", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:#f2f4f8; color:#222; overflow-x:hidden;
}
button { font-family:inherit; border:none; background:none; cursor:pointer; }
img { display:block; }

/* ===== 通用页头 ===== */
.topbar {
  height:52px; display:flex; align-items:center; padding:0 14px;
  background:#fff; border-bottom:1px solid #e5e7eb; gap:10px; position:sticky; top:0; z-index:20;
}
.topbar .back { font-size:20px; padding:6px 10px; color:#444; }
.topbar .title { font-size:17px; font-weight:600; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .sub { font-size:12px; color:#999; }

/* ===== 级别选择 ===== */
.level-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; padding:20px; max-width:1100px; margin:0 auto; }
.level-card {
  background:#fff; border-radius:14px; padding:22px 14px; text-align:center;
  box-shadow:0 2px 8px rgba(0,0,0,.06); transition:transform .12s, box-shadow .12s;
  border:2px solid transparent; cursor:pointer;
}
.level-card:hover { transform:translateY(-3px); box-shadow:0 6px 16px rgba(0,0,0,.1); }
.level-card.gk { border-color:#ff8a3d; background:linear-gradient(180deg,#fff7f0,#fff); }
.level-card .lv { font-size:30px; font-weight:800; color:#ff6b1a; }
.level-card .desc { font-size:12px; color:#888; margin-top:6px; }
.level-card .count { font-size:11px; color:#bbb; margin-top:2px; }

/* ===== 书架 ===== */
.shelf { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:18px; padding:22px; max-width:1200px; margin:0 auto; }
.book-card { cursor:pointer; text-align:center; transition:transform .12s; }
.book-card:hover { transform:translateY(-4px); }
.book-cover {
  width:100%; aspect-ratio:1/1.3; border-radius:10px; overflow:hidden;
  background:#e9edf2; box-shadow:0 3px 10px rgba(0,0,0,.1); position:relative;
  display:flex; align-items:center; justify-content:center;
}
.book-cover img { width:100%; height:100%; object-fit:cover; }
.book-cover .noimg { font-size:13px; color:#9aa4b2; }
.book-title { font-size:13px; margin-top:8px; color:#333; font-weight:600; line-height:1.3; }

/* ===== 书本入口: 四个模块 ===== */
.mod-list { max-width:760px; margin:24px auto; padding:0 20px; display:flex; flex-direction:column; gap:14px; }
.mod-item {
  display:flex; align-items:center; gap:16px; background:#fff; border-radius:14px;
  padding:18px 20px; box-shadow:0 2px 8px rgba(0,0,0,.05); cursor:pointer; transition:transform .1s;
}
.mod-item:active { transform:scale(.98); }
.mod-icon {
  width:52px; height:52px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  font-size:24px; color:#fff; flex-shrink:0;
}
.mod-icon.read { background:#ff6b1a; }
.mod-icon.cards { background:#22a06b; }
.mod-icon.words { background:#2f7df6; }
.mod-icon.sent { background:#9b51e0; }
.mod-body { flex:1; }
.mod-name { font-size:16px; font-weight:700; }
.mod-desc { font-size:12px; color:#999; margin-top:3px; }
.mod-lock { font-size:12px; color:#fff; background:#f5222d; border-radius:20px; padding:4px 10px; flex-shrink:0; }
.mod-lock.free { background:#52c41a; }

/* ===== 点读器 ===== */
.reader { position:fixed; inset:0; background:#000; z-index:100; display:flex; flex-direction:column; }
.reader-top {
  height:44px; background:rgba(0,0,0,.5); color:#fff; display:flex; align-items:center;
  padding:0 10px; gap:8px; z-index:5;
}
.reader-top .rt-title { font-size:14px; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.reader-top button { color:#fff; font-size:13px; padding:5px 10px; border-radius:6px; background:rgba(255,255,255,.12); }
.reader-top button.on { background:#ff6b1a; }
.reader-stage {
  flex:1; display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative;
}
.page-wrap {
  position:relative; background:#fff; box-shadow:0 0 40px rgba(0,0,0,.5);
  transform-origin:center; transition:opacity .15s;
}
.page-img { position:absolute; }
.page-text {
  position:absolute; display:flex; flex-wrap:wrap; align-content:flex-start;
  align-items:flex-start; color:#000; line-height:1.4;
  overflow-wrap:normal; word-break:normal; white-space:normal;
  max-height:calc(100% - 20px); overflow-y:auto;
  scrollbar-width:thin;
}
.page-text::-webkit-scrollbar { width:4px; }
.page-text::-webkit-scrollbar-thumb { background:rgba(0,0,0,.2); border-radius:2px; }
.page-text span.word {
  cursor:pointer; display:inline-block; border-radius:4px; padding:0 1px;
  margin-right:0.34em; white-space:pre;
}
.page-text span.word:last-child { margin-right:0; }
.page-text span.gap { display:inline-block; margin-right:0; width:0.18em; }
.page-text span.word.hit { background:rgba(255,107,26,.28); }
.page-translate {
  position:absolute; left:2.5%; bottom:2.5%; width:46%;
  background:rgba(0,0,0,.55); color:#fff; border-radius:8px;
  font-size:20px; font-weight:600; padding:10px 14px; text-align:left;
  line-height:1.5; max-height:40%; overflow-y:auto;
  scrollbar-width:thin;
}
.page-translate::-webkit-scrollbar { width:4px; }
.page-translate::-webkit-scrollbar-thumb { background:rgba(255,255,255,.3); border-radius:2px; }
/* 点词弹窗: 发音 + 词典释义 */
.word-tip {
  position:absolute; z-index:30; min-width:200px; max-width:260px;
  background:#fff; border-radius:10px; box-shadow:0 6px 24px rgba(0,0,0,.25);
  padding:10px 14px; opacity:0; transform:translateY(4px); transition:all .15s;
  pointer-events:none;
}
.word-tip.show { opacity:1; transform:none; }
.wt-head { display:flex; align-items:center; gap:8px; }
.wt-word { font-size:20px; font-weight:800; color:#222; }
.wt-spk { cursor:pointer; font-size:16px; padding:2px 6px; border-radius:6px; background:#fff1e6; pointer-events:auto; }
.wt-zh { font-size:14px; color:#555; margin-top:6px; line-height:1.5; max-height:90px; overflow-y:auto; }
.reader-nav {
  height:56px; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; gap:18px;
}
.reader-nav button {
  color:#fff; font-size:14px; padding:8px 14px; border-radius:8px;
  background:rgba(255,255,255,.14); min-width:64px;
}
.reader-nav button.on { background:#22a06b; font-weight:700; }
.reader-nav button.primary { background:#ff6b1a; font-weight:700; }
.reader-nav .page-ind { color:#fff; font-size:13px; min-width:64px; text-align:center; }
.rate-panel {
  position:absolute; bottom:64px; left:50%; transform:translateX(-50%);
  background:rgba(20,20,20,.95); border-radius:10px; padding:8px; display:none; gap:6px; z-index:6;
}
.rate-panel.show { display:flex; }
.rate-panel button { color:#fff; font-size:13px; padding:6px 12px; border-radius:6px; background:rgba(255,255,255,.12); }
.rate-panel button.on { background:#ff6b1a; }

/* ===== 卡片练习 ===== */
.prac { max-width:900px; margin:0 auto; padding:20px; }
.card-area { background:#fff; border-radius:16px; padding:24px 30px 30px; box-shadow:0 3px 12px rgba(0,0,0,.07); text-align:center; }
.card-area img { max-width:55%; max-height:200px; margin:0 auto 14px; border-radius:10px; object-fit:contain; }
.card-area .card-word { font-size:34px; font-weight:800; letter-spacing:1px; }
.card-area .card-word small { display:block; font-size:14px; color:#aaa; font-weight:400; margin-top:6px; }
.prac-btns { display:flex; justify-content:center; gap:16px; margin-top:18px; }
.prac-btns button { padding:12px 26px; border-radius:10px; font-size:15px; color:#fff; background:#2f7df6; }
.prac-btns button:disabled { opacity:.4; }
.auto-row { display:flex; justify-content:center; margin-top:14px; }
.auto-row button {
  padding:7px 18px; border-radius:20px; font-size:13px; color:#555;
  border:1.5px solid #ccc; background:#fff;
}
.auto-row button.on { color:#fff; background:#22a06b; border-color:#22a06b; font-weight:700; }
.word-flow { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:16px; }
.word-chip {
  background:#fff; border:2px solid #e3e6ea; border-radius:10px; padding:10px 14px; font-size:15px; cursor:pointer;
}
.word-chip.play { border-color:#ff6b1a; color:#ff6b1a; }
.word-chip.done { border-color:#52c41a; color:#52c41a; }
.sentence-box { background:#fff; border-radius:16px; padding:30px; box-shadow:0 3px 12px rgba(0,0,0,.07); text-align:center; }
.sentence-line { font-size:30px; font-weight:700; line-height:1.5; }
.sentence-line span.w { cursor:pointer; padding:0 2px; border-radius:4px; }
.sentence-line span.w.hit { background:rgba(255,107,26,.3); }
.sentence-zh { color:#888; font-size:15px; margin-top:14px; }

/* 加载 / 错误 */
.loading { text-align:center; color:#999; padding:60px 0; font-size:15px; }
.err { text-align:center; color:#f5222d; padding:40px 0; }
.toast {
  position:fixed; left:50%; bottom:90px; transform:translateX(-50%); background:rgba(0,0,0,.8);
  color:#fff; padding:10px 18px; border-radius:8px; font-size:14px; z-index:300; display:none;
}
