/* 故事拾光 · 移动端样式（480px 容器） */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* 全局防误触：所有可点元素禁掉 iOS 双击缩放 + 去除点按高亮 */
a, button, label, input[type="submit"], input[type="button"], [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
:root {
  --primary: #ff6b35;
  --primary-dark: #e8551f;
  --bg: #f5f6f7;
  --card: #ffffff;
  --text: #222;
  --muted: #999;
  --line: #eee;
}
html, body { height: 100%; }
body {
  background: #3a3d42;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 15px;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* 防止 .app 被 stretch 成视口高度、内容溢出到深色背景 */
}
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
.flash-wrap { padding: 10px 14px 0; }
.flash {
  padding: 9px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 6px;
}
.flash-success { background: #e8f7ee; color: #1a9e54; border: 1px solid #bfe8d1; }
.flash-error   { background: #fdecec; color: #d43c3c; border: 1px solid #f5c6c6; }
.flash-warning { background: #fff6e6; color: #c67c0e; border: 1px solid #f5deb0; }

/* 顶栏 */
.topbar {
  background: linear-gradient(135deg, var(--primary), #ff9068);
  color: #fff; padding: 14px 16px 18px;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 3px; }
.topbar .row { display: flex; align-items: center; justify-content: space-between; }

/* 搜索 */
.search-box { margin: 12px 14px 0; display: flex; gap: 8px; }
.search-box input[type=text] {
  flex: 1; border: none; border-radius: 18px; padding: 9px 14px; font-size: 14px; outline: none;
}
.search-box button {
  border: none; background: #fff; color: var(--primary); border-radius: 18px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* 卡片 */
.card {
  background: var(--card); border-radius: 14px; margin: 12px 14px 0; padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.card h2 { font-size: 16px; margin-bottom: 10px; }
.card h2 .more { float: right; font-size: 12px; color: var(--muted); font-weight: 400; text-decoration: none; }

/* 分类胶囊（首页已改版，保留样式供搜索页复用） */
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 14px 0; }
.cat-chip {
  padding: 5px 14px; border-radius: 14px; background: #fff; color: #666;
  font-size: 13px; text-decoration: none; border: 1px solid var(--line);
}
.cat-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 首页：今日必读 + 经典书单推荐 ===== */
.daily-card {
  position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center;
  margin: 14px 14px 0; padding: 14px; min-height: 128px;
  border-radius: 12px; text-decoration: none; overflow: hidden;
  background: linear-gradient(135deg, #7a1f1f 0%, #a83232 60%, #8f2626 100%);
  box-shadow: 0 4px 14px rgba(122,31,31,.35);
}
.daily-badge {
  position: absolute; top: 10px; right: 10px; background: linear-gradient(135deg, #ffb75e, #ff8a1e);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1.25; text-align: center;
  padding: 4px 7px; border-radius: 8px;
}
.daily-cover {
  width: 74px; height: 100px; border-radius: 8px; overflow: hidden;
  background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.5; padding: 4px;
}
.daily-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.daily-info { min-width: 0; padding-right: 40px; align-self: center; }
.daily-title { color: #fff; font-size: 17px; font-weight: 800; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-meta { color: rgba(255,255,255,.75); font-size: 12px; margin: 6px 0; }
.daily-desc { color: rgba(255,255,255,.85); font-size: 12px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.classic-block { margin: 14px 14px 0; background: linear-gradient(135deg, #7a1f1f, #a83232);
  border-radius: 12px; padding: 12px 10px 14px; box-shadow: 0 4px 14px rgba(122,31,31,.35); }
.classic-head { display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #ffd9a0; font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.classic-head span { flex: none; width: 36px; height: 1px; background: rgba(255,217,160,.5); }
.classic-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: start; }
.cl-item { text-decoration: none; }
.cl-cover {
  position: relative; width: 100%; height: 118px; border-radius: 8px; overflow: hidden;
  background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.5; padding: 4px;
}
.cl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-title { color: #fff; font-size: 12px; margin-top: 6px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 书单横向滚动 */
.hscroll { display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.hscroll::-webkit-scrollbar { display: none; }
.hbook { width: 86px; flex-shrink: 0; text-decoration: none; color: var(--text); }
.cover {
  width: 86px; height: 116px; border-radius: 8px; background: linear-gradient(160deg, #ffd8b0, #ff9b6b);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: #7c3a10; font-size: 14px; font-weight: 700; text-align: center; padding: 6px; line-height: 1.4;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.hbook .t { font-size: 13px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbook .a { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 每行 4 本的封面网格（阅读记录 / 近期在读） */
.bgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; }
.bgrid .hbook { width: auto; min-width: 0; }
.bgrid .cover { width: 100%; height: auto; aspect-ratio: 86 / 116; }
/* 旧内核不支持 aspect-ratio 时退回固定高度，封面不会塌陷 */
@supports not (aspect-ratio: 86 / 116) {
  .bgrid .cover { height: 118px; }
}

/* 双列榜单/列表 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.book-item { display: flex; gap: 10px; text-decoration: none; color: var(--text); align-items: flex-start; }
.book-item .cover { width: 64px; height: 86px; font-size: 12px; flex-shrink: 0; }
.book-item .info { min-width: 0; flex: 1; }
.book-item .bt { font-size: 14px; font-weight: 600; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-item .bd { font-size: 11px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; min-height: 33px; }
.badge-done { display: inline-block; font-size: 10px; background: #e8f7ee; color: #1a9e54;
  border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
.badge-serial { display: inline-block; font-size: 10px; background: #fff0e6; color: #e8551f;
  border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
.badge-paid { display: inline-block; font-size: 10px; background: #fff4cc; color: #b8860b;
  border-radius: 4px; padding: 1px 5px; }

/* 榜单编号 */
.rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.rank-item:last-child { border-bottom: none; }
.rank-no { width: 22px; font-size: 16px; font-weight: 800; color: #ccc; text-align: center; flex-shrink: 0; }
.rank-no.top1 { color: #ff4500; } .rank-no.top2 { color: #ff8c00; } .rank-no.top3 { color: #ffb400; }
.rank-item .rt { font-size: 14px; font-weight: 600; }
.rank-item .ra { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 详情页 */
.detail-head { display: flex; gap: 14px; margin-top: 12px; }
.detail-head .cover { width: 100px; height: 136px; font-size: 15px; }
.dtitle { font-size: 20px; font-weight: 700; }
.dmeta { font-size: 12px; color: var(--muted); margin: 8px 0; line-height: 1.8; }
.ddesc { font-size: 13px; color: #555; line-height: 1.8; margin-top: 10px; }
.btn-row { display: flex; gap: 10px; margin: 14px 14px 0; }
.btn {
  flex: 1; text-align: center; border: none; border-radius: 20px; padding: 11px 0;
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: block;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #ff9068); color: #fff; }
.btn-ghost { background: #fff; color: #666; border: 1px solid var(--line); }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.chapter-list { max-height: 420px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chapter-list a {
  display: flex; justify-content: space-between; padding: 11px 2px; font-size: 14px;
  color: #333; text-decoration: none; border-bottom: 1px solid var(--line);
}
.chapter-list a .lock { color: #b8860b; font-size: 12px; }

/* 阅读器 */
.reader-body { background: #f7f5f2; }
.reader-top {
  background: var(--card); padding: 10px 16px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.reader-top a { color: var(--primary); text-decoration: none; font-weight: 600; }
.rd-diag { font-size: 11px; color: var(--muted); }
.chapter-title { font-size: 19px; font-weight: 700; margin: 18px 0 6px; }
.reader-content { padding: 0 18px 40px; line-height: 2; font-size: 16px; }
.reader-content p { text-indent: 2em; margin-bottom: 14px; }
.preview-tip { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0; }

/* 付费章锁定占位（不显示任何正文） */
.locked-block { text-align: center; padding: 90px 24px 60px; }
.locked-icon { font-size: 44px; margin-bottom: 14px; }
.locked-text { font-size: 17px; font-weight: 600; color: var(--text, #333); }
.locked-sub { font-size: 13px; color: var(--muted, #999); margin: 8px 0 22px; }
.locked-btn { background: linear-gradient(90deg,#ff8a1e,#ff6a00); color: #fff; border: 0; border-radius: 22px; padding: 10px 26px; font-size: 14px; }
.reader-nav { display: flex; gap: 10px; margin: 0 14px 20px; }

/* 充值底部面板 */
/* 兼容旧内核：不用 inset 简写（iOS Safari<14.5 / Chrome<87 不支持） */
.recharge-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55); z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
}
.rf-sheet {
  background: #f7f5f2; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0;
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(26px + env(safe-area-inset-bottom)); position: relative;
}
.rf-handle { width: 40px; height: 4px; border-radius: 2px; background: #ddd; margin: 0 auto 12px; }
/* 右上角关闭按钮（参考站样式） */
.rf-close {
  position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #fff; color: #999; font-size: 14px; line-height: 20px;
  cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.rf-close:active { background: #eee; }
/* 标题行：左侧提示 + 右侧余额 */
.rf-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 0 14px; padding-right: 26px; }
.rf-title { font-size: 17px; font-weight: 700; }
.rf-bal { color: var(--muted); font-size: 13px; }
.rf-bal b { color: var(--primary); font-size: 16px; }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 2px; }
.rc-card {
  background: #fff; border: 2px solid #f1e9e2; border-radius: 12px; padding: 12px 10px 0;
  text-align: center; position: relative; cursor: pointer; overflow: hidden;
}
.rc-card.selected { border-color: #ff9d4d; background: #fff7ef; }
/* 右上角标（如：国产限制级小说） */
.rc-card .rbadge {
  position: absolute; top: 0; right: 0; background: #8a4a3a; color: #fff;
  font-size: 10px; padding: 3px 8px; border-radius: 0 9px 0 10px;
}
/* 大字金额 + 币值 */
.rc-card .rc-price { font-size: 26px; font-weight: 800; color: #3a2c22; line-height: 1.2; }
.rc-card .rc-price small { font-size: 14px; font-weight: 700; margin-left: 2px; }
.rc-card .rc-coins { font-size: 12px; color: #8a6f5c; margin-top: 2px; }
/* 底部赠送条 */
.rc-card .rc-bonus {
  display: block; margin-top: 10px; width: calc(100% + 20px); margin-left: -10px;
  background: linear-gradient(90deg, #ffb75e, #ff8a1e); color: #fff;
  font-size: 13px; font-weight: 700; text-align: center; padding: 5px 0;
}
.rc-card.selected .rc-bonus { background: linear-gradient(90deg, #ff9d4d, #ff6a00); }
/* 充值页（我的 → 去充值） */
.rc-page { padding: 14px; }
.rc-bal {
  background: linear-gradient(135deg, var(--primary), #ff9068); color: #fff;
  border-radius: 12px; padding: 14px 16px; font-size: 13px; margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 6px;
}
.rc-bal b { font-size: 26px; font-weight: 800; }
.rc-paybtn {
  margin-top: 16px; width: 100%; border: none; border-radius: 22px; padding: 12px 0;
  font-size: 16px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #ff9068);
}
.rf-paybtn {
  margin-top: 16px; width: 100%; border: none; border-radius: 22px; padding: 12px 0;
  font-size: 16px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #ff9068);
}

/* 底部 TabBar */
.main-nav {
  position: -webkit-sticky; /* iOS 13- 需要 webkit 前缀 */
  position: sticky; bottom: 0; margin-top: auto; display: flex;
  background: #fff; border-top: 1px solid var(--line); z-index: 100;
  padding-bottom: env(safe-area-inset-bottom); /* 全面屏 home 条不压住导航 */
}
.main-nav a {
  flex: 1; text-align: center; padding: 9px 0 11px; text-decoration: none;
  color: #999; font-size: 12px;
}
.main-nav a .ico { font-size: 21px; display: block; margin-bottom: 2px; }
.main-nav a.active { color: var(--primary); font-weight: 700; }

/* ===== 继续阅读悬浮条（书城页，fixed 跟随滚动） ===== */
.resume-bar {
  position: fixed; bottom: calc(64px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 456px; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #b3bfa0, #9dab89);
  border: 0; border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  padding: 9px 12px;
}
.rs-cover {
  width: 44px; height: 58px; border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: #6e7d5c; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700; text-decoration: none;
}
.rs-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-info { flex: 1; min-width: 0; text-decoration: none; }
.rs-title {
  font-size: 14px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rs-sub { font-size: 12px; color: rgba(255, 255, 255, .85); margin-top: 3px; }
.rs-btn {
  flex-shrink: 0; height: 34px; line-height: 34px; padding: 0 16px;
  border-radius: 17px; font-size: 13px; font-weight: 700; text-decoration: none;
  color: #6e7d2f; background: #f5e9b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.rs-close {
  flex-shrink: 0; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .45); color: #5c6a4a; font-size: 14px; line-height: 20px;
  padding: 0; cursor: pointer; margin-left: -2px;
}
.rs-close:active { background: rgba(255, 255, 255, .7); }

/* 我的页 */
.me-head {
  background: linear-gradient(135deg, var(--primary), #ff9068); padding: 22px 16px 24px; color: #fff;
}
.me-row { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
.me-name { font-size: 18px; font-weight: 700; }
.me-id { font-size: 12px; opacity: .85; margin-top: 3px; }
/* 合并版钱包卡：数据行 + 大充值按钮 */
.me-wallet {
  margin-top: 14px; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(160, 60, 10, .18);
}
.mw-stats { display: flex; text-align: center; padding: 14px 6px 12px; }
.mw-stats .w { flex: 1; }
.mw-stats .w + .w { border-left: 1px solid #f3ede7; }
.mw-stats .wn { font-size: 20px; font-weight: 800; color: var(--primary); }
.mw-stats .wl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mw-recharge {
  position: relative; display: block; text-align: center;
  margin: 0 12px 12px; padding: 12px 0; border-radius: 24px;
  background: linear-gradient(135deg, #ff6a00, #ff9d4d);
  color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 1px;
  text-decoration: none; box-shadow: 0 4px 12px rgba(255, 106, 0, .4);
}
.mw-recharge:active { transform: scale(.98); }
.mw-recharge .mwr-icon { font-size: 17px; margin-right: 4px; }
.mw-recharge .mwr-arrow { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; opacity: .85; }
.menu-list a {
  display: flex; justify-content: space-between; align-items: center; padding: 13px 2px;
  border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px;
}
.menu-list a:last-child { border-bottom: none; }
.menu-list .arrow { color: #ccc; }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-group input[type=text], .form-group input[type=password], .form-group input[type=number],
.form-group input[type=file], .form-group select, .form-group textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; outline: none; background: #fff; font-family: inherit;
}
.form-group textarea { min-height: 120px; line-height: 1.7; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; }
.help-error { color: #d43c3c; font-size: 12px; margin-top: 4px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.btn-block { width: 100%; }
.link-line { text-align: center; margin-top: 14px; font-size: 13px; }
.link-line a { color: var(--primary); text-decoration: none; }

/* 分页 */
.pager { display: flex; justify-content: center; gap: 8px; margin: 16px 0 90px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 6px 12px; border-radius: 8px; background: #fff; color: #555;
  font-size: 13px; text-decoration: none; border: 1px solid var(--line);
}
.pager .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.spacer-bottom { height: 90px; }

/* ===== 后台（桌面样式） ===== */
.admin-body { background: #f0f2f5; display: block; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side {
  width: 210px; background: #262b33; color: #cfd6e0; padding: 16px 0; flex-shrink: 0;
}
.admin-side .brand { font-size: 17px; font-weight: 700; color: #fff; padding: 4px 20px 16px; }
.admin-side a {
  display: block; padding: 11px 20px; color: #cfd6e0; text-decoration: none; font-size: 14px;
}
.admin-side a:hover, .admin-side a.active { background: #1f232a; color: #ffb27a; border-left: 3px solid var(--primary); padding-left: 17px; }
.admin-main { flex: 1; padding: 22px 26px; overflow-x: auto; }
.admin-main h1 { font-size: 20px; margin-bottom: 16px; }
.atable { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); font-size: 13px; }
.atable th, .atable td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.atable th { background: #fafbfc; color: #666; font-weight: 600; }
.atable a { color: var(--primary); text-decoration: none; margin-right: 8px; }
.atable a.danger { color: #d43c3c; }
.aform { background: #fff; border-radius: 10px; padding: 20px; max-width: 640px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.aform .form-group input, .aform .form-group select, .aform .form-group textarea {
  border-color: #dde1e6; border-radius: 8px;
}
.abtn {
  display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 9px 20px; font-size: 14px; cursor: pointer; text-decoration: none;
}
.abtn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.abtn-ghost { background: #fff; color: #555; border: 1px solid #dde1e6; }
.admin-toolbar { margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-toolbar input[type=text] { border: 1px solid #dde1e6; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.inline-form { display: inline; }
.inline-form input[type=number], .inline-form input[type=password] {
  width: 90px; border: 1px solid #dde1e6; border-radius: 6px; padding: 4px 8px; font-size: 12px;
}
/* 小说级别徽章 */
.lvl-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; }
.lvl-a { background: #ffe9e0; color: #d43a00; border: 1px solid #ffc4a8; }
.lvl-b { background: #eef2f6; color: #5a6b7c; border: 1px solid #d5dde5; }

/* ===== 封面图本地上传 ===== */
.cover-preview {
  width: 150px; height: 200px; border: 1px solid #dde1e6; border-radius: 8px;
  background: #fafbfc; display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 10px;
}
.cover-preview img { max-width: 100%; max-height: 100%; display: block; }
.cover-preview.empty { border-style: dashed; }
.cover-empty-text { font-size: 12px; color: #aab1ba; }
.cover-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cover-msg { font-size: 12px; color: var(--primary); }

/* ===== 后台独立登录页 ===== */
.auth-stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b3038 0%, #3d4450 100%);
}
.auth-card {
  width: 380px; background: #fff; border-radius: 14px; padding: 34px 34px 26px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); text-align: center;
}
.auth-brand { font-size: 42px; }
.auth-title { font-size: 22px; margin-top: 8px; color: #222; }
.auth-sub { font-size: 13px; color: #999; margin: 6px 0 20px; }
.auth-card .form-group { text-align: left; }
.auth-btn { width: 100%; padding: 12px 0; font-size: 15px; margin-top: 6px; }
.auth-hint { font-size: 12px; color: #b08b5e; background: #fdf6ec; border: 1px solid #f0e0c8;
  border-radius: 8px; padding: 8px 10px; margin-top: 18px; }
.auth-back { display: inline-block; margin-top: 14px; font-size: 12px; color: #999; text-decoration: none; }
.auth-back:hover { color: var(--primary); }

/* ===== 阅读页专属：背景全覆盖 + 底部三键导航 ===== */
body.reader-yes { background: #f7f5f2; }
body.reader-yes .app { background: #f7f5f2; }
body.reader-yes .main-nav { display: none; }
.reader-content { background: transparent; }
body.reader-yes .spacer-bottom { height: 96px; }
.reader-bottom {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex; gap: 12px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: #f7f5f2; border-top: 1px solid var(--line); z-index: 100;
}
.rb-btn {
  flex: 1; height: 44px; line-height: 44px; text-align: center; border-radius: 22px;
  background: #efe9df; color: #3a3a3a; font-size: 15px; text-decoration: none;
  border: 0; font-family: inherit; cursor: pointer; display: block;
}
.rb-next { flex: 1.15; background: #4a3a2c; color: #fff; font-weight: 600; }

/* 阅读设置面板 */
.rd-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 9998; display: none; }
.rd-mask.open { display: block; }
.rd-sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; border-radius: 18px 18px 0 0;
  z-index: 9999; padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
}
.rd-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; font-size: 15px; }
.rd-row .ops { display: flex; gap: 10px; align-items: center; }
.rd-row button { min-width: 64px; height: 38px; border-radius: 19px; border: 1px solid var(--line); background: #f6f4f0; font-size: 14px; cursor: pointer; }
.rd-fsize {
  min-width: 64px; height: 38px; line-height: 38px; text-align: center;
  border-radius: 19px; border: 1px solid var(--line); background: #f6f4f0;
  font-size: 15px; color: #555; display: inline-block;
}
/* 背景色圆点 */
.bg-dot {
  width: 30px; height: 30px; min-width: 30px; max-width: 30px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); cursor: pointer; padding: 0; flex-shrink: 0;
}
.rd-row button.bg-dot { min-width: 30px; max-width: 30px; }
.bg-dot.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e4531f; }
/* 禁用手机双击缩放：连续点色点/字号按钮不会触发页面放大 */
.rd-sheet button, .reader-bottom button, .rb-btn, .rd-back { touch-action: manipulation; }

/* ===== 阅读页背景色（设置面板选择，存 localStorage） ===== */
body.reader-yes[data-bg="1"], body.reader-yes[data-bg="1"] .app { background: #d9cba8; }
body.reader-yes[data-bg="2"], body.reader-yes[data-bg="2"] .app { background: #c9e0b8; }
body.reader-yes[data-bg="3"], body.reader-yes[data-bg="3"] .app { background: #7a5b43; }
body.reader-yes[data-bg="3"] .reader-content { color: #f0e8dc; }
body.reader-yes[data-bg="4"], body.reader-yes[data-bg="4"] .app { background: #9c9c9c; }
body.reader-yes[data-bg="4"] .reader-content { color: #fff; }

/* ===== 后台分页器（修复竖排错位） ===== */
.pager { display: flex; justify-content: center; margin: 18px 0 10px; }
ul.pagination { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
ul.pagination li { margin: 0; }
ul.pagination li a, ul.pagination li span {
  display: block; min-width: 34px; height: 34px; line-height: 32px; text-align: center;
  padding: 0 10px; border-radius: 8px; border: 1px solid #e2e5ea; background: #fff;
  color: #444; font-size: 13px; text-decoration: none; box-sizing: border-box;
}
ul.pagination li.active span { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
ul.pagination li.disabled span { color: #bbb; background: #f6f7f9; }
ul.pagination li a:hover { border-color: var(--primary); color: var(--primary); }

/* 阅读页大返回图标（返回书城） */
.rd-back {
  font-size: 30px; font-weight: 700; color: #2a2a2a; text-decoration: none;
  line-height: 1; padding: 0 8px; margin-left: -4px;
}
.rd-back:hover, .rd-back:active { color: var(--primary); }
.rd-back::after { content: none; }

/* 后台热门推荐开关 */
.hot-toggle {
  display: inline-block; min-width: 44px; text-align: center; padding: 3px 10px;
  border-radius: 12px; font-size: 12px; text-decoration: none;
  background: #f1f2f4; color: #888; border: 1px solid #e2e5ea;
}
.hot-toggle.on { background: #fff1e6; color: #ff6b35; border-color: #ffc9a3; font-weight: 600; }
.hot-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* 热门推荐书单底部面板 */
.hot-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 9998; display: none; }
.hot-mask.open { display: block; }
.hot-sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; border-radius: 18px 18px 0 0;
  z-index: 9999; padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.hot-head { text-align: center; font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.hot-nav { display: flex; align-items: center; gap: 16px; padding: 0 2px 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.hot-nav .hn { font-size: 14px; color: #666; text-decoration: none; }
.hot-nav .hn.active { font-size: 16px; font-weight: 700; color: #222; }
.hot-nav .hn-close { margin-left: auto; color: var(--primary); font-size: 14px; }
.hot-item {
  display: flex; gap: 12px; align-items: center; border: 1px solid #f0e4d8;
  border-radius: 12px; padding: 10px; margin-bottom: 10px; background: #fffdf9;
}
.hot-item .cover {
  width: 64px; height: 86px; border-radius: 8px; flex: 0 0 64px; overflow: hidden;
  background: linear-gradient(160deg, #ffd8b0, #ff9b6b); display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 15px; font-weight: 600;
}
.hot-item .cover img { width: 100%; height: 100%; object-fit: cover; }
.hot-item .info { flex: 1; min-width: 0; }
.hot-item .t { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.hot-item .d { font-size: 12px; color: #999; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hot-item .go {
  flex: 0 0 auto; background: linear-gradient(90deg,#ffa63e,#ff7a1e); color: #fff;
  font-size: 13px; border-radius: 16px; padding: 6px 14px; text-decoration: none;
}
.hot-empty { text-align: center; color: #999; font-size: 13px; padding: 30px 0; }

/* ===== 后台：支付配置 ===== */
.pay-filter {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  background: #fff; border: 1px solid #e5e8ee; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.pay-filter label { display: flex; align-items: center; gap: 6px; color: #555; }
.pay-filter input[type="text"], .pay-filter input[type="date"], .pay-filter select {
  height: 30px; border: 1px solid #d5dae2; border-radius: 6px; padding: 0 8px; font-size: 13px;
}
.pay-ico { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; background: #f6f7f9; display: block; }
.pay-ellipsis { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-time { font-size: 12px; white-space: nowrap; line-height: 1.5; }
.form-row2 { display: flex; gap: 14px; }
.form-row2 > div { flex: 1; }
.atable td { vertical-align: middle; }

/* ===================== 后台：充值统计 / 充值记录 ===================== */
.admin-filter {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  background: #fff; border: 1px solid #e5e8ee; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 13px;
}
.admin-filter label { display: flex; align-items: center; gap: 6px; color: #555; }
.admin-filter input[type="text"], .admin-filter input[type="date"], .admin-filter select {
  height: 30px; border: 1px solid #d5dae2; border-radius: 6px; padding: 0 8px; font-size: 13px;
  background: #fff; color: #333;
}
.admin-filter .sep { color: #b6bdc8; }
.admin-main h1 .h1-sub { font-size: 13px; font-weight: 400; color: #98a1af; margin-left: 8px; }

/* 汇总条 */
.agg-bar {
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
  background: #fbfcfd; border: 1px solid #eaeef4; border-left: 3px solid #ff8a4c;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #5b6472;
}
.agg-bar b { color: #232936; font-weight: 700; }
.agg-bar b.money { color: #e8551f; }
.agg-bar b.refund { color: #7c8698; }

/* 通用文本 */
.money { color: #e8551f; font-weight: 600; white-space: nowrap; }
.refund { color: #9a6a6a; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.small { font-size: 12px; }
.muted { color: #b6bdc8; }
.nowrap { white-space: nowrap; }
.atable td.empty, .table-empty { text-align: center; color: #98a1af; padding: 34px 0; }

/* 状态徽章 */
.st-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px;
  line-height: 18px; white-space: nowrap; border: 1px solid transparent;
}
.st-paid      { background: #e8f7ee; color: #1a9e54; border-color: #bfe8d1; }
.st-pending   { background: #fff5e6; color: #c67c0e; border-color: #f6dfb4; }
.st-refunded  { background: #eef2f6; color: #5a6b7c; border-color: #dbe3ec; }
.st-closed    { background: #f4f5f7; color: #98a1af; border-color: #e6e9ee; }
.tag-new {
  display: inline-block; font-size: 11px; font-style: normal; padding: 0 5px;
  border-radius: 4px; background: #fff1e6; color: #e8551f; border: 1px solid #ffd3b8;
}

/* 记录表 */
.recharge-table td { font-size: 13px; }
.recharge-table .cell-user b { display: block; font-weight: 600; color: #232936; }
.recharge-table .cell-user span { font-size: 11px; color: #98a1af; }
.recharge-table .sub-time { font-size: 11px; color: #98a1af; margin-top: 2px; }
.recharge-table .ops a { margin-right: 6px; }

/* 统计页头部 */
.stats-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.range-tabs { display: flex; gap: 6px; background: #fff; padding: 4px; border-radius: 9px; border: 1px solid #e5e8ee; }
.range-tabs a {
  padding: 5px 12px; border-radius: 6px; font-size: 13px; color: #5b6472; text-decoration: none;
}
.range-tabs a:hover { background: #f6f7f9; color: var(--primary); }
.range-tabs a.on { background: var(--primary); color: #fff; font-weight: 600; }
.range-form { display: flex; align-items: center; gap: 6px; }
.range-form input[type="date"] {
  height: 30px; border: 1px solid #d5dae2; border-radius: 6px; padding: 0 8px; font-size: 13px;
}
.range-form .sep, .range-note { color: #98a1af; font-size: 12px; }

/* KPI 卡片 */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-card {
  background: #fff; border: 1px solid #eaeef4; border-radius: 12px; padding: 14px 16px 12px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}
.kpi-card.kpi-main {
  background: linear-gradient(135deg, #fff7f2 0%, #ffffff 62%);
  border-color: #ffd9c4;
}
.kpi-label { font-size: 13px; color: #5b6472; display: flex; align-items: baseline; gap: 6px; }
.kpi-hint { font-size: 11px; color: #b6bdc8; }
.kpi-value { font-size: 27px; font-weight: 800; color: #1f2430; margin: 8px 0 6px; letter-spacing: -.5px; }
.kpi-main .kpi-value { color: #e8551f; }
.kpi-value small { font-size: 13px; font-weight: 600; color: #98a1af; margin-left: 2px; }
.kpi-foot { font-size: 12px; color: #98a1af; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-extra { font-size: 12px; color: #8b95a5; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #eef1f5; }
.delta { font-weight: 700; }
.delta.up { color: #e5484d; }      /* 涨：红 */
.delta.down { color: #1a9e54; }    /* 跌：绿 */
.delta.flat { color: #98a1af; }
.delta-note { color: #a9b1bd; }

/* 次级指标 */
.mini-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
.mini-item {
  background: #fff; border: 1px solid #eaeef4; border-radius: 10px; padding: 11px 13px;
}
.mini-item span { font-size: 12px; color: #8b95a5; display: block; }
.mini-item b { font-size: 18px; font-weight: 700; color: #232936; display: block; margin: 4px 0 3px; }
.mini-item b.money { color: #e8551f; }
.mini-item b.refund { color: #9a6a6a; }
.mini-item em { font-size: 11px; font-style: normal; color: #a9b1bd; }

/* 面板 */
.panel {
  background: #fff; border: 1px solid #eaeef4; border-radius: 12px; padding: 14px 16px 16px;
  margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; color: #232936; }
.panel-sub { font-size: 12px; color: #98a1af; }
.panel-link { font-size: 12px; color: var(--primary); text-decoration: none; margin-left: auto; }
.panel-split { height: 1px; background: #f0f3f7; margin: 14px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.empty-tip { text-align: center; color: #a9b1bd; font-size: 13px; padding: 26px 0; }

/* 趋势图 */
.legend { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; font-size: 12px; color: #6b7686; }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend .lg-bar { width: 10px; height: 10px; border-radius: 2px; background: linear-gradient(180deg, #ffb27a, #ff6b35); }
.legend .lg-line { width: 14px; height: 2px; background: #2f7dd1; border-radius: 1px; }
.legend .lg-note { color: #a9b1bd; }
.trend-svg { width: 100%; height: auto; display: block; }
.trend-svg .axis-x { font-size: 11px; fill: #98a1af; font-family: inherit; }
.trend-svg .axis-y { font-size: 11px; fill: #98a1af; font-family: inherit; }
.trend-svg .axis-y2 { fill: #92a8c8; }

/* 排行 / 分布 */
.rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank-table td { padding: 7px 8px; border-bottom: 1px solid #f4f6f9; vertical-align: middle; }
.rank-table tr:last-child td { border-bottom: none; }
.rank-table .rk {
  width: 22px; text-align: center; color: #b6bdc8; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rank-table .nm { color: #333; }
.rank-table .nm > div:first-child { margin-bottom: 5px; }
.rank-table .pct { text-align: right; color: #6b7686; font-variant-numeric: tabular-nums; width: 56px; }
.rank-table .num { text-align: right; color: #5b6472; white-space: nowrap; width: 64px; }
.rank-table .money { text-align: right; width: 96px; }
.bar-wrap { height: 6px; background: #f2f4f8; border-radius: 4px; overflow: hidden; }
.bar-wrap i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ffc39c, #ff8a4c); }

.dist-list { display: flex; flex-direction: column; gap: 9px; }
.dist-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.dist-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dist-name { width: 92px; color: #4d5766; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-bar { flex: 1; height: 8px; background: #f2f4f8; border-radius: 4px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ffc39c, #ff8a4c); }
.dist-val { width: 92px; text-align: right; color: #333; font-variant-numeric: tabular-nums; }
.dist-pct { width: 50px; text-align: right; color: #98a1af; font-variant-numeric: tabular-nums; }
.dist-channel .dist-name { width: 118px; color: #5b6472; }

/* 时段分布 */
.hour-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 6px 2px 0; }
.hour-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.hour-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.hour-bar-wrap i {
  display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #ffb27a, #ff7f3f);
}
.hour-x { font-size: 10px; color: #b6bdc8; margin-top: 5px; }
.hour-note { font-size: 11px; color: #a9b1bd; margin-top: 8px; }

/* TOP 用户 */
.top-table .rk-no {
  display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 6px; background: #f2f4f8; color: #8b95a5; font-size: 12px; font-weight: 700;
}
.top-table .rk-no.rk-1 { background: #ffece0; color: #e8551f; }
.top-table .rk-no.rk-2 { background: #fff3e0; color: #d98a20; }
.top-table .rk-no.rk-3 { background: #fdf6e3; color: #b99427; }
.top-table .cell-user b { display: block; font-weight: 600; }
.top-table .cell-user span { font-size: 11px; color: #98a1af; }

/* 每日明细 */
.daily-table td { font-size: 13px; }
.daily-table .sum-row td { background: #fbfcfd; font-weight: 700; color: #232936; border-top: 2px solid #eef1f5; }
.mini-bar { display: inline-block; width: 74px; height: 6px; background: #f2f4f8; border-radius: 4px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd0b3, #ff8a4c); border-radius: 4px; }

/* 详情页 */
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table th {
  width: 104px; text-align: left; color: #8b95a5; font-weight: 400; padding: 8px 10px 8px 0;
  vertical-align: top; border-bottom: 1px solid #f4f6f9;
}
.kv-table td { padding: 8px 0; color: #232936; border-bottom: 1px solid #f4f6f9; word-break: break-all; }
.kv-table tr:last-child th, .kv-table tr:last-child td { border-bottom: none; }
.mini-table { font-size: 12px; }
.mini-table th, .mini-table td { padding: 7px 8px; }

@media (max-width: 1320px) {
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .detail-grid { grid-template-columns: 1fr; }
}

.atable th { white-space: nowrap; }

.atable th { white-space: nowrap; }
.status-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: #8b95a5; padding-top: 10px; border-top: 1px dashed #eef1f5; }
.status-sum b { color: #232936; font-weight: 700; }
.admin-filter label { white-space: nowrap; }

/* ===== 数据统计（stat） ===== */
.stat-nav {
  display: flex; align-items: center; gap: 4px; background: #fff;
  border: 1px solid #e5e8ee; border-radius: 11px; padding: 5px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.stat-nav > a {
  padding: 8px 18px; border-radius: 7px; font-size: 14px; color: #5b6472; text-decoration: none;
}
.stat-nav > a:hover { background: #f5f6f8; color: #e8551f; }
.stat-nav > a.on { background: #262b33; color: #fff; font-weight: 600; }
.stat-live { margin-left: auto; padding-right: 12px; font-size: 12px; color: #8b95a5; display: flex; align-items: center; gap: 5px; }
.stat-live i {
  width: 7px; height: 7px; border-radius: 50%; background: #1a9e54;
  box-shadow: 0 0 0 3px rgba(26,158,84,.16); display: inline-block;
}
.stat-live b { color: #1a9e54; font-size: 14px; }
.stat-live-sub { color: #b6bdc8; margin-left: 2px; }

.stat-pagehead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.stat-pagehead h2 { font-size: 19px; color: #1f2430; }
.stat-pagehead-sub { font-size: 12px; color: #98a1af; }
.stat-flex { flex: 1; }

.kpi-grid.kpi-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mini-grid.mini-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.mini-item em .delta { font-size: 11px; }

.metric-tabs { display: flex; gap: 4px; background: #f5f6f8; border-radius: 8px; padding: 3px; }
.metric-tabs a {
  padding: 5px 12px; font-size: 13px; color: #5b6472; border-radius: 6px; text-decoration: none;
}
.metric-tabs a:hover { color: #e8551f; }
.metric-tabs a.on { background: #fff; color: #e8551f; font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-note { font-size: 11px; color: #a9b1bd; margin-top: 10px; line-height: 1.7; }

.stat-select {
  height: 30px; border: 1px solid #d5dae2; border-radius: 6px; padding: 0 6px;
  font-size: 13px; background: #fff; color: #4d5766;
}
.stat-input {
  height: 30px; border: 1px solid #d5dae2; border-radius: 6px; padding: 0 10px; font-size: 13px; width: 160px;
}
.stat-check { font-size: 12px; color: #5b6472; display: inline-flex; align-items: center; gap: 4px; }

.dist-title { font-size: 12px; color: #98a1af; margin: 2px 0 9px; }
.scroll-y { max-height: 320px; overflow-y: auto; }
.small-table { font-size: 12px; }
.small-table th { text-align: left; color: #98a1af; font-weight: 500; padding: 6px 8px; }

/* 留存矩阵 */
.cohort-wrap { overflow-x: auto; }
.cohort-table { border-collapse: separate; border-spacing: 3px; font-size: 12px; width: 100%; }
.cohort-table th { color: #8b95a5; font-weight: 500; font-size: 11px; padding: 4px 6px; text-align: center; }
.cohort-table th:first-child, .cohort-table td:first-child { text-align: left; }
.cohort-table td { padding: 4px 6px; text-align: center; color: #4d5766; }
.cohort-table td.num { text-align: center; color: #5b6472; }
.cohort-table .heat {
  display: block; border-radius: 5px; padding: 5px 4px; font-size: 12px; font-weight: 600;
  color: #5b3a28; background: #f7f8fa; font-variant-numeric: tabular-nums;
}
.cohort-table .heat-empty { color: #c3c9d2; background: #fafbfc; font-weight: 400; }
.cohort-table .sum-row td { border-top: 1px dashed #e5e8ee; color: #232936; }

/* 价值分层 */
.tier-list { display: flex; flex-direction: column; gap: 8px; }
.tier-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.tier-name { flex: 1; color: #4d5766; display: flex; align-items: center; gap: 7px; }
.tier-name i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tier-users { color: #8b95a5; font-size: 12px; width: 120px; text-align: right; }
.tier-amount { width: 96px; text-align: right; color: #e8551f; font-weight: 600; }
.tier-bar { height: 5px; }

/* 漏斗 */
.funnel { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 2px; }
.funnel-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.funnel-label { width: 92px; color: #5b6472; flex: none; }
.funnel-track { flex: 1; height: 26px; background: #f4f6f9; border-radius: 7px; overflow: hidden; }
.funnel-track i {
  display: block; height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, #ffc39c, #ff6b35);
}
.funnel-value { width: 84px; text-align: right; font-weight: 700; color: #232936; font-variant-numeric: tabular-nums; }
.funnel-rate { width: 74px; text-align: right; color: #98a1af; font-size: 12px; }

/* IP 明细 */
.ip-table td { font-size: 12.5px; }
.ip-table .muted { color: #a9b1bd; }
.stat-daily td { vertical-align: middle; }
.kv-mini { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 16px; font-size: 13px; }
.kv-mini > div { display: flex; justify-content: space-between; color: #5b6472; padding: 4px 0; border-bottom: 1px dashed #f0f3f7; }
.kv-mini b { color: #232936; }

@media (max-width: 1500px) {
  .mini-grid.mini-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1320px) {
  .kpi-grid.kpi-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .kpi-grid.kpi-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-grid.mini-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== 支付方式选择 ===== */
.rc-channels {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px;
}
.rc-channel {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: #444; cursor: pointer;
}
.rc-channel img { width: 18px; height: 18px; border-radius: 4px; display: block; }
.rc-channel.selected {
  border-color: #ff6a2c; color: #ff6a2c; font-weight: 700;
  background: #fff4ef; box-shadow: 0 0 0 1px #ff6a2c inset;
}

/* 转化健康度 */
.conv-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.conv-strip > div { background: #fafbfc; border: 1px solid #eef1f5; border-radius: 9px; padding: 10px 12px; }
.conv-strip span { font-size: 12px; color: #8b95a5; display: block; }
.conv-strip b { font-size: 18px; color: #232936; display: block; margin: 4px 0 2px; }
.conv-strip em { font-size: 11px; font-style: normal; color: #a9b1bd; }
@media (max-width: 1100px) { .conv-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== 访客登录 / 注册弹层 ===== */
.auth-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .55); z-index: 10010;
  display: none; align-items: flex-end; justify-content: center;
}
.auth-mask.open { display: flex; }
.auth-sheet {
  width: 100%; max-width: 480px; background: #fff; border-radius: 20px 20px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); position: relative;
  box-shadow: 0 -6px 26px rgba(0, 0, 0, .18);
}
.auth-handle { width: 40px; height: 4px; border-radius: 2px; background: #e6e6e6; margin: 0 auto 10px; }
.auth-close {
  position: absolute; top: 10px; right: 12px; width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 50%; background: #f4f4f4; color: #999;
  font-size: 15px; line-height: 22px; cursor: pointer;
}
.auth-title { font-size: 17px; font-weight: 700; color: #222; text-align: center; margin: 6px 0 14px; }
.auth-tabs { display: flex; background: #f5f6f7; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button {
  flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 0;
  font-size: 14px; color: #666; font-family: inherit; cursor: pointer;
}
.auth-tabs button.on { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.auth-field { display: block; margin-bottom: 12px; }
.auth-field span { display: block; font-size: 12px; color: #888; margin-bottom: 5px; }
.auth-field input {
  width: 100%; border: 1px solid #e8e8e8; background: #fafafa; border-radius: 10px;
  padding: 11px 12px; font-size: 15px; outline: none; font-family: inherit; color: #222;
}
.auth-field input:focus { border-color: #ffb27a; background: #fff; }
.auth-err { min-height: 16px; color: #e5484d; font-size: 12px; margin: 2px 0 8px; }
.auth-submit {
  width: 100%; border: 0; border-radius: 24px; padding: 12px 0; font-size: 16px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--primary), #ff9068);
  font-family: inherit; cursor: pointer;
}
.auth-submit:disabled { opacity: .72; }
.auth-tip { text-align: center; font-size: 11px; color: #aaa; margin-top: 12px; }

/* ===== 手机端输入框聚焦防放大 =====
   iOS Safari 在输入框字号 <16px 时聚焦会强制放大页面（maximum-scale=1 也会被忽略），
   手机宽度下把前台输入类控件统一提到 16px */
@media (max-width: 520px) {
  .search-box input[type=text],
  .form-group input[type=text], .form-group input[type=password], .form-group input[type=number],
  .form-group select, .form-group textarea,
  .auth-field input {
    font-size: 16px;
  }
}


/* ==================== 本地收银台（模拟支付） ==================== */
.cs-page { padding: 12px 14px 0; }
.cs-head {
  background: linear-gradient(135deg, #ff8a4c, var(--primary));
  border-radius: 16px; padding: 20px 18px 16px; color: #fff;
  box-shadow: 0 8px 20px rgba(255, 107, 53, .22);
}
.cs-label { font-size: 13px; opacity: .9; }
.cs-big { font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -.5px; }
.cs-big small { font-size: 20px; font-weight: 600; margin-right: 3px; }
.cs-product { font-size: 13px; opacity: .95; margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.cs-product em { font-style: normal; background: rgba(255,255,255,.22); border-radius: 20px; padding: 1px 8px; font-size: 12px; }
.cs-countdown { margin-top: 12px; font-size: 12px; opacity: .9; background: rgba(0,0,0,.10); display: inline-block; padding: 4px 10px; border-radius: 20px; }
.cs-countdown b { font-variant-numeric: tabular-nums; }

.cs-block { background: var(--card); border-radius: 14px; padding: 14px; margin-top: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.cs-block-t { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.cs-ways { display: flex; gap: 10px; }
.cs-way {
  flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; transition: .15s;
}
.cs-way.selected { border-color: var(--primary); background: #fff5ef; }
.cs-way-ico {
  width: 22px; height: 22px; border-radius: 6px; color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 22px;
}
.cs-way-ico.wx { background: #21c05a; }
.cs-way-ico.ali { background: #1677ff; }
.cs-way-t { font-size: 14px; }

.cs-info div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; }
.cs-info div span { color: var(--muted); flex: 0 0 auto; }
.cs-info div b { font-weight: 500; text-align: right; word-break: break-all; }

.cs-btn {
  display: block; width: 100%; text-align: center; border: 0; border-radius: 12px;
  font-size: 16px; font-weight: 600; padding: 14px; margin-top: 12px; cursor: pointer;
  font-family: inherit; text-decoration: none; line-height: 1.2;
}
.cs-btn-main { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(255,107,53,.28); }
.cs-btn-main:active { background: var(--primary-dark); }
.cs-btn-main[disabled] { opacity: .7; }
.cs-btn-ghost { background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; border: 1px solid var(--line); }
.cs-tip { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.55; }

.cs-result { background: var(--card); border-radius: 16px; padding: 28px 18px 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cs-ico { font-size: 46px; line-height: 1; }
.cs-rtitle { font-size: 19px; font-weight: 700; margin-top: 12px; }
.cs-ok .cs-rtitle { color: #1a9e54; }
.cs-closed .cs-rtitle { color: #8a8f99; }
.cs-rsub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.cs-amt { font-size: 26px; font-weight: 700; margin-top: 12px; color: var(--text); }
.cs-meta { text-align: left; margin: 16px 0 4px; border-top: 1px dashed var(--line); padding-top: 12px; }
.cs-meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; }
.cs-meta div span { color: var(--muted); }
.cs-meta div b { font-weight: 500; text-align: right; word-break: break-all; }

/* 待支付订单提醒条（充值页顶部） */
.rc-pending {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff8f3; border: 1px solid #ffe0cc; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 10px; text-decoration: none; color: var(--text);
}
.rc-pending-t { font-size: 14px; font-weight: 600; color: var(--primary); }
.rc-pending-s { font-size: 12px; color: var(--muted); }
.rc-pending-go { margin-left: auto; font-size: 13px; color: var(--primary); }

/* 收银台：无可用支付通道时的提示 */
.cs-warn {
  background: #fff7e6; border: 1px solid #ffe0a3; color: #a8660a;
  border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.6; margin-top: 12px;
}
