﻿*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
body{
  background:#f6f7f9;color:#1f2328;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  padding:calc(env(safe-area-inset-top,0px) + 14px) 16px calc(env(safe-area-inset-bottom,0px) + 24px);
  max-width:620px;margin:0 auto;min-height:100vh;
}
.hidden{display:none !important}
button{font-family:inherit;cursor:pointer}

.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.brand{display:flex;align-items:center;gap:10px}
.logo{
  width:40px;height:40px;border-radius:10px;flex:0 0 auto;
  background:#2c3e50;display:flex;align-items:center;justify-content:center;
  color:#d4af37;font-weight:900;font-size:16px;
}
.bt h1{font-size:18px;font-weight:800;letter-spacing:.5px}
.bt .sub{font-size:10px;letter-spacing:.16em;color:#8b8f98;font-weight:600;text-transform:uppercase}
.navi{display:flex;gap:8px}
.nav-btn{
  border:1px solid #e2e5ea;background:#fff;border-radius:999px;
  padding:6px 14px;font-size:13px;color:#3d434c;font-weight:600;
}
.nav-btn.on{background:#2c3e50;border-color:#2c3e50;color:#d4af37}

.search-box{display:flex;gap:8px;margin-bottom:10px}
.search-box input{
  flex:1;border:1px solid #e2e5ea;background:#fff;border-radius:12px;
  padding:12px 14px;font-size:15px;outline:none;color:#1f2328;
}
.search-box input:focus{border-color:#b8c0cc}
.search-box button{
  border:none;border-radius:12px;padding:0 20px;font-size:15px;font-weight:700;
  background:#2c3e50;color:#fff;
}
.hint{font-size:12px;color:#a3a8b1;margin:2px 0 12px}
.loading{text-align:center;color:#8b8f98;font-size:13px;padding:24px 0}
.err{color:#c0392b;font-size:13px;text-align:center;padding:16px 0}

/* 热门推荐 */
.hot-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:16px}
.hot-card{
  background:#fff;border:1px solid #e8eaee;border-radius:14px;padding:12px 13px;
  box-shadow:0 1px 2px rgba(0,0,0,.03);cursor:pointer;display:flex;flex-direction:column;gap:4px;
}
.hot-card:active{background:#f0f2f5}
.hot-card .hc-t{font-size:14px;font-weight:700;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hot-card .hc-a{font-size:12px;color:#8b8f98;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hot-card .cs{align-self:flex-start}

.list{display:flex;flex-direction:column;gap:10px}
.card{
  background:#fff;border:1px solid #e8eaee;border-radius:14px;
  padding:13px 14px;box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.card:active{background:#f0f2f5}
.card .ct{font-size:15px;font-weight:700;line-height:1.3}
.card .ca{font-size:12.5px;color:#8b8f98;margin-top:3px}
.card .cs{
  display:inline-block;margin-top:6px;font-size:10.5px;color:#5a6470;
  background:#eef1f4;border-radius:6px;padding:2px 8px;
}

.sec-h{display:flex;align-items:center;gap:8px;margin:16px 2px 10px}
.sec-h b{font-size:13px;font-weight:700;color:#3d434c;letter-spacing:.04em}
.sec-h i{flex:1;height:1px;background:#e2e5ea}
.sec-h:first-child{margin-top:0}

.detail-head{display:flex;gap:12px;background:#fff;border:1px solid #e8eaee;border-radius:14px;padding:14px}
.dcvr{
  width:84px;height:112px;border-radius:8px;flex:0 0 auto;
  background:linear-gradient(135deg,#3d566e,#2c3e50);
  color:#d4af37;font-weight:900;font-size:22px;
  display:flex;align-items:center;justify-content:center;text-align:center;overflow:hidden;
}
.dcvr img{width:100%;height:100%;object-fit:cover}
.dinfo{flex:1;min-width:0}
.dinfo h2{font-size:17px;font-weight:800;line-height:1.3}
.dauthor{font-size:12.5px;color:#8b8f98;margin-top:3px}
.dsrc{font-size:11px;color:#a3a8b1;margin-top:2px}
.dinfo button{margin-top:10px;margin-right:8px}
.primary-btn{
  border:none;background:#2c3e50;color:#fff;border-radius:10px;
  padding:9px 18px;font-size:13.5px;font-weight:700;
}
.ghost-btn{
  border:1px solid #d5d9df;background:#fff;color:#3d434c;border-radius:10px;
  padding:9px 18px;font-size:13.5px;font-weight:600;
}
.dintro{
  margin-top:10px;background:#fff;border:1px solid #e8eaee;border-radius:14px;
  padding:13px 14px;font-size:13.5px;line-height:1.75;color:#4a525c;
  max-height:200px;overflow:auto;white-space:pre-wrap;
}
.dintro:empty{display:none}

.chlist{display:flex;flex-direction:column;background:#fff;border:1px solid #e8eaee;border-radius:14px;overflow:hidden}
.chitem{
  padding:11px 14px;font-size:13.5px;color:#2f353c;border-bottom:1px solid #f0f1f4;
  display:flex;justify-content:space-between;gap:8px;
}
.chitem:last-child{border-bottom:none}
.chitem:active{background:#f0f2f5}
.chitem .ct2{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.reader-bar{
  display:flex;align-items:center;gap:10px;margin-bottom:10px;
}
.bar-btn{
  border:1px solid #e2e5ea;background:#fff;border-radius:999px;
  padding:6px 12px;font-size:12.5px;color:#3d434c;font-weight:600;
}
.r-title{flex:1;font-size:14px;font-weight:700;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reader-ctl{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.ctl-btn{
  border:1px solid #e2e5ea;background:#fff;border-radius:999px;
  padding:5px 12px;font-size:12px;color:#3d434c;font-weight:600;
}
.ctl-btn.on{background:#2c3e50;border-color:#2c3e50;color:#d4af37}
.ctl-state{flex:1;font-size:11.5px;color:#a3a8b1;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shelf-go{
  margin-top:8px;border:none;background:#2c3e50;color:#fff;border-radius:9px;
  padding:7px 12px;font-size:12.5px;font-weight:700;
}
.reader-body{
  background:#fff;border:1px solid #e8eaee;border-radius:14px;
  padding:20px 18px;font-size:16px;line-height:1.95;color:#33383e;
  white-space:pre-wrap;word-break:break-word;
}
.reader-body .rch-title{font-size:1.25em;font-weight:800;text-align:center;margin-bottom:16px}
.reader-nav{display:flex;gap:10px;margin-top:12px}
.nav-btn2{
  flex:1;border:1px solid #e2e5ea;background:#fff;border-radius:12px;
  padding:12px 0;font-size:14px;color:#3d434c;font-weight:700;
}
.nav-btn2:disabled{opacity:.45;cursor:not-allowed}

.mask{
  position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:99;
  display:flex;align-items:flex-end;justify-content:center;
}
.sheet{
  background:#fff;border-radius:16px 16px 0 0;padding:16px 18px calc(env(safe-area-inset-bottom,0px) + 18px);
  width:100%;max-width:620px;
}
.sheet-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.sheet-h b{font-size:15px}
.sheet-h button{border:none;background:none;font-size:20px;color:#8b8f98}
.row{display:flex;align-items:center;justify-content:space-between;font-size:13.5px;color:#3d434c;margin:10px 0}
.btns{display:flex;gap:8px}
.btns button,.small-btn{
  border:1px solid #d5d9df;background:#fff;border-radius:9px;
  padding:7px 12px;font-size:12.5px;color:#3d434c;font-weight:600;
}
.bg-btn.on{background:#2c3e50;color:#fff;border-color:#2c3e50}

/* 阅读背景主题（整页跟随） */
body.bg-paper{background:#ffffff;color:#1f2328}
body.bg-beige{background:#f7f0e3;color:#4a3f2f}
body.bg-green{background:#e9f0e5;color:#2e3d2c}
body.bg-night{background:#14171c;color:#b9c0ca}

body.bg-paper .reader-body{background:#fff;color:#33383e;border-color:#e8eaee}
body.bg-beige .reader-body{background:#f7f0e3;color:#4a3f2f;border-color:#e7ddc8}
body.bg-green .reader-body{background:#e9f0e5;color:#2e3d2c;border-color:#d3e2cd}
body.bg-night .reader-body{background:#1c2127;color:#b9c0ca;border-color:#2a3038}

body.bg-night .topbar h1,body.bg-night .bt h1,body.bg-night .r-title{color:#e6e8ec}
body.bg-night .bt .sub{color:#5c646e}

/* 夜间模式整页深色 */
body.bg-night .card,body.bg-night .hot-card,body.bg-night .chlist,body.bg-night .detail-head,
body.bg-night .dintro,body.bg-night .sheet,body.bg-night .search-box input,
body.bg-night .shelf-go{background:#1c2127;border-color:#2a3038}
body.bg-night .card .ct,body.bg-night .hot-card .hc-t,body.bg-night .chitem,
body.bg-night .dinfo h2,body.bg-night .sheet-h b{color:#e6e8ec}
body.bg-night .card .ca,body.bg-night .hot-card .hc-a,body.bg-night .dauthor,
body.bg-night .dintro,body.bg-night .row,body.bg-night .search-box input{color:#9aa3ad}
body.bg-night .card .cs{background:#2a3038;color:#b9c0ca}
body.bg-night .chitem{border-bottom-color:#2a3038}
body.bg-night .dintro{border-color:#2a3038}
body.bg-night .search-box input:focus{border-color:#3a434d}
body.bg-night .search-box button{background:#2a3038}
body.bg-night .mask{background:rgba(0,0,0,.6)}
body.bg-night .sec-h b,body.bg-night .bar-btn,body.bg-night .ctl-btn,body.bg-night .nav-btn2,
body.bg-night .nav-btn,body.bg-night .ghost-btn,body.bg-night .small-btn,body.bg-night .bg-btn,
body.bg-night .btns button{color:#b9c0ca}
body.bg-night .bar-btn,body.bg-night .ctl-btn,body.bg-night .nav-btn2,body.bg-night .nav-btn,
body.bg-night .ghost-btn,body.bg-night .small-btn,body.bg-night .btns button,
body.bg-night .bg-btn{background:#1c2127;border-color:#2a3038}
body.bg-night .primary-btn{background:#2a3038}
body.bg-night .btn{background:#2a3038;border-color:#2a3038;color:#b9c0ca}
body.bg-night .sheet-h button{color:#5c646e}
body.bg-night .ctl-state,body.bg-night .dsrc,body.bg-night .hint{color:#5c646e}

/* 米黄 / 护眼整页浅色跟随 */
body.bg-beige .card,body.bg-beige .hot-card,body.bg-beige .chlist,body.bg-beige .detail-head,
body.bg-beige .dintro,body.bg-beige .sheet,body.bg-beige .search-box input{background:#fbf5e9;border-color:#e7ddc8}
body.bg-green .card,body.bg-green .hot-card,body.bg-green .chlist,body.bg-green .detail-head,
body.bg-green .dintro,body.bg-green .sheet,body.bg-green .search-box input{background:#f2f7ef;border-color:#d3e2cd}

@media (min-width:620px){ .reader-body{padding:28px 30px} }
