/* ===== 阅读主题 ===== */
body{padding-bottom:0}
:root{
  --r-bg:#f5f0e8;
  --r-text:#3d3528;
  --r-text-2:#8a7e6a;
  --r-bar-bg:#2b2b2b;
  --r-bar-text:#e0e0e0;
  --r-bar-text-2:#999;
  --r-accent:#4a67c5;
  --r-border:rgba(0,0,0,.08);
}
.theme-light{
  --r-bg:#ffffff;
  --r-text:#222;
  --r-text-2:#888;
  --r-border:rgba(0,0,0,.06);
}
.theme-sepia{
  --r-bg:#f5f0e8;
  --r-text:#3d3528;
  --r-text-2:#8a7e6a;
  --r-border:rgba(0,0,0,.08);
}
.theme-green{
  --r-bg:#c7edcc;
  --r-text:#2d4a32;
  --r-text-2:#6a8a6e;
  --r-border:rgba(0,0,0,.06);
}
.theme-dark{
  --r-bg:#1a1a1a;
  --r-text:#b0b0b0;
  --r-text-2:#666;
  --r-border:rgba(255,255,255,.08);
  --r-bar-bg:#000;
}

body{
  font-family:"PingFang SC","Noto Serif SC",-apple-system,"Microsoft YaHei",serif;
  background:var(--r-bg);
  color:var(--r-text);
  max-width:430px;
  margin:0 auto;
  min-height:100vh;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  transition:background .3s,color .3s;
}

/* ===== 顶部导航栏 ===== */
.top-bar{
  position:fixed;top:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;
  background:var(--r-bar-bg);
  color:var(--r-bar-text);
  display:flex;align-items:center;
  padding:12px 16px;
  z-index:200;
  transition:transform .3s;
}
.top-bar.hidden{transform:translateX(-50%) translateY(-100%)}
.top-bar .back{font-size:22px;cursor:pointer;width:30px;text-align:center}
.top-bar .ch-title{flex:1;text-align:center;font-size:16px;font-weight:600;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 8px}
.top-bar .menu{display:flex;gap:16px}
.top-bar .menu .ic{font-size:18px;cursor:pointer;opacity:.9;transition:opacity .2s}
.top-bar .menu .ic:active{opacity:.6}
.top-bar .menu .ic.shelf.on{opacity:1;color:#e6a23c}

/* ===== 内容区域 ===== */
.content{
  padding:60px 20px 120px;
  min-height:100vh;
}
.chapter-title{
  font-size:22px;font-weight:700;text-align:center;
  margin:20px 0 6px;line-height:1.4;
}
.chapter-meta{
  text-align:center;font-size:12px;color:var(--r-text-2);
  margin-bottom:30px;padding-bottom:20px;
  border-bottom:1px solid var(--r-border);
}
.chapter-meta span{margin:0 8px}

.text-content{
  font-size:18px;line-height:1.9;
  letter-spacing:.5px;
}
.text-content p{
  text-indent:2em;
  margin-bottom:16px;
}

.chapter-end{
  text-align:center;
  padding:40px 0 20px;
  color:var(--r-text-2);
  font-size:13px;
}
.chapter-end .line{
  display:inline-block;width:60px;height:1px;
  background:var(--r-border);vertical-align:middle;margin:0 12px;
}

.chapter-nav{
  display:flex;justify-content:space-between;
  padding:20px 0;gap:12px;
  /* above tap-zone(50), below top/bottom bars(200) */
  position:relative;z-index:60;
  pointer-events:none;
}
.chapter-nav .btn{
  flex:1;text-align:center;padding:12px;
  border-radius:8px;font-size:14px;cursor:pointer;
  border:1px solid var(--r-border);
  transition:all .2s;
  position:relative;z-index:61;
  pointer-events:auto !important;
}
.chapter-nav .btn:active{transform:scale(.97)}
.chapter-nav .btn.prev{
  color:var(--r-text-2);
  position:relative;z-index:61;
  pointer-events:auto !important;
}
.chapter-nav .btn.next{
  background:var(--r-accent);color:#fff;border-color:var(--r-accent);
  position:relative;z-index:61;
  pointer-events:auto !important;
}
.chapter-nav .btn.disabled{opacity:.4;pointer-events:none !important;}

/* ===== 底部工具栏 ===== */
.bottom-bar{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;
  background:var(--r-bar-bg);
  z-index:200;
  transition:transform .3s;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.bottom-bar.hidden{transform:translateX(-50%) translateY(100%)}

.progress-section{
  padding:10px 16px 8px;
  display:flex;align-items:center;gap:12px;
}
.progress-section .nav-btn{
  color:var(--r-bar-text);font-size:20px;
  cursor:pointer;flex-shrink:0;
  width:32px;height:32px;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;background:rgba(255,255,255,.08);
  transition:background .2s;
}
.progress-section .nav-btn:active{background:rgba(255,255,255,.2)}
.progress-section .nav-btn.disabled{opacity:.3;pointer-events:none}
.progress-section .progress-wrap{
  flex:1;min-width:0;
}
.progress-info{
  display:flex;justify-content:space-between;
  color:var(--r-bar-text-2);font-size:11px;
  margin-bottom:6px;
}
.progress-bar{
  height:3px;background:rgba(255,255,255,.15);
  border-radius:2px;cursor:pointer;position:relative;
}
.progress-bar .fill{
  height:100%;background:var(--r-accent);
  border-radius:2px;transition:width .3s;
  position:relative;
}
.progress-bar .fill::after{
  content:'';position:absolute;right:-6px;top:50%;
  transform:translateY(-50%);
  width:12px;height:12px;border-radius:50%;
  background:var(--r-accent);
}

.toolbar{
  display:flex;padding:6px 0 10px;
}
.toolbar .tool{
  flex:1;display:flex;flex-direction:column;
  align-items:center;gap:3px;cursor:pointer;
  color:var(--r-bar-text);
}
.toolbar .tool:active{opacity:.6}
.toolbar .tool .ic{font-size:20px}
.toolbar .tool .lb{font-size:10px;color:var(--r-bar-text-2)}

/* ===== 章节目录抽屉 ===== */
.drawer-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.5);
  z-index:300;opacity:0;visibility:hidden;
  transition:opacity .3s;
}
.drawer-overlay.show{opacity:1;visibility:visible}

.chapter-drawer{
  position:fixed;top:0;left:0;
  width:80%;max-width:340px;height:100vh;
  background:#fff;z-index:301;
  transform:translateX(-100%);
  transition:transform .3s;
  display:flex;flex-direction:column;
}
.chapter-drawer.show{transform:translateX(0)}

.drawer-header{
  padding:16px;border-bottom:1px solid #f0f0f0;
  display:flex;align-items:center;gap:12px;
}
.drawer-header .book-name{
  flex:1;font-size:16px;font-weight:600;
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
}
.drawer-header .sort-btn{
  font-size:12px;color:#4a67c5;cursor:pointer;
  display:flex;align-items:center;gap:4px;
}
.drawer-header .close{
  font-size:20px;color:#999;cursor:pointer;
}

.drawer-info{
  padding:12px 16px;background:#f9f9f9;
  font-size:12px;color:#888;
  display:flex;justify-content:space-between;
}
.drawer-info .total{color:#666}

/* ===== 抽屉 tab（目录/书签） ===== */
.drawer-tabs{
  display:flex;border-bottom:1px solid #f0f0f0;flex-shrink:0;
}
.drawer-tabs .tab{
  flex:1;text-align:center;padding:12px 0;
  font-size:14px;color:#888;cursor:pointer;
  position:relative;transition:color .2s;
}
.drawer-tabs .tab.active{color:#4a67c5;font-weight:600}
.drawer-tabs .tab.active::after{
  content:'';position:absolute;left:50%;bottom:0;
  transform:translateX(-50%);
  width:24px;height:2px;border-radius:2px;background:#4a67c5;
}
.drawer-tabs .tab .cnt{
  display:inline-block;font-size:11px;color:#aaa;
  margin-left:4px;vertical-align:middle;
}
.drawer-tabs .tab.active .cnt{color:#4a67c5}

/* ===== 书签列表 ===== */
.bookmark-list{
  flex:1;overflow-y:auto;
  padding:0 16px 20px;
}
.bookmark-list::-webkit-scrollbar{width:3px}
.bookmark-list::-webkit-scrollbar-thumb{background:#ddd;border-radius:2px}
.bm-item{
  display:flex;align-items:center;gap:12px;
  padding:14px 0;border-bottom:1px solid #f5f5f5;
  cursor:pointer;transition:background .2s;
}
.bm-item:active{background:#f9f9f9}
.bm-item.current .bm-title{color:#4a67c5;font-weight:600}
.bm-item .bm-ic{
  width:28px;height:28px;border-radius:6px;
  background:#fff5e6;font-size:14px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.bm-item.current .bm-ic{background:#eef2ff}
.bm-item .bm-body{flex:1;min-width:0}
.bm-item .bm-title{
  font-size:14px;
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
}
.bm-item .bm-meta{
  font-size:11px;color:#aaa;margin-top:3px;
}
.bm-item .bm-del{
  font-size:14px;color:#ccc;padding:6px;
  flex-shrink:0;
}
.bm-item .bm-del:active{color:#f56c6c}
.bm-empty{
  padding:60px 20px;text-align:center;color:#bbb;
}
.bm-empty .ic{font-size:40px;margin-bottom:12px}
.bm-empty p{font-size:14px;margin:0 0 6px}
.bm-empty .tip{font-size:12px;color:#ccc}

.chapter-list{
  flex:1;overflow-y:auto;
  padding:0 16px 20px;
}
.chapter-list::-webkit-scrollbar{width:3px}
.chapter-list::-webkit-scrollbar-thumb{background:#ddd;border-radius:2px}

.chapter-list .ch-item{
  display:flex;align-items:center;
  padding:14px 0;border-bottom:1px solid #f5f5f5;
  cursor:pointer;gap:10px;
  transition:background .2s;
}
.chapter-list .ch-item:active{background:#f9f9f9}
.chapter-list .ch-item.current{color:#4a67c5;font-weight:600}
.chapter-list .ch-item.current .ch-num{background:#4a67c5;color:#fff}
.chapter-list .ch-item .ch-num{
  width:28px;height:28px;border-radius:6px;
  background:#f0f0f0;color:#888;
  font-size:11px;display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.chapter-list .ch-item .ch-name{
  flex:1;font-size:14px;
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
}
.chapter-list .ch-item .ch-tag{
  font-size:10px;padding:1px 6px;border-radius:3px;
  background:#e8f5e9;color:#22c55e;flex-shrink:0;
}
.chapter-list .ch-item .ch-tag.vip{background:#fff5e6;color:#f59e0b}
.chapter-list .ch-item .ch-tag.unlocked{background:#eef2ff;color:#4a67c5}
.chapter-list .ch-item .ch-tag.latest{background:#fef2f2;color:#ef4444}

.theme-dark .chapter-drawer{
  background:#1e1e1e;
  color:#ccc;
}
.theme-dark .drawer-header{
  border-bottom-color:rgba(255,255,255,.08);
}
.theme-dark .drawer-header .book-name{color:#e5e5e5}
.theme-dark .drawer-header .sort-btn{color:#8aa0e8}
.theme-dark .drawer-header .close{color:#888}
.theme-dark .drawer-info{
  background:#161616;
  color:#888;
}
.theme-dark .drawer-info .total{color:#aaa}
.theme-dark .drawer-tabs{border-bottom-color:rgba(255,255,255,.08)}
.theme-dark .drawer-tabs .tab{color:#888}
.theme-dark .drawer-tabs .tab.active{color:#8aa0e8}
.theme-dark .drawer-tabs .tab.active::after{background:#8aa0e8}
.theme-dark .drawer-tabs .tab .cnt{color:#666}
.theme-dark .drawer-tabs .tab.active .cnt{color:#8aa0e8}
.theme-dark .bookmark-list::-webkit-scrollbar-thumb{background:#444}
.theme-dark .bm-item{border-bottom-color:rgba(255,255,255,.06)}
.theme-dark .bm-item:active{background:rgba(255,255,255,.05)}
.theme-dark .bm-item.current .bm-title{color:#8aa0e8}
.theme-dark .bm-item .bm-ic{background:#2a2a2a}
.theme-dark .bm-item.current .bm-ic{background:rgba(74,103,197,.28)}
.theme-dark .bm-item .bm-title{color:#ccc}
.theme-dark .bm-item .bm-meta{color:#666}
.theme-dark .bm-item .bm-del{color:#555}
.theme-dark .bm-empty{color:#666}
.theme-dark .bm-empty .tip{color:#555}
.theme-dark .chapter-list::-webkit-scrollbar-thumb{background:#444}
.theme-dark .chapter-list .ch-item{
  border-bottom-color:rgba(255,255,255,.06);
  color:#ccc;
}
.theme-dark .chapter-list .ch-item:active{background:rgba(255,255,255,.05)}
.theme-dark .chapter-list .ch-item.current{color:#8aa0e8}
.theme-dark .chapter-list .ch-item.current .ch-num{background:#4a67c5;color:#fff}
.theme-dark .chapter-list .ch-item .ch-num{
  background:#2a2a2a;
  color:#999;
}
.theme-dark .chapter-list .ch-item .ch-name{color:inherit}
.theme-dark .chapter-list .ch-item .ch-tag{
  background:rgba(34,197,94,.16);
  color:#4ade80;
}
.theme-dark .chapter-list .ch-item .ch-tag.vip{
  background:rgba(245,158,11,.16);
  color:#fbbf24;
}
.theme-dark .chapter-list .ch-item .ch-tag.unlocked{
  background:rgba(74,103,197,.22);
  color:#8aa0e8;
}
.theme-dark .chapter-list .ch-item .ch-tag.latest{
  background:rgba(239,68,68,.18);
  color:#f87171;
}

/* ===== 设置面板 ===== */
.settings-panel{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;
  background:var(--r-bar-bg);
  z-index:300;
  transform:translateX(-50%) translateY(100%);
  transition:transform .3s;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.settings-panel.show{transform:translateX(-50%) translateY(0)}

.settings-panel .sp-header{
  display:flex;justify-content:space-between;align-items:center;
  padding:16px 20px 10px;
  color:var(--r-bar-text-2);font-size:13px;
}
.settings-panel .sp-header .close{font-size:20px;cursor:pointer;color:var(--r-bar-text)}

.sp-section{
  padding:12px 20px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.sp-section .sp-label{
  font-size:12px;color:var(--r-bar-text-2);
  margin-bottom:10px;
}

/* 字号控制 */
.font-size-ctrl{
  display:flex;align-items:center;gap:16px;justify-content:center;
}
.font-size-ctrl .btn{
  width:40px;height:40px;border-radius:50%;
  background:rgba(255,255,255,.1);color:var(--r-bar-text);
  display:flex;align-items:center;justify-content:center;
  font-size:16px;cursor:pointer;
  transition:background .2s;
}
.font-size-ctrl .btn:active{background:rgba(255,255,255,.2)}
.font-size-ctrl .preview{
  color:var(--r-bar-text);font-size:18px;
  min-width:40px;text-align:center;
}

/* 字号 + 简繁同一行 */
.sp-font-row{
  display:flex;align-items:center;gap:12px;
}
.sp-font-row .font-size-ctrl{
  flex:1;justify-content:flex-start;gap:12px;
}
.hanzi-ctrl{
  display:flex;gap:8px;flex-shrink:0;
}
.hanzi-ctrl .opt{
  min-width:52px;height:40px;padding:0 12px;
  display:flex;align-items:center;justify-content:center;
  border-radius:8px;font-size:13px;cursor:pointer;
  background:rgba(255,255,255,.08);color:var(--r-bar-text-2);
  transition:all .2s;
}
.hanzi-ctrl .opt.active{background:var(--r-accent);color:#fff}

/* 行距控制 */
.spacing-ctrl{
  display:flex;gap:8px;
}
.spacing-ctrl .opt{
  flex:1;text-align:center;padding:10px;
  border-radius:8px;font-size:13px;cursor:pointer;
  background:rgba(255,255,255,.08);color:var(--r-bar-text-2);
  transition:all .2s;
}
.spacing-ctrl .opt.active{background:var(--r-accent);color:#fff}

/* 背景主题 */
.theme-ctrl{
  display:flex;gap:10px;justify-content:center;
}
.theme-ctrl .opt{
  width:44px;height:44px;border-radius:50%;
  cursor:pointer;border:2px solid transparent;
  transition:border-color .2s;
  display:flex;align-items:center;justify-content:center;
  font-size:16px;
}
.theme-ctrl .opt.active{border-color:var(--r-accent)}
.theme-ctrl .opt[data-theme="light"]{background:#fff}
.theme-ctrl .opt[data-theme="sepia"]{background:#f5f0e8}
.theme-ctrl .opt[data-theme="green"]{background:#c7edcc}
.theme-ctrl .opt[data-theme="dark"]{background:#1a1a1a;color:#999}

/* 字体选择 */
.font-ctrl{
  display:flex;gap:8px;
}
.font-ctrl .opt{
  flex:1;text-align:center;padding:10px;
  border-radius:8px;cursor:pointer;
  background:rgba(255,255,255,.08);color:var(--r-bar-text-2);
  font-size:13px;transition:all .2s;
}
.font-ctrl .opt.active{background:var(--r-accent);color:#fff}
.font-ctrl .opt[data-font="system"]{font-family:-apple-system,"PingFang SC",sans-serif}
.font-ctrl .opt[data-font="serif"]{font-family:"Noto Serif SC",serif}
.font-ctrl .opt[data-font="kai"]{font-family:"STKaiti","KaiTi",serif}

/* 亮度滑块 */
.brightness-ctrl{
  display:flex;align-items:center;gap:12px;
}
.brightness-ctrl .ic{font-size:18px;color:var(--r-bar-text-2)}
.brightness-ctrl input[type="range"]{
  flex:1;-webkit-appearance:none;height:4px;
  background:rgba(255,255,255,.15);border-radius:2px;
  outline:none;
}
.brightness-ctrl input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;width:18px;height:18px;
  border-radius:50%;background:#fff;cursor:pointer;
}

/* ===== 遮罩(点击中间区域) ===== */
.tap-zone{
  position:fixed;top:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;
  height:calc(100vh - 220px);
  z-index:50;display:flex;
  pointer-events:auto;
}
/* 工具栏显示时，左右翻页区域不拦截事件（避免覆盖底部按钮），但中间区域仍可点击隐藏工具栏 */
.tap-zone.inactive{
  pointer-events:none;
}
.tap-zone.inactive .zone-center{
  pointer-events:auto;
}
.tap-zone .zone-left,.tap-zone .zone-right{
  flex:0 0 40%;cursor:pointer;
  min-height:100%;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.tap-zone .zone-center{
  flex:0 0 20%;cursor:pointer;
  min-height:100%;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.tap-zone.hidden{display:none}

/* ===== 翻书过渡 ===== */
.flip-overlay{
  position:fixed;top:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;height:100%;
  z-index:1200;display:flex;align-items:center;justify-content:center;
  background:var(--r-bg);
}
.flip-book{
  width:84px;height:112px;
  perspective:700px;
  position:relative;
}
.flip-base{
  position:absolute;inset:0;
  background:
    linear-gradient(90deg,#7a5428 0 7px,#d8b56a 7px 9px,#f6efe0 9px 50%,#fffdf8 50%);
  border-radius:3px 7px 7px 3px;
  box-shadow:
    0 10px 28px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.35);
}
.flip-base::after{
  content:"";position:absolute;left:9px;top:10px;right:8px;bottom:10px;
  background:repeating-linear-gradient(
    to bottom,
    transparent 0 9px,
    rgba(180,150,110,.18) 9px 10px
  );
  border-radius:0 3px 3px 0;
  opacity:.55;
}
.flip-leaf{
  position:absolute;top:6px;right:6px;bottom:6px;left:50%;
  transform-origin:left center;
  transform-style:preserve-3d;
  backface-visibility:hidden;
  background:
    linear-gradient(90deg,rgba(0,0,0,.06),transparent 10%),
    repeating-linear-gradient(to bottom, #fffdf8 0 8px, #f3ead6 8px 9px);
  border-radius:0 4px 4px 0;
  box-shadow:1px 0 4px rgba(0,0,0,.12);
  animation:flipPage 1.15s ease-in-out infinite;
}
.flip-leaf.leaf-2{animation-delay:.18s;opacity:.9}
.flip-leaf.leaf-3{animation-delay:.36s;opacity:.75}
@keyframes flipPage{
  0%{transform:rotateY(0deg)}
  55%{transform:rotateY(-158deg)}
  100%{transform:rotateY(-180deg)}
}
.page-loading{
  min-height:70vh;display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  color:var(--r-text-2);font-size:14px;text-align:center;padding:24px;
}

/* ===== 加载提示 ===== */
.loading{
  text-align:center;padding:40px 0;
  color:var(--r-text-2);font-size:14px;
}

/* ===== 支付跳转等待遮罩 ===== */
.pay-wait-overlay{
  position:fixed;top:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;height:100%;
  z-index:2300;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.72);
}
.pay-wait-box{
  display:flex;flex-direction:column;align-items:center;gap:18px;
}
.pay-wait-text{
  color:#fff;font-size:15px;letter-spacing:1px;
  animation:payWaitPulse 1.2s ease-in-out infinite;
}
@keyframes payWaitPulse{
  0%,100%{opacity:.55}
  50%{opacity:1}
}
.loading .dots{
  display:inline-block;animation:dots 1.5s infinite;
}
@keyframes dots{0%,20%{content:''}40%{content:'.'}60%{content:'..'}80%,100%{content:'...'}}
.loading .dots::after{content:'';animation:dots 1.5s infinite}

/* ===== 购买章节弹窗 ===== */
.buy-dialog-overlay{
  position:fixed;top:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;height:100vh;
  background:rgba(0,0,0,.5);
  z-index:300;display:flex;align-items:center;justify-content:center;
}
.buy-dialog{
  width:80%;max-width:300px;
  background:var(--r-bg);
  border-radius:12px;padding:20px;
  box-shadow:0 10px 30px rgba(0,0,0,.2);
}
.buy-title{
  text-align:center;font-size:18px;font-weight:600;
  margin-bottom:16px;color:var(--r-text);
}
.buy-info{
  text-align:center;margin-bottom:12px;
}
.buy-chapter{
  font-size:15px;color:var(--r-text);margin-bottom:6px;
}
.buy-price{
  font-size:22px;font-weight:700;color:#e6a23c;
}
.buy-balance{
  text-align:center;font-size:13px;color:var(--r-text-2);
  margin-bottom:20px;
}
.buy-actions{
  display:flex;gap:12px;
}
.buy-actions .btn{
  flex:1;text-align:center;padding:11px 0;
  border-radius:8px;font-size:14px;cursor:pointer;
  border:1px solid var(--r-border);
}
.buy-actions .btn.cancel{
  color:var(--r-text-2);background:transparent;
}
.buy-actions .btn.confirm{
  background:var(--r-accent);color:#fff;border-color:var(--r-accent);
}
.buy-actions .btn.recharge{
  background:#e6a23c;color:#fff;border-color:#e6a23c;
}

/* ===== 阅读器付费墙 ===== */
.paywall-hint{
  margin:24px 16px 8px;padding:14px 16px;text-align:center;
  border:1px dashed #d4b483;border-radius:12px;
  color:#8a6d3b;background:rgba(230,162,60,.08);cursor:pointer;font-size:14px;
}
.paywall-overlay{
  position:fixed;top:0;bottom:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;height:auto;
  background:rgba(20,17,15,.45);
  z-index:2000;display:flex;align-items:flex-end;justify-content:center;
  overflow:hidden;
}
.paywall-sheet{
  width:100%;max-height:100%;background:var(--r-bg);
  border-radius:18px 18px 0 0;
  padding:22px 20px 0;
  box-shadow:0 -10px 30px rgba(0,0,0,.18);position:relative;
  display:flex;flex-direction:column;box-sizing:border-box;
  overflow:hidden;
}
.paywall-sheet .pw-body{
  flex:1 1 auto;min-height:0;overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
.pw-close{
  position:absolute;top:12px;right:14px;width:28px;height:28px;
  display:flex;align-items:center;justify-content:center;
  color:var(--r-text-2);font-size:16px;cursor:pointer;
}
.pw-title{
  text-align:center;font-size:18px;font-weight:700;
  margin-bottom:8px;color:var(--r-text);
}
.pw-desc{
  text-align:center;font-size:14px;line-height:1.6;
  color:var(--r-text-2);margin-bottom:12px;
}
.pw-balance{
  text-align:center;font-size:12px;color:var(--r-text-2);margin-bottom:16px;
}
.pw-plan{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;border:2px solid #e6a23c;border-radius:14px;
  margin-bottom:16px;background:rgba(230,162,60,.08);cursor:pointer;
}
.pw-plan-info{display:flex;flex-direction:column}
.pw-plan-coins{font-size:18px;font-weight:700;color:#b8860b}
.pw-plan-tag{font-size:12px;color:var(--r-text-2);margin-top:4px}
.pw-plan-price{font-size:22px;font-weight:700;color:var(--r-text)}
.pw-grid{
  display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:16px;
}
.pw-item{
  background:var(--r-bg);border:2px solid var(--r-border);border-radius:12px;
  padding:16px 10px 12px;text-align:center;cursor:pointer;position:relative;
}
.pw-item.selected{border-color:#c9a84c;background:rgba(201,168,76,.08)}
.pw-item .pw-tag{
  position:absolute;top:0;right:0;font-size:10px;color:#fff;
  padding:2px 8px;border-radius:0 10px 0 10px;
}
.pw-item .pw-tag.hot-tag{background:linear-gradient(135deg,#f59e0b,#fbbf24)}
.pw-item .pw-tag.best-tag{background:linear-gradient(135deg,#ef4444,#f87171)}
.pw-item .pw-tag.deal-tag{background:linear-gradient(135deg,#8b5cf6,#a78bfa)}
.pw-item .pw-price{font-size:20px;font-weight:700;color:#4a67c5}
.pw-item .pw-coins{font-size:12px;color:var(--r-text-2);margin-top:4px}
.pw-item .pw-bonus{font-size:11px;color:#e6a23c;margin-top:4px}
.pw-btn{
  display:block;width:100%;padding:13px 0;border:none;border-radius:999px;
  font-size:16px;font-weight:600;color:#fff;cursor:pointer;
  background:linear-gradient(135deg,#d4b483,#b8860b);
  box-shadow:0 8px 20px rgba(201,168,76,.35);
  flex-shrink:0;
  margin:12px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}
.pw-btn:disabled{opacity:.65;cursor:not-allowed}

/* ===== 付费墙三方登录半拉框 ===== */
.login-modal{
  position:fixed;inset:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;
  background:rgba(20,17,15,.5);
  z-index:2100;display:none;
  align-items:flex-end;justify-content:center;
}
.login-modal.active{display:flex}
.login-sheet{
  width:100%;background:var(--r-bg);
  border-radius:20px 20px 0 0;
  padding:28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow:0 -8px 30px rgba(0,0,0,.2);
}
.login-sheet-title{
  font-size:18px;font-weight:700;color:var(--r-text);
  text-align:center;margin-bottom:8px;
}
.login-sheet-desc{
  font-size:14px;line-height:1.6;color:var(--r-text-2);
  text-align:center;margin-bottom:20px;
}
.login-options{display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.login-option{
  display:flex;align-items:center;justify-content:center;
  width:100%;padding:14px 12px;border:2px solid var(--r-border);
  border-radius:12px;background:var(--r-bg);cursor:pointer;
  font-size:15px;font-weight:600;color:var(--r-text);
}
.login-option:disabled{opacity:.65;cursor:not-allowed}
.login-option-icon{width:24px;height:24px;margin-right:10px;display:flex;align-items:center;justify-content:center}
.login-option-facebook{color:#1877F2}
.login-option-google{color:var(--r-text)}
.login-close{
  display:block;margin:8px auto 0;padding:8px 16px;
  font-size:14px;color:var(--r-text-2);background:none;border:none;cursor:pointer;
}
.login-close:disabled{opacity:.5;cursor:not-allowed}

/* ===== 段评（长按段落触发；有评论才显示淡灰小图标） ===== */
.para-item{
  position:relative;
  border-radius:6px;
  padding:2px 4px;margin-bottom:16px;
  transition:background .2s;
  -webkit-user-select:none;user-select:none;
  -webkit-touch-callout:none;
}
.para-item.active{background:rgba(74,103,197,.08)}
.theme-dark .para-item.active{background:rgba(74,103,197,.15)}
.theme-sepia .para-item.active{background:rgba(74,103,197,.08)}

.para-badge{
  position:relative;z-index:60;
  font-size:13px;
  color:#c3c7cf;
  margin-left:4px;vertical-align:middle;
  cursor:pointer;user-select:none;-webkit-touch-callout:none;
  pointer-events:auto;
  -webkit-tap-highlight-color:transparent;
  white-space:nowrap;
}
.para-badge:active{opacity:.5}
.para-badge-num{
  color:#e53935;
  font-size:11px;
  font-weight:700;
  margin-left:1px;
  vertical-align:super;
  line-height:1;
}
.theme-dark .para-badge{color:#5f6672}
.theme-dark .para-badge-num{color:#ff5252}
.theme-sepia .para-badge{color:#c3b8a8}
.theme-sepia .para-badge-num{color:#e53935}

.comment-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.4);
  z-index:400;opacity:0;visibility:hidden;
  transition:opacity .3s;
}
.comment-overlay.show{opacity:1;visibility:visible}

.comment-panel{
  position:fixed;bottom:0;left:50%;
  width:100%;max-width:430px;
  background:#fff;z-index:401;
  border-radius:16px 16px 0 0;
  transform:translateX(-50%) translateY(100%);
  transition:transform .3s;
  max-height:65vh;display:flex;flex-direction:column;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.comment-panel.show{transform:translateX(-50%) translateY(0)}
.theme-dark .comment-panel{background:#1e1e1e}
.theme-sepia .comment-panel{background:var(--r-bg)}

.cp-header{
  display:flex;justify-content:space-between;align-items:center;
  padding:16px 20px 12px;
  border-bottom:1px solid var(--r-border,#f0f0f0);
}
.theme-dark .cp-header{border-color:rgba(255,255,255,.08)}
.cp-title{font-size:15px;font-weight:600;color:var(--r-text,#333)}
.theme-dark .cp-title{color:#ccc}
.cp-close{font-size:20px;color:#999;cursor:pointer}

.cp-quote{
  padding:12px 20px;font-size:13px;color:var(--r-text-2,#888);
  background:rgba(0,0,0,.03);
  border-left:3px solid var(--r-accent);
  margin:0;
  line-height:1.6;
}
.theme-dark .cp-quote{background:#1a1a1a;color:#666}
.theme-sepia .cp-quote{background:rgba(61,53,40,.05)}

.cp-list{
  flex:1;overflow-y:auto;
  padding:0 20px;
}
.cp-list::-webkit-scrollbar{width:3px}
.cp-list::-webkit-scrollbar-thumb{background:#ddd;border-radius:2px}

.cp-item{
  display:flex;gap:10px;
  padding:14px 0;
  border-bottom:1px solid var(--r-border,#f5f5f5);
}
.theme-dark .cp-item{border-color:rgba(255,255,255,.06)}
.cp-avatar{
  width:36px;height:36px;border-radius:50%;
  background:#f0f0f0;
  display:flex;align-items:center;justify-content:center;
  font-size:18px;flex-shrink:0;
}
.theme-dark .cp-avatar{background:#333}
.cp-body{flex:1;min-width:0}
.cp-user{
  font-size:13px;font-weight:600;color:var(--r-text-2,#666);
  display:flex;align-items:center;gap:6px;
  margin-bottom:4px;
}
.theme-dark .cp-user{color:#999}
.cp-author-tag{
  font-size:10px;background:#e8f5e9;color:#22c55e;
  padding:1px 5px;border-radius:3px;font-weight:400;
}
.cp-text{
  font-size:15px;line-height:1.6;color:var(--r-text,#333);
  word-break:break-word;
}
.theme-dark .cp-text{color:#bbb}
.cp-meta{
  display:flex;gap:16px;margin-top:6px;
  font-size:12px;color:#aaa;
}
.cp-like{cursor:pointer;transition:color .2s}
.cp-like:active{color:var(--r-accent)}

.cp-empty{
  text-align:center;padding:40px 0;
  color:#bbb;font-size:14px;
}

.cp-input{
  display:flex;gap:8px;
  padding:12px 20px;
  border-top:1px solid var(--r-border,#f0f0f0);
  background:#fff;
}
.theme-dark .cp-input{background:#1e1e1e;border-color:rgba(255,255,255,.08)}
.theme-sepia .cp-input{background:var(--r-bg);border-color:var(--r-border)}
.cp-input input{
  flex:1;border:1px solid #e0e0e0;
  border-radius:20px;padding:10px 16px;
  font-size:14px;outline:none;
  background:#f9f9f9;color:var(--r-text,#333);
  transition:border-color .2s;
}
.cp-input input:focus{border-color:var(--r-accent);background:#fff}
.theme-dark .cp-input input{
  border-color:#333;background:#1a1a1a;color:#ccc;
}
.theme-sepia .cp-input input{
  border-color:var(--r-border);background:rgba(255,255,255,.55);color:var(--r-text);
}
.cp-input button{
  padding:10px 18px;border:none;border-radius:20px;
  background:var(--r-accent);color:#fff;
  font-size:14px;cursor:pointer;
  transition:opacity .2s;flex-shrink:0;
}
.cp-input button:active{opacity:.8}

/* ===== 阅读页右上角举报 ===== */
.reader-report-wrap{
  position:fixed;top:calc(10px + env(safe-area-inset-top,0px));
  left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;
  z-index:190;pointer-events:none;
  display:flex;justify-content:flex-end;
  padding:0 12px;
  transition:opacity .25s;
}
.reader-report-wrap.hidden{opacity:0;pointer-events:none}
.reader-report-btn{
  pointer-events:auto;
  font-size:12px;font-weight:600;line-height:1;
  padding:6px 12px;border:none;border-radius:14px;
  background:rgba(43,43,43,.55);color:#f5f0e8;
  cursor:pointer;font-family:inherit;
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
.reader-report-btn:active{opacity:.7}
.theme-dark .reader-report-btn{
  background:rgba(255,255,255,.16);color:#e5e5e5;
}

/* ===== 举报弹窗（独立浅色，不跟随阅读器纸张主题） ===== */
.report-modal{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);
  width:100%;max-width:430px;background:#fff;color:#1a1a1a;
  border-radius:16px 16px 0 0;z-index:500;
  padding:16px;padding-bottom:calc(16px + var(--safe-bottom, env(safe-area-inset-bottom,0px)));
  display:none;flex-direction:column;
  box-shadow:0 -4px 20px rgba(0,0,0,.12);
  max-height:85vh;overflow-y:auto;
}
.report-modal.show{display:flex;animation:rmSlideUp .3s ease}
@keyframes rmSlideUp{
  from{transform:translateX(-50%) translateY(100%)}
  to{transform:translateX(-50%) translateY(0)}
}
.theme-dark .report-modal,
.theme-sepia .report-modal,
.theme-light .report-modal,
.theme-green .report-modal{
  background:#fff;color:#1a1a1a;
}
.report-modal .rm-mask{
  position:fixed;top:0;left:0;width:100%;height:100%;
  background: rgb(236 230 230 / 45%);z-index:-1;
}
.report-modal .rm-head{
  display:flex;align-items:center;margin-bottom:16px;
}
.report-modal .rm-head .rm-close{font-size:20px;color:#999;cursor:pointer;width:30px}
.report-modal .rm-head .rm-title{flex:1;text-align:center;font-size:16px;font-weight:600;color:#1a1a1a}
.report-modal .rm-head .rm-submit{
  font-size:14px;color:#000;font-weight:600;cursor:pointer;
  background:none;border:none;padding:0;min-width:30px;font-family:inherit;
}
.report-modal .rm-target{
  background:#fef2f2;border-radius:8px;padding:10px 12px;margin-bottom:14px;
  font-size:12px;color:#dc2626;display:flex;align-items:center;gap:6px;
}
.report-modal .rm-section-title{font-size:13px;font-weight:600;color:#555;margin-bottom:10px}
.report-modal .rm-req{color:#ef4444}
.report-modal .rm-reasons{
  display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;
}
.report-modal .rm-reason{
  padding:8px 14px;border:1px solid #e5e7eb;border-radius:20px;
  font-size:13px;color:#333;cursor:pointer;
  transition:all .15s;background:#fff;
}
.report-modal .rm-reason:active{transform:scale(.95)}
.report-modal .rm-reason.selected{
  border-color:#ef4444;color:#dc2626;
  background:#fef2f2;font-weight:600;
}
.report-modal .rm-textarea{
  width:100%;min-height:80px;border:1px solid #e5e7eb;border-radius:10px;
  padding:12px;font-size:13px;line-height:1.6;resize:none;
  font-family:inherit;color:#1a1a1a;background:#f9fafb;
  box-sizing:border-box;
}
.report-modal .rm-textarea:focus{outline:none;border-color:#ef4444;background:#fff}
.report-modal .rm-foot{
  display:flex;align-items:center;justify-content:space-between;margin-top:10px;
}
.report-modal .rm-foot .rm-count{font-size:12px;color:#888}
.report-modal .rm-note{font-size:11px;color:#888;line-height:1.5;margin-top:12px}


/* ===== 落地页新人福利弹窗 ===== */
.gift-overlay{
  position:fixed;inset:0;z-index:2200;background:rgba(0,0,0,.55);
  display:flex;align-items:center;justify-content:center;padding:24px;
}
.gift-sheet{
  position:relative;width:min(88vw,340px);background:#fff;border-radius:20px;
  padding:32px 22px 22px;text-align:center;overflow:hidden;
  box-shadow:0 16px 48px rgba(0,0,0,.28);
  animation:gift-in .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes gift-in{
  from{transform:scale(.7) translateY(30px);opacity:0}
  to{transform:scale(1) translateY(0);opacity:1}
}
.gift-sheet.claimed{background:linear-gradient(160deg,#fffdf5,#fff6df)}
.gift-icon{font-size:56px;line-height:1;margin-bottom:8px;animation:gift-bounce 1.6s ease-in-out infinite}
@keyframes gift-bounce{
  0%,100%{transform:translateY(0) rotate(-3deg)}
  50%{transform:translateY(-8px) rotate(3deg)}
}
.gift-sheet.claimed .gift-icon{animation:none}
.gift-title{font-size:21px;font-weight:800;color:#2c2416;margin-bottom:6px}
.gift-desc{font-size:13px;color:#6b6256;line-height:1.6;margin-bottom:14px}
.gift-amount{
  font-size:44px;font-weight:900;color:#a8872e;line-height:1;margin-bottom:18px;
  transition:transform .3s;
}
.gift-amount .gift-plus{font-size:28px;vertical-align:6px;margin-right:2px}
.gift-amount .gift-unit{font-size:15px;font-weight:600;margin-left:4px}
.gift-amount.pop{animation:amount-pop .5s cubic-bezier(.2,.9,.3,1.4)}
@keyframes amount-pop{
  0%{transform:scale(1)}
  45%{transform:scale(1.35)}
  100%{transform:scale(1)}
}
.gift-btn{
  display:block;width:100%;padding:13px 0;border:none;border-radius:999px;
  background:linear-gradient(135deg,#c9a84c,#a8872e);color:#fff;
  font-size:16px;font-weight:800;cursor:pointer;
  transition:transform .12s, opacity .2s;
}
.gift-btn:active:not(:disabled){transform:scale(.96)}
.gift-btn:disabled{opacity:.65;cursor:default}
.gift-sheet.claimed .gift-btn{background:linear-gradient(135deg,#7bc47f,#4caf50)}
.gift-later{margin-top:12px;font-size:12px;color:#9a9184;cursor:pointer}
.gift-later:active{opacity:.6}


/* ===== Android FB 内置浏览器适配：底部悬浮工具栏遮挡 ===== */
/* FB_IAB 底部工具栏（分享/刷新/收藏/记录）+ 系统导航条约 96px，遮挡底部弹层按钮 */
html.fb-iab .paywall-overlay{padding-bottom:96px}
html.fb-iab .gift-overlay{padding-bottom:96px}

/* ===== 取消支付引导下载APP弹窗 ===== */
.appdl-overlay{
  position:fixed;inset:0;z-index:2400;background:rgba(0,0,0,.6);
  display:flex;align-items:center;justify-content:center;padding:24px;
}
.appdl-sheet{
  position:relative;width:min(88vw,340px);background:linear-gradient(160deg,#f0f7ff,#ffffff 55%);
  border-radius:20px;padding:30px 22px 20px;text-align:center;overflow:hidden;
  box-shadow:0 16px 48px rgba(0,0,0,.3);
  animation:gift-in .35s cubic-bezier(.2,.9,.3,1.2);
}
.appdl-close{
  position:absolute;top:10px;right:12px;width:30px;height:30px;line-height:30px;
  font-size:16px;color:#999;border-radius:50%;cursor:pointer;
}
.appdl-close:active{background:#f0f0f0}
.appdl-icon{font-size:52px;line-height:1;margin-bottom:8px;animation:gift-bounce 1.6s ease-in-out infinite}
.appdl-title{font-size:19px;font-weight:800;color:#1f2d3d;margin-bottom:8px}
.appdl-desc{font-size:13px;color:#5a6a7a;line-height:1.7;margin-bottom:18px}
.appdl-btn{
  width:100%;padding:14px 0;border:none;border-radius:50px;cursor:pointer;
  background:linear-gradient(135deg,#3b82f6,#06b6d4);color:#fff;
  font-size:16px;font-weight:700;letter-spacing:1px;
  box-shadow:0 8px 20px rgba(59,130,246,.35);
}
.appdl-btn:active{transform:scale(.97)}
.appdl-later{
  margin-top:14px;font-size:13px;color:#99a4b0;cursor:pointer;padding:6px 0;
}
