/* ==========================================================================
   W1 Read — 澄镜视觉系统 & 沉浸式 EPUB 阅读器样式
   遵循 W1 Brand 浅/深双主题规范，主色为 W1 Read 书卷琥珀金 (#9A6B12 / #EFC46B)
   ========================================================================== */

:root {
  --bg: #0a0a0c;
  --surface: #141418;
  --raised: #1c1c22;
  --ink: #f5f5f7;
  --muted: #9c9ca6;
  --faint: rgba(245, 245, 247, 0.48);
  --rule: rgba(255, 255, 255, 0.09);

  --accent: #efc46b;
  --accent-strong: #f6d388;
  --accent-ink: #171308;
  --accent-soft: rgba(239, 196, 107, 0.14);

  --glass-bg: rgba(20, 20, 24, 0.68);
  --glass-edge: rgba(255, 255, 255, 0.11);
  --glass-hover: rgba(255, 255, 255, 0.09);
  --glass-blur: blur(24px) saturate(1.6);

  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.42);
  --shadow-hover: 0 20px 44px rgba(0, 0, 0, 0.62);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --ease: cubic-bezier(0.21, 0.86, 0.26, 0.99);
  --max-w: 1320px;
  --pad: clamp(16px, 3.8vw, 48px);

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
}

html[data-theme="light"] {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --raised: #ffffff;
  --ink: #1b1c20;
  --muted: #666872;
  --faint: rgba(27, 28, 32, 0.45);
  --rule: rgba(0, 0, 0, 0.08);

  --accent: #9a6b12;
  --accent-strong: #b47e18;
  --accent-ink: #ffffff;
  --accent-soft: rgba(154, 107, 18, 0.11);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(0, 0, 0, 0.08);
  --glass-hover: rgba(0, 0, 0, 0.05);
  --glass-blur: blur(24px) saturate(1.8);

  --shadow-card: 0 2px 8px rgba(18, 18, 22, 0.06), 0 10px 24px rgba(18, 18, 22, 0.08);
  --shadow-hover: 0 18px 36px rgba(18, 18, 22, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

/* 环境辉光 */
.ambient-glow {
  position: fixed;
  inset: -120px -120px auto -120px;
  height: 520px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(640px 360px at 18% 12%, rgba(239, 196, 107, 0.12), transparent 72%),
    radial-gradient(560px 320px at 82% 8%, rgba(120, 148, 210, 0.09), transparent 70%);
  transition: opacity 0.6s var(--ease);
}

html[data-theme="light"] .ambient-glow {
  background:
    radial-gradient(640px 360px at 18% 10%, rgba(154, 107, 18, 0.09), transparent 72%),
    radial-gradient(560px 320px at 82% 8%, rgba(110, 140, 190, 0.07), transparent 70%);
}

/* ==========================================================================
   顶部玻璃导航栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-edge);
}

.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 30px;
  width: auto;
  display: block;
}

html[data-theme="dark"] .brand-logo-light { display: none; }
html[data-theme="light"] .brand-logo-dark { display: none; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-pill:hover {
  background: var(--glass-hover);
  color: var(--ink);
}

.nav-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: clamp(170px, 24vw, 290px);
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-hover);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.icon-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }

/* ==========================================================================
   主内容区
   ========================================================================== */
.app-view {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px var(--pad) 80px;
}

/* 精选 Hero 横幅 */
.hero-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  margin-bottom: 36px;
}

.hero-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(42px) saturate(1.4);
  opacity: 0.26;
  transform: scale(1.1);
}

html[data-theme="light"] .hero-bg {
  opacity: 0.16;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--surface) 18%, transparent 100%);
  opacity: 0.85;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 3.6vw, 42px);
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
}

.hero-cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--raised);
}

.hero-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.22;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.douban-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--accent);
}

.hero-desc {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 68ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-hover);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: transparent;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-danger:hover:not(:disabled) {
  border-color: #e55353;
  color: #e55353;
}

/* 区块标题 */
.section {
  margin-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* 继续阅读横向条 */
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.recent-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}

.recent-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.recent-cover {
  width: 68px;
  height: 100px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--raised);
}

.recent-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.recent-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-chapter {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--rule);
  overflow: hidden;
  margin: 8px 0 4px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.recent-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}

/* 书籍卡片网格 */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 22px 18px;
}

.book-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  group: true;
}

.book-cover-box {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}

/* 模拟真实书脊微光 */
.book-cover-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0%, rgba(255, 255, 255, 0.14) 4%, transparent 10%);
  pointer-events: none;
}

.book-card:hover .book-cover-box {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.book-cover-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  background: linear-gradient(145deg, var(--raised), var(--surface));
}

.badge-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(10, 10, 14, 0.78);
  color: #f6d388;
  backdrop-filter: blur(8px);
}

.badge-shelf {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
}

.badge-score {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(10, 10, 14, 0.78);
  color: #f6d388;
  backdrop-filter: blur(8px);
}

.book-card-title {
  margin: 10px 0 3px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   书籍详情页
   ========================================================================== */
.detail-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 3.5vw, 40px);
  margin-bottom: 28px;
}

.detail-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(22px, 3.5vw, 40px);
  align-items: start;
}

.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--raised);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-title {
  margin: 0 0 6px;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  line-height: 1.25;
}

.detail-subtitle {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--muted);
}

.meta-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--glass-hover);
  border: 1px solid var(--rule);
  margin: 16px 0 20px;
  font-size: 13px;
}

.meta-item-label {
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 2px;
}

.meta-item-val {
  font-weight: 600;
}

.rating-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.rating-refresh-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.8;
  padding: 0 4px;
  text-decoration: underline;
}

.rating-refresh-btn:hover {
  opacity: 1;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.panel-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--muted);
  white-space: pre-line;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--glass-hover);
  font-size: 13px;
}

.source-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* 存储与配额状态栏 */
.storage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  margin-bottom: 24px;
  font-size: 13px;
}

.storage-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
}

.storage-metrics strong {
  color: var(--ink);
}

/* 筛选胶囊 */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.filter-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}

/* 笔记卡片 */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.note-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--hl-bar, var(--accent));
}

.note-quote {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 8px;
}

.note-comment {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--glass-hover);
  font-size: 13.5px;
  line-height: 1.6;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   沉浸式 EPUB 阅读器
   ========================================================================== */
.reader-shell {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  --r-bg: #111215;
  --r-paper: #16171b;
  --r-ink: #e4e5e9;
  --r-muted: #8f929d;
  --r-rule: rgba(255, 255, 255, 0.09);
  --r-bar: rgba(20, 21, 26, 0.88);
  background: var(--r-bg);
  color: var(--r-ink);
}

.reader-shell[hidden] {
  display: none;
}

.reader-shell[data-reader-theme="light"] {
  --r-bg: #f3f3f1;
  --r-paper: #ffffff;
  --r-ink: #1e2024;
  --r-muted: #6c6f78;
  --r-rule: rgba(0, 0, 0, 0.08);
  --r-bar: rgba(255, 255, 255, 0.9);
}

.reader-shell[data-reader-theme="sepia"] {
  --r-bg: #ede5d4;
  --r-paper: #f7f1e3;
  --r-ink: #33291b;
  --r-muted: #7c6b53;
  --r-rule: rgba(66, 48, 24, 0.12);
  --r-bar: rgba(245, 238, 222, 0.92);
}

.reader-topbar {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--r-bar);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--r-rule);
  flex-shrink: 0;
}

.reader-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reader-title-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.reader-book-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-ch-title {
  font-size: 11.5px;
  color: var(--r-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r-btn {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--r-rule);
  background: transparent;
  color: var(--r-ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s;
}

.r-btn:hover,
.r-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.reader-body-wrap {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
}

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px clamp(14px, 4vw, 48px) 96px;
  scroll-behavior: smooth;
}

.reader-paper {
  max-width: var(--r-width, 760px);
  margin: 0 auto;
  padding: clamp(24px, 4.5vw, 52px);
  border-radius: 14px;
  background: var(--r-paper);
  border: 1px solid var(--r-rule);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
}

.reader-content {
  font-size: var(--r-font-size, 18px);
  line-height: var(--r-line-height, 1.9);
  font-family: var(--r-font-family, var(--font-serif));
  word-break: break-word;
}

.reader-content h1,
.reader-content h2,
.reader-content h3 {
  line-height: 1.4;
  margin: 1.4em 0 0.7em;
}

.reader-content p {
  margin: 0 0 1.05em;
  text-align: justify;
}

.reader-content img,
.reader-content svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px auto;
  border-radius: 8px;
  cursor: zoom-in;
}

.reader-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9em;
}

.reader-content th,
.reader-content td {
  border: 1px solid var(--r-rule);
  padding: 8px 10px;
}

.reader-chapter-nav {
  max-width: var(--r-width, 760px);
  margin: 24px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reader-footer {
  height: 36px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--r-muted);
  background: var(--r-bar);
  border-top: 1px solid var(--r-rule);
  flex-shrink: 0;
}

/* 抽屉（目录 / 笔记 / 排版） */
.reader-drawer {
  width: min(340px, 86vw);
  background: var(--r-paper);
  border-right: 1px solid var(--r-rule);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.reader-drawer.right {
  border-right: none;
  border-left: 1px solid var(--r-rule);
}

.reader-drawer[hidden] {
  display: none;
}

.drawer-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--r-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.toc-item {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--r-ink);
  font-size: 13.5px;
  cursor: pointer;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-item:hover {
  background: var(--accent-soft);
}

.toc-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* 排版弹出面板 */
.settings-popover {
  position: absolute;
  top: 60px;
  right: 16px;
  z-index: 230;
  width: 280px;
  padding: 16px;
  border-radius: 14px;
  background: var(--r-paper);
  border: 1px solid var(--r-rule);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.settings-popover[hidden] {
  display: none;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.setting-row:last-child {
  margin-bottom: 0;
}

/* 高亮标记（5 色） */
mark.w1-hl {
  border-radius: 3px;
  padding: 1px 0;
  cursor: pointer;
  color: inherit;
  transition: filter 0.15s;
}

mark.w1-hl:hover {
  filter: brightness(1.12);
}

mark.w1-hl[data-color="amber"] { background: rgba(245, 194, 66, 0.34); }
mark.w1-hl[data-color="green"] { background: rgba(98, 209, 138, 0.30); }
mark.w1-hl[data-color="blue"]  { background: rgba(96, 174, 255, 0.30); }
mark.w1-hl[data-color="pink"]  { background: rgba(245, 118, 152, 0.30); }
mark.w1-hl[data-color="purple"]{ background: rgba(176, 132, 245, 0.30); }

mark.w1-hl.has-note {
  border-bottom: 2px dashed var(--accent);
}

mark.w1-hl.flash {
  outline: 2px solid var(--accent);
}

/* 划词悬浮工具条 */
.hl-toolbar {
  position: fixed;
  z-index: 260;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(22, 23, 28, 0.94);
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}

.hl-toolbar[hidden] {
  display: none;
}

.hl-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.hl-dot:hover {
  transform: scale(1.18);
}

.hl-dot[data-color="amber"] { background: #f5c242; }
.hl-dot[data-color="green"] { background: #62d18a; }
.hl-dot[data-color="blue"]  { background: #60aeff; }
.hl-dot[data-color="pink"]  { background: #f57698; }
.hl-dot[data-color="purple"]{ background: #b084f5; }

.hl-action-btn {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.hl-action-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* 批注编辑弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-box {
  width: min(460px, 94vw);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--glass-edge);
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-quote {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.65;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--glass-hover);
  border-radius: 6px;
  margin: 0 0 14px;
  max-height: 120px;
  overflow-y: auto;
}

.modal-box textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-edge);
  background: var(--bg);
  resize: vertical;
  outline: none;
  margin-bottom: 14px;
}

.modal-box textarea:focus {
  border-color: var(--accent);
}

/* 图片灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

/* 骨架屏 & 空状态 & Toast */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
  border-radius: var(--radius-md);
  border: 1px dashed var(--rule);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px 18px;
}

.skeleton-card {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--raised) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast-root {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 320;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 21, 26, 0.92);
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
}

/* 响应式 */
@media (max-width: 720px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar-actions {
    width: 100%;
    margin-left: 0;
  }
  .search-box {
    flex: 1;
    width: auto;
  }
  .hero-content,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .hero-cover-wrap,
  .detail-cover {
    width: 148px;
    margin: 0 auto;
  }
  .reader-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 220;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.4);
  }
  .reader-drawer.right {
    right: 0;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.4);
  }
}

/* ==========================================================================
   W1 Books 进阶视觉与「澄镜」动效升级
   ========================================================================== */

/* 入场错峰渐现 */
@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stagger-item {
  animation: cardRise 0.5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 32ms);
}

/* 3D 指针微倾 + 镜面高光追踪 */
.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s;
}

.tilt-card .sheen-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.26),
    transparent 65%
  );
  transition: opacity 0.25s ease;
  z-index: 3;
}

.tilt-card:hover .sheen-layer {
  opacity: 1;
}

/* 每日推荐策展卡（2×2 精装双栏） */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.daily-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 102px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.daily-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.daily-card-bg {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(36px) saturate(1.3);
  opacity: 0.14;
  pointer-events: none;
}

html[data-theme="light"] .daily-card-bg {
  opacity: 0.09;
}

.daily-cover {
  position: relative;
  z-index: 1;
  aspect-ratio: 2 / 3;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--raised);
}

.daily-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.daily-info {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.daily-reason {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-title {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 书架高级藏书卡片 */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px 20px;
}

.shelf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s;
}

.shelf-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.shelf-stage {
  position: relative;
  padding: 22px 22px 16px;
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, var(--glass-hover) 0%, transparent 100%);
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}

.shelf-stage-cover {
  width: 126px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--raised);
  position: relative;
}

.shelf-stage-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0%, rgba(255, 255, 255, 0.15) 4%, transparent 10%);
  pointer-events: none;
}

.shelf-stage-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shelf-keep-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.shelf-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.shelf-card-title {
  margin: 0 0 3px;
  font-size: 15.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.shelf-card-author {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.shelf-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.shelf-card-actions .btn-primary {
  flex: 1;
}

@media (max-width: 820px) {
  .daily-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stagger-item {
    animation: none !important;
  }
  .tilt-card {
    transition: none !important;
  }
}

/* ==========================================================================
   三态主题切换（浅色 / 深色 / 自动）、自定义书架、阅读状态徽标与阅读看板
   ========================================================================== */

.theme-segmented {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-hover);
  gap: 2px;
  flex-shrink: 0;
}

.theme-seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.theme-seg-btn:hover {
  color: var(--ink);
}

.theme-seg-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

/* 书架选择器弹窗 */
.sp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 240px;
  overflow-y: auto;
}

.sp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--glass-hover);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.sp-row:hover {
  border-color: var(--accent);
}

.sp-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sp-create-form {
  display: flex;
  gap: 8px;
}

.sp-create-form input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--bg);
  font-size: 13px;
  outline: none;
}

.sp-create-form input:focus {
  border-color: var(--accent);
}

/* 书架导航条：内置「稍后再读」与自建书架区分 */
.shelf-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.shelf-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 12px;
  border: 1px solid var(--glass-edge);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.16s;
}

.shelf-chip:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}

.shelf-chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}

.shelf-chip.special {
  border-style: dashed;
  border-color: rgba(239, 196, 107, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
}

.shelf-chip.special.active {
  border-style: solid;
  background: var(--accent);
  color: var(--accent-ink);
}

.shelf-chip-count {
  font-size: 11.5px;
  opacity: 0.78;
}

/* 阅读状态徽标 */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.status-pill.unread {
  background: rgba(160, 164, 178, 0.16);
  color: var(--muted);
}

.status-pill.reading {
  background: rgba(96, 174, 255, 0.16);
  color: #60aeff;
}

.status-pill.finished {
  background: rgba(98, 209, 138, 0.16);
  color: #4ec57a;
}

/* ==========================================================================
   阅读看板（Dashboard）
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-value span {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--accent);
}

.dashboard-split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* 12 周阅读热力图 */
.heatmap-wrap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.heatmap-col {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 6px;
}

.heat-cell {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  background: var(--glass-hover);
  border: 1px solid var(--rule);
  transition: transform 0.15s;
}

.heat-cell:hover {
  transform: scale(1.22);
}

.heat-cell[data-level="1"] { background: rgba(239, 196, 107, 0.25); border-color: transparent; }
.heat-cell[data-level="2"] { background: rgba(239, 196, 107, 0.50); border-color: transparent; }
.heat-cell[data-level="3"] { background: rgba(239, 196, 107, 0.78); border-color: transparent; }
.heat-cell[data-level="4"] { background: var(--accent); border-color: transparent; }

/* 柱状图 */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 168px;
  padding-top: 18px;
}

.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.bar-track {
  width: 100%;
  max-width: 28px;
  height: 126px;
  border-radius: 999px;
  background: var(--glass-hover);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  min-height: 4px;
  transition: height 0.6s var(--ease);
}

.bar-val {
  font-size: 10.5px;
  color: var(--muted);
}

.bar-lbl {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Logo 放大、书架主界面卡片、「稍后再读」独立入口、笔记分组、原生右键菜单
   ========================================================================== */

.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}

/* 「稍后再读」专属横向玻璃入口（与自建书架完全区分） */
.read-later-panel {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 34px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 60%);
  border: 1px solid rgba(239, 196, 107, 0.28);
  box-shadow: var(--shadow-card);
}

.read-later-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.read-later-item {
  flex: 0 0 250px;
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.22s;
}

.read-later-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.read-later-cover {
  width: 54px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--raised);
}

/* 书架主界面：各个书架卡片 */
.shelf-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.shelf-folder-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 224px;
  transition: transform 0.26s var(--ease), border-color 0.26s, box-shadow 0.26s;
}

.shelf-folder-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.shelf-folder-covers {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 118px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.shelf-mini-cover {
  width: 72px;
  height: 104px;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--raised);
  flex-shrink: 0;
}

.shelf-mini-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shelf-folder-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  border-radius: 10px;
  background: var(--glass-hover);
}

.shelf-folder-new {
  border-style: dashed;
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  gap: 8px;
}

.shelf-folder-new:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* 笔记按书籍分组卡片 */
.notes-book-group {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.notes-book-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.notes-book-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.notes-book-thumb {
  width: 42px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--raised);
}

/* 原生风格毛玻璃右键菜单 */
.ctx-menu {
  position: fixed;
  z-index: 400;
  min-width: 196px;
  padding: 6px;
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ctx-menu[hidden] {
  display: none;
}

.ctx-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ctx-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.ctx-item.danger {
  color: #eb6666;
}

.ctx-item.danger:hover {
  background: rgba(235, 102, 102, 0.14);
  color: #ff7b7b;
}

.ctx-sep {
  height: 1px;
  background: var(--rule);
  margin: 4px 6px;
}

/* ==========================================================================
   W1 Account 登录页与「我的」个人中心
   ========================================================================== */
.auth-gate {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 94vw);
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.auth-card .brand-logo {
  height: 44px;
  margin: 0 auto 18px;
}

.me-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.me-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.me-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--glass-edge);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.18s;
}

.history-row:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.history-cover {
  width: 44px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--raised);
}
