/* ============================================================
 * 声声 — 有声图书馆 v2.2
 * ============================================================ */
:root {
  --bg: #0a0a0f; --bg2: #12121a; --bg3: #1a1a25; --card: #1e1e2a;
  --text: #e8e8f0; --text2: #a0a0b0; --muted: #707080;
  --accent: #6c5ce7; --accent2: #a29bfe; --border: #2a2a35;
  --success: #00b894; --player-h: 68px; --radius: 10px;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

body {
  background:var(--bg); color:var(--text); font-family:'Noto Serif SC',serif;
  -webkit-tap-highlight-color:transparent; min-height:100dvh;
}
.app{display:flex;flex-direction:column;min-height:100dvh}
.hidden{display:none!important}

/* ── Header ── */
.header{position:sticky;top:0;z-index:10;backdrop-filter:blur(14px);background:rgba(10,10,15,.92);padding:12px 16px 0}
.logo{font-size:20px;font-weight:600;margin-bottom:10px}
.header-tabs{display:flex;gap:6px;padding-bottom:8px}
.tab{background:var(--bg3);border:1px solid var(--border);color:var(--text2);padding:5px 18px;border-radius:20px;font-size:13px;cursor:pointer;transition:.2s;font-family:inherit}
.tab.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.search{display:block;width:100%;background:var(--bg3);border:1px solid var(--border);border-radius:8px;padding:9px 14px;color:var(--text);font-size:14px;outline:none;font-family:inherit}
.search::placeholder{color:var(--muted)}

/* ── Content ── */
.content{flex:1;padding:0 16px 200px;overflow-y:auto}
.section-title{font-size:14px;font-weight:500;color:var(--text2);margin:16px 0 10px;display:flex;align-items:center;gap:6px}
.section-count{font-size:12px;color:var(--muted)}

/* ── Welcome ── */
.welcome{text-align:center;padding:10px 0}
.welcome-icon{font-size:44px;margin-bottom:6px}
.welcome-hint{font-size:13px;color:var(--muted);margin-bottom:12px}
.stats-row{display:flex;justify-content:center;gap:24px}
.stat{text-align:center}
.stat-value{display:block;font-size:22px;font-weight:600;color:var(--accent2)}
.stat-label{font-size:11px;color:var(--muted)}

/* ── Book Grid ── */
.book-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
@media(min-width:600px){.book-grid{grid-template-columns:repeat(3,1fr)}}
.book-card{background:var(--card);border-radius:var(--radius);overflow:hidden;cursor:pointer;border:1px solid var(--border);transition:transform .2s,box-shadow .2s}
.book-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(0,0,0,.5)}
.book-card.active{border-color:var(--accent)}
.card-cover{height:100px;display:flex;align-items:center;justify-content:center;font-size:38px}
.card-body{padding:8px 10px 10px; position:relative}
.local-badge{position:absolute;top:-6px;right:-6px;z-index:5;background:linear-gradient(135deg,#00b894,#00cec9);color:white;padding:2px 8px;border-radius:10px;font-size:10px;font-weight:600;white-space:nowrap}
.book-card{position:relative}
.card-title{font-size:13px;font-weight:500;line-height:1.3;margin-bottom:3px}
.card-author{font-size:11px;color:var(--muted);margin-bottom:4px}
.card-meta{display:flex;justify-content:space-between;font-size:11px}
.card-rating{color:var(--accent2)}
.card-ch{color:var(--text2)}
.card-progress{margin-top:6px;height:3px;background:var(--bg);border-radius:2px;overflow:hidden}
.card-progress-fill{height:100%;background:var(--success);border-radius:2px}

/* ── Empty ── */
.empty{text-align:center;padding:60px 20px;color:var(--muted)}
.empty-title{font-size:16px;color:var(--text2);margin-bottom:6px}
.empty-sub{font-size:12px}

/* ── Detail ── */
.detail-head{margin-bottom:20px}
.btn-back{background:none;border:1px solid var(--border);color:var(--text);padding:6px 16px;border-radius:20px;font-size:13px;cursor:pointer;font-family:inherit;margin-bottom:14px;transition:.2s}
.btn-back:hover{background:var(--border)}
.detail-head{display:flex;gap:16px;flex-wrap:wrap}
.detail-cover{width:130px;height:170px;border-radius:var(--radius);border:1px solid var(--border);flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:56px}
.detail-body{flex:1;min-width:0}
.detail-genre{color:var(--accent2);font-size:12px;margin-bottom:4px}
.detail-title{font-size:20px;font-weight:600;line-height:1.2;margin-bottom:6px}
.detail-author{font-size:14px;color:var(--text2);margin-bottom:10px}
.detail-desc{font-size:13px;line-height:1.6;color:var(--text2);margin-bottom:12px;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.detail-tags{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.tag{background:var(--bg3);padding:3px 10px;border-radius:12px;font-size:11px;color:var(--text2)}
.detail-prog{margin-bottom:14px}
.prog-info{display:flex;justify-content:space-between;font-size:12px;margin-bottom:4px;color:var(--muted)}
.prog-bar{height:5px;background:var(--bg3);border-radius:3px;overflow:hidden}
.prog-fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--success));border-radius:3px}
.detail-btns{display:flex;gap:10px}
.btn-play-main{background:var(--accent);color:#fff;border:none;padding:10px 22px;border-radius:25px;font-size:14px;cursor:pointer;font-family:inherit;transition:.2s}
.btn-play-main:hover{background:#5a4bd1}
.btn-fav{background:none;border:1px solid var(--border);color:var(--text);padding:10px 18px;border-radius:25px;font-size:14px;cursor:pointer;font-family:inherit;transition:.2s}
.btn-fav.faved{border-color:#FFE082;background:#FFF3CD;color:#856404}

/* ── Chapters ── */
.chapters{margin-top:10px}
.chapters-title{font-size:15px;font-weight:500;padding-bottom:8px;border-bottom:1px solid var(--border);margin-bottom:10px}
.ch-list{display:flex;flex-direction:column;gap:6px}
.ch{display:flex;align-items:center;gap:10px;background:var(--bg3);padding:10px 12px;border-radius:8px;cursor:pointer;transition:.2s;border:1px solid transparent}
.ch:hover{background:var(--card)}
.ch.playing{background:var(--accent);color:#fff}
.ch.playing .ch-num,.ch.playing .ch-dur{color:#ddd}
.ch.active{border-color:var(--accent2)}
.ch-num{color:var(--accent2);font-size:12px;min-width:28px}
.ch-name{flex:1;font-size:14px}
.ch-dur{font-size:11px;color:var(--muted)}

/* ── Player Bar ── */
.player-bar{position:fixed;bottom:0;left:0;right:0;height:var(--player-h);background:var(--bg2);border-top:1px solid var(--border);z-index:20;display:flex;align-items:center;padding:0 14px;gap:14px;padding-bottom:env(safe-area-inset-bottom,0)}
.player-left{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.player-cover{width:44px;height:44px;border-radius:8px;flex-shrink:0;border:1px solid var(--border)}
.player-info{min-width:0}
.player-title{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.player-subtitle{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.player-controls{display:flex;gap:14px;align-items:center}
.ctl{background:none;border:none;color:var(--text);font-size:20px;cursor:pointer;padding:0 6px}
.btn-main{background:var(--accent);width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.player-right{flex-shrink:0}
.ctl-sm{background:var(--bg3);border:1px solid var(--border);color:var(--accent2);padding:3px 10px;border-radius:14px;font-size:12px;cursor:pointer;font-family:inherit}
.progress-track{position:absolute;top:-3px;left:0;right:0;height:6px;cursor:pointer}
.progress-bar{height:100%;background:var(--accent);border-radius:3px}

/* ── Toast ── */
.toast{position:fixed;bottom:calc(var(--player-h) + 12px);left:50%;transform:translateX(-50%) translateY(20px);background:var(--card);padding:9px 20px;border-radius:10px;box-shadow:0 4px 16px rgba(0,0,0,.4);z-index:30;font-size:13px;opacity:0;pointer-events:none;transition:opacity .3s,transform .3s;white-space:pre-line;text-align:center;max-width:90%}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ── Icon Button ── */
.btn-icon{background:var(--bg3);border:1px solid var(--border);color:var(--text);width:32px;height:32px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;text-decoration:none;transition:.2s}
.btn-icon:hover{background:var(--border)}

/* ── Book Detail ── */
.book-detail{background:var(--bg2);border-radius:12px;padding:0;margin-top:16px}
