.e-reader {
  --reader-bg: linear-gradient(180deg, #f5fbff 0%, #dfeef9 100%);
  --reader-surface: rgba(34, 95, 140, 0.08);
  --reader-text: #0f2334;
  --reader-muted: rgba(15, 35, 52, 0.64);
  --reader-card: rgba(248, 252, 255, 0.88);
  --reader-card-border: rgba(67, 119, 154, 0.18);
  --reader-drawer-surface: rgba(248, 252, 255, 0.98);
  --reader-drawer-strong: rgba(255, 255, 255, 0.94);
  --reader-drawer-shadow: 0 28px 72px rgba(18, 58, 88, 0.24);
  --reader-drawer-mask: rgba(8, 24, 39, 0.34);
  --reader-page: linear-gradient(180deg, #fffdfa 0%, #edf4f8 100%);
  --reader-page-shadow: 0 24px 64px rgba(32, 80, 114, 0.14);
  --reader-accent: #2175ad;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(255, 250, 244, 0.5), transparent 38%),
    linear-gradient(180deg, rgba(83, 112, 131, 0.08), rgba(255, 255, 255, 0.05));
  --reader-frame-edge-left: rgba(30, 94, 136, 0.1);
  --reader-frame-edge-right: rgba(30, 94, 136, 0.08);
  --reader-page-border: rgba(103, 129, 146, 0.16);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(255, 249, 240, 0.26), transparent 36%),
    linear-gradient(180deg, rgba(251, 247, 241, 0.5), rgba(228, 238, 244, 0.54));
  --reader-veil-border: rgba(76, 117, 146, 0.1);
  position: relative;
  height: 100%;
  min-height: 100%;
  padding: 0;
  color: var(--reader-text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 28%),
    radial-gradient(circle at bottom right, rgba(84, 166, 222, 0.16), transparent 34%),
    var(--reader-bg);
  overflow: hidden;
}

.e-reader--ocean {
  --reader-bg: linear-gradient(180deg, #daf3ff 0%, #c4ddf8 100%);
  --reader-surface: rgba(13, 117, 183, 0.1);
  --reader-text: #0e2234;
  --reader-muted: rgba(14, 34, 52, 0.7);
  --reader-card: rgba(239, 249, 255, 0.88);
  --reader-card-border: rgba(28, 113, 173, 0.2);
  --reader-drawer-surface: rgba(244, 251, 255, 0.98);
  --reader-drawer-strong: rgba(255, 255, 255, 0.95);
  --reader-drawer-shadow: 0 28px 72px rgba(12, 74, 121, 0.24);
  --reader-drawer-mask: rgba(8, 30, 48, 0.38);
  --reader-page: linear-gradient(180deg, #fbfeff 0%, #e8f5fd 100%);
  --reader-page-shadow: 0 26px 64px rgba(31, 98, 152, 0.16);
  --reader-accent: #0d87c9;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.4), transparent 36%),
    linear-gradient(180deg, rgba(29, 95, 144, 0.08), rgba(223, 242, 252, 0.08));
  --reader-frame-edge-left: rgba(13, 117, 183, 0.12);
  --reader-frame-edge-right: rgba(13, 117, 183, 0.1);
  --reader-page-border: rgba(69, 131, 176, 0.15);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(239, 249, 255, 0.42), rgba(214, 233, 247, 0.5));
  --reader-veil-border: rgba(53, 115, 160, 0.1);
}

.e-reader--night {
  --reader-bg: linear-gradient(180deg, #09121b 0%, #050a11 100%);
  --reader-surface: rgba(125, 195, 255, 0.08);
  --reader-text: #eef4fb;
  --reader-muted: rgba(238, 244, 251, 0.68);
  --reader-card: rgba(12, 23, 35, 0.84);
  --reader-card-border: rgba(125, 195, 255, 0.16);
  --reader-drawer-surface: rgba(8, 17, 27, 0.96);
  --reader-drawer-strong: rgba(14, 27, 41, 0.94);
  --reader-drawer-shadow: 0 32px 84px rgba(0, 0, 0, 0.46);
  --reader-drawer-mask: rgba(0, 0, 0, 0.48);
  --reader-page: linear-gradient(180deg, #102132 0%, #0b1521 100%);
  --reader-page-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
  --reader-accent: #8ed8ff;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(142, 216, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(5, 12, 19, 0.78), rgba(8, 17, 27, 0.94));
  --reader-frame-edge-left: rgba(142, 216, 255, 0.1);
  --reader-frame-edge-right: rgba(142, 216, 255, 0.08);
  --reader-page-border: rgba(142, 216, 255, 0.12);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(142, 216, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(10, 20, 31, 0.82), rgba(7, 14, 23, 0.92));
  --reader-veil-border: rgba(142, 216, 255, 0.08);
}

.e-reader--sepia {
  --reader-bg: linear-gradient(180deg, #f4e8d5 0%, #e6d3b8 100%);
  --reader-surface: rgba(118, 84, 44, 0.08);
  --reader-text: #3c2716;
  --reader-muted: rgba(60, 39, 22, 0.66);
  --reader-card: rgba(252, 246, 238, 0.9);
  --reader-card-border: rgba(141, 106, 63, 0.18);
  --reader-drawer-surface: rgba(250, 242, 232, 0.98);
  --reader-drawer-strong: rgba(255, 249, 241, 0.95);
  --reader-drawer-shadow: 0 28px 72px rgba(90, 60, 28, 0.22);
  --reader-drawer-mask: rgba(47, 28, 10, 0.28);
  --reader-page: linear-gradient(180deg, #f7efe2 0%, #eadbc4 100%);
  --reader-page-shadow: 0 24px 64px rgba(98, 67, 31, 0.16);
  --reader-accent: #9b6d35;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(255, 245, 226, 0.42), transparent 36%),
    linear-gradient(180deg, rgba(121, 89, 51, 0.08), rgba(255, 250, 244, 0.06));
  --reader-frame-edge-left: rgba(155, 109, 53, 0.1);
  --reader-frame-edge-right: rgba(155, 109, 53, 0.08);
  --reader-page-border: rgba(140, 104, 67, 0.16);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(255, 247, 232, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(245, 233, 214, 0.34), rgba(227, 210, 185, 0.44));
  --reader-veil-border: rgba(132, 97, 59, 0.1);
}

.e-reader--forest {
  --reader-bg: linear-gradient(180deg, #e0efe8 0%, #c5ddd1 100%);
  --reader-surface: rgba(40, 105, 73, 0.08);
  --reader-text: #163022;
  --reader-muted: rgba(22, 48, 34, 0.66);
  --reader-card: rgba(244, 250, 245, 0.9);
  --reader-card-border: rgba(62, 121, 90, 0.18);
  --reader-drawer-surface: rgba(242, 249, 245, 0.98);
  --reader-drawer-strong: rgba(250, 254, 251, 0.95);
  --reader-drawer-shadow: 0 28px 72px rgba(24, 71, 48, 0.2);
  --reader-drawer-mask: rgba(8, 30, 18, 0.28);
  --reader-page: linear-gradient(180deg, #f5f9f1 0%, #dce9db 100%);
  --reader-page-shadow: 0 24px 64px rgba(31, 78, 54, 0.16);
  --reader-accent: #2f8f5c;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(250, 255, 252, 0.34), transparent 36%),
    linear-gradient(180deg, rgba(47, 111, 82, 0.08), rgba(232, 243, 236, 0.08));
  --reader-frame-edge-left: rgba(47, 143, 92, 0.1);
  --reader-frame-edge-right: rgba(47, 143, 92, 0.08);
  --reader-page-border: rgba(71, 124, 95, 0.16);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(248, 255, 252, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(234, 243, 233, 0.32), rgba(206, 225, 214, 0.42));
  --reader-veil-border: rgba(62, 121, 90, 0.1);
}

.e-reader--graphite {
  --reader-bg: linear-gradient(180deg, #23272f 0%, #171b22 100%);
  --reader-surface: rgba(194, 202, 214, 0.08);
  --reader-text: #edf2f8;
  --reader-muted: rgba(237, 242, 248, 0.66);
  --reader-card: rgba(31, 36, 44, 0.9);
  --reader-card-border: rgba(150, 162, 181, 0.18);
  --reader-drawer-surface: rgba(23, 28, 36, 0.98);
  --reader-drawer-strong: rgba(31, 36, 44, 0.96);
  --reader-drawer-shadow: 0 30px 78px rgba(0, 0, 0, 0.42);
  --reader-drawer-mask: rgba(0, 0, 0, 0.46);
  --reader-page: linear-gradient(180deg, #2f3640 0%, #212731 100%);
  --reader-page-shadow: 0 30px 72px rgba(0, 0, 0, 0.4);
  --reader-accent: #a7b4c8;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 34%),
    linear-gradient(180deg, rgba(10, 13, 18, 0.78), rgba(25, 29, 37, 0.94));
  --reader-frame-edge-left: rgba(167, 180, 200, 0.08);
  --reader-frame-edge-right: rgba(167, 180, 200, 0.06);
  --reader-page-border: rgba(167, 180, 200, 0.12);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 36%),
    linear-gradient(180deg, rgba(30, 36, 45, 0.72), rgba(18, 22, 29, 0.86));
  --reader-veil-border: rgba(167, 180, 200, 0.08);
}

.e-reader--rose {
  --reader-bg: linear-gradient(180deg, #fbeef1 0%, #f4dce4 100%);
  --reader-surface: rgba(155, 77, 101, 0.08);
  --reader-text: #3c2430;
  --reader-muted: rgba(60, 36, 48, 0.64);
  --reader-card: rgba(255, 247, 249, 0.9);
  --reader-card-border: rgba(173, 101, 125, 0.18);
  --reader-drawer-surface: rgba(255, 244, 247, 0.98);
  --reader-drawer-strong: rgba(255, 250, 251, 0.96);
  --reader-drawer-shadow: 0 28px 72px rgba(113, 59, 80, 0.2);
  --reader-drawer-mask: rgba(47, 16, 28, 0.28);
  --reader-page: linear-gradient(180deg, #fff7f6 0%, #f7e6e9 100%);
  --reader-page-shadow: 0 24px 64px rgba(113, 59, 80, 0.14);
  --reader-accent: #cf6f8e;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.32), transparent 36%),
    linear-gradient(180deg, rgba(178, 108, 130, 0.08), rgba(255, 244, 246, 0.08));
  --reader-frame-edge-left: rgba(207, 111, 142, 0.1);
  --reader-frame-edge-right: rgba(207, 111, 142, 0.08);
  --reader-page-border: rgba(176, 108, 130, 0.14);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(251, 237, 241, 0.34), rgba(238, 214, 223, 0.44));
  --reader-veil-border: rgba(176, 108, 130, 0.1);
}

.e-reader--dawn {
  --reader-bg: linear-gradient(180deg, #f6f1e6 0%, #dfd5c2 100%);
  --reader-surface: rgba(122, 94, 52, 0.08);
  --reader-text: #332515;
  --reader-muted: rgba(51, 37, 21, 0.64);
  --reader-card: rgba(252, 247, 239, 0.9);
  --reader-card-border: rgba(154, 122, 77, 0.18);
  --reader-drawer-surface: rgba(250, 245, 236, 0.98);
  --reader-drawer-strong: rgba(255, 249, 240, 0.96);
  --reader-drawer-shadow: 0 28px 72px rgba(98, 74, 39, 0.2);
  --reader-drawer-mask: rgba(47, 29, 8, 0.28);
  --reader-page: linear-gradient(180deg, #faf1df 0%, #eadfc7 100%);
  --reader-page-shadow: 0 24px 64px rgba(94, 71, 40, 0.15);
  --reader-accent: #bd8a3d;
  --reader-frame-bg:
    radial-gradient(circle at top, rgba(255, 247, 228, 0.38), transparent 36%),
    linear-gradient(180deg, rgba(153, 120, 70, 0.08), rgba(248, 240, 225, 0.08));
  --reader-frame-edge-left: rgba(189, 138, 61, 0.1);
  --reader-frame-edge-right: rgba(189, 138, 61, 0.08);
  --reader-page-border: rgba(154, 122, 77, 0.16);
  --reader-veil-bg:
    radial-gradient(circle at top, rgba(255, 250, 236, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(247, 238, 218, 0.34), rgba(226, 209, 177, 0.44));
  --reader-veil-border: rgba(154, 122, 77, 0.1);
}

.e-reader__floating-bar,
.e-reader__floating-actions,
.e-reader__floating-status,
.e-reader__panel-header,
.e-reader__gesture-hint,
.e-reader__reader-footer,
.e-reader__page-topline,
.e-reader__page-bottomline,
.e-reader__import-url-row,
.e-reader__index-grid {
  display: flex;
  align-items: center;
}

.e-reader__floating-bar,
.e-reader__panel-header,
.e-reader__reader-footer,
.e-reader__import-url-row {
  justify-content: space-between;
}

.e-reader__floating-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 5;
  flex-wrap: wrap;
  row-gap: 8px;
}

.e-reader__floating-actions {
  gap: 8px;
}

.e-reader__panel-header-actions,
.e-reader__floating-status {
  gap: 10px;
}

.e-reader__floating-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.e-reader__card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.e-reader__panel-header-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.e-reader__panel-header > h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.e-reader__icon-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--reader-card-border);
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
}

.e-reader__exit-button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--reader-card-border);
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
}

.e-reader__reader-stage,
.e-reader__reader-panel,
.e-reader__menu-stage,
.e-reader__book-list,
.e-reader__import-fields {
  height: 100%;
  min-height: 0;
}

.e-reader__reader-panel,
.e-reader__panel {
  border: 1px solid var(--reader-card-border);
  border-radius: 0;
  background: var(--reader-card);
  backdrop-filter: blur(12px);
}

.e-reader__reader-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 56px 12px 12px;
}

.e-reader__menu-stage {
  display: grid;
  padding: 56px 12px 12px;
}

.e-reader__source-link,
.e-reader__book-card span,
.e-reader__book-card p,
.e-reader__import-fields span,
.e-reader__font-control span,
.e-reader__library-status,
.e-reader__import-status,
.e-reader__display-meta {
  color: var(--reader-muted);
}

.e-reader__source-link {
  display: inline-flex;
  align-self: start;
  font-size: 13px;
  text-decoration: none;
}

.e-reader__page-frame {
  position: relative;
  min-height: 0;
  height: 100%;
  padding: clamp(8px, 1.2vw, 14px);
  border-radius: 30px;
  background: var(--reader-frame-bg);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.e-reader__page-frame::before,
.e-reader__page-frame::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16%;
  pointer-events: none;
}

.e-reader__page-frame::before {
  left: 0;
  background: linear-gradient(90deg, var(--reader-frame-edge-left), transparent);
}

.e-reader__page-frame::after {
  right: 0;
  background: linear-gradient(270deg, var(--reader-frame-edge-right), transparent);
}

.e-reader__page-stack {
  position: relative;
  height: 100%;
  min-height: 0;
}

.e-reader__page-stack--hidden > .e-reader__page-layer--visible .e-reader__page {
  visibility: hidden;
}

.e-reader__page-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  visibility: hidden;
}

.e-reader__page-layer--visible {
  z-index: 2;
  pointer-events: auto;
  visibility: visible;
}

.e-reader__page-layer--preloading {
  z-index: -1;
  visibility: hidden;
}

.e-reader__page-preload {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  visibility: hidden;
}

.e-reader__page-veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 24px;
  background: var(--reader-veil-bg);
  border: 1px solid var(--reader-veil-border);
  box-shadow: var(--reader-page-shadow);
}

.e-reader__page {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--reader-page-border);
  border-radius: 24px;
  background: var(--reader-page);
  box-shadow: var(--reader-page-shadow);
  will-change: transform;
  backface-visibility: hidden;
  contain: paint;
  transform: translateZ(0);
}

.e-reader__page-topline,
.e-reader__page-bottomline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--reader-muted);
}

.e-reader__page-topline-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.e-reader__page-topline-detail {
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.e-reader__timeline-meta,
.e-reader__book-card-dates {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.e-reader__page-body {
  min-height: 0;
  width: min(100%, 78ch);
  margin: 0 auto;
  line-height: 1.92;
  white-space: pre-wrap;
  overflow: hidden;
  padding-right: 0;
}

.e-reader__page-body p {
  margin: 0 0 1.15em;
}

.e-reader__page-html {
  display: grid;
  gap: 1.2em;
}

.e-reader__page-title {
  margin: 0 0 0.4em;
  font-size: clamp(1.6em, 2.6vw, 2.3em);
  line-height: 1.16;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.e-reader__page-html > * {
  margin: 0;
}

.e-reader__page-html figure {
  display: grid;
  gap: 10px;
  margin: 0;
}

.e-reader__page-html img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: min(32vh, 260px);
  border-radius: 18px;
  object-fit: cover;
  background: rgba(132, 164, 184, 0.14);
}

.e-reader__page-html figcaption,
.e-reader__page-html blockquote {
  color: var(--reader-muted);
}

.e-reader__page-measure {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  visibility: hidden;
}

.e-reader__page-body--measure {
  contain: strict;
}

.e-reader__panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.e-reader__panel--import {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.e-reader__panel--library {
  position: relative;
}

.e-reader__panel-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  min-width: 0;
}

.e-reader__panel-body--locked {
  overflow: hidden;
  padding-right: 0;
}

.e-reader__index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.e-reader__nav-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  text-align: left;
  color: inherit;
  border: 1px solid var(--reader-card-border);
  border-radius: 20px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.48), transparent 54%),
    rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.e-reader__nav-card strong {
  font-size: 15px;
}

.e-reader__nav-card p {
  margin: 0;
  color: var(--reader-muted);
  font-size: 12px;
  line-height: 1.45;
}

.e-reader__book-list,
.e-reader__import-fields,
.e-reader__import-grid,
.e-reader__news-filter-grid,
.e-reader__news-list {
  display: grid;
  gap: 12px;
}

.e-reader__book-list,
.e-reader__import-fields {
  align-content: start;
}

.e-reader__library-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.e-reader__library-sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.e-reader__library-sort-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--reader-ink);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.e-reader__library-sort-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--reader-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.e-reader__library-sort-trigger .anticon {
  flex: 0 0 auto;
  font-size: 12px;
}

.e-reader__library-sort-trigger span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.e-reader__bottom-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.e-reader__bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 18, 22, 0.18);
  pointer-events: auto;
}

.e-reader__bottom-sheet-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 12px;
  padding: 12px 0 max(18px, calc(env(safe-area-inset-bottom, 0px) + 10px));
  border-radius: 28px 28px 0 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}

.e-reader__bottom-sheet-handle {
  width: 84px;
  height: 6px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.14);
}

.e-reader__bottom-sheet-options {
  display: grid;
}

.e-reader__bottom-sheet-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 72px;
  padding: 0 20px;
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: transparent;
  color: var(--reader-ink);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.e-reader__bottom-sheet-option--selected {
  color: #0f9f61;
}

.e-reader__news-filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.e-reader__news-filter-grid label {
  display: grid;
  gap: 6px;
}

.e-reader__news-filter-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.e-reader__news-filter-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.e-reader__news-filter-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.e-reader__news-filter-date,
.e-reader__news-filter-limit {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.e-reader__news-filter-date .ant-input {
  min-height: 42px;
  border-radius: 16px;
  width: 100%;
}

.e-reader__news-filter-grid .ant-input,
.e-reader__news-filter-grid .ant-select-selector {
  min-height: 42px;
  border-radius: 16px;
}

.e-reader__news-stage {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  height: 100%;
  min-width: 0;
}

.e-reader__news-actions,
.e-reader__news-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.e-reader__news-actions {
  margin-bottom: 0;
}

.e-reader__news-status-stack {
  display: grid;
  gap: 6px;
}

.e-reader__news-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.e-reader__news-list {
  align-content: start;
  min-width: 0;
}

.e-reader__news-list--paged {
  grid-template-columns: repeat(var(--news-columns, 2), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.e-reader__news-card {
  display: grid;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  padding: 14px;
  text-align: left;
  color: inherit;
  border: 1px solid var(--reader-card-border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), transparent 52%),
    rgba(255, 255, 255, 0.26);
  cursor: pointer;
}

.e-reader__news-signal-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.e-reader__news-card--read,
.e-reader__book-card--read {
  border-color: color-mix(in srgb, var(--reader-accent) 26%, var(--reader-card-border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--reader-accent) 10%, white) 0%, transparent 52%),
    rgba(255, 255, 255, 0.3);
}

.e-reader__news-card strong {
  font-size: 15px;
  line-height: 1.45;
}

.e-reader__news-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--reader-muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.e-reader__news-meta {
  justify-content: space-between;
  align-items: start;
  font-size: 11px;
  color: var(--reader-muted);
}

.e-reader__news-meta > span,
.e-reader__timeline-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.e-reader__search-autocomplete {
  width: 100%;
}

.e-reader__search-autocomplete .ant-input-affix-wrapper,
.e-reader__search-autocomplete .ant-select-selector,
.e-reader__news-filter-limit .ant-select,
.e-reader__news-filter-limit .ant-select-selector {
  width: 100%;
  border-radius: 16px;
}

.e-reader__install-summary,
.e-reader__install-copy {
  display: grid;
  gap: 6px;
}

.e-reader__install-summary {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--reader-card-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--reader-accent) 8%, white);
}

.e-reader__install-summary span,
.e-reader__install-copy span,
.e-reader__install-status {
  font-size: 12px;
  color: var(--reader-muted);
}

.e-reader__install-summary code,
.e-reader__install-copy code {
  padding: 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.42);
}

.e-reader__install-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--reader-card-border);
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--reader-accent) 10%, white) 0%, rgba(255, 255, 255, 0.34) 100%);
}

.e-reader__install-copy strong {
  font-size: 14px;
}

.e-reader__install-status {
  margin: 0;
}

.e-reader__book-card {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 172px;
  min-width: 0;
  padding: 12px;
  text-align: left;
  color: inherit;
  border: 1px solid rgba(127, 89, 50, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), transparent 48%),
    rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.e-reader--night .e-reader__book-card {
  border-color: rgba(142, 216, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(142, 216, 255, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.02);
}

.e-reader__book-card--active {
  border-color: var(--reader-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--reader-accent) 36%, transparent);
}

.e-reader__book-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff8ef;
  background: linear-gradient(135deg, var(--reader-accent) 0%, #69b7e5 100%);
}

.e-reader__book-card strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.42;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.e-reader__book-card p,
.e-reader__import-fields span,
.e-reader__font-control span,
.e-reader__library-status,
.e-reader__import-status {
  font-size: 12px;
}

.e-reader__book-card > span,
.e-reader__book-card p,
.e-reader__library-status {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.e-reader__book-card-date {
  display: inline-flex;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--reader-muted);
}

.e-reader__library-status,
.e-reader__import-status {
  margin: 0;
}

.e-reader__book-card p {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.e-reader__book-list {
  grid-template-columns: repeat(auto-fit, minmax(208px, 1fr));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.e-reader__book-list--paged {
  grid-template-columns: repeat(var(--library-columns, 2), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  height: 100%;
}

.e-reader__book-list--paged .e-reader__book-card {
  min-height: 0;
  height: 100%;
}

.e-reader__book-empty {
  display: grid;
  gap: 6px;
  padding: 20px 16px;
  text-align: center;
  border: 1px dashed var(--reader-card-border);
  background: rgba(255, 255, 255, 0.2);
}

.e-reader__book-empty p {
  margin: 0;
  color: var(--reader-muted);
  font-size: 12px;
}

.e-reader__import-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.e-reader__import-fields label,
.e-reader__font-control {
  display: grid;
  gap: 6px;
}

.e-reader__import-body-field,
.e-reader__panel--settings .e-reader__panel-body {
  align-content: start;
}

.e-reader__import-textarea.ant-input-textarea textarea {
  min-height: 240px !important;
  resize: vertical;
}

.e-reader__import-actions,
.e-reader__theme-switcher,
.e-reader__gesture-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.e-reader__library-pager {
  display: grid;
  min-height: 0;
  height: 100%;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.e-reader__book-swipe-frame {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

.e-reader__theme-chip {
  min-width: 72px;
  padding: 10px 12px;
  border: 1px solid var(--reader-card-border);
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.e-reader__theme-chip--active {
  border-color: var(--reader-accent);
  background: color-mix(in srgb, var(--reader-accent) 14%, transparent);
}

.e-reader__gesture-hint {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--reader-surface);
  font-size: 13px;
}

.e-reader__progress {
  display: grid;
  gap: 8px;
}

.e-reader__reader-footer {
  gap: 14px;
}

.e-reader__progress {
  flex: 1;
}

.e-reader__progress strong {
  font-size: 12px;
  color: var(--reader-muted);
}

.e-reader__progress-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(39, 90, 124, 0.12);
  overflow: hidden;
}

.e-reader__progress-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--reader-accent) 0%, #69b7e5 100%);
}

@media (max-width: 720px) {
  .e-reader {
    padding: 0;
  }

  .e-reader__floating-bar {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
    align-items: flex-start;
  }

  .e-reader__reader-panel {
    padding: 56px 10px 10px;
  }

  .e-reader__menu-stage {
    padding: 56px 10px 10px;
  }

  .e-reader__panel {
    padding: 14px;
    gap: 12px;
  }

  .e-reader__panel--library .e-reader__panel-body {
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }

  .e-reader__panel--library .e-reader__book-list,
  .e-reader__panel--library .e-reader__library-pager {
    padding-bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  }

  .e-reader__import-grid,
  .e-reader__import-url-row,
  .e-reader__news-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .e-reader__news-filter-topbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .e-reader__news-filter-topbar-actions {
    justify-content: flex-start;
  }

  .e-reader__news-pager {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .e-reader__import-url-row {
    display: grid;
  }

  .e-reader__install-panel {
    grid-template-columns: 1fr;
  }

  .e-reader__page {
    padding: 18px 16px;
  }

  .e-reader__page-body {
    width: 100%;
    line-height: 1.82;
  }

  .e-reader__book-icon {
    width: 30px;
    height: 30px;
  }
}
