/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  color-scheme: light;
  /* 圆角：8-12px，不要直角、不要胶囊 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;

  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --surface-3: #eaeae6;
  --border: #e6e6e1;
  --border-strong: #d6d6d0;
  --text: #16161a;
  --text-2: #6b6b70;
  --text-3: #9a9aa0;
  --accent: #b5623a;
  --accent-ink: #ffffff;
  --accent-soft: #f6ede7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-reader: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia,
    serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131315;
  --surface: #1c1c1f;
  --surface-2: #242428;
  --surface-3: #2e2e33;
  --border: #2c2c31;
  --border-strong: #3a3a40;
  --text: #ededef;
  --text-2: #9e9ea5;
  --text-3: #6e6e76;
  --accent: #d9825a;
  --accent-ink: #1a1410;
  --accent-soft: #2a211c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 240ms ease, color 240ms ease;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

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

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

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* ---------- 基础控件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 160ms ease, opacity 160ms ease;
}
.btn:hover {
  background: var(--surface-3);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  filter: brightness(1.06);
  background: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.field {
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.muted {
  color: var(--text-2);
}
.tiny {
  font-size: 12px;
}

/* 阅读区：由 palette 变量驱动 */
.reader-surface {
  background: var(--palette-bg);
  color: var(--palette-ink);
  font-family: var(--reader-font);
  transition: background 240ms ease, color 240ms ease;
}
.reader-surface .unit {
  transition: background 200ms ease;
  border-radius: var(--r-xs);
}
.reader-surface .unit.active {
  background: var(--hl, #f7e9ae);
  color: var(--hl-ink, #3a3208);
}
.reader-surface .chap-title {
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

/* 联想词条下拉 */
.suggest-wrap {
  position: static;
}
/* 不再是浮在下面的联想弹窗，而是直接排在输入框下面的一段列表 */
.suggest-list {
  position: static;
  margin-top: 12px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: pop 140ms ease;
}
.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-align: left;
}
.suggest-item:hover,
.suggest-item[data-active="true"] {
  background: var(--surface-2);
}
.suggest-item .meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.suggest-item .mins {
  flex: none;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text-2);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- 书架 ---------- */
.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 76px 32px 140px;
}
/* 书架：整页不滚，只有文档区滚 */
.shelf {
  height: 100vh;
  padding-bottom: 0;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shelf .topbar {
  flex: none;
}
.shelf-scroll {
  flex: 1 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 110px;
  margin-top: 0;
}
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 26px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
}
.brand small {
  display: block;
  margin-top: 9px;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-2);
}
.toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.grid {
  margin-top: 34px;
  display: grid;
  /* 五个一行，卡片小一点、之间留更多空气 */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-gap: 42px 38px;
  gap: 42px 38px;
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 38px 30px;
  }
}
@media (max-width: 780px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.book-item {
  text-align: left;
  display: block;
  width: 100%;
}
.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background-image: linear-gradient(
    162deg,
    rgba(255, 255, 255, 0.14),
    rgba(0, 0, 0, 0.04)
  );
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.book-item:hover .cover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.cover .initial {
  font-size: 34px;
  font-weight: 500;
  opacity: 0.55;
}
/* 默认封面：把标题写在配色底上 */
.cover .cover-rule {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.28;
}
.cover .cover-title {
  padding: 24px 10px 18px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover .cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover .fmt {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}
.book-title {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-2);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.progress-rail {
  margin-top: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-rail i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 64px 24px;
  text-align: center;
}
.empty h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
}
.empty p {
  margin: 0 auto 18px;
  max-width: 380px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ---------- 弹层 ---------- */
html.modal-open,
html.modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}
html.modal-open .shelf-scroll {
  overflow: hidden;
}
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  overscroll-behavior: contain;
  background: rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  animation: fade 160ms ease;
}
.sheet {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 22px;
  animation: pop 180ms ease;
}
.sheet h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}
.sheet .sub {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--text-2);
}
.time-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.time-input-row .field {
  flex: 1 1;
  font-size: 17px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  height: 44px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.chip {
  height: 28px;
  padding: 0 11px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.chip:hover {
  background: var(--surface-3);
  color: var(--text);
}
.chip[data-on="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.no-fit {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}
.no-fit strong {
  color: var(--text);
  font-weight: 500;
}

.combo-list {
  margin-top: 14px;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.combo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  text-align: left;
  width: 100%;
}
.combo-row:hover {
  background: var(--surface-2);
}
.combo-row .box {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
}
.combo-row[data-on="true"] .box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.combo-row .grow {
  flex: 1 1;
  min-width: 0;
}
.combo-row .t {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-row .m {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 1px;
}
.combo-row .n {
  flex: none;
  font-size: 12.5px;
  color: var(--text-2);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.sheet-footer-gap {
  flex: 1 1 auto;
  min-height: 18px;
}
.sheet-settings {
  height: 520px;
  min-height: 520px;
}
/* 弹窗里可滚动的那一段 */
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -6px;
  padding: 0 6px;
}
.sheet-foot {
  flex: none;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- 阅读页 ---------- */
.reader-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* 未来侧边聊天栏的预留宽度 */
  --chat-reserve: 25vw;
}
.reader-head {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--palette-bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--palette-ink) 9%, transparent);
}
.reader-head .name {
  flex: 1 1;
  min-width: 0;
  padding-left: 10px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.72;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: inherit;
  opacity: 0.72;
}
.icon-btn:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--palette-ink) 8%, transparent);
}
.reader-body {
  width: 100%;
  /* 行宽上限：--measure 个字；同时保证右侧永远留得下 25% 屏宽的聊天栏 + 边距 */
  max-width: min(
    calc(var(--measure, 46) * 1em),
    calc(100vw - var(--chat-reserve, 25vw) - 64px)
  );
  margin: 0 auto;
  padding: 56px 28px 220px;
  font-size: var(--reader-size, 18px);
  line-height: var(--reader-line, 1.8);
}
.reader-body p.para {
  margin: 0 0 1.1em;
}
.reader-body .chap-title {
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
  text-wrap: balance;
}
/* 大章：换行、上方留白大、带分隔线 */
.reader-body .chap-title.level-1 {
  margin: 2.8em 0 1.2em;
  padding-top: 1.1em;
  border-top: 1px solid color-mix(in srgb, var(--palette-ink) 12%, transparent);
  font-size: 1.36em;
  font-weight: 700;
  line-height: 1.45;
}
/* 节 */
.reader-body .chap-title.level-2 {
  margin: 2em 0 0.75em;
  font-size: 1.16em;
  font-weight: 600;
  line-height: 1.5;
}
/* 小节 */
.reader-body .chap-title.level-3 {
  margin: 1.9em 0 0.5em;
  font-size: 1.05em;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.005em;
}
.reader-body section:first-child > .chap-title {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
/* 句子是行内的：同段的句子连成一行，段落之间才有间距 */
.reader-body .unit {
  display: inline;
  padding: 1px 2px;
  margin: 0 -2px;
  border-radius: 3px;
  cursor: pointer;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.reader-body .unit:hover {
  background: color-mix(in srgb, var(--palette-ink) 13%, transparent);
}

.player-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 40px));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.play-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.play-btn:hover {
  filter: brightness(1.07);
}
.player-bar .meta {
  flex: 1 1;
  min-width: 0;
}
.player-bar .line {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-bar .sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-rail {
  margin-top: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.mini-rail i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* 统一行高，让每两条分隔线之间的距离相同 */
  min-height: 64px;
  padding: 12px 0;
  font-size: 13px;
}
/* 相邻块之间只画一条线：由后一个块自己带上边线 */
.sheet > .setting-row,
.sheet > .group,
.group-body > .setting-row {
  border-top: 1px solid var(--border);
}
.sheet > div:first-of-type {
  border-top: none;
}
/* 副标题行压紧一点，两行文字的行也落进同样高度 */
.setting-row .muted {
  line-height: 1.2;
  margin-top: 1px !important;
}
.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.seg button {
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}
.seg button[data-on="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.swatches {
  display: flex;
  gap: 8px;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.swatch[data-on="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}


/* ---------- 按时长听：高度固定，避免内容变化时弹窗缩放 ---------- */
.sheet-tall {
  min-height: 452px;
  max-height: min(86vh, 820px);
  overflow: hidden;
}
.sheet-tall .sheet-foot {
  margin-top: auto;
}

/* ---------- 阅读页顶部的播放按钮（跟随纸面配色） ---------- */
.reader-head .play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--palette-ink) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--palette-ink) 12%, transparent);
  color: var(--palette-ink);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 160ms ease;
}
.reader-head .play:hover {
  background: color-mix(in srgb, var(--palette-ink) 16%, transparent);
}

/* ---------- 可拖动的进度条 ---------- */
.scrub {
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  width: 100%;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.scrub:focus {
  outline: none;
}
.scrub::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--accent) var(--pct, 0%),
    var(--surface-3) var(--pct, 0%)
  );
}
.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}
.scrub::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
}
.scrub::-moz-range-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.scrub::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}

.player-bar .times {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-2);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ---------- 苹果风格滚动条 ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 20%, transparent) transparent;
}
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--text) 15%, transparent);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--text) 32%, transparent);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- 「上次听到」浮标 ---------- */
.listen-bubble {
  /* 贴右侧，避开居中的正文栏，尽量不压字 */
  position: fixed;
  right: 18px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: pop 160ms ease;
}
.listen-bubble.up {
  top: 62px;
}
.listen-bubble.down {
  bottom: 100px;
}

/* ---------- 拖入导入 ---------- */
.drop-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  animation: fade 120ms ease;
  pointer-events: none;
}
.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 46px 64px;
  border: 2px dashed var(--accent);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.drop-icon {
  font-size: 26px;
  color: var(--accent);
  line-height: 1;
}
.drop-title {
  font-size: 15px;
  font-weight: 600;
}
.drop-sub {
  font-size: 12px;
  color: var(--text-2);
}

/* ---------- 行距滑块的刻度 ---------- */
.lh-ticks {
  position: relative;
  display: block;
  height: 15px;
  margin-top: 1px;
}
.lh-ticks span {
  position: absolute;
  font-size: 10.5px;
  color: var(--text-3);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ---------- 设置里的二级分组（可折叠） ---------- */
.group {
  border-bottom: none;
}
/* 和普通设置行同一套样式、同宽同起点；加号放在左侧留白里，不挤占正文 */
.group-head {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  text-align: left;
}
.group-chev {
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-3);
  text-align: center;
  transition: color 150ms ease;
}
.group-head:hover .group-chev {
  color: var(--accent);
}
.group-body {
  /* 一块比底色深/浅一档的圆角底板，把同类项圈在一起；折叠时整块消失 */
  margin: 0;
  padding: 0 12px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.group-body .setting-row {
  border-bottom-color: color-mix(in srgb, var(--text) 7%, transparent);
}
.group-body .setting-row:first-child {
  padding-top: 12px;
}
.group-body .setting-row:last-child {
  padding-bottom: 12px;
}

/* ---------- 首页搜索 ---------- */
.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-input {
  width: 172px;
  padding-right: 28px;
}
.search-clear {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-3);
}
.search-clear:hover {
  background: var(--surface-2);
  color: var(--text);
}
.search-results {
  margin: -18px 0 26px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
}
.search-row:hover {
  background: var(--surface-2);
}
.search-title {
  flex: 1 1;
  min-width: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-meter {
  flex: none;
  width: 110px;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}
.search-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.search-left {
  /* 固定宽度 + 不换行：不同时长的行，进度条右端才会对齐在同一条竖线上 */
  flex: none;
  width: 88px;
  margin-left: 12px;
  white-space: nowrap;
  text-align: right;
  font-size: 11.5px;
  letter-spacing: -0.2px;
  color: var(--text-2);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* 搜索里的小封面 */
.cover-thumb {
  flex: none;
  width: 26px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cover-thumb .cover-title {
  padding: 0;
  line-height: 1;
  font-weight: 500;
  display: block;
  overflow: hidden;
}
.cover-thumb .cover-img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 卡片上的「上次打开」 */
.book-time {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ---------- 卡片右上角的三点菜单 ---------- */
.book-item-wrap {
  position: relative;
}
.book-more {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease;
}
.book-item-wrap:hover .book-more,
.book-more:focus-visible {
  opacity: 1;
}
.book-more:hover {
  background: rgba(0, 0, 0, 0.45);
}
.book-menu {
  position: absolute;
  top: 36px;
  right: 6px;
  z-index: 20;
  padding: 4px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
          backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: var(--shadow-md);
  animation: pop 130ms ease;
}
.book-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 12px 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  white-space: nowrap;
}
.book-menu-item.danger {
  color: #d24b3e;
}
.book-menu-item.danger:hover {
  background: color-mix(in srgb, #d24b3e 12%, transparent);
}

/* ---------- 苹果式确认框 ---------- */
.sheet-mask.center {
  align-items: center;
  padding: 20px;
}
.alert {
  width: min(324px, 100%);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
          backdrop-filter: blur(26px) saturate(180%);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: pop 160ms ease;
}
.alert-body {
  padding: 20px 22px 17px;
  text-align: center;
}
.alert-body h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}
.alert-body p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.alert-actions {
  display: flex;
  border-top: 1px solid var(--border);
}
.alert-actions button {
  flex: 1 1;
  height: 45px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.alert-actions button + button {
  border-left: 1px solid var(--border);
}
.alert-actions .plain {
  color: var(--text-2);
  font-weight: 400;
}
.alert-actions .danger {
  color: #d24b3e;
  font-weight: 600;
}
.alert-actions button:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

/* 标题两行内放不下时，中间省略但保留结尾 */
.book-title {
  word-break: break-word;
}

/* ---------- 搜索浮层 ---------- */
.search-trigger {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}
.search-trigger svg {
  width: 20px;
  height: 20px;
}
.search-trigger:hover {
  color: var(--text);
  background: var(--surface-2);
}
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 13vh 20px 40px;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
          backdrop-filter: blur(22px) saturate(120%);
  animation: fade 140ms ease;
}
.search-panel {
  width: min(760px, 100%);
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 50px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.search-ico {
  flex: none;
  color: var(--text-3);
}
.search-input-lg {
  flex: 1 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}
.search-cancel {
  flex: none;
  font-size: 13px;
  color: var(--accent);
  padding: 5px 7px;
  border-radius: var(--r-xs);
}
.search-cancel:hover {
  background: var(--accent-soft);
}
.search-list {
  margin-top: 12px;
  padding: 6px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  animation: pop 150ms ease;
}
.search-hint,
.search-empty {
  padding: 26px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ---------- 按时长推荐：一页六条、视口三行 ---------- */
.suggest-list {
  /* 六条一次全部显示，不滚动 */
}
.suggest-item .title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.pager-btn {
  font-size: 12.5px;
  color: var(--accent);
  padding: 6px 9px;
  border-radius: var(--r-sm);
}
.pager-btn:hover {
  background: var(--accent-soft);
}

/* 按时长弹窗左下角的组合听 */
.combo-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
}
.combo-icon:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ---------- 表头「⋯」菜单 ---------- */
.toolbar-wide {
  display: flex;
  gap: 16px;
  align-items: center;
}
.more-trigger {
  display: none;
  width: 36px;
  height: 36px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-2);
  border-radius: var(--r-sm);
}
.more-trigger:hover {
  background: var(--surface-2);
  color: var(--text);
}
.more-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 41;
  min-width: 148px;
  padding: 5px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
          backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: pop 130ms ease;
}
.more-menu button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  text-align: left;
  color: var(--text);
}
.more-menu button:hover {
  background: var(--surface-2);
}
.toolbar {
  position: relative;
}

/* ================= 手机适配 ================= */
@media (max-width: 640px) {
  /* 整体留白 */
  .shell {
    padding: 20px 16px 60px;
  }
  .shelf {
    padding-top: 14px;
  }
  .shelf-scroll {
    padding-bottom: 80px;
  }

  /* 表头：品牌缩小，三个按钮收进「⋯」 */
  .topbar {
    align-items: flex-start;
    padding-bottom: 14px;
    gap: 10px;
  }
  .brand {
    font-size: 22px;
    letter-spacing: 0.1em;
  }
  .brand small {
    margin-top: 5px;
    font-size: 11.5px;
  }
  .toolbar-wide {
    display: none;
  }
  .more-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .toolbar {
    gap: 4px;
  }
  .search-trigger,
  .more-trigger {
    width: 42px;
    height: 42px;
  }

  /* 书架：一行两个 */
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 16px;
    margin-top: 20px;
  }
  .book-title {
    font-size: 12.5px;
  }
  .book-more {
    opacity: 1;
    width: 28px;
    height: 28px;
  }

  /* 弹窗：从底部升起 */
  .sheet-mask {
    align-items: flex-end;
    padding: 0;
  }
  .sheet {
    max-width: none;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    max-height: 88vh;
  }
  .sheet-settings {
    height: auto;
    min-height: 0;
    max-height: 88vh;
  }
  .sheet-tall {
    min-height: 0;
    max-height: 88vh;
  }
  .sheet h2 {
    font-size: 17px;
  }
  .setting-row {
    min-height: 56px;
  }
  .group-head {
    min-height: 56px;
  }

  /* 手指点的东西不小于 44 */
  .btn,
  .icon-btn,
  .seg button,
  .chip,
  .pager-btn,
  .combo-icon {
    min-height: 40px;
  }
  .btn {
    padding: 0 14px;
  }

  /* 搜索：全屏 */
  .search-overlay {
    padding: 12px 12px 0;
  }
  .search-panel {
    width: 100%;
  }
  .search-list {
    max-height: calc(100vh - 120px);
  }
  .search-meter {
    width: 56px;
  }
  .search-left {
    width: 62px;
    font-size: 11px;
  }
  .search-title {
    font-size: 13px;
  }

  /* 阅读页 */
  .reader-head {
    gap: 8px;
    padding: 10px 12px;
  }
  .reader-head .name {
    padding-left: 2px;
    font-size: 12px;
  }
  .reader-head .play {
    width: 38px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
  .play-text {
    display: none;
  }
  .reader-body {
    padding: 26px 18px 190px;
    max-width: 100%;
  }
  .player-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 10px 12px;
    gap: 10px;
  }
  .player-bar .line {
    font-size: 12px;
  }
  .listen-bubble {
    right: 12px;
  }
}

