/* ═══════════════════════════════════════════════════════════
   Papertone · 极简版
   规则：
     1. 只用无衬线字体
     2. 不给按钮画边框，用留白和细线组织层次
     3. 台词占中上部可滚动，控制台固定在底部
     4. 可点元素一律 ≥ 44px
   ═══════════════════════════════════════════════════════════ */

:root {
  /* 拉丁字体必须排在中文字体之前：
     浏览器按字符逐个回退，若中文字体在前，英文会被 PingFang 的拉丁字形接管，
     字距会明显偏松。Gill Sans 只覆盖拉丁，中文自然落到后面的 PingFang。 */
  --font: 'Gill Sans', 'Gill Sans MT', 'Helvetica Neue', Helvetica, Arial,
          'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
          system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --bg: #fffaff;
  --fg: #2f2638;
  --accent: #b992ff;
  --accent-ink: #74509f;
  --muted: #ecdff8;
  --hair: #f0e8f8;
  --secondary: #8b8296;
  --wave-on: #9a6fe0;
  --wave-off: #dfd0f2;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #191919;
  --fg: #f4ecff;
  --accent: #d7a2ff;
  --accent-ink: #d7a2ff;
  --muted: #67557f;
  --hair: #2b2632;
  --secondary: #a79db2;
  --wave-on: #d9a6ff;
  --wave-off: #3d3446;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, a, .line, .row { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font-family: inherit; }

/* ── 顶栏：无边框，仅靠毛玻璃把滚动内容压在下面 ───────── */
.topbar {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: .25rem;
  height: 56px;
  padding: 0 .5rem;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
}
.topbar-title {
  font-size: .92rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46vw;
}
.topbar-space { flex: 1; }

/* 顶栏底缘的渐隐细线：只在中间一段显色，两端淡出 */
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg,
              transparent 0%,
              color-mix(in srgb, var(--accent) 40%, transparent) 30%,
              color-mix(in srgb, var(--accent) 40%, transparent) 70%,
              transparent 100%);
}

/* 列表页不需要返回键和显示模式 */
body[data-view='list'] .back,
body[data-view='list'] .mode-btn { display: none; }

/* ── 通用裸按钮：没有边框，只有文字与图标 ─────────────── */
.plain-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .6rem;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: .84rem;
  text-decoration: none;
  cursor: pointer;
  border-radius: .6rem;
  transition: color 140ms ease, background 140ms ease;
}
.plain-btn:hover, .plain-btn:active {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.plain-btn.on { color: var(--accent-ink); }
.back { font-size: 1.05rem; }
.menu-wrap { position: relative; }
.caret { font-size: .7rem; opacity: .7; }

/* 品牌标识：耳机 + 论文 + 声波，粗线条扁平二维，无渐变/投影/方形底。
   用色严格取自站点调色板，只用紫色系两档，并保持「轮廓深、声波浅」的关系：
     浅色  ink = --accent-ink(#74509f)  wave = --accent(#b992ff)
     深色  ink = accent 与 muted 调出的中紫 wave = --accent(#d7a2ff)
   （深色主题里 --accent 与 --accent-ink 同值 #d7a2ff，直接取用会分不出层次，
     所以往 --muted 压一档得到中紫，两个来源都是站点自己的令牌） */
:root {
  --brand-ink: #74509f;
  --brand-wave: #b992ff;
}
[data-theme='dark'] {
  --brand-ink: color-mix(in srgb, var(--accent) 78%, var(--muted));
  --brand-wave: var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding-left: .2rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
}
.brand-mark svg { width: 34px; height: 34px; display: block; }
/* 纸页要盖住背后的耳机头梁，所以必须填底色 */
.brand-mark .ink { stroke: var(--brand-ink); }
.brand-mark .wave { stroke: var(--brand-wave); }
.brand-mark .doc { fill: var(--bg); stroke: var(--brand-ink); }
.brand-title {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.015em;
  color: var(--fg);
}
.brand-title em {
  font-style: normal;
  color: var(--accent-ink);
}

/* 图标统一走粗线条：24 视图框、约 2.2–2.4 的描边 */
.plain-btn svg { width: 20px; height: 20px; display: block; flex: none; }
.plain-btn .caret { width: 15px; height: 15px; opacity: .8; }

body[data-view='episode'] .brand { display: none; }

/* ── 下拉菜单：靠投影分层，不画边框 ──────────────────── */
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 8.5rem;
  padding: .3rem;
  border-radius: .85rem;
  background: var(--bg);
  box-shadow: 0 18px 40px -18px rgb(70 40 110 / 28%),
              0 2px 8px -4px rgb(70 40 110 / 16%);
  display: flex;
  flex-direction: column;
}
.menu.up { top: auto; bottom: calc(100% + 8px); }
.menu[hidden] { display: none; }

/* 定时停止菜单底部的自定义分钟数 */
.menu-custom {
  display: flex;
  gap: .3rem;
  margin-top: .3rem;
  padding: .4rem .35rem .1rem;
  border-top: 1px solid var(--hair);
}
.menu-custom input {
  width: 5.4rem;
  min-width: 0;
  height: 34px;
  padding: 0 .5rem;
  border: 1px solid var(--hair);
  border-radius: .45rem;
  background: color-mix(in srgb, var(--muted) 24%, transparent);
  color: var(--fg);
  font-family: inherit;
  font-size: .78rem;
  outline: none;
}
.menu-custom input:focus { border-color: var(--accent); }
.menu-custom button {
  flex: none;
  min-width: 0;
  min-height: 34px;
  padding: 0 .7rem;
  font-size: .78rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.menu button {
  min-height: 44px;
  padding: 0 .7rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: var(--fg);
  font-size: .86rem;
  text-align: left;
  cursor: pointer;
}
.menu button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.menu button.on { color: var(--accent-ink); font-weight: 500; }

/* ══ 列表视图 ═════════════════════════════════════════ */
.view-list { flex: 1; padding-bottom: 6rem; }
.view-list[hidden] { display: none; }

.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
  max-width: 54rem;
  margin-inline: auto;
  padding: .5rem 1rem 1.35rem;
}
/* 搜索框给出 16rem 的基准宽度：装得下就和右边并排，装不下
   （窄屏）就自己占一行，第二行留给数量与排序，不硬挤。 */
.list-tools .search-wrap { flex: 1 1 16rem; min-width: 0; }
.list-tools .sort-wrap { margin-left: auto; }
.sort-btn { min-height: 38px; color: var(--secondary); font-size: .78rem; }
.sort-btn svg { width: 17px; height: 17px; }
.sort-btn .caret { width: 14px; height: 14px; opacity: .75; }

/* 窄屏：搜索占满第一行，数量与排序并排第二行（数量左、排序右），
   比让排序单独飘在一行要整齐 */
@media (max-width: 34rem) {
  .list-tools .search-wrap { flex-basis: 100%; }
}

/* 资料库规模：一行小字，数字用强调色，不加边框 */
.library-count {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: .3rem;
  margin: 0;
  color: var(--secondary);
  font-size: .76rem;
  white-space: nowrap;
}
.library-count span:first-child {
  color: var(--accent-ink);
  font-size: 1.02rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 搜索：填充式圆角胶囊，不用边框 */
.search-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 46px;
  max-width: 26rem;
  padding: 0 1.05rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  transition: background 180ms ease, box-shadow 180ms ease;
}
.search-wrap:focus-within {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.search-icon {
  flex: none;
  width: 17px; height: 17px;
  color: var(--secondary);
  transition: color 180ms ease;
}
.search-wrap:focus-within .search-icon { color: var(--accent-ink); }
.search {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  padding: 0;
}
.search::placeholder { color: var(--secondary); }

/* ── 继续收听 ─────────────────────────────────────────── */
.continue { max-width: 54rem; margin: 0 auto; padding: 0 1rem 1.1rem; }
.continue-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  width: 100%;
  padding: .7rem .8rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(120deg,
              color-mix(in srgb, var(--accent) 15%, transparent),
              color-mix(in srgb, var(--accent) 5%, transparent));
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease;
}
.continue-card:hover { background: linear-gradient(120deg,
              color-mix(in srgb, var(--accent) 22%, transparent),
              color-mix(in srgb, var(--accent) 8%, transparent)); }
.continue-art {
  flex: none;
  width: 46px; height: 58px;
  border-radius: .55rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.continue-art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.continue-body { flex: 1; min-width: 0; }
.continue-kicker {
  display: block;
  font-size: .66rem;
  letter-spacing: .06em;
  color: var(--accent-ink);
  margin-bottom: .15rem;
}
.continue-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.35;
}
.continue-bar {
  display: block;
  height: 3px;
  margin-top: .5rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  overflow: hidden;
}
.continue-bar i { display: block; height: 100%; background: var(--accent-ink); }
.continue-meta { display: block; margin-top: .3rem; font-size: .72rem; color: var(--secondary); }
.continue-go {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .95rem;
  background: color-mix(in srgb, var(--accent) 74%, var(--accent-ink));
  box-shadow: 0 10px 20px -12px color-mix(in srgb, var(--accent) 95%, transparent);
}

/* ── 过滤条：状态 + 标签，横向滚动 ────────────────────── */
.filters {
  display: flex;
  gap: .4rem;
  max-width: 54rem;
  margin-inline: auto;
  padding: 0 1rem 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 32px;
  padding: 0 .8rem;
  border: 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--muted) 34%, transparent);
  color: var(--secondary);
  font-family: inherit;
  font-size: .78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.chip:hover { color: var(--accent-ink); }
.chip.on {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent-ink);
  font-weight: 500;
}
.chip.sep { width: 1px; min-width: 1px; padding: 0; min-height: 18px; background: var(--hair); margin: .07rem .3rem 0; pointer-events: none; }

/* 论文卡片：以论文首页预览图为主体 */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 1.5rem 1.15rem;
  max-width: 54rem;
  margin-inline: auto;
  padding: 0 1rem 2.5rem;
}
.card {
  display: flex;
  flex-direction: column;
}
/* 卡片本体是按钮（打开播放器），右下角另有一个独立的 alphaXiv 链接 */
.card-hit {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.card-src {
  display: inline-flex;
  align-items: center;
  gap: .18rem;
  font-size: .72rem;
  color: var(--accent-ink);
  text-decoration: none;
  opacity: .85;
  white-space: nowrap;
  transition: opacity 140ms ease;
}
.card-src:hover { opacity: 1; text-decoration: underline; }

/* 卡片底栏：左收听记录、右 alphaXiv 链接 */
.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  margin-top: .5rem;
  min-height: 1rem;
  font-size: .72rem;
}
.card-art {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: .9rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  box-shadow: 0 16px 32px -24px color-mix(in srgb, var(--accent-ink) 70%, transparent);
}
.card-art img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 420ms cubic-bezier(.2, .7, .3, 1);
}
.card-hit:hover .card-art img { transform: scale(1.045); }
.card-fallback { display: block; width: 100%; height: 100%; }
.card-dur {
  position: absolute;
  right: .5rem; bottom: .5rem;
  padding: .16rem .5rem;
  border-radius: 99px;
  background: rgb(22 16 30 / 56%);
  color: #fff;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
}
.card-play {
  position: absolute;
  left: 50%; top: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgb(255 255 255 / 93%);
  color: #4b2f7a;
  display: grid;
  place-items: center;
  font-size: .95rem;
  opacity: 0;
  transform: scale(.85);
  box-shadow: 0 10px 22px -10px rgb(40 20 70 / 55%);
  transition: opacity 200ms ease, transform 200ms ease;
}
.card-hit:hover .card-play, .card-hit:focus-visible .card-play { opacity: 1; transform: scale(1); }
.card-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgb(255 255 255 / 28%);
}
.card-progress i { display: block; height: 100%; background: var(--accent); }
.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.4;
}
.card-sub {
  font-size: .75rem;
  color: var(--secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .72rem;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.card-meta .sep { opacity: .45; }

/* 卡片上的浏览量：带一只小眼睛，四位以上压成 2.2k */
.card-views {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  color: var(--secondary);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.card-views[hidden] { display: none; }
.card-views svg { width: 13px; height: 13px; flex: none; opacity: .85; }

/* 手机上改成横向条目：小缩略图在左，文字在右 */
@media (max-width: 34rem) {
  .cards {
    grid-template-columns: 1fr;
    gap: .15rem;
    padding: 0 .5rem 2.5rem;
  }
  .card-hit {
    flex-direction: row;
    align-items: center;
    gap: .85rem;
    padding: .55rem .5rem;
    border-radius: .85rem;
    transition: background 160ms ease;
  }
  .card-hit:hover, .card-hit:active { background: color-mix(in srgb, var(--accent) 7%, transparent); }
  /* 底栏左缘对齐正文列（缩略图宽度 + 间距 + 卡片内边距） */
  .card-foot { padding: 0 .5rem .25rem calc(74px + .85rem + .5rem); margin-top: .1rem; }
  .card-art {
    flex: none;
    width: 74px;
    aspect-ratio: 3 / 4;
    border-radius: .5rem;
    box-shadow: 0 8px 18px -14px color-mix(in srgb, var(--accent-ink) 85%, transparent);
  }
  .card-hit:hover .card-art img { transform: none; }
  .card-play { display: none; }
  .card-dur { right: .22rem; bottom: .22rem; padding: .08rem .32rem; font-size: .58rem; }
  .card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .28rem; }
  .card-title { font-size: .88rem; }
  .card-sub { font-size: .73rem; }
}
.empty {
  max-width: 54rem;
  margin-inline: auto;
  padding: 1rem 1rem 2rem;
  color: var(--secondary);
  font-size: .88rem;
}

/* ═══════════════════════════════════════════════════════════
   访问统计（资料库页脚）

   数字由不蒜子的脚本直接写进 <dd id="busuanzi_*">；颜色与字号走本站
   自己的令牌，字体用 inherit（即 --font，Gill Sans 打头），
   所以和页面其它文字的字距、粗细一致。
   ═══════════════════════════════════════════════════════════ */
.visitor-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .55rem 1.1rem;
  max-width: 54rem;
  margin: 0 auto;
  padding: 1rem 1rem 0;
  border-top: 1px solid var(--hair);
  color: var(--secondary);
  font-size: .74rem;
  opacity: .72;
  transition: opacity 240ms ease;
}
.visitor-footer.is-loaded { opacity: 1; }
.visitor-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--fg);
  font-weight: 600;
}
.visitor-dot {
  flex: none;
  width: .34rem;
  height: .34rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--accent) 24%, transparent);
}
.visitor-footer.is-loaded .visitor-dot { animation: visitor-pulse 2.6s ease-in-out infinite; }
@keyframes visitor-pulse {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}
/* 系统开了「减少动态效果」就不做这个呼吸灯 */
@media (prefers-reduced-motion: reduce) {
  .visitor-footer.is-loaded .visitor-dot { animation: none; }
}
.visitor-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: 0;
}
.visitor-metrics > div {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
}
.visitor-metrics dt { color: var(--secondary); }
.visitor-metrics dd {
  margin: 0;
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.visitor-provider {
  margin-left: auto;
  font-size: .68rem;
  opacity: .8;
}

/* ══ 播放视图：台词在中间，控制台贴底 ══════════════════ */
.view-episode {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.view-episode[hidden] { display: none; }

.transcript-region {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: .25rem .5rem 1.25rem;
  scrollbar-width: thin;
}

.lines { list-style: none; margin: 0 auto; padding: 0; max-width: 46rem; }

.line {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: .75rem;
  padding: .65rem .7rem;
  border-radius: .7rem;
  cursor: pointer;
  transition: background 140ms ease;
}
.line:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.line.now { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.line-meta {
  display: flex;
  flex-direction: column;
  gap: .06rem;
  min-width: 0;
  padding-top: .12rem;
}
.line-time {
  font-size: .74rem;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.line.now .line-time { color: var(--accent-ink); }
.line-speaker {
  font-size: .7rem;
  color: var(--secondary);
  opacity: .8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line.now .line-speaker { color: var(--accent-ink); }
.line-en { font-size: 1rem; line-height: 1.62; }
.line-zh {
  margin-top: .25rem;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--secondary);
}
.line.blank .line-en, .line.blank .line-zh { filter: blur(5px); }
.line.blank.now .line-en, .line.blank.now .line-zh { filter: none; }

/* ── 控制台 ───────────────────────────────────────────
   参考成熟播放器的组织方式：
     1. 时间码与进度条同排（左当前 / 中进度 / 右总长），不各占一行
     2. 控制键居中收窄，不铺满整屏，否则宽屏上会散得很难看
     3. 次要功能（倍速、定时、更多）放在最下一排，字号更小
   ────────────────────────────────────────────────────── */
.deck {
  flex: none;
  padding: .55rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px) saturate(165%);
}
.deck > * { max-width: 34rem; margin-inline: auto; }

.deck-meta { display: flex; align-items: center; gap: .6rem; min-height: 34px; }
.deck-cover {
  flex: none;
  width: 32px; height: 32px;
  border-radius: .5rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.deck-cover img, .mini-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.deck-text { min-width: 0; display: flex; flex-direction: column; }
.deck-title {
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-authors {
  font-size: .7rem;
  line-height: 1.3;
  color: var(--secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 论文首次公开日期，靠右对齐，不参与标题的截断 */
.deck-date {
  flex: none;
  margin-left: auto;
  padding-left: .5rem;
  font-size: .68rem;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 时间码与波形进度条同排
   参考主流的音乐播放器：波形本身承担进度显示，range 只作为透明的拖拽层 */
.scrubber {
  display: flex;
  align-items: center;
  gap: .75rem;
  /* 用 auto 保持与 .deck > * 的居中约束一致，
     写成 margin: .45rem 0 0 会把左右 margin 覆盖成 0，整行就贴到屏幕两侧了 */
  margin: .6rem auto .1rem;
}
.wave-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 44px;
}
#wave { display: block; width: 100%; height: 100%; }
.wave-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.wave-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; }
.wave-range::-moz-range-thumb { width: 30px; height: 30px; border: 0; }
.t-now, .t-total {
  font-size: .72rem;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  line-height: 1;
}
.t-total { text-align: right; }

.progress {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  background: transparent;
  cursor: pointer;
}
.progress::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg,
              var(--accent) 0%, var(--accent) var(--pct, 0%),
              var(--muted) var(--pct, 0%), var(--muted) 100%);
}
.progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.progress::-moz-range-track { height: 3px; border-radius: 99px; background: var(--muted); }
.progress::-moz-range-progress { height: 3px; border-radius: 99px; background: var(--accent); }
.progress::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); }

/* 控制键排成一排，无边框 */
.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: .25rem auto .15rem;
}
.tbtn {
  min-width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-radius: 99px;
  display: grid;
  place-items: center;
  transition: color 140ms ease, background 140ms ease, transform 120ms ease;
}
.tbtn svg { width: 25px; height: 25px; display: block; fill: currentColor; }
.tbtn.num { font-size: .9rem; font-weight: 600; letter-spacing: -.015em; }
.tbtn:hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tbtn:active { transform: scale(.94); }
.tbtn.play {
  width: 60px; height: 60px;
  color: #fff;
  font-size: 1.15rem;
  /* 实心强调色，比渐变干净，也让白字更清楚 */
  background: color-mix(in srgb, var(--accent) 74%, var(--accent-ink));
  box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--accent) 95%, transparent);
}
.tbtn.play svg { width: 28px; height: 28px; }
.tbtn.play:hover {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 64%, var(--accent-ink));
}

.deck-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .3rem;
  padding-top: .45rem;
  border-top: 1px solid var(--hair);
}
.rates { display: flex; align-items: center; gap: .1rem; }
.rates button {
  min-width: 44px;
  min-height: 38px;
  padding: 0 .35rem;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-radius: .5rem;
  transition: color 140ms ease;
}
.rates button:hover { color: var(--accent-ink); }
.rates button.on { color: var(--accent-ink); font-weight: 600; }
.deck-tools { display: flex; align-items: center; gap: .1rem; }
.deck-tools .plain-btn { font-size: .78rem; min-width: 40px; padding: 0 .45rem; }
.deck-tools .plain-btn svg { width: 18px; height: 18px; }

/* 手机上按钮行是「前后集 + ±3/±5 + 播放」共 7 个。
   用等分宽度而不是固定 min-width，任何屏宽都不会溢出：
   6 个按钮平分去掉播放键之后的空间。 */
@media (max-width: 34rem) {
  .deck { padding: .5rem .55rem calc(.6rem + env(safe-area-inset-bottom)); }
  .transport .tbtn { flex: 1 1 0; min-width: 0; height: 48px; }
  .transport .tbtn.play { flex: 0 0 auto; width: 58px; height: 58px; }
  .transport .tbtn.num { font-size: .9rem; }
  /* 底栏挤不下就换行，不硬撑出横向滚动 */
  .deck-foot { flex-wrap: wrap; gap: .3rem .5rem; }
  .rates button { min-width: 30px; padding: 0 .15rem; font-size: .72rem; }
  .deck-tools .plain-btn { min-width: 34px; padding: 0 .3rem; font-size: .72rem; }
  .deck-tools .plain-btn svg { width: 17px; height: 17px; }
}

.abstract-box { padding: .2rem .7rem .6rem; max-width: 22rem; }
.abstract-box summary {
  cursor: pointer;
  font-size: .84rem;
  color: var(--fg);
  min-height: 40px;
  display: flex;
  align-items: center;
}
.abstract-box p { margin: .1rem 0 .5rem; font-size: .82rem; color: var(--secondary); line-height: 1.6; }
.citation {
  margin: .4rem .7rem .5rem;
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.55;
  color: var(--secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── 列表页迷你条 ───────────────────────────────────── */
.mini {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px) saturate(165%);
}
.mini[hidden] { display: none; }
/* 迷你条上的进度同样可拖动，触控命中区加高到 20px，视觉仍是细线 */
.mini-progress { margin: 0; height: 20px; }
.mini-progress::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; }
@media (hover: none) {
  .mini-progress::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -5px; }
}
.mini-row { display: flex; align-items: center; gap: .7rem; padding: .55rem 1rem; min-height: 58px; }
.mini-cover {
  flex: none;
  width: 38px; height: 38px;
  border-radius: .5rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.mini-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-title { font-size: .84rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { font-size: .72rem; color: var(--secondary); font-variant-numeric: tabular-nums; }
.mini-play { font-size: 1rem; color: var(--fg); }
.mini-play svg { width: 20px; height: 20px; display: block; fill: currentColor; }

/* ── 轻提示 ─────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(7rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  padding: .55rem 1.1rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--fg) 88%, transparent);
  color: var(--bg);
  font-size: .82rem;
  white-space: nowrap;
  box-shadow: 0 14px 30px -14px rgb(0 0 0 / 45%);
}
.toast[hidden] { display: none; }

/* ── 手机端：台词压紧，一屏装更多 ────────────────────
   字号与首页卡片保持一致（标题 .88rem / 副文字 .78rem），
   行距和间距同步收紧。这一段必须在基础 .line 规则之后，否则会被覆盖。
   ────────────────────────────────────────────────────── */
@media (max-width: 34rem) {
  .line {
    grid-template-columns: 3.1rem minmax(0, 1fr);
    gap: .55rem;
    padding: .46rem .45rem;
    border-radius: .55rem;
  }
  .line-meta { gap: .04rem; padding-top: .1rem; }
  .line-time { font-size: .66rem; }
  .line-speaker { font-size: .63rem; }
  .line-en { font-size: .88rem; line-height: 1.55; }
  .line-zh {
    margin-top: .18rem;
    font-size: .78rem;
    line-height: 1.5;
  }
  .transcript-region { padding: .1rem .45rem 1rem; }
  .mini-play { font-size: .95rem; }
  .deck-cover { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ══ 增量抓取面板 ══════════════════════════════════════ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(24 16 34 / 42%);
  backdrop-filter: blur(3px);
  padding: 0;
}
.sheet[hidden] { display: none; }
@media (min-width: 40rem) {
  .sheet { align-items: center; padding: 2rem; }
}
.sheet-card {
  width: 100%;
  max-width: 34rem;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  border-radius: 1.1rem 1.1rem 0 0;
  background: var(--bg);
  box-shadow: 0 -14px 40px -20px rgb(50 25 90 / 45%);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 40rem) {
  .sheet-card { border-radius: 1.1rem; box-shadow: 0 24px 60px -30px rgb(50 25 90 / 55%); }
}
.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem .6rem .5rem 1.1rem;
  border-bottom: 1px solid var(--hair);
}
.sheet-head strong { font-size: .95rem; font-weight: 650; }
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.3rem;
}

.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.field > span { font-size: .72rem; color: var(--secondary); letter-spacing: .02em; }
.field input, .field select {
  width: 100%;
  height: 42px;
  padding: 0 .75rem;
  border: 1px solid var(--hair);
  border-radius: .6rem;
  background: color-mix(in srgb, var(--muted) 22%, transparent);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  outline: none;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field-row { display: flex; gap: .7rem; }
.field-row .field { flex: 1; min-width: 0; }
.field-hint { margin: 0 0 .9rem; font-size: .76rem; line-height: 1.6; color: var(--secondary); }
.threshold-hint { margin: -.4rem 0 .9rem; font-size: .72rem; line-height: 1.55; opacity: .9; }

.check {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 40px;
  margin: -.2rem 0 .1rem;
  font-size: .84rem;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-ink);
  cursor: pointer;
}

.btn {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--hair);
  border-radius: .7rem;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  color: var(--fg);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 550;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 74%, var(--accent-ink));
  color: #fff;
}
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 64%, var(--accent-ink)); }

.sync-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 12rem;
  overflow-y: auto;
  border: 1px solid var(--hair);
  border-radius: .7rem;
}
.sync-list li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .5rem .7rem;
  border-top: 1px solid var(--hair);
  font-size: .78rem;
}
.sync-list li:first-child { border-top: 0; }
.sync-list .sid { flex: none; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.sync-list .tier {
  flex: none;
  min-width: 2rem;
  padding: .05rem .3rem;
  border-radius: .35rem;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-ink);
  font-size: .66rem;
  text-align: center;
}
.sync-list .stitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-list .sviews { flex: none; color: var(--secondary); font-variant-numeric: tabular-nums; }

.sync-log {
  margin: .6rem 0 0;
  max-height: 14rem;
  overflow: auto;
  padding: .7rem;
  border-radius: .7rem;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  font-family: var(--mono);
  font-size: .7rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--secondary);
}
.sync-log[hidden] { display: none; }

.device-block { margin-bottom: .2rem; }
.device-block .field-row .btn { min-height: 42px; font-size: .82rem; }
.sheet-sep {
  height: 1px;
  margin: 1rem 0;
  border: 0;
  background: var(--hair);
}
