:root {
  color-scheme: light;
  font-family:
    Source Han Sans SC,
    PingFang SC,
    Microsoft YaHei UI,
    sans-serif;
  --page-bg: #efe5d2;
  --page-glow: rgba(244, 219, 177, 0.7);
  --panel: rgba(255, 250, 241, 0.9);
  --panel-strong: rgba(255, 252, 246, 0.96);
  --panel-border: rgba(58, 44, 29, 0.12);
  --panel-shadow: 0 22px 48px rgba(64, 42, 18, 0.12);
  --text-main: #241b13;
  --text-muted: #6e5a49;
  --text-soft: #8e7865;
  --accent: #a5521d;
  --accent-strong: #ca7131;
  --accent-soft: rgba(202, 113, 49, 0.12);
  --deep: #17352e;
  --deep-soft: rgba(23, 53, 46, 0.1);
  --danger: #8d2d29;
  --danger-soft: rgba(141, 45, 41, 0.1);
  background: var(--page-bg);
  color: var(--text-main);
}
html,
body,
#root {
  min-height: 100%;
}
* {
  box-sizing: border-box;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #644c3447;
  background-clip: padding-box;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 14%, var(--page-glow), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(35, 82, 68, 0.12), transparent 24%),
    linear-gradient(180deg, #f6eddc, #f0e2c8 45%, #e7d8bb);
  color: var(--text-main);
}
button,
input,
select {
  font: inherit;
}
a {
  color: inherit;
}
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  isolation: isolate;
}
.app-shell:before,
.app-shell:after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  pointer-events: none;
  filter: blur(12px);
}
.app-shell:before {
  top: 140px;
  right: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: #ca713124;
}
.app-shell:after {
  bottom: 80px;
  left: -50px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: #17352e14;
}
.app-shell:fullscreen {
  width: 100%;
  height: 100%;
}
.app-shell.is-fullscreen {
  min-height: 100%;
  height: 100%;
}
.site-watermark {
  position: fixed;
  right: max(14px, calc(14px + env(safe-area-inset-right)));
  bottom: max(12px, calc(12px + env(safe-area-inset-bottom)));
  z-index: 12;
  pointer-events: none;
  user-select: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(36, 27, 19, 0.34);
  opacity: 0.72;
  white-space: nowrap;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  margin: 16px 16px 0;
  padding: 22px 24px;
  border: 1px solid rgba(58, 44, 29, 0.1);
  border-radius: 28px;
  background:
    linear-gradient(135deg, #fffbf4f0, #f9f2e7e0),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--panel-shadow);
}
.topbar-copy {
  min-width: 0;
  flex: 1 1 520px;
}
.topbar-kicker,
.pane-eyebrow,
.empty-state-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--text-soft);
}
.topbar-kicker:before,
.pane-eyebrow:before,
.empty-state-kicker:before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.75;
}
.topbar h1 {
  margin: 0;
  font-family:
    "Source Han Serif SC",
    "Noto Serif SC",
    Songti SC,
    serif;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.topbar p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
}
.topbar-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.download-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.download-strip-label {
  font-size: 12px;
  color: var(--text-soft);
}
.download-link-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(58, 44, 29, 0.1);
  text-decoration: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.download-link-chip.is-primary {
  background: #17352e14;
  color: var(--deep);
}
.download-link-chip.is-primary:hover {
  transform: translateY(-1px);
  border-color: #17352e38;
  box-shadow: 0 12px 22px #1c342c1a;
}
.download-link-chip.is-backup {
  background: #ffffffb3;
  color: var(--accent);
  box-shadow: 0 10px 20px #4d381f0f;
}
.download-link-chip.is-backup:hover {
  transform: translateY(-1px);
  border-color: #a5521d3d;
  box-shadow: 0 14px 24px #4d381f1a;
}
.topbar-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 100%;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff94;
  border: 1px solid rgba(58, 44, 29, 0.08);
  color: var(--text-muted);
  font-size: 13px;
  box-shadow: inset 0 1px #ffffff8c;
}
.topbar-note.is-book {
  background: #17352e14;
  color: var(--deep);
  max-width: min(100%, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-note.is-warning {
  background: #8d2d2916;
  color: var(--danger);
  border-color: #8d2d2928;
}
.topbar-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 1 540px;
  flex-wrap: wrap;
}
.book-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 290px;
}
.book-selector span {
  font-size: 12px;
  color: var(--text-soft);
}
.book-selector select {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(58, 44, 29, 0.12);
  background: #fffefaeb;
  color: var(--text-main);
  box-shadow: inset 0 1px #ffffff8c;
}
.reader-mode-button,
.import-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(58, 44, 29, 0.1);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}
.reader-mode-button {
  background: #fffdf8f0;
  color: #3f2f22;
  box-shadow: 0 10px 20px #4d381f14;
  text-decoration: none;
}
.reader-mode-button:hover:not(:disabled),
.import-button:hover {
  transform: translateY(-2px);
  border-color: #a5521d47;
  box-shadow: 0 16px 26px #4d381f1f;
}
.reader-mode-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}
.reader-mode-button.is-floating,
.import-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fffaf4;
  border-color: #8f42144d;
  box-shadow: 0 18px 30px #84451938;
}
.import-button input {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}
.notice-banner,
.error-banner,
.loading,
.pane-error,
.empty-state {
  margin: 16px 16px 0;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(58, 44, 29, 0.08);
  box-shadow: var(--panel-shadow);
}
.notice-banner {
  background: linear-gradient(135deg, #5e4e3a1c, #fffbf4b8);
  color: #574b3f;
}
.warning-banner {
  background: linear-gradient(135deg, #8d2d291c, #fff8f3);
  color: var(--danger);
  border-color: #8d2d2924;
}
.warning-banner strong {
  display: block;
  margin-bottom: 6px;
}
.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.update-banner strong {
  display: block;
  margin-bottom: 5px;
}
.update-banner-text {
  color: var(--text-muted);
  word-break: break-word;
}
.update-banner-link-row {
  margin-top: 8px;
}
.update-banner-link-row a {
  color: var(--accent);
}
.update-action-button {
  flex: none;
}
.error-banner,
.pane-error {
  background: linear-gradient(135deg, #8d2d291c, #fff8f6d1);
  color: var(--danger);
  border-color: #8d2d291f;
}
.loading {
  background: linear-gradient(135deg, #17352e14, #fffbf4c7);
  color: var(--deep);
}
.empty-state {
  max-width: 820px;
  margin: 32px auto 0;
  padding: 34px 30px;
  background:
    radial-gradient(
      circle at top right,
      rgba(202, 113, 49, 0.12),
      transparent 26%
    ),
    linear-gradient(135deg, #fffbf4f5, #f7efe2f5);
  border: 1px solid rgba(58, 44, 29, 0.1);
}
.empty-state h2 {
  margin: 0 0 12px;
  font-family:
    "Source Han Serif SC",
    "Noto Serif SC",
    Songti SC,
    serif;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.12;
}
.empty-state p {
  margin: 0 0 10px;
  line-height: 1.85;
  color: var(--text-muted);
}
.empty-state code {
  padding: 3px 8px;
  border-radius: 10px;
  background: #17352e14;
  color: var(--deep);
}
.empty-state-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.empty-state-tips span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffffb8;
  border: 1px solid rgba(58, 44, 29, 0.08);
  color: var(--text-muted);
  font-size: 13px;
}
.library-shelf,
.bookmark-shelf {
  margin: 16px 16px 0;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(58, 44, 29, 0.08);
  background: linear-gradient(135deg, #fffbf4f5, #f7efe2f0);
  box-shadow: var(--panel-shadow);
}
.library-shelf-header h2,
.bookmark-shelf-header h2 {
  margin: 0;
  font-family:
    "Source Han Serif SC",
    "Noto Serif SC",
    Songti SC,
    serif;
  font-size: 28px;
  line-height: 1.12;
}
.library-shelf-header p,
.bookmark-shelf-header p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.8;
}
.library-list,
.bookmark-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.library-card,
.bookmark-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(58, 44, 29, 0.08);
  background: #ffffffb8;
}
.library-card.is-current,
.bookmark-card.is-current {
  border-color: #17352e2e;
  background: #17352e12;
}
.bookmark-card.is-unavailable {
  opacity: 0.82;
}
.library-card-copy,
.bookmark-card-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.library-card-copy h3,
.bookmark-card-copy h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  color: var(--text-main);
}
.library-card-copy p,
.bookmark-card-copy p {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}
.library-card-actions,
.bookmark-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.library-card-subtle {
  font-size: 13px;
}
.library-card-actions .reader-mode-button {
  min-height: 46px;
}
.bookmark-delete-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(141, 45, 41, 0.16);
  background: #8d2d2914;
  color: var(--danger);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}
.bookmark-delete-button:hover {
  transform: translateY(-1px);
  border-color: #8d2d2947;
  box-shadow: 0 14px 24px #8d2d291a;
}
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  padding: 18px;
}
.pane-shell {
  min-height: 0;
}
.left-pane,
.right-pane {
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(32, 26, 21, 0.12);
  background: linear-gradient(180deg, #fffdf8f2, #fff8efe8);
  box-shadow: 0 18px 36px #57432814;
}
.pdf-pane,
.translation-pane {
  height: 100%;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}
.pdf-pages {
  margin: 0 auto;
  padding: 18px 0 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}
.pdf-page-card {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(32, 26, 21, 0.06);
  background: linear-gradient(180deg, #fffdfb, #fffaf4);
  box-shadow: 0 12px 26px #2e241518;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.pdf-page-surface {
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffefc, #f7f1e7ec);
  border: 1px solid rgba(32, 26, 21, 0.08);
}
.pdf-page-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.pdf-page-label {
  font-size: 12px;
  line-height: 20px;
  min-height: 20px;
  display: block;
  color: #7b6d60;
  margin-bottom: 12px;
}
.right-pane {
  display: flex;
  flex-direction: column;
}
.sync-status {
  display: flex;
  gap: 16px;
  padding: 14px 18px;
  color: #6a5b4f;
  font-size: 13px;
  flex-wrap: wrap;
  flex: none;
  border-bottom: 1px solid rgba(32, 26, 21, 0.1);
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(248, 239, 226, 0.82));
}
.sync-status span {
  display: inline;
}
.translation-pane {
  padding: 18px;
}
.translation-empty {
  color: var(--text-muted);
}
.translation-page-group {
  margin-bottom: 30px;
}
.translation-page-group h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.2;
  color: var(--deep);
}
.translation-page-group h2:before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 6px #ca71311f;
}
.translation-card {
  position: relative;
  margin-bottom: 12px;
  padding: 16px 18px 16px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf9fc, #fff8edf7);
  border: 1px solid rgba(58, 44, 29, 0.08);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 9px 18px #34241112;
}
.translation-card:before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #17352e26, #ca71318c);
}
.translation-card:hover {
  transform: translateY(-1px);
  border-color: #ca713152;
  box-shadow: 0 16px 28px #3424111a;
}
.translation-card.is-active {
  border-color: #ca71317a;
  background: linear-gradient(180deg, #fff7e9fc, #fff0d8fb);
  transform: translate3d(-3px, 0, 0);
  box-shadow: 0 18px 30px #5e341022;
}
.translation-card.is-active:before {
  background: linear-gradient(180deg, var(--accent), #e18a3a);
}
.translation-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.translation-card p {
  margin: 0;
  color: #2e2318;
  line-height: 1.82;
  white-space: pre-wrap;
}
.translation-type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 10px;
  padding: 0 10px;
  border-radius: 999px;
  background: #17352e14;
  color: var(--deep);
  font-size: 12px;
}
.reader-floating-controls {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  width: 58px;
  height: 58px;
  pointer-events: none;
}
.reader-floating-controls > * {
  pointer-events: auto;
}
.reader-floating-controls.is-dragging {
  z-index: 34;
}
.reader-floating-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  width: min(168px, calc(100vw - 44px));
  max-width: 100%;
  padding: 10px;
  border-radius: 24px;
  border: 1px solid rgba(58, 44, 29, 0.1);
  background: linear-gradient(135deg, #fffbf4f2, #f5ebdaeb);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 40px #201a1526;
  transform-origin: bottom right;
  transition:
    opacity 0.22s ease,
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.26s ease,
    padding 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
  overflow: hidden;
  max-height: 80px;
  will-change: transform, opacity;
}
.reader-floating-controls.is-right-edge .reader-floating-panel {
  right: 0;
}
.reader-floating-controls.is-left-edge .reader-floating-panel {
  left: 0;
  transform-origin: bottom left;
}
.reader-floating-controls.is-collapsed .reader-floating-panel {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
}
.reader-floating-actions {
  display: flex;
  align-items: center;
  justify-content: center;
}
.reader-floating-ball {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(143, 66, 20, 0.28);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fffaf4;
  box-shadow: 0 18px 30px #84451942;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
  will-change: transform, box-shadow;
}
.reader-floating-ball:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 34px #84451952;
}
.reader-floating-controls.is-dragging .reader-floating-ball,
.reader-floating-ball:active {
  cursor: grabbing;
  transform: scale(1.04);
  filter: saturate(1.06);
}
.reader-floating-ball-page {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.reader-floating-ball-label {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1;
}
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 228, 180, 0.22), transparent 36%),
    #18120e75;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.bookmark-modal {
  width: min(560px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, #fffbf4fa, #f7efe3fa);
  border: 1px solid rgba(58, 44, 29, 0.1);
  box-shadow: 0 28px 56px #201a1533;
}
.bookmark-modal h2 {
  margin: 0 0 12px;
  font-family:
    "Source Han Serif SC",
    "Noto Serif SC",
    Songti SC,
    serif;
  font-size: 28px;
}
.bookmark-modal p {
  margin: 0 0 10px;
  line-height: 1.8;
  color: var(--text-muted);
}
.bookmark-modal-meta {
  color: var(--text-soft);
  font-size: 14px;
}
.bookmark-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}
.app-shell.is-fullscreen .topbar {
  display: none;
}
.app-shell.is-fullscreen .workspace {
  gap: 12px;
  padding: 12px;
}
.app-shell.is-fullscreen .pane-shell {
  border-radius: 14px;
}
.app-shell.is-fullscreen .sync-status {
  display: none;
}
.app-shell.is-fullscreen .notice-banner,
.app-shell.is-fullscreen .error-banner {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  margin: 0;
  z-index: 35;
}
.app-shell.low-power .topbar,
.app-shell.low-power .reader-floating-panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.app-shell.low-power .reader-mode-button,
.app-shell.low-power .import-button,
.app-shell.low-power .bookmark-delete-button,
.app-shell.low-power .translation-card,
.app-shell.low-power .reader-floating-panel,
.app-shell.low-power .reader-floating-ball {
  transition: none;
}
.app-shell.low-power .pane-shell,
.app-shell.low-power .pdf-page-card,
.app-shell.low-power .reader-mode-button,
.app-shell.low-power .import-button,
.app-shell.low-power .bookmark-delete-button,
.app-shell.low-power .reader-floating-panel,
.app-shell.low-power .reader-floating-ball,
.app-shell.low-power .notice-banner,
.app-shell.low-power .error-banner,
.app-shell.low-power .library-shelf,
.app-shell.low-power .bookmark-shelf,
.app-shell.low-power .empty-state {
  box-shadow: none;
}
.app-shell.low-power .translation-card.is-active,
.app-shell.low-power .translation-card:hover {
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .pdf-page-card,
  .translation-card,
  .reader-floating-panel,
  .reader-floating-ball {
    transition: none;
  }

  .translation-card:hover,
  .translation-card.is-active,
  .reader-floating-ball:hover,
  .reader-floating-ball:active {
    transform: none;
  }
}
@media (max-width: 1180px) {
  .topbar {
    flex-direction: column;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .book-selector {
    min-width: min(100%, 300px);
  }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .topbar {
    margin: 12px 12px 0;
    padding: 18px;
    border-radius: 22px;
  }
  .topbar h1 {
    font-size: 34px;
  }
  .topbar-actions {
    gap: 10px;
  }
  .book-selector,
  .book-selector select,
  .reader-mode-button,
  .import-button,
  .backup-link-button {
    width: 100%;
  }
  .notice-banner,
  .error-banner {
    margin: 12px 12px 0;
  }
  .workspace {
    gap: 12px;
    padding: 12px;
  }
  .sync-status {
    gap: 8px;
  }
  .sync-status span {
    width: auto;
  }
  .empty-state {
    margin: 20px 12px 0;
    padding: 24px 20px;
  }
  .library-shelf,
  .bookmark-shelf {
    margin: 12px 12px 0;
    padding: 18px;
  }
  .library-card,
  .bookmark-card {
    align-items: stretch;
    flex-direction: column;
  }
  .library-card-actions,
  .bookmark-card-actions {
    justify-content: stretch;
  }
  .library-card-actions .reader-mode-button,
  .library-card-actions .bookmark-delete-button,
  .bookmark-card-actions .reader-mode-button,
  .bookmark-delete-button {
    width: 100%;
  }
  .update-banner,
  .bookmark-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .reader-floating-controls {
    width: 54px;
    height: 54px;
  }
  .reader-floating-panel {
    width: min(168px, calc(100vw - 24px));
  }
  .reader-floating-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .reader-floating-actions .reader-mode-button,
  .reader-mode-button.is-floating {
    width: 100%;
  }
  .site-watermark {
    right: max(10px, calc(10px + env(safe-area-inset-right)));
    bottom: max(10px, calc(10px + env(safe-area-inset-bottom)));
    font-size: 11px;
  }
}
@media (max-width: 520px) {
  .topbar-note,
  .download-link-chip,
  .empty-state-tips span {
    width: 100%;
    justify-content: center;
  }
}
