/* ==========================================================================
   cloud.it09.com · 书城风格（Bootstrap 5.3.8 之上的轻量主题层）
   设计目标：浅色卡片 + 强调色渐变头部 + 纯 CSS 书封，零图片、零第三方脚本
   ========================================================================== */

:root {
  --accent: #2563eb;
  --ink: #16181d;
  --ink-soft: #5b6472;
  --paper: #ffffff;
  --bg: #f4f6fb;
  --line: #e6e9f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 24, 38, .04), 0 12px 30px -18px rgba(18, 24, 38, .35);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  background: linear-gradient(135deg, var(--accent), #7aa7ff);
  box-shadow: 0 6px 16px -8px var(--accent);
}
.brand-mark.small { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
.brand-text { font-size: 1.05rem; letter-spacing: .5px; }
.site-nav { display: flex; gap: 4px; margin-left: 6px; }
.site-nav .nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: .95rem;
}
.site-nav .nav-link.active,
.site-nav .nav-link:hover { color: var(--accent); background: rgba(37, 99, 235, .08); }
.header-search { display: flex; gap: 8px; margin-left: auto; width: 300px; }
.header-search .form-control { border-radius: 9px; flex: 1 1 auto; width: auto; min-width: 0; }
.header-search .btn { flex: 0 0 auto; white-space: nowrap; }
.theme-toggle { border: 1px solid var(--line); background: transparent; color: var(--ink-soft); }
.btn-ghost { border: 1px solid var(--line); background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-brand {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  border-radius: 9px;
  font-weight: 600;
}
.btn-brand:hover { filter: brightness(1.06); color: #fff; }

.notice-bar {
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #ffe3a3;
  color: #8a5a00;
  font-size: .92rem;
}

/* ---------- 主区域 ---------- */
.site-main { display: block; padding-bottom: 32px; }

.hero {
  background:
    radial-gradient(1200px 320px at 12% -10%, rgba(37, 99, 235, .16), transparent 60%),
    radial-gradient(900px 260px at 88% 0%, rgba(124, 58, 237, .14), transparent 62%),
    #fff;
  border-bottom: 1px solid var(--line);
  padding: 54px 0 42px;
}
.hero-inner { max-width: 860px; }
.hero-eyebrow {
  color: var(--accent);
  font-size: .9rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero-title { font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.5px; margin-bottom: 22px; }
.hero-search { display: flex; gap: 10px; max-width: 620px; }
.hero-search .form-control { height: 52px; border-radius: 12px; border-color: var(--line); font-size: 1rem; flex: 1 1 auto; width: auto; min-width: 0; }
.hero-search .btn { padding: 0 26px; height: 52px; border-radius: 12px; flex: 0 0 auto; white-space: nowrap; }
.hero-stats { margin: 14px 0 0; color: var(--ink-soft); font-size: .9rem; }

.page-grid { padding-top: 28px; }
.page-head { padding-top: 26px; }
.page-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head-row h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-sub { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.crumbs { display: flex; gap: 6px; color: var(--ink-soft); font-size: .82rem; margin-bottom: 8px; }
.crumbs a:hover { color: var(--accent); }

/* ---------- 面板 ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; letter-spacing: .3px; }
.panel-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -1px;
}
.panel-more { color: var(--ink-soft); font-size: .82rem; }
.panel-more:hover { color: var(--accent); }
.panel-foot { margin-top: 18px; }
.panel + .panel { margin-top: 22px; }
.empty { color: var(--ink-soft); padding: 18px 0; text-align: center; margin: 0; }

/* ---------- 书卡 ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.book-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.book-card:hover {
  transform: translateY(-2px);
  border-color: var(--line);
  background: #fbfcfe;
  color: var(--ink);
}
.book-cover {
  flex: 0 0 46px;
  width: 46px;
  height: 62px;
  border-radius: 8px 10px 10px 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(150deg, hsl(var(--h) 62% 52%), hsl(var(--h2) 64% 40%));
  box-shadow: inset -6px 0 0 rgba(0, 0, 0, .12);
}
.book-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.book-name {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-meta { color: var(--ink-soft); font-size: .76rem; }
.book-tag {
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(37, 99, 235, .08);
  color: var(--accent);
  font-size: .72rem;
}

/* ---------- 列表 / 标签 ---------- */
.book-list { list-style: none; margin: 0; padding: 0; }
.book-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.book-list li:last-child { border-bottom: 0; }
.book-list-name { font-size: .92rem; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-list-tag { color: var(--ink-soft); font-size: .74rem; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: #f2f5fb;
  color: var(--ink-soft);
  font-size: .84rem;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.name-chip:hover { background: rgba(37, 99, 235, .1); color: var(--accent); }

/* ---------- 排行 ---------- */
.top-list { margin: 0; padding: 0; list-style: none; }
.top-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: .9rem;
}
.top-list li:last-child { border-bottom: 0; }
.top-list a { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-count { color: var(--ink-soft); font-size: .76rem; }
.rank-no {
  flex: 0 0 22px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.rank-no.hot { color: #fff; background: var(--accent); border-radius: 6px; line-height: 22px; }

.rank-list { margin: 0; padding: 0; list-style: none; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}
.rank-item:last-child { border-bottom: 0; }
.rank-name { flex: 1 1 auto; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-tag { color: var(--ink-soft); font-size: .76rem; }

.sticky-panel { position: sticky; top: 86px; }
.about-panel h2 { font-size: .95rem; font-weight: 700; margin-bottom: 8px; }

/* ---------- 搜索 ---------- */
.search-panel { padding: 0 2px 4px; }

/* ---------- 阅读 ---------- */
.reader { padding-top: 22px; max-width: 900px; margin-left: auto; margin-right: auto; }
.reader-head { padding: 16px 20px; }
.reader-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.reader-title-row h1 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.reader-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reader-page-no { color: var(--ink-soft); font-size: .84rem; }
.reader-progress { height: 3px; margin-top: 12px; background: #eef1f7; }
.reader-progress span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

.reader-body {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px clamp(16px, 4vw, 46px);
  margin-top: 16px;
  font-size: 1.05rem;
  line-height: 2;
  letter-spacing: .02em;
}
.reader-body p { text-indent: 2em; margin: 0 0 .9em; }
.reader-body p:last-child { margin-bottom: 0; }
.reader-body .cx { color: var(--ink-soft); opacity: .6; }

.reader-foot { margin-top: 16px; }
.reader-nav { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.reader-nav .page-input { width: 88px; }

/* ---------- 护眼 / 沉浸阅读 ---------- */
.eye-mode { background: #efeee7; }
.eye-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 18px 40px;
  background: #efece3;
  min-height: 100vh;
  box-shadow: 0 0 0 100vmax #efeee7;
  clip-path: inset(0 -100vmax);
}
.eye-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  background: rgba(239, 238, 231, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.eye-back { font-size: 1.1rem; padding: 2px 10px; border-radius: 8px; }
.eye-title { flex: 1 1 auto; font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eye-page { color: var(--ink-soft); font-weight: 400; font-size: .8rem; margin-left: 8px; }
.eye-tools { display: flex; gap: 4px; }
.eye-btn {
  border: 1px solid rgba(0, 0, 0, .12);
  background: rgba(255, 255, 255, .5);
  color: var(--ink);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: .8rem;
  line-height: 1.7;
}
.eye-body {
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Simsun, serif;
  font-size: 1.12rem;
  line-height: 2.15;
  color: #2b2b28;
  padding: 26px 8px 10px;
}
.eye-body p { text-indent: 2em; margin: 0 0 1em; }
.eye-foot { padding: 10px 4px 0; }
.eye-progress { height: 3px; background: rgba(0, 0, 0, .08); border-radius: 2px; margin-bottom: 14px; }
.eye-progress span { display: block; height: 100%; background: var(--accent); }
.eye-shell[data-eye="dark"] {
  background: #1d1e1c;
  box-shadow: 0 0 0 100vmax #171816;
  color: #d9d6cd;
}
.eye-shell[data-eye="dark"] .eye-body { color: #ddd9cf; }
.eye-shell[data-eye="dark"] .eye-bar { background: rgba(29, 30, 28, .92); border-color: rgba(255, 255, 255, .1); }
.eye-shell[data-eye="dark"] .eye-btn { background: rgba(255, 255, 255, .06); color: #e6e2d8; border-color: rgba(255, 255, 255, .16); }

/* ---------- 空状态 / 状态页 ---------- */
.narrow-page { max-width: 620px; padding-top: 48px; }
.empty-panel { text-align: center; padding: 46px 24px; }
.empty-panel h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.status-page { background: #f4f6fb; }
.status-page .container { max-width: 620px; padding-top: 8vh; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 30px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  font-size: .86rem;
  color: var(--ink-soft);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-links { display: flex; gap: 14px; }
.footer-links a:hover { color: var(--accent); }
.footer-meta { text-align: right; }

/* ---------- 暗色 ---------- */
body[data-theme="dark"] {
  --ink: #e8ecf3;
  --ink-soft: #98a2b3;
  --paper: #161a22;
  --bg: #0e1117;
  --line: #242a35;
  --shadow: 0 10px 30px -20px #000;
}
body[data-theme="dark"] .site-header { background: rgba(14, 17, 23, .88); }
body[data-theme="dark"] .hero { background: #121722; }
body[data-theme="dark"] .site-footer { background: #121722; }
body[data-theme="dark"] .book-card:hover { background: #1b2130; }
body[data-theme="dark"] .name-chip { background: #1b2130; }
body[data-theme="dark"] .header-search .form-control,
body[data-theme="dark"] .hero-search .form-control { background: #121722; color: var(--ink); border-color: var(--line); }

/* ---------- 响应式 ---------- */
@media (max-width: 991.98px) {
  .header-search { width: 220px; }
  .sticky-panel { position: static; }
}
@media (max-width: 767.98px) {
  .header-inner { flex-wrap: wrap; padding: 8px 0; gap: 10px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; }
  .header-search { order: 4; width: 100%; margin-left: 0; }
  .hero { padding: 34px 0 28px; }
  .hero-search { flex-direction: column; }
  .hero-search .btn { width: 100%; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .reader-body { padding: 22px 16px; font-size: 1rem; line-height: 1.95; }
  .eye-body { font-size: 1.04rem; line-height: 2; }
  .footer-meta { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .book-card { transition: none; }
}

/* ---------- 书籍不存在 / 已下架 ---------- */
.missing-panel { max-width: 720px; margin: 36px auto; padding: 42px 26px; text-align: center; }
.missing-mark {
  width: 64px; height: 64px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--line); color: var(--accent);
}
.missing-panel h1 { font-size: 1.45rem; margin: 0 0 10px; }
.missing-desc { color: var(--ink-soft); margin: 0 0 4px; }
.missing-book { color: var(--ink-soft); font-size: .92rem; margin: 0 0 6px; }
.missing-book span { color: var(--ink); }
.missing-search { display: flex; gap: 8px; max-width: 520px; margin: 22px auto 10px; }
.missing-search input {
  flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: .95rem; color: var(--ink); background: var(--paper);
}
.missing-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.missing-hint { color: var(--ink-soft); font-size: .86rem; margin: 0 0 6px; }
.missing-hint a { color: var(--accent); }
.missing-suggest { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--line); }
.missing-suggest-label { color: var(--ink-soft); font-size: .86rem; }
.suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 0; }
.suggest-chip {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem;
  color: var(--ink-soft); background: var(--paper); transition: border-color .15s, color .15s;
}
.suggest-chip:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 575px) {
  .missing-panel { padding: 30px 16px; }
  .missing-search { flex-direction: column; }
  .missing-search .btn { width: 100%; }
}

/* ==========================================================================
   2026-11 移动端重构：cloud 走“现代阅读 App”路线
   - 头部压缩为两行，搜索收进导航，杜绝横向溢出
   - 书库改为单列横向卡片，手机上更好点、更好读
   - 阅读页改为沉浸式：顶部书名栏 + 底部固定翻页栏
   ========================================================================== */
html,
body { max-width: 100%; overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
.book-card, .book-info, .reader-title-row, .header-inner { min-width: 0; }

@media (max-width: 991.98px) {
  /* 头部：搜索框在平板也会挤掉导航，统一收进“搜索”导航项 */
  .header-search { display: none; }
  .site-nav { margin-left: 0; }
  .theme-toggle { margin-left: auto; }

  /* 阅读页：隐藏站点头尾，改用专属阅读栏 */
  body.reader-page { background: var(--paper); }
  body.reader-page .site-header,
  body.reader-page .site-footer,
  body.reader-page .notice-bar { display: none; }
  body.reader-page .site-main { padding-bottom: 0; }
  body.reader-page .reader { padding-top: 0; }
  body.reader-page .reader-head,
  body.reader-page .reader-foot { display: none; }

  body.reader-page .container.reader {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }
  body.reader-page .reader-body {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 22px 18px calc(96px + env(safe-area-inset-bottom));
    font-size: 1.06rem;
    line-height: 2.05;
    letter-spacing: .015em;
    min-height: 100vh;
    overflow-wrap: break-word;
  }
  body.reader-page .reader-body p { margin-bottom: 1em; }

  /* 顶部阅读栏 */
  .m-reader-top {
    position: sticky;
    top: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 0;
    min-height: 54px;
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .m-reader-top .m-icon {
    flex: 0 0 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--ink);
    background: var(--bg);
  }
  .m-reader-top .m-icon:hover { color: var(--accent); }
  .m-book {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
  }
  .m-book strong {
    font-size: .92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-book span { color: var(--ink-soft); font-size: .72rem; font-variant-numeric: tabular-nums; }
  .m-tools { display: flex; gap: 4px; flex: 0 0 auto; }
  .m-tools button {
    width: 34px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: transparent;
    color: var(--ink-soft);
    font-size: .78rem;
    line-height: 1;
  }
  .m-tools button:active { background: var(--bg); color: var(--accent); }
  .m-tools .m-night { font-size: .82rem; }
  .m-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: transparent;
  }
  .m-progress span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

  /* 底部固定翻页栏 */
  .m-reader-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .m-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
  }
  .m-nav-btn.next { color: #fff; background: var(--accent); }
  .m-nav-btn:active { transform: scale(.98); }
  .m-nav-btn.is-disabled { color: var(--ink-soft); background: transparent; opacity: .45; }
  .m-count {
    display: flex;
    align-items: baseline;
    gap: 2px;
    padding: 0 8px;
    color: var(--ink-soft);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
  }
  .m-count b { color: var(--ink); font-size: 1rem; }
  .m-count i { font-style: normal; opacity: .55; }
}

/* 护眼/沉浸模式：所有尺寸都隐藏站点头尾，手机两行工具栏 */
body.eye-page .site-header,
body.eye-page .site-footer { display: none; }
body.eye-page .site-main { padding: 0; }
body.eye-page .eye-bar { background: rgba(239, 238, 231, .94); }

@media (max-width: 575.98px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 6px 10px;
    min-height: 0;
    padding: 7px 0 0;
  }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
  .brand-text { font-size: .98rem; }
  .theme-toggle { height: 32px; padding: 2px 10px; font-size: .78rem; }
  .site-nav {
    order: 3;
    width: 100%;
    gap: 2px;
    padding: 3px 0 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav .nav-link {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 8px 10px;
    text-align: center;
    font-size: .88rem;
  }

  .hero { padding: 26px 0 24px; }
  .hero-eyebrow { font-size: .76rem; letter-spacing: .12em; margin-bottom: 6px; }
  .hero-title {
    font-size: 1.42rem;
    line-height: 1.4;
    letter-spacing: 0;
    margin-bottom: 16px;
    overflow-wrap: anywhere;
  }
  .hero-search { gap: 8px; }
  .hero-search .form-control { height: 46px; font-size: .94rem; }
  .hero-search .btn { height: 46px; padding: 0 14px; flex: 0 0 auto; font-size: .92rem; }
  .hero-stats { margin-top: 10px; font-size: .8rem; }

  .page-grid { padding-top: 18px; }
  .page-head { padding-top: 18px; }
  .page-head-row { gap: 6px; }
  .page-head-row h1 { font-size: 1.3rem; }
  .page-sub { font-size: .82rem; }

  .panel { padding: 15px 14px; border-radius: 12px; }
  .panel + .panel { margin-top: 14px; }
  .panel-head { margin-bottom: 10px; }
  .panel-head h2 { font-size: 1rem; }
  .panel-more { font-size: .76rem; }

  /* 书库：单列横向卡片 */
  .book-grid { grid-template-columns: 1fr; gap: 8px; }
  .book-card {
    padding: 10px 11px;
    border-color: var(--line);
    border-radius: 12px;
    background: var(--paper);
    gap: 11px;
  }
  .book-card:hover { transform: none; }
  .book-cover { flex-basis: 52px; width: 52px; height: 70px; font-size: 1.2rem; }
  .book-name { font-size: .95rem; -webkit-line-clamp: 2; }
  .book-meta { font-size: .74rem; }
  .book-tag { font-size: .7rem; }

  .book-list li { padding: 10px 0; gap: 8px; }
  .book-list-name { font-size: .9rem; }
  .book-list-tag { flex: 0 0 auto; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .rank-item { gap: 8px; padding: 10px 0; }
  .rank-item .rank-tag { display: none; }
  .rank-name { font-size: .92rem; }
  .rank-count { flex: 0 0 auto; font-size: .72rem; }
  .top-list li { gap: 8px; }
  .top-list a { font-size: .88rem; }

  .chip-grid { gap: 6px; }
  .name-chip { max-width: 100%; font-size: .8rem; padding: 5px 10px; }

  .pagination { flex-wrap: wrap; gap: 4px; }
  .pagination .page-link { min-width: 36px; min-height: 36px; display: grid; place-items: center; padding: 4px 8px; }

  .search-panel .input-group-lg .form-control,
  .search-panel .input-group-lg .btn { height: 46px; font-size: .94rem; }

  .footer-inner { gap: 10px; }
  .footer-brand { width: 100%; }
  .footer-links { gap: 12px; }
  .site-footer { margin-top: 20px; padding: 22px 0 28px; }

  .m-reader-top { min-height: 50px; padding-left: 8px; padding-right: 8px; }
  .m-book strong { font-size: .86rem; }
  .m-tools button { width: 32px; height: 34px; }
  body.reader-page .reader-body { padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); font-size: 1.02rem; line-height: 2; }

  .eye-shell { padding: 0 13px 26px; }
  .eye-bar { flex-wrap: wrap; gap: 6px; padding: 7px 4px 8px; }
  .eye-back { flex: 0 0 30px; padding: 2px 6px; }
  .eye-title { flex: 1 1 0; min-width: 0; font-size: .9rem; }
  .eye-page { margin-left: 4px; }
  .eye-tools {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }
  .eye-btn { padding: 6px 2px; text-align: center; min-height: 36px; font-size: .76rem; }
  .eye-body { padding: 16px 2px 8px; font-size: 1.02rem; line-height: 2; }
}

/* 夜间模式下的阅读栏 */
body[data-theme="dark"] .m-reader-top,
body[data-theme="dark"] .m-reader-bar { background: rgba(22, 26, 34, .94); }
body[data-theme="dark"] .m-tools button,
body[data-theme="dark"] .m-icon { background: #1b2130; border-color: var(--line); color: var(--ink); }
body[data-theme="dark"] .m-nav-btn { background: #1b2130; }
body[data-theme="dark"] .m-nav-btn.next { background: var(--accent); color: #fff; }
body[data-theme="dark"] .m-nav-btn.is-disabled { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .m-nav-btn:active { transform: none; }
  .book-card { transition: none; }
}

/* 全文下载链接 */
.dl-link { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.dl-link:hover { text-decoration: none; }
.reader-page-no .dl-link { color: var(--accent); font-weight: 600; }
.m-book .m-dl { color: var(--accent); text-decoration: underline; }
.eye-btn.eye-dl {
  display: inline-flex;
  align-items: center;
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.eye-btn.eye-dl:hover { background: var(--accent); color: #fff; }
