/* ============ 拷贝漫画阅读器 - 暗色主题 v2 ============ */
:root {
  --bg: #0b0c11;
  --bg-2: #14161d;
  --bg-3: #1c1f29;
  --card: #161923;
  --border: #262a38;
  --border-light: #333850;
  --text: #eceef4;
  --text-dim: #8f96a8;
  --accent: #ff5c8a;
  --accent-2: #ff8fb1;
  --violet: #8b5cf6;
  --accent-dark: #a61e4d;
  --ok: #51cf66;
  --warn: #ffd43b;
  --radius: 14px;
  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.6);
  --glow-accent: 0 4px 24px rgba(255, 92, 138, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 氛围光晕背景 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 40% at 12% -5%, rgba(255, 92, 138, 0.09), transparent 60%),
    radial-gradient(ellipse 50% 45% at 95% 15%, rgba(139, 92, 246, 0.08), transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(255, 92, 138, 0.05), transparent 65%);
  pointer-events: none;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #ffd0e0; }

::selection { background: rgba(255, 92, 138, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #33384a, #262a38);
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #4a5170; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶栏（毛玻璃） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 12, 17, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px;
}
.logo { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.logo-mark {
  font-size: 23px; font-weight: 900; letter-spacing: 1.5px;
  background: linear-gradient(120deg, var(--accent), var(--violet));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sub {
  font-size: 12px; color: var(--text-dim); letter-spacing: 2px;
  padding-left: 9px; border-left: 1px solid var(--border-light);
}

/* 搜索框 */
.search-box { flex: 1; max-width: 440px; display: flex; position: relative; }
.search-box input {
  width: 100%; padding: 10px 40px 10px 16px;
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  border: 1px solid var(--border); border-radius: 22px;
  outline: none; font-size: 14px;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.search-box input::placeholder { color: #6a7186; }
.search-box input:focus {
  border-color: var(--accent);
  background: rgba(255, 92, 138, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.14);
}
.search-box button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--text-dim); padding: 6px 10px; border-radius: 50%;
  transition: color .2s, background .2s;
}
.search-box button:hover { color: var(--accent-2); background: rgba(255, 92, 138, 0.12); }

/* 导航 */
.nav-tabs { display: flex; gap: 2px; margin-left: auto; }
.nav-tabs a {
  position: relative;
  padding: 8px 17px; border-radius: 20px; font-size: 14px; font-weight: 500;
  color: var(--text-dim); transition: color .2s, background .2s;
}
.nav-tabs a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-tabs a.active {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  box-shadow: 0 3px 14px rgba(255, 92, 138, 0.35);
}
/* 顶栏「下载APP」按钮（仅网页版显示） */
.nav-tabs a[data-dl-app] {
  color: #fff;
  border: 1px solid rgba(255, 92, 138, 0.55);
  background: linear-gradient(120deg, rgba(255, 92, 138, 0.16), rgba(255, 92, 138, 0.05));
  margin-left: 6px;
}
.nav-tabs a[data-dl-app]:hover {
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  box-shadow: 0 3px 14px rgba(255, 92, 138, 0.35);
}

/* ---------- 视图容器 ---------- */
.view { max-width: 1240px; margin: 0 auto; padding: 26px 20px 90px; }

.view-section-title {
  font-size: 20px; font-weight: 800; margin: 8px 0 18px;
  display: flex; align-items: center; gap: 12px; letter-spacing: 0.5px;
}
.view-section-title::before {
  content: ""; width: 5px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--violet));
  box-shadow: 0 0 12px rgba(255, 92, 138, 0.5);
}

/* ---------- 漫画网格 ---------- */
.comic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 20px 16px;
}
.comic-card {
  cursor: pointer; transition: transform .22s cubic-bezier(.34,1.56,.64,1);
  animation: rise .45s ease backwards;
}
.comic-card:nth-child(-n+12) { animation-delay: calc(var(--i, 0) * 0s + 0.03s); }
.comic-card:nth-child(2n) { animation-delay: .05s; }
.comic-card:nth-child(3n) { animation-delay: .09s; }
.comic-card:hover { transform: translateY(-6px); }

.comic-card .cover {
  position: relative; aspect-ratio: 3/4; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: box-shadow .25s, border-color .25s;
}
.comic-card:hover .cover {
  border-color: rgba(255, 92, 138, 0.55);
  box-shadow: var(--glow-accent), var(--shadow-pop);
}
.comic-card .cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .45s ease, filter .3s;
}
.comic-card:hover .cover img { transform: scale(1.07); }

/* 封面底部渐隐 + 状态标签 */
.comic-card .cover::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none; opacity: 0; transition: opacity .25s;
}
.comic-card:hover .cover::after { opacity: 1; }

.comic-card .cover .status-tag {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
  color: #ffd9e4; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 9px;
  border: 1px solid rgba(255, 143, 177, 0.35);
}
.comic-card .name {
  margin-top: 10px; font-size: 13.5px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--text);
  transition: color .2s;
}
.comic-card:hover .name { color: var(--accent-2); }
.comic-card .author {
  margin-top: 3px; font-size: 12px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 加载更多 / 空态 ---------- */
.load-more-row { text-align: center; margin: 32px 0 10px; }
.btn-load {
  padding: 10px 32px; border-radius: 22px; border: 1px solid var(--border-light);
  background: var(--bg-3); color: var(--text); cursor: pointer; font-size: 14px;
  transition: all .22s;
}
.btn-load:hover {
  border-color: var(--accent); color: var(--accent-2);
  box-shadow: var(--glow-accent); transform: translateY(-2px);
}
.empty-state {
  text-align: center; padding: 90px 20px; color: var(--text-dim);
  animation: rise .4s ease;
}
.empty-state .icon { font-size: 52px; margin-bottom: 16px; filter: grayscale(0.3); }
.empty-state small { color: #6a7186; }

/* ---------- 详情页 ---------- */
.detail-hero {
  display: flex; gap: 30px; padding: 10px 0 30px;
  border-bottom: 1px solid var(--border);
  animation: rise .4s ease;
  position: relative;
}
.detail-cover {
  width: 225px; flex-shrink: 0; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-pop), 0 0 40px rgba(255, 92, 138, 0.12);
  transition: transform .3s;
}
.detail-cover:hover { transform: scale(1.02) rotate(-0.5deg); }
.detail-cover img { width: 100%; display: block; }
.detail-info { flex: 1; min-width: 0; }
.detail-title {
  font-size: 27px; font-weight: 900; margin-bottom: 14px; line-height: 1.35;
  background: linear-gradient(120deg, #fff, #ffd9e4);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.detail-meta { font-size: 13.5px; color: var(--text-dim); line-height: 2.1; }
.detail-meta b { color: var(--text); font-weight: 600; }
.detail-meta .tag {
  display: inline-block; background: rgba(255, 92, 138, 0.1); color: var(--accent-2);
  border: 1px solid rgba(255, 92, 138, 0.25);
  padding: 2.5px 11px; border-radius: 12px; margin-right: 6px; font-size: 12.5px;
  transition: background .2s, transform .2s;
}
.detail-meta .tag:hover { background: rgba(255, 92, 138, 0.2); transform: translateY(-1px); }
.detail-intro {
  margin-top: 16px; font-size: 14px; line-height: 1.9; color: var(--text-dim);
  background: var(--bg-2); padding: 15px 19px; border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
}
.detail-intro::before {
  content: "简介"; position: absolute; top: -9px; left: 14px;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px;
  border-radius: 9px; letter-spacing: 1px;
}
.detail-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  padding: 11px 28px; border-radius: 22px; border: none; cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  color: #fff; font-size: 14.5px; font-weight: 700; letter-spacing: 0.5px;
  box-shadow: var(--glow-accent);
  transition: transform .2s, filter .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.12); box-shadow: 0 8px 30px rgba(255, 92, 138, 0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  padding: 11px 24px; border-radius: 22px; cursor: pointer;
  background: transparent; border: 1px solid var(--border-light); color: var(--text-dim);
  font-size: 14px; transition: all .22s;
}
.btn-ghost:hover {
  border-color: var(--accent); color: var(--accent-2);
  background: rgba(255, 92, 138, 0.07); transform: translateY(-2px);
}

/* 章节列表 */
.chapter-section { margin-top: 34px; }
.chapter-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.chapter-item {
  padding: 12px 16px; border-radius: 11px; background: var(--card);
  border: 1px solid var(--border); cursor: pointer; font-size: 13.5px;
  color: var(--text); transition: all .18s; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: relative;
}
.chapter-item::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 92, 138, 0.12), transparent 65%);
  opacity: 0; transition: opacity .2s;
}
.chapter-item:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); }
.chapter-item:hover::before { opacity: 1; }
.chapter-item.locked { color: var(--text-dim); cursor: not-allowed; opacity: .45; }
.chapter-warn {
  padding: 15px 19px; border-radius: var(--radius); font-size: 14px; line-height: 1.7;
  background: rgba(255, 212, 59, 0.07); border: 1px solid rgba(255, 212, 59, 0.28);
  color: var(--warn); margin: 14px 0;
}

/* ---------- 批量下载选择模式 ---------- */
.chapter-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.chapter-head .view-section-title { margin-bottom: 0; }
.btn-mini {
  padding: 7px 13px; font-size: 12.5px; border-radius: 9px; cursor: pointer;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  transition: all .15s; white-space: nowrap; font-family: inherit;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent-2); }
.btn-mini.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-mini.accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-mini:disabled { opacity: .45; cursor: default; }

body.selecting .chapter-item { cursor: pointer; padding-left: 40px; }
body.selecting .chapter-item:not(.locked)::after {
  content: ""; position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  font-size: 11px; line-height: 15px; text-align: center;
  color: #fff; transition: all .15s;
}
body.selecting .chapter-item.sel {
  border-color: var(--accent);
  background: rgba(255, 92, 138, 0.13);
  color: var(--accent-2);
}
body.selecting .chapter-item.sel::after {
  content: "✓"; background: var(--accent); border-color: var(--accent);
}
body.selecting .chapter-item.range-a { border-color: var(--violet); color: var(--violet); }
body.selecting .chapter-item.range-a::after {
  content: "A"; background: var(--violet); border-color: var(--violet);
}

.dl-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; border-radius: 14px;
  background: rgba(22, 24, 32, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 92, 138, 0.35);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  animation: fadeIn .2s;
  max-width: calc(100vw - 24px);
}
.dl-bar[hidden] { display: none; }
.dl-bar-info { font-size: 13px; color: var(--text); white-space: nowrap; }
.dl-bar-btns { display: flex; gap: 7px; }
.dl-save.ok { color: var(--ok, #4ade80); }

/* 我的下载 */
.dl-progress {
  height: 4px; border-radius: 2px; overflow: hidden;
  background: rgba(255, 255, 255, 0.08); margin: 8px 0 5px;
}
.dl-progress i {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width .5s;
}
.dl-item.readable { cursor: pointer; }
.cover-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff; font-size: 34px; font-weight: 800;
}
.cover-ph.big { font-size: 64px; aspect-ratio: 3 / 4; border-radius: var(--radius); }
.dl-ch { display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.dl-ch .dl-ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.dl-del {
  flex: none; width: 34px; height: 34px; line-height: 32px; text-align: center;
  border-radius: 50%; font-size: 14px; color: var(--text-dim); margin-left: 4px;
  border: 1px solid var(--border); transition: all .15s; cursor: pointer;
}
.dl-del:hover { background: rgba(255, 92, 138, 0.18); border-color: var(--accent); color: var(--accent); }
.dl-read-tag {
  font-size: 12px; color: var(--accent-2); white-space: nowrap;
  border: 1px solid rgba(255, 92, 138, 0.4); padding: 4px 10px; border-radius: 99px;
  transition: all .15s;
}
.dl-item.readable:hover .dl-read-tag { background: rgba(255, 92, 138, 0.14); }
.local-tag {
  font-size: 11.5px; color: var(--accent-2); white-space: nowrap;
  border: 1px solid rgba(255, 92, 138, 0.4); padding: 2px 9px; border-radius: 99px;
}

@media (max-width: 700px) {
  .dl-bar {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));  /* 避开底部导航 */
    flex-wrap: wrap; justify-content: center; row-gap: 8px; padding: 10px 12px;
  }
  .dl-bar-info { width: 100%; text-align: center; }
}

/* ---------- 排行榜 ---------- */
.rank-boards { display: flex; flex-direction: column; gap: 30px; }
.rank-board-title {
  font-size: 16.5px; font-weight: 700; margin-bottom: 14px; color: var(--accent-2);
  display: flex; align-items: center; gap: 8px;
}
.rank-board-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255, 92, 138, 0.4), transparent);
}
.rank-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 13px; padding: 9px 14px;
  border-radius: 12px; cursor: pointer; transition: background .18s, transform .18s;
  border: 1px solid transparent;
}
.rank-item:hover {
  background: var(--bg-2); transform: translateX(4px);
  border-color: var(--border);
}
.rank-no {
  width: 27px; height: 27px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 9px; font-weight: 800; font-size: 13px;
  background: var(--bg-3); color: var(--text-dim);
  transition: transform .18s;
}
.rank-item:hover .rank-no { transform: scale(1.12); }
.rank-item:nth-child(1) .rank-no { background: linear-gradient(135deg, #ffd76e, #f7a325); color: #5c3a00; box-shadow: 0 2px 10px rgba(247, 163, 37, 0.4); }
.rank-item:nth-child(2) .rank-no { background: linear-gradient(135deg, #dfe3ea, #a0a6b3); color: #333; }
.rank-item:nth-child(3) .rank-no { background: linear-gradient(135deg, #e8a075, #c76b3a); color: #fff; }
.rank-name { flex: 1; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item:hover .rank-name { color: var(--accent-2); }

/* ---------- 题材页 ---------- */
.theme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px;
}
.theme-item {
  padding: 15px 16px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--border); cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text); text-align: center; transition: all .2s;
  position: relative; overflow: hidden;
}
.theme-item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255, 92, 138, 0.12), rgba(139, 92, 246, 0.1));
  opacity: 0; transition: opacity .25s;
}
.theme-item:hover {
  border-color: var(--accent); color: var(--accent-2);
  transform: translateY(-3px); box-shadow: var(--glow-accent);
}
.theme-item:hover::after { opacity: 1; }

/* ---------- 阅读器 ---------- */
.reader-top {
  position: sticky; top: 0; z-index: 90;
  background: rgba(11, 12, 17, 0.82); backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 18px; display: flex; align-items: center; gap: 14px;
}
.reader-top .back {
  cursor: pointer; color: var(--text-dim); font-size: 24px; line-height: 1;
  padding: 2px 8px; border-radius: 8px; transition: color .2s, background .2s;
}
.reader-top .back:hover { color: var(--accent-2); background: rgba(255, 92, 138, 0.1); }
.reader-title {
  font-size: 14.5px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.reader-top select {
  margin-left: auto; background: var(--bg-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 12px; font-size: 13px; outline: none; max-width: 210px;
  cursor: pointer; transition: border-color .2s;
}
.reader-top select:hover, .reader-top select:focus { border-color: var(--accent); }
.reader-nav { display: flex; gap: 8px; }
.reader-nav.local-only { margin-left: auto; }
.reader-nav button {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 15px; cursor: pointer; font-size: 13px;
  transition: all .18s;
}
.reader-nav button:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent-2);
  background: rgba(255, 92, 138, 0.08);
}
.reader-nav button:disabled { opacity: .3; cursor: not-allowed; }
.reader-nav button.ghost {
  opacity: .55; font-size: 15px; padding: 8px 11px;
}
.reader-nav button.ghost:hover { opacity: 1; }

/* 页面大小设置面板 */
.rset-panel {
  position: fixed; top: 64px; right: 16px; z-index: 120;
  width: 240px; padding: 14px 16px; border-radius: 14px;
  background: rgba(20, 22, 30, 0.72);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 92, 138, 0.28);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: fadeIn .18s;
}
.rset-panel[hidden] { display: none; }
.rset-title {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.rset-title::before { content: "📐"; font-size: 13px; }
.rset-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.rset-chips button {
  padding: 6px 4px; font-size: 11.5px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--text-dim);
  border: 1px solid var(--border); transition: all .15s; font-family: inherit;
}
.rset-chips button:hover { border-color: var(--accent); color: var(--accent-2); }
.rset-chips button.on {
  background: rgba(255, 92, 138, 0.16); border-color: var(--accent);
  color: var(--accent-2); font-weight: 600;
}
.rset-slider-row { display: flex; align-items: center; gap: 10px; }
.rset-slider-row input[type="range"] {
  flex: 1; accent-color: var(--accent); cursor: pointer;
}
.rset-val { font-size: 12.5px; color: var(--accent-2); font-weight: 700; min-width: 38px; text-align: right; }

.reader-body { max-width: 880px; margin: 0 auto; padding: 12px 0 50px; }
.reader-body img {
  display: block; width: var(--reader-w, 100%); margin: 0 auto 6px; border-radius: 6px;
  background:
    linear-gradient(90deg, #14161d 40%, #1c1f29 50%, #14161d 60%) #14161d;
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 40px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.reader-body img.loaded {
  animation: fadeIn .4s ease, none;
  background: #14161d;
}
.reader-end {
  text-align: center; padding: 36px 0 10px; color: var(--text-dim); font-size: 14px;
  letter-spacing: 2px;
}
.reader-pbar {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 200;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  box-shadow: 0 0 8px rgba(255, 92, 138, 0.6);
  transition: width .15s; border-radius: 0 2px 2px 0;
}

/* ---------- 搜索页 ---------- */
.search-head { margin-bottom: 20px; animation: rise .4s ease; }
.search-head h2 { font-size: 21px; font-weight: 800; }
.search-head h2 em {
  font-style: normal; color: var(--accent);
}
.search-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 5px; }

/* ---------- 无限滚动 / 更新标记 / 下载管理 ---------- */
.scroll-sentinel { height: 1px; }
.the-end { color: #6a7186; font-size: 13px; letter-spacing: 2px; }

.upd-tag {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 9px;
  box-shadow: 0 2px 10px rgba(255, 92, 138, 0.5);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.nav-tabs a.has-update::after, .bottom-nav a.has-update .bicon::after {
  content: ""; position: absolute;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px rgba(255, 92, 138, 0.9);
}
.nav-tabs a.has-update { position: relative; }
.nav-tabs a.has-update::after { top: 5px; right: 9px; }
.bottom-nav a.has-update { position: relative; }
.bottom-nav a.has-update .bicon { position: relative; }
.bottom-nav a.has-update .bicon::after { top: -1px; right: -4px; }

.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; transition: border-color .18s, transform .18s;
  color: var(--text);
}
.dl-item:hover { border-color: rgba(255, 92, 138, 0.5); transform: translateY(-2px); color: var(--text); }
.dl-icon { font-size: 22px; }
.dl-info { flex: 1; min-width: 0; }
.dl-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-size { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.dl-save {
  flex: none; font-size: 12.5px; font-weight: 700; color: var(--accent-2);
  border: 1px solid rgba(255, 92, 138, 0.4); border-radius: 14px; padding: 5px 14px;
  transition: background .2s;
}
.dl-item:hover .dl-save { background: rgba(255, 92, 138, 0.12); }

/* ---------- 章节分组 / 上次阅读标记 ---------- */
.chapter-group-title {
  color: var(--text-dim); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  margin: 18px 0 10px; padding-left: 10px; border-left: 3px solid var(--accent);
}
.chapter-item.last-read {
  border-color: var(--accent); color: var(--accent-2); font-weight: 700;
  background: rgba(255, 92, 138, 0.08);
}
.chapter-item.last-read::after { content: " •"; color: var(--accent); }

/* ---------- 阅读历史（书架页） ---------- */
.hist-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.hist-item {
  display: flex; align-items: center; gap: 15px;
  background: var(--card); border: 1px solid var(--border); border-radius: 13px;
  padding: 11px 15px; cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s;
  animation: rise .4s ease backwards;
}
.hist-item:hover {
  border-color: rgba(255, 92, 138, 0.5); transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.hist-item img {
  width: 46px; height: 60px; object-fit: cover; border-radius: 7px; flex: none;
  background: var(--bg-3);
}
.hist-info { flex: 1; min-width: 0; }
.hist-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-last { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-time { color: #6a7186; font-size: 11px; margin-top: 2px; }
.btn-continue { flex: none; }
.hist-item .btn-load { pointer-events: auto; }

/* ---------- Toast / Loading ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(28, 31, 41, 0.95); backdrop-filter: blur(12px);
  color: var(--text); padding: 12px 24px; border-radius: 24px;
  border: 1px solid var(--border-light); font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .28s;
  z-index: 300; box-shadow: var(--shadow-pop);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.warn { border-color: rgba(255, 212, 59, 0.5); color: var(--warn); }

.loading {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 18px;
  align-items: center; justify-content: center; background: rgba(11, 12, 17, 0.78);
  backdrop-filter: blur(6px); z-index: 400;
}
.loading[hidden] { display: none; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--bg-3); border-top-color: var(--accent);
  border-right-color: var(--violet);
  animation: spin .85s cubic-bezier(.5,.15,.5,.85) infinite;
}
.loading span { color: var(--text-dim); font-size: 13.5px; letter-spacing: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 底部导航（手机） ---------- */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
  background: rgba(11, 12, 17, 0.88);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; font-size: 11px; color: var(--text-dim); border-radius: 10px;
  transition: color .2s;
}
.bottom-nav a .bicon { font-size: 20px; line-height: 1; }
.bottom-nav a.active { color: var(--accent-2); }
.bottom-nav a.active .bicon { transform: translateY(-1px) scale(1.1); }

/* ---------- 动画 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.view > * { animation: rise .4s ease backwards; }
.view > *:nth-child(2) { animation-delay: .05s; }
.view > *:nth-child(3) { animation-delay: .1s; }

/* ---------- 响应式 ---------- */
@media (max-width: 700px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .logo-sub { display: none; }
  .nav-tabs { display: none; }
  .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
  .bottom-nav { display: flex; }
  .view { padding: 18px 14px 110px; }
  .detail-hero { flex-direction: column; align-items: center; text-align: center; gap: 20px; }
  .detail-cover { width: 175px; }
  .detail-actions { justify-content: center; }
  .comic-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
  .chapter-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .reader-top select { max-width: 120px; }
}

/* ---------- 发现页：轮播 + 排行侧栏 ---------- */
.hero-wrap {
  display: grid; grid-template-columns: 1fr 280px; gap: 20px;
  margin: 8px 0 26px; align-items: stretch;
}
.hero-carousel {
  position: relative; width: 100%; aspect-ratio: 21/9; align-self: start;
  border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-card); background: var(--bg-3);
  cursor: pointer;
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .8s ease; pointer-events: none;
}
.hero-slide.on { opacity: 1; pointer-events: auto; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.02);
}
.hero-slide.on img { animation: heroZoom 6s ease forwards; }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1.0); } }
.hero-mask {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,12,17,0.88) 0%, rgba(11,12,17,0.45) 45%, rgba(11,12,17,0.05) 75%),
              linear-gradient(0deg, rgba(11,12,17,0.55), transparent 40%);
}
.hero-txt {
  position: absolute; left: 34px; bottom: 30px; right: 40%;
  cursor: pointer;
}
.hero-name {
  font-size: 26px; font-weight: 900; line-height: 1.3;
  text-shadow: 0 2px 14px rgba(0,0,0,0.8);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-author {
  margin-top: 8px; font-size: 13px; color: rgba(236,238,244,0.75);
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}
.hero-btn {
  display: inline-block; margin-top: 14px; padding: 8px 22px;
  border-radius: 20px; font-size: 13.5px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  box-shadow: var(--glow-accent);
}
.hero-dots {
  position: absolute; right: 16px; bottom: 14px; display: flex; gap: 7px; z-index: 3;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.35); transition: all .25s;
}
.hero-dot.on { width: 22px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 8px rgba(255,92,138,0.7); }

/* 排行侧栏 */
.rank-side {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
}
.rank-side-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 8px;
}
.rank-side-title { font-size: 15px; font-weight: 800; white-space: nowrap; }
.rank-side-tabs { display: flex; gap: 3px; }
.rank-side-tabs button {
  padding: 3px 9px; font-size: 11.5px; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-dim); border: 1px solid transparent;
  font-family: inherit; transition: all .15s;
}
.rank-side-tabs button:hover { color: var(--accent-2); }
.rank-side-tabs button.on {
  background: rgba(255,92,138,0.14); color: var(--accent-2);
  border-color: rgba(255,92,138,0.35); font-weight: 700;
}
.rank-side .rank-side-item {
  display: flex; align-items: center; gap: 12px; padding: 7px 6px;
  border-radius: 9px; cursor: pointer; transition: background .15s, transform .15s;
}
.rank-side .rank-side-item:hover { background: var(--bg-2); transform: translateX(3px); }
.rank-side .rank-side-item .rank-no {
  width: 24px; height: 24px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 8px; font-weight: 800; font-size: 12px;
  background: var(--bg-3); color: var(--text-dim);
}
.rank-side .rank-side-item:nth-child(2) .rank-no { background: linear-gradient(135deg, #ffd76e, #f7a325); color: #5c3a00; }
.rank-side .rank-side-item:nth-child(3) .rank-no { background: linear-gradient(135deg, #dfe3ea, #a0a6b3); color: #333; }
.rank-side .rank-side-item:nth-child(4) .rank-no { background: linear-gradient(135deg, #e8a075, #c76b3a); color: #fff; }
.rank-side .rank-side-item .rank-name {
  flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-side .rank-side-item:hover .rank-name { color: var(--accent-2); }

/* 题材快捷条 */
.theme-chips-row {
  display: flex; align-items: center; gap: 9px; margin: 0 0 24px;
  overflow-x: auto; padding-bottom: 4px; scrollbar-width: none;
}
.theme-chips-row::-webkit-scrollbar { display: none; }
.chip-label { font-size: 13px; color: var(--text-dim); flex-shrink: 0; letter-spacing: 1px; }
.theme-chip {
  flex-shrink: 0; padding: 7px 16px; border-radius: 18px; font-size: 13px;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  cursor: pointer; font-family: inherit; transition: all .18s; white-space: nowrap;
}
.theme-chip:hover {
  border-color: var(--accent); color: var(--accent-2);
  background: rgba(255,92,138,0.09); transform: translateY(-2px);
}

/* ---------- 我的（个人中心） ---------- */
.me-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 38px 20px 30px; margin-bottom: 24px;
  background: linear-gradient(160deg, rgba(255,92,138,0.08), rgba(139,92,246,0.06)), var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  animation: rise .4s ease;
}
.me-avatar-wrap {
  position: relative; cursor: pointer; width: 96px; height: 96px;
}
.me-avatar-big {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; background: linear-gradient(135deg, var(--accent), var(--violet));
  border: 3px solid rgba(255,255,255,0.14);
  box-shadow: var(--glow-accent);
}
img.me-avatar-big { background: var(--bg-3); }
.me-avatar-edit {
  position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--bg-3); border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.me-name { margin-top: 16px; font-size: 21px; font-weight: 800; }
.me-sub { margin-top: 6px; font-size: 13px; color: var(--text-dim); }
.me-stats { display: flex; gap: 34px; margin-top: 18px; }
.me-stat { display: flex; flex-direction: column; align-items: center; }
.me-stat b { font-size: 22px; font-weight: 900; color: var(--accent-2); }
.me-stat span { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.me-btns { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; justify-content: center; }

.me-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 16px; animation: rise .4s ease backwards;
}
.me-card-title {
  font-size: 14.5px; font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; letter-spacing: 0.5px;
}
.me-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.me-card .me-row:first-of-type { border-top: none; }
.me-row-info { flex: 1; min-width: 0; }
.me-row-name { font-size: 14px; font-weight: 600; }
.me-row-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; word-break: break-all; }
.me-row-sub a { cursor: pointer; color: var(--accent-2); }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.emoji-grid button {
  aspect-ratio: 1; font-size: 22px; border-radius: 11px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--border);
  transition: all .15s; font-family: inherit;
}
.emoji-grid button:hover { border-color: var(--accent); transform: scale(1.1); }
.emoji-grid button.on {
  border-color: var(--accent); background: rgba(255,92,138,0.14);
  box-shadow: 0 0 10px rgba(255,92,138,0.25);
}

/* 开关 */
.switch { position: relative; flex-shrink: 0; }
.switch input { display: none; }
.switch i {
  display: block; width: 46px; height: 26px; border-radius: 15px;
  background: var(--bg-3); border: 1px solid var(--border-light);
  cursor: pointer; transition: background .2s; position: relative;
}
.switch i::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #6a7186;
  transition: all .22s cubic-bezier(.34,1.56,.64,1);
}
.switch input:checked + i { background: rgba(255,92,138,0.35); border-color: var(--accent); }
.switch input:checked + i::after { left: 22px; background: var(--accent); box-shadow: 0 0 8px rgba(255,92,138,0.6); }

/* 底栏头像（图片型） */
.bottom-nav .me-ico.img {
  background-size: cover; background-position: center;
  border-radius: 50%; border: 1.5px solid var(--accent);
  width: 22px; height: 22px; display: inline-block;
}

/* ---------- 登录 / 注册弹窗 ---------- */
.auth-mask {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(5,6,10,0.72); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s; padding: 20px;
}
.auth-card {
  position: relative; width: 360px; max-width: 100%;
  background: var(--bg-2); border: 1px solid var(--border-light);
  border-radius: 20px; padding: 34px 32px 26px;
  box-shadow: var(--shadow-pop);
  animation: rise .35s cubic-bezier(.34,1.4,.64,1);
  max-height: 92vh; overflow-y: auto;
}
.auth-close {
  position: absolute; right: 14px; top: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: none; background: transparent; color: var(--text-dim);
  font-size: 14px; cursor: pointer; transition: all .15s;
}
.auth-close:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  box-shadow: var(--glow-accent);
}
.auth-title { text-align: center; font-size: 19px; font-weight: 900; }
.auth-sub { text-align: center; font-size: 12.5px; color: var(--text-dim); margin: 8px 0 20px; }
.auth-label { display: block; font-size: 12.5px; color: var(--text-dim); margin: 14px 0 6px; }
.auth-card input[type="text"], .auth-card input[type="password"], .auth-card input[type="url"] {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.05); color: var(--text);
  border: 1px solid var(--border); outline: none; font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,92,138,0.14); }
.auth-adv { margin-top: 12px; }
.auth-adv-toggle {
  background: none; border: none; color: var(--text-dim); font-size: 12px;
  cursor: pointer; padding: 4px 0; font-family: inherit;
}
.auth-adv-toggle:hover { color: var(--accent-2); }
.auth-adv input[type="url"] { margin-top: 8px; font-size: 12.5px; }
.auth-err { color: var(--warn); font-size: 12.5px; min-height: 20px; margin-top: 10px; }
.auth-go { width: 100%; margin-top: 8px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 18px; }
.auth-switch a { cursor: pointer; font-weight: 700; }

/* ---------- 响应式（新增部分） ---------- */
@media (max-width: 900px) {
  .hero-wrap { grid-template-columns: 1fr; }
  .rank-side { display: none; }
}
@media (max-width: 700px) {
  .hero-carousel { aspect-ratio: 16/9; border-radius: 12px; }
  .hero-txt { left: 18px; bottom: 18px; right: 18%; }
  .hero-name { font-size: 18px; }
  .hero-author { display: none; }
  .hero-btn { padding: 6px 16px; font-size: 12px; margin-top: 8px; }
  .hero-dots { right: 12px; bottom: 10px; }
  .me-card { padding: 15px 16px; }
  .me-row { flex-wrap: wrap; }
}
