:root {
  --bg: #0e1116;
  --bg-soft: #12161d;
  --panel: #171c24;
  --panel-2: #1d232c;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9ecf1;
  --muted: #98a2b3;
  --accent: #e3ad74;
  --accent-2: #c98a4b;
  --danger: #f87171;
  --ok: #6ee7b7;
  --radius: 16px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(227, 173, 116, 0.12), transparent 55%),
    radial-gradient(800px 500px at 100% 0%, rgba(97, 122, 163, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

a { color: var(--accent); }

::selection { background: rgba(227, 173, 116, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------- 登录 ------------------------------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(94vw, 400px);
  padding: 34px 30px 24px;
  background: linear-gradient(180deg, rgba(26, 32, 42, 0.96), rgba(16, 20, 27, 0.96));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: #2a1a09;
  background: linear-gradient(135deg, #f0c28b, #d29555);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(201, 138, 75, 0.3);
}

.login-card h1 { text-align: center; font-size: 22px; letter-spacing: 1px; }
.login-sub { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 2px; margin: 4px 0 26px; }
.login-foot { text-align: center; color: rgba(152, 162, 179, 0.6); font-size: 11.5px; margin-top: 18px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

.field input, .search-input, select {
  width: 100%;
  background: #0b0f15;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus, .search-input:focus, select:focus {
  border-color: rgba(227, 173, 116, 0.7);
  box-shadow: 0 0 0 3px rgba(227, 173, 116, 0.13);
}

select { cursor: pointer; }

.form-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #efc38e, #d79a5b);
  color: #2a1907;
  box-shadow: 0 8px 22px rgba(201, 138, 75, 0.22);
}

.btn-primary:hover { background: linear-gradient(135deg, #f5d0a2, #e2a96c); }

.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.16); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); background: transparent; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
}

.icon-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.06); }

/* ------------------------------- 顶栏 ------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px 26px;
  background: rgba(14, 17, 22, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 170px; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0c28b, #c98a4b);
  color: #2a1907;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 8px 18px rgba(201, 138, 75, 0.22);
}

.brand-text h1 { font-size: 16.5px; letter-spacing: 0.5px; }
.brand-text p { color: var(--muted); font-size: 11.5px; letter-spacing: 1px; }

.tabs { display: flex; align-items: center; gap: 4px; padding: 4px; background: rgba(255, 255, 255, 0.05); border-radius: 12px; }

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab span { font-size: 11px; opacity: 0.7; margin-left: 4px; }
.tab:hover { color: var(--text); }
.tab.active { background: rgba(227, 173, 116, 0.16); color: #f3cf9f; }

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

/* ------------------------------- 布局 ------------------------------- */

.layout { width: min(1280px, 100% - 48px); margin: 22px auto 0; }

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cat-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.cat-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.cat-chip.active { background: rgba(227, 173, 116, 0.15); border-color: rgba(227, 173, 116, 0.45); color: #f3cf9f; }

.lib-tools { display: flex; align-items: center; gap: 12px; }
.search-input { width: 230px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; }
.shelf-stat { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ------------------------------- 书架 ------------------------------- */

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 22px 18px;
  padding-bottom: 30px;
}

.book-card {
  position: relative;
  cursor: pointer;
  border-radius: 14px;
  transition: transform 0.18s ease;
}

.book-card:hover { transform: translateY(-4px); }

.cover-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #232a35, #141922);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

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

.cover-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 10.5px;
  color: #e6e8ec;
  backdrop-filter: blur(6px);
}

.cover-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  display: flex;
  align-items: flex-end;
  padding: 0 8px 7px;
}

.cover-progress span { font-size: 10.5px; color: #f3cf9f; font-weight: 600; }

.cover-progress::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--p, 0%);
  background: linear-gradient(90deg, #c98a4b, #f0c28b);
}

.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.book-card:hover .card-actions { opacity: 1; }

.card-actions button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 13, 18, 0.8);
  color: #e6e8ec;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
  backdrop-filter: blur(6px);
}

.card-actions button:hover { background: rgba(201, 138, 75, 0.85); color: #2a1907; }

.book-meta { padding: 9px 2px 0; }
.book-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 11.5px; overflow: hidden; }
.book-sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { opacity: 0.4; }

/* ------------------------------- 空状态 / 页脚 ------------------------------- */

.empty-state {
  padding: 60px 20px 80px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--muted);
}

.empty-icon { font-size: 38px; margin-bottom: 10px; }
.empty-state h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.foot {
  width: min(1280px, 100% - 48px);
  margin: 0 auto;
  padding: 20px 4px 34px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(152, 162, 179, 0.55);
  font-size: 11.5px;
}

/* ------------------------------- 弹窗 ------------------------------- */

.dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #12171f;
  color: var(--text);
  padding: 22px 24px;
  width: min(94vw, 460px);
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

.dialog::backdrop { background: rgba(3, 5, 8, 0.72); backdrop-filter: blur(3px); }

.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dialog-head h2 { font-size: 18px; font-weight: 650; }
.dialog-note { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.upload-dialog { width: min(94vw, 600px); }
.search-dialog { width: min(94vw, 720px); }

.form-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }

.seg { display: flex; padding: 3px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.seg-btn.active { background: rgba(227, 173, 116, 0.18); color: #f3cf9f; }

.mini-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); }
.mini-field select { min-width: 120px; padding: 7px 10px; border-radius: 9px; }

.drop-zone {
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 26px 18px;
  text-align: center;
  transition: all 0.15s ease;
  background: rgba(255, 255, 255, 0.02);
}

.drop-zone.dragover { border-color: rgba(227, 173, 116, 0.7); background: rgba(227, 173, 116, 0.07); }
.drop-icon { font-size: 26px; color: var(--accent); margin-bottom: 6px; }
.drop-zone p { font-size: 13.5px; }
.drop-hint { color: var(--muted); font-size: 11.5px !important; margin: 5px 0 14px !important; }
.drop-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.upload-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.upload-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.02);
}

.upload-item-head { display: flex; justify-content: space-between; gap: 10px; }
.upload-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-state { color: var(--muted); flex: none; }
.upload-bar { height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; margin-top: 7px; overflow: hidden; }
.upload-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c98a4b, #f0c28b); transition: width 0.2s ease; }
.upload-item.error { border-color: rgba(248, 113, 113, 0.4); }
.upload-item.done { border-color: rgba(110, 231, 183, 0.25); }

.search-row { display: flex; gap: 10px; margin-bottom: 10px; }
.search-row .search-input { flex: 1; width: auto; }
.search-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.search-results { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.url-import { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.url-import .search-input { flex: 1; min-width: 200px; }
.url-import select { width: auto; min-width: 100px; padding: 8px 10px; border-radius: 9px; }
#urlStatus { margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 12px; }

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.result-main { flex: 1; min-width: 0; }
.result-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-source { flex: none; font-size: 10.5px; color: #f3cf9f; border: 1px solid rgba(227, 173, 116, 0.35); padding: 2px 7px; border-radius: 999px; }
.result-item .btn { flex: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  z-index: 300;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(227, 173, 116, 0.35);
  background: rgba(16, 20, 27, 0.97);
  color: #f3e3cf;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(248, 113, 113, 0.45); color: #fecaca; }

/* ------------------------------- 阅读器 ------------------------------- */

.reader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #101318;
  color: #e9ecf1;
}

.reader[data-theme="light"] { background: #f5f0e6; color: #2b2a27; }
.reader[data-theme="sepia"] { background: #efe1c6; color: #4a3a28; }
.reader[data-theme="dark"] { background: #101318; color: #d9dee8; }

.reader-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.18);
  flex: none;
  background: inherit;
  z-index: 2;
}

.reader-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-progress-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.reader[data-theme="light"] .reader-progress-label,
.reader[data-theme="sepia"] .reader-progress-label { color: #8a7a62; }

.reader-body { display: flex; flex: 1; min-height: 0; position: relative; }

.reader-sidebar {
  width: 280px;
  flex: none;
  border-right: 1px solid rgba(128, 128, 128, 0.16);
  overflow: auto;
  padding: 12px;
  background: inherit;
}

.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; color: var(--muted); font-size: 11.5px; }

.chapter-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.72;
}

.chapter-item:hover { background: rgba(128, 128, 128, 0.12); opacity: 1; }
.chapter-item.active { background: rgba(227, 173, 116, 0.16); color: #c98a4b; opacity: 1; }

.reader-main { flex: 1; min-width: 0; overflow: auto; }

.reader-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 42px 34px 120px;
  font-size: var(--reader-font, 19px);
  line-height: var(--reader-line, 1.95);
}

.reader-content h2.chapter-title {
  font-size: 1.35em;
  margin: 0 0 1.2em;
  font-weight: 650;
  padding-bottom: 0.6em;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.reader-text p { margin: 0 0 0.9em; text-indent: 2em; }
.reader-text img { max-width: 100%; height: auto; display: block; margin: 1em auto; border-radius: 6px; }
.reader-text h1, .reader-text h2, .reader-text h3, .reader-text h4 { margin: 1.4em 0 0.7em; line-height: 1.4; }
.reader-text blockquote { margin: 1em 0; padding: 0.5em 1em; border-left: 3px solid rgba(201, 138, 75, 0.6); opacity: 0.9; }
.reader-text .epub-link { color: inherit; }
.reader-text .epub-svg { margin: 1em auto; text-align: center; }
.reader-text table { max-width: 100%; border-collapse: collapse; }
.reader-text td, .reader-text th { border: 1px solid rgba(128, 128, 128, 0.3); padding: 4px 8px; }
.reader-text ruby rt { font-size: 0.55em; }

.reader-controls {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(18, 22, 29, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  z-index: 5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.reader[data-theme="light"] .reader-controls,
.reader[data-theme="sepia"] .reader-controls { background: rgba(255, 255, 255, 0.86); border-color: rgba(0, 0, 0, 0.12); }

.reader-controls button {
  border: none;
  background: transparent;
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
}

.reader-controls button:hover { background: rgba(128, 128, 128, 0.18); }
.reader-controls button:disabled { opacity: 0.35; cursor: default; }

.reader-page-input {
  width: 54px;
  text-align: center;
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 8px;
  background: transparent;
  padding: 5px 4px;
  color: inherit;
  font-size: 12.5px;
}

.reader-control-label { font-size: 12px; color: inherit; opacity: 0.65; padding: 0 2px; }

.reader-settings {
  position: absolute;
  right: 18px;
  top: 62px;
  width: 240px;
  padding: 14px;
  border-radius: 14px;
  background: #171c24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #e9ecf1;
}

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.setting-row input[type="range"] { width: 110px; accent-color: #d79a5b; }
.theme-btns { display: flex; gap: 6px; }
.theme-btn { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.theme-btn.active { border-color: #e3ad74; }
.theme-btn[data-theme="light"] { background: #f5f0e6; }
.theme-btn[data-theme="sepia"] { background: #efe1c6; }
.theme-btn[data-theme="dark"] { background: #101318; }

.reader-empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* 漫画 / PDF */
.reader.manga .reader-main,
.reader.pdf .reader-main {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #06070a;
  position: relative;
}

.reader.manga .reader-main {
  overflow: hidden;
}

.reader.pdf .reader-main {
  overflow: auto;
  align-items: flex-start;
}

.manga-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: auto;
}

.manga-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  background: #0b0d12;
}

.manga-stage.fit-width img { width: 100%; max-height: none; }
.manga-stage.fit-height img { height: 100%; max-height: 100%; width: auto; }

.reader.manga .reader-controls { background: rgba(12, 14, 18, 0.9); color: #e9ecf1; border-color: rgba(255, 255, 255, 0.12); }

.zoom-label { font-size: 11.5px; opacity: 0.65; min-width: 42px; text-align: center; }

.pdf-canvas-wrap { padding: 16px; display: flex; justify-content: center; }
.pdf-canvas-wrap canvas { max-width: 100%; height: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); background: #fff; }

.pdf-loading { color: #98a2b3; padding: 60px 20px; text-align: center; }

/* 漫画点击热区 */
.manga-zone { position: absolute; top: 0; bottom: 0; width: 33%; z-index: 3; cursor: pointer; opacity: 0; }
.manga-zone.left { left: 0; }
.manga-zone.right { right: 0; }

/* ------------------------------- 响应式 ------------------------------- */

@media (max-width: 960px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .brand { min-width: 0; }
  .tabs { order: 3; width: 100%; }
  .tab { flex: 1; }
  .top-actions { margin-left: auto; }
  .layout, .foot { width: calc(100% - 24px); }
  .library-head { align-items: flex-start; }
  .lib-tools { width: 100%; }
  .search-input { flex: 1; width: auto; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 12px; }
  .reader-sidebar { position: absolute; inset: 0 auto 0 0; width: 260px; z-index: 6; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 20px 0 40px rgba(0, 0, 0, 0.3); }
  .reader-sidebar.open { transform: translateX(0); }
  .reader-content { padding: 28px 20px 110px; }
}

@media (max-width: 560px) {
  .brand-text p { display: none; }
  .top-actions .btn { padding: 7px 10px; font-size: 12px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-actions { opacity: 1; }
  .book-title { font-size: 12.5px; }
  .dialog { padding: 18px; }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }
  .reader-title { font-size: 12.5px; }
  .reader-progress-label { display: none; }
  .reader-controls { bottom: 12px; max-width: calc(100vw - 20px); }
  .reader-settings { right: 10px; top: 56px; max-width: calc(100vw - 20px); }
}
