/* ==========================================================================
   云阁书库 · 基础样式（书架 / 通用组件）
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --bg-soft: #10151d;
  --panel: #141a23;
  --panel-2: #1a2230;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ece8e0;
  --muted: #96a0b2;
  --faint: #6b7688;
  --accent: #d9a85c;
  --accent-strong: #f0c078;
  --accent-soft: rgba(217, 168, 92, 0.13);
  --danger: #e4776a;
  --ok: #6fbf9b;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Songti SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 12% -10%, rgba(217, 168, 92, 0.09), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(88, 132, 196, 0.09), transparent 62%),
    linear-gradient(180deg, #0b0f15 0%, #080b0f 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

svg {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 46px);
  background: rgba(8, 11, 15, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #14171c;
  background: linear-gradient(150deg, var(--accent-strong), #b9833a);
  box-shadow: 0 8px 22px rgba(217, 168, 92, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 46vw;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(111, 191, 155, 0.16);
  flex: 0 0 auto;
}

.status-dot.is-busy {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 168, 92, 0.18);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   页面容器
   -------------------------------------------------------------------------- */

.shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 46px) 72px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(150deg, var(--accent-strong), #c1893f);
  color: #17130a;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(217, 168, 92, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(150deg, #f6cb8a, #ce9445);
}

.btn-small {
  padding: 7px 14px;
  font-size: 12.5px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
}

/* --------------------------------------------------------------------------
   继续阅读
   -------------------------------------------------------------------------- */

.continue {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
  padding: 18px 22px;
  border: 1px solid rgba(217, 168, 92, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, rgba(217, 168, 92, 0.12), rgba(217, 168, 92, 0.02) 46%, transparent 70%),
    var(--panel);
  box-shadow: var(--shadow);
}

.continue-cover {
  position: relative;
  width: 62px;
  height: 82px;
  flex: 0 0 auto;
  border-radius: 6px 9px 9px 6px;
  background: linear-gradient(150deg, hsl(32 36% 38%), hsl(24 42% 16%));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.continue-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent);
}

.continue-cover span {
  position: absolute;
  left: 12px;
  right: 8px;
  bottom: 8px;
  font-family: var(--font-serif);
  font-size: 10.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.continue-body {
  flex: 1 1 auto;
  min-width: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.continue-body h2 {
  margin: 2px 0 4px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-body p {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   工具栏
   -------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 46px 0 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.search input::placeholder {
  color: var(--faint);
}

.search input:focus {
  border-color: rgba(217, 168, 92, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  transition: all 0.18s ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.is-active {
  color: #17130a;
  border-color: transparent;
  background: linear-gradient(150deg, var(--accent-strong), #c1893f);
  font-weight: 600;
}

.chip .count {
  margin-left: 5px;
  opacity: 0.62;
  font-size: 11px;
}

.sort-wrap {
  position: relative;
  flex: 0 0 auto;
}

.sort-wrap select {
  appearance: none;
  height: 40px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}

.sort-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.local-open {
  flex: 0 0 auto;
  color: var(--accent-strong);
  border-color: rgba(217, 168, 92, 0.28);
  background: var(--accent-soft);
}

.local-open:hover {
  border-color: rgba(217, 168, 92, 0.5);
  background: rgba(217, 168, 92, 0.2);
}

.upload-open[hidden] {
  display: none;
}

.upload-open:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* --------------------------------------------------------------------------
   书架网格与卡片
   -------------------------------------------------------------------------- */

.shelf {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  column-gap: 24px;
  row-gap: 0;
  padding: 24px 22px 26px;
  border: 1px solid rgba(217, 168, 92, 0.12);
  border-radius: 20px;
  perspective: 1600px;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(217, 168, 92, 0.07), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 1px, rgba(255, 255, 255, 0.012) 1px 3px, transparent 3px 88px),
    linear-gradient(165deg, #241a11 0%, #1a120c 46%, #120c08 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -40px 70px rgba(0, 0, 0, 0.55),
    0 26px 60px rgba(0, 0, 0, 0.42);
}

/* 书柜两侧的立板 */
.shelf::before,
.shelf::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 13px;
  pointer-events: none;
  background: linear-gradient(90deg, #5a3d23, #33210f 60%, #241608);
  box-shadow: inset -1px 0 0 rgba(255, 214, 160, 0.16), 6px 0 14px rgba(0, 0, 0, 0.5);
}

.shelf::before {
  left: 0;
}

.shelf::after {
  right: 0;
  background: linear-gradient(270deg, #5a3d23, #33210f 60%, #241608);
  box-shadow: inset 1px 0 0 rgba(255, 214, 160, 0.16), -6px 0 14px rgba(0, 0, 0, 0.5);
}

.book {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 10px 34px;
  border: 0;
  border-radius: 0;
}

.book:hover .book-title {
  color: var(--accent-strong);
}

/* 层板：横向铺满整个书柜，同一行拼成整块木板 */
.shelf-board {
  position: relative;
  z-index: 3;
  display: block;
  height: 15px;
  margin: -1px -9999px 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, #7d5936 0%, #5c3f25 26%, #3d2816 66%, #241608 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 226, 180, 0.34),
    inset 0 -3px 0 rgba(0, 0, 0, 0.5),
    0 12px 18px -6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 4px 10px 10px 4px;
  background:
    linear-gradient(150deg, var(--c1, hsl(32 34% 34%)), var(--c2, hsl(24 40% 14%)));
  transform: perspective(1400px) rotateY(-6deg);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.22, 0.7, 0.3, 1), box-shadow 0.3s ease;
  box-shadow:
    0 16px 24px -10px rgba(0, 0, 0, 0.75),
    0 3px 6px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset -14px 0 22px rgba(0, 0, 0, 0.18),
    inset -2px 0 0 rgba(238, 227, 205, 0.42);
  overflow: hidden;
  isolation: isolate;
}

.book:nth-child(3n + 1) .cover {
  transform: perspective(1400px) rotateY(-3deg);
}

.book:nth-child(3n + 2) .cover {
  transform: perspective(1400px) rotateY(-11deg);
}

.book:hover .cover,
.book:focus-within .cover {
  transform: perspective(1400px) rotateY(0deg) translateY(-5px);
  box-shadow:
    0 26px 34px -12px rgba(0, 0, 0, 0.8),
    0 6px 10px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset -14px 0 22px rgba(0, 0, 0, 0.16),
    inset -2px 0 0 rgba(238, 227, 205, 0.5);
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 15px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 52px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2) 58%, transparent);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 2;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 84% -6%, rgba(255, 255, 255, 0.2), transparent 58%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.028) 0 2px, transparent 2px 7px);
  mix-blend-mode: screen;
  opacity: 0.75;
  pointer-events: none;
}

.cover-badge {
  position: absolute;
  top: 11px;
  right: 10px;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.86);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  backdrop-filter: blur(4px);
}

.cover-title {
  position: absolute;
  z-index: 3;
  left: 24px;
  right: 14px;
  top: 26%;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.cover-rule {
  position: absolute;
  z-index: 3;
  left: 24px;
  bottom: 20px;
  width: 26px;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
}

.book-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding-top: 14px;
}

.book-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.book-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.book-download {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  opacity: 0;
}

.book:hover .book-download,
.book-download:focus-visible {
  opacity: 1;
}

.book-remove {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--faint);
  opacity: 0;
}

.book:hover .book-remove,
.book-remove:focus-visible {
  opacity: 1;
}

.book-remove:hover {
  color: var(--danger);
}

.book-dir {
  margin: 0;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--faint);
}

.tag {
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.tag-epub { color: #8fd3b4; background: rgba(111, 191, 155, 0.14); }
.tag-pdf { color: #efa196; background: rgba(228, 119, 106, 0.14); }
.tag-markdown,
.tag-txt { color: #a9c4e6; background: rgba(120, 160, 214, 0.14); }
.tag-fb2 { color: #c0b1ea; background: rgba(150, 128, 214, 0.14); }
.tag-comic { color: #e9c07a; background: rgba(217, 168, 92, 0.16); }
.tag-image { color: #f0b6cf; background: rgba(214, 120, 165, 0.14); }
.tag-download { color: var(--muted); }
.tag-local { color: var(--accent-strong); background: var(--accent-soft); }

.book-progress {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.book-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.book-progress-text {
  margin: 0;
  font-size: 11px;
  color: var(--accent);
}

.book-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.book-actions .btn {
  flex: 1 1 auto;
}

/* 骨架屏 */
.skeleton-card {
  pointer-events: none;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 6px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 1.5s infinite;
}

.skeleton.cover {
  aspect-ratio: 3 / 4;
  border-radius: 5px 11px 11px 5px;
}

.skeleton.line {
  height: 11px;
  border-radius: 999px;
  margin-top: 6px;
}

.w-70 { width: 70%; }
.w-45 { width: 45%; }
.w-90 { width: 90%; }

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* --------------------------------------------------------------------------
   提示 / 空状态 / 错误
   -------------------------------------------------------------------------- */

.notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.notice h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.notice p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 13.5px;
}

.setup-list {
  display: grid;
  gap: 6px;
  width: min(520px, 100%);
  margin: 4px 0 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  text-align: left;
  font-size: 12.5px;
}

.setup-list code {
  color: var(--accent-strong);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.notice-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

.more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

.footer span {
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   访问口令
   -------------------------------------------------------------------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(10px);
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: min(400px, 100%);
  padding: 32px 28px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}

.gate-card h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}

.gate-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.gate-input {
  width: 100%;
  height: 46px;
  margin-bottom: 12px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  outline: none;
  text-align: center;
  letter-spacing: 0.12em;
}

.gate-input:focus {
  border-color: rgba(217, 168, 92, 0.6);
}

.gate-card .btn {
  width: 100%;
}

.gate-hint {
  margin: 14px 0 0 !important;
  font-size: 11.5px !important;
  color: var(--faint) !important;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 95;
  max-width: min(520px, calc(100vw - 36px));
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(17, 22, 30, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand p {
    display: none;
  }

  .status-pill {
    max-width: 52vw;
    font-size: 11.5px;
  }

  .shell {
    padding: 18px 16px 56px;
  }

  .continue {
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px;
  }

  .continue-cover {
    width: 52px;
    height: 70px;
  }

  .continue-body {
    flex-basis: calc(100% - 70px);
  }

  .continue .btn {
    width: 100%;
  }

  .shelf {
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    column-gap: 14px;
    padding: 16px 18px 18px;
    border-radius: 16px;
  }

  .book {
    padding: 6px 6px 24px;
  }

  .shelf-board {
    height: 13px;
  }

  .book-body {
    padding-top: 10px;
  }

  .cover-title {
    font-size: 14px;
    left: 20px;
  }

  .book-download {
    opacity: 1;
  }

  .book-remove {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
