* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;
  --bg: #07080a;
  --panel: rgba(14, 17, 22, 0.96);
  --panel-2: #171a20;
  --line: rgba(255, 255, 255, 0.15);
  --text: #f6f7f9;
  --muted: #aeb6c2;
  --yellow: #f5c62f;
  --yellow-dark: #d5a915;
  --blue: #66a6ff;
  --danger: #ff7070;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  overflow: hidden;
}

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

select {
  appearance: auto;
  -webkit-appearance: menulist;
}

button {
  cursor: pointer;
}

.topbar {
  height: 46px;
  display: grid;
  grid-template-columns: auto minmax(280px, 620px) minmax(100px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: #030303;
  border-bottom: 1px solid #1f2329;
}

.brand {
  font-size: 23px;
  font-weight: 800;
  color: #ff9aab;
  white-space: nowrap;
}

.brand span {
  color: #d3bdf7;
}

.top-shelf-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-shelf-actions button {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: #171a20;
  color: #edf3f0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.top-shelf-actions button.active {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.searchbar {
  display: grid;
  grid-template-columns: 130px 1fr 84px;
  gap: 8px;
  min-width: 0;
}

.searchbar select,
.searchbar input,
.bottom-search input {
  height: 34px;
  border: 1px solid #2b3139;
  border-radius: 6px;
  background: #171a20;
  color: var(--text);
  padding: 0 10px;
  min-width: 0;
}

.searchbar button,
.actions button,
.ai-form button {
  border: 1px solid #525862;
  border-radius: 6px;
  background: #2a2e35;
  color: var(--text);
  font-weight: 700;
}

.searchbar button {
  height: 34px;
}

.searchbar button:hover,
.actions button:hover,
.ai-form button:hover {
  border-color: #7a8390;
  background: #343942;
}

.actions button.active {
  border-color: #f7c52b;
  background: #f7c52b;
  color: #101418;
}

.status {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d8dde5;
  font-size: 13px;
  white-space: nowrap;
}

.auth-status button {
  height: 28px;
  border: 1px solid #4a515c;
  border-radius: 6px;
  background: #232831;
  color: var(--text);
  font-weight: 800;
}

.layout {
  height: calc(100dvh - 46px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 382px;
  min-height: 0;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: radial-gradient(circle at 50% 35%, #25272b 0, #17191d 40%, #0a0b0d 100%);
  overflow: hidden;
}

.player {
  position: absolute;
  inset: 0 0 132px;
  width: 100%;
  height: calc(100% - 132px);
  object-fit: contain;
  background: #262626;
}

.stage.audio-only .player {
  opacity: 0;
  pointer-events: none;
}

.stage.audio-only::before {
  content: "只听音频";
  position: absolute;
  inset: 0 0 132px;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(28px, 4vw, 58px);
  font-weight: 950;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(245, 198, 47, 0.18), transparent 34%),
    linear-gradient(135deg, #141b1f, #07090b 72%);
  pointer-events: none;
}

.stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 132px;
  height: 180px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.center-controls {
  position: absolute;
  left: 50%;
  top: calc(50% - 58px);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 26px;
  z-index: 5;
  pointer-events: none;
  opacity: 1;
  transition: opacity 160ms ease;
}

.stage.is-advancing .center-controls {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.round-btn,
.play-btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

.round-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 52px;
  line-height: 1;
  padding-bottom: 8px;
}

.play-btn {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  font-size: 42px;
  padding-left: 6px;
}

.subtitle-overlay {
  position: absolute;
  left: 50%;
  bottom: 164px;
  transform: translateX(-50%);
  z-index: 6;
  width: min(980px, calc(100% - 80px));
  text-align: center;
  pointer-events: none;
}

.subtitle-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  pointer-events: auto;
}

.subtitle-primary,
.subtitle-zh {
  display: inline;
  padding: 7px 14px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.78);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7);
  line-height: 1.22;
  word-break: normal;
  overflow-wrap: anywhere;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.subtitle-primary {
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 650;
}

.subtitle-zh {
  display: table;
  margin: 10px auto 0;
  font-size: clamp(20px, 1.8vw, 28px);
  color: #f4f5f7;
}

.ai-pill {
  flex: 0 0 auto;
  width: 38px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: var(--yellow);
  color: #111;
  font-weight: 900;
  pointer-events: auto;
}

.word-token {
  border-radius: 4px;
  padding: 0 2px;
}

.word-token:hover,
.word-token.active {
  background: rgba(245, 198, 47, 0.78);
  color: #101010;
}

/* 字幕里命中当前分类词/搜索词的部分 */
.word-token.hit {
  color: #ffd84d;
  text-decoration: underline;
  text-decoration-color: #ffd84d;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* 播放时标出这条视频是关于哪个词 / 词组 / 句子 */
.subtitle-query {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(245, 198, 47, 0.94);
  color: #141414;
  font-size: clamp(14px, 1.15vw, 19px);
  font-weight: 800;
  line-height: 1.3;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.subtitle-query[hidden] {
  display: none;
}

.subtitle-query-label {
  font-size: 0.8em;
  font-weight: 700;
  opacity: 0.75;
}

.subtitle-query strong {
  font-size: 1.15em;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.subtitle-query-zh {
  font-size: 0.9em;
  font-weight: 700;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40vw;
}

@media (max-width: 900px) {
  .subtitle-query {
    font-size: 13px;
    padding: 4px 11px;
    margin-bottom: 6px;
  }

  .subtitle-query-zh {
    max-width: 50vw;
  }
}

/* 英文字幕：背景逐行贴着文字，而不是整块铺满 */
#primarySubtitle,
.subtitle-primary,
body.mobile-learn-layout .subtitle-primary,
body.mobile-template-shorts .subtitle-primary {
  background: transparent !important;
  padding: 0 !important;
  border: 0 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.subtitle-primary .subtitle-text {
  display: inline;
  padding: 7px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7);
  line-height: 1.55;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* 播放控件放在中文字幕下面，跟字幕一起显示，播放中也不隐藏 */
.subtitle-overlay .center-controls,
.stage.is-playing .subtitle-overlay .center-controls,
.stage.is-paused .subtitle-overlay .center-controls,
.stage.is-advancing .subtitle-overlay .center-controls,
.stage.is-playing:hover .subtitle-overlay .center-controls,
.stage.is-playing:focus-within .subtitle-overlay .center-controls,
.stage:focus-within .subtitle-overlay .center-controls {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  margin: 12px auto 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.subtitle-overlay .round-btn,
.subtitle-overlay .play-btn {
  border-width: 2px;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.subtitle-overlay .round-btn {
  width: 44px;
  height: 44px;
  font-size: 34px;
  padding-bottom: 5px;
}

.subtitle-overlay .play-btn {
  width: 56px;
  height: 56px;
  font-size: 26px;
  padding-left: 4px;
}

/* 视频区加载提示 */
.stage-loading {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}

.stage-loading[hidden] {
  display: none;
}

.stage-loading-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffd22e;
  animation: stage-spin 0.8s linear infinite;
}

@keyframes stage-spin {
  to { transform: rotate(360deg); }
}

/* 场景里进场的那条切片：缩略图高亮 + 「当前」角标 */
.thumb.seed {
  position: relative;
  outline: 3px solid #ffd22e;
  outline-offset: -3px;
}

.thumb-seed-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ffd22e;
  color: #151914;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.5;
  pointer-events: none;
}

/* 手机短视频模板：视频固定占上部，字幕层在剩余空间内滚动，不再把视频压成一条黑边 */
@media (max-width: 900px) {
  body.mobile-template-shorts .player {
    flex: 0 0 auto !important;
    /* 旧内核不认 svh / min()：逐级回退，后面的写法不支持就用前一条 */
    height: 56.25vw !important;
    height: min(56.25vw, 40vh) !important;
    height: min(56.25vw, 40svh) !important;
    min-height: 150px !important;
  }

  body.mobile-template-shorts .stage-loading {
    top: 28vw !important;
    top: calc(min(56.25vw, 40vh) / 2) !important;
    top: calc(min(56.25vw, 40svh) / 2) !important;
  }

  body.mobile-template-shorts .subtitle-overlay {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
  }

  body.mobile-template-shorts .subtitle-query {
    margin: 0 !important;
    padding: 3px 10px !important;
    font-size: 12px !important;
  }

  body.mobile-template-shorts .subtitle-primary {
    font-size: clamp(16px, 4.4vw, 21px) !important;
  }

  body.mobile-template-shorts .subtitle-primary .subtitle-text {
    padding: 5px 10px !important;
    line-height: 1.45 !important;
  }

  body.mobile-template-shorts .subtitle-zh {
    margin-top: 4px !important;
    font-size: clamp(14px, 3.9vw, 18px) !important;
  }

  body.mobile-template-shorts .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay .center-controls {
    flex: 0 0 auto !important;
    height: 54px !important;
    gap: 18px !important;
    margin: 2px 0 0 !important;
    background: transparent !important;
  }

  body.mobile-template-shorts .subtitle-overlay .play-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
  }

  body.mobile-template-shorts .subtitle-overlay .round-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 24px !important;
  }

  body.mobile-template-shorts .scene-bar {
    margin-top: 2px !important;
    gap: 4px !important;
  }

  body.mobile-template-shorts #enterSceneBtn {
    padding: 5px 12px !important;
    font-size: 13px !important;
  }

  body.mobile-template-shorts .scene-crumb {
    font-size: 12px !important;
    padding: 4px 10px !important;
  }
}

/* 进入场景 + 面包屑返回 */
.scene-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  pointer-events: auto;
}

#enterSceneBtn {
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

#enterSceneBtn:disabled {
  opacity: 0.6;
  cursor: default;
}

#enterSceneBtn[hidden],
.scene-crumb[hidden] {
  display: none;
}

.scene-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #dfe7e2;
  font-size: 13px;
  font-weight: 700;
}

.scene-crumb-back {
  border: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffd22e;
  color: #151914;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.scene-crumb-sep {
  opacity: 0.6;
}

.scene-crumb-here {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 48vw;
}

.thumb-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46px;
  height: 86px;
  z-index: 7;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(0, 0, 0, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  scrollbar-color: #b8bcc4 #25272b;
}

.thumb {
  position: relative;
  flex: 0 0 142px;
  height: 86px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  padding: 0;
  color: #fff;
  background: #101214;
  text-align: left;
  overflow: hidden;
}

.thumb.active {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
}

.thumb video,
.side-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050505;
  display: block;
}

.thumb::after,
.side-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 25%, rgba(0, 0, 0, 0.82));
  pointer-events: none;
}

.thumb-number {
  position: absolute;
  top: 6px;
  left: 7px;
  z-index: 2;
  min-width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--yellow);
  color: #111;
  font-size: 12px;
  font-weight: 900;
}

.thumb-caption {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  z-index: 2;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bottom-search {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  z-index: 8;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #15171a;
  border-top: 1px solid #2c3036;
}

.lang-badge {
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #4b515b;
  border-radius: 8px;
  color: #cfd4dc;
  font-weight: 800;
}

.side-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  background: var(--panel);
  border-left: 1px solid #222831;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
}

.panel-head h1 {
  margin: 0 0 3px;
  font-size: 14px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.counter {
  flex: 0 0 54px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #3b414a;
  border-radius: 8px;
  background: #20242b;
}

.counter strong {
  font-size: 19px;
  line-height: 1;
}

.counter span {
  font-size: 11px;
  color: var(--muted);
}

.metrics {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px 14px 8px;
}

.metrics span {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: #20242b;
  color: #d7dbe2;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.actions button {
  height: 30px;
}

.audio-mode-toggle,
.scene-window-control {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #525862;
  border-radius: 6px;
  background: #2a2e35;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.scene-window-control {
  justify-content: space-between;
  padding: 0 8px;
}

.scene-window-control span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scene-window-control select {
  min-width: 72px;
  border: 1px solid #525862;
  border-radius: 6px;
  background: #171b21;
  color: var(--text);
  font-weight: 900;
}

.audio-mode-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--yellow);
  margin: 0;
}

.audio-mode-toggle.active {
  border-color: #f7c52b;
  background: #f7c52b;
  color: #101418;
}

.actions .primary-action {
  grid-column: 1 / -1;
  background: var(--yellow);
  color: #121212;
  border: 0;
}

.actions .primary-action:hover {
  background: #ffd850;
}

.catalog {
  padding: 10px 14px 12px;
  border-bottom: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #d9dde4;
  font-size: 13px;
  font-weight: 800;
}

.catalog-tabs {
  display: flex;
  gap: 6px;
}

.catalog-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 7px;
  margin-bottom: 7px;
}

.catalog-filters select,
.catalog-controls select,
.catalog-controls input,
.catalog-controls button {
  height: 31px;
  min-width: 0;
  border: 1px solid #3d444e;
  border-radius: 6px;
  background: #171a20;
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
}

.catalog-tabs button,
.catalog-list button,
.catalog-controls button {
  border: 1px solid #4c535d;
  border-radius: 6px;
  background: #242830;
  color: var(--text);
  font-weight: 800;
}

.catalog-tabs button {
  height: 26px;
  min-width: 48px;
  padding: 0 10px;
  font-size: 12px;
}

.catalog-tabs button.active,
.catalog-list button.active,
.catalog-list button.catalog-load-all {
  background: var(--yellow);
  color: #111;
  border-color: var(--yellow);
}

.catalog-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  margin-bottom: 8px;
  color: #d9dde4;
  font-size: 12px;
  font-weight: 700;
  user-select: none;
}

.catalog-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--yellow);
}

.catalog-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(58px, auto);
  gap: 7px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.catalog-list button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  height: auto;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.22;
  overflow: hidden;
  text-align: left;
}

.catalog-source,
.catalog-meaning {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-source {
  color: inherit;
}

.catalog-meaning {
  color: #b9c2cc;
  font-size: 11px;
  font-weight: 700;
}

.catalog-meaning.loading,
.catalog-meaning.empty {
  color: #76818d;
  font-weight: 600;
}

.catalog-list button.active .catalog-meaning,
.catalog-list button.catalog-load-all .catalog-meaning {
  color: rgba(17, 17, 17, 0.74);
}

.catalog-list button.catalog-load-all {
  grid-column: 1 / -1;
  min-height: 36px;
  align-items: center;
  text-align: center;
}

.catalog-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 2px;
}

.list-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #d9dde4;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.pager button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid #4c535d;
  border-radius: 6px;
  background: #242830;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.pager button:disabled {
  cursor: default;
  opacity: 0.42;
}

.pager span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.catalog > .pager {
  flex: 0 0 auto;
  width: 100%;
  justify-content: center;
  margin: 0 0 8px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 18, 23, 0.92);
}

.subtitle-list {
  display: none;
}

.line-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 86px minmax(0, 1fr) 34px 40px;
  gap: 8px;
  align-items: center;
  min-height: 86px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  text-align: left;
  width: 100%;
}

.line-item:hover,
.line-item.active {
  background: rgba(245, 198, 47, 0.14);
}

.line-no {
  color: #9aa3ae;
  font-weight: 800;
  text-align: right;
}

.side-thumb {
  position: relative;
  width: 86px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  background: #050505;
}

.side-play {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 13px;
}

.line-text {
  min-width: 0;
}

.line-original {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
}

.line-translation {
  margin-top: 4px;
  color: #c8ced8;
  font-size: 13px;
  line-height: 1.32;
}

.line-ai {
  width: 34px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: var(--yellow);
  color: #111;
  font-weight: 900;
}

.favorite-btn {
  width: 30px;
  height: 28px;
  border: 1px solid #4b515c;
  border-radius: 6px;
  background: #242830;
  color: #cfd5df;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.favorite-btn.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #111;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 4, 6, 0.82);
  backdrop-filter: blur(10px);
}

.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid #333a45;
  border-radius: 8px;
  background: #11151b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.login-brand {
  font-size: 27px;
}

.login-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.login-card input {
  height: 40px;
  min-width: 0;
  border: 1px solid #3d444e;
  border-radius: 6px;
  background: #1b2028;
  color: var(--text);
  padding: 0 12px;
}

.login-card button {
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--yellow);
  color: #111;
  font-weight: 900;
}

.login-card p {
  min-height: 18px;
  margin: 0;
  color: #ff8b8b;
  font-size: 13px;
}

.word-popup {
  position: fixed;
  z-index: 50;
  width: min(390px, calc(100vw - 20px));
  border: 1px solid #3a414d;
  border-radius: 8px;
  background: #11151b;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}

.popup-head,
.ai-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.popup-head strong {
  display: block;
  font-size: 22px;
}

.word-meta {
  margin-top: 5px;
  color: #d8dde6;
  font-size: 13px;
}

.popup-head button,
.ai-head button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid #555d69;
  border-radius: 6px;
  background: #2b3038;
  color: #fff;
}

.popup-body {
  padding: 12px 14px 14px;
  color: #eef1f6;
  line-height: 1.55;
  white-space: pre-wrap;
}

.word-entry {
  display: grid;
  gap: 10px;
  white-space: normal;
}

.word-phonetics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.word-ipa {
  padding: 8px 10px;
  border: 1px solid rgba(255, 210, 46, 0.28);
  border-radius: 8px;
  background: rgba(255, 210, 46, 0.12);
  color: #ffe27a;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

/* 词卡：英/美音标 + 喇叭发音 */
.word-pron {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-pron-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: #1c2129;
  color: #eef1f6;
  font-size: 14px;
  cursor: pointer;
}

.word-pron-btn:hover,
.word-pron-btn.playing {
  border-color: rgba(255, 210, 46, 0.6);
  background: rgba(255, 210, 46, 0.14);
}

.word-pron-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #b9c3d0;
  font-size: 12px;
  font-weight: 700;
}

.word-pron-ipa {
  font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Segoe UI", "Noto Sans", sans-serif;
  color: #ffe27a;
  letter-spacing: 0.2px;
}

.word-pron-speaker {
  font-size: 15px;
  line-height: 1;
}

/* 词卡：按词性分行的释义 */
.word-defs {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.word-def {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 15px;
  line-height: 1.5;
}

.word-def-pos {
  color: #8fa0b3;
  font-size: 13px;
  font-weight: 700;
}

.word-def-text {
  color: #f3f6fa;
  overflow-wrap: anywhere;
}

.word-section {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.word-section.compact {
  padding: 8px 10px;
}

.word-section-title {
  margin-bottom: 5px;
  color: #9eb0c4;
  font-size: 12px;
  font-weight: 800;
}

.word-section-body {
  color: #f4f7fb;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}

.ai-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.ai-card {
  width: min(720px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  border: 1px solid #3a414d;
  border-radius: 8px;
  background: #10141a;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.ai-head h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.ai-head p {
  margin: 0;
  color: #cbd2dc;
  font-size: 13px;
  line-height: 1.35;
}

.ai-messages {
  overflow: auto;
  padding: 14px;
}

.ai-message {
  margin-bottom: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #242832;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-message.assistant {
  display: grid;
  gap: 8px;
  white-space: normal;
}

.ai-section {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.ai-section-title {
  margin-bottom: 4px;
  color: #ffd22e;
  font-weight: 900;
  font-size: 13px;
}

.ai-section-body {
  color: #f2f5f7;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}

.ai-message.user {
  background: var(--yellow);
  color: #101010;
}

.ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.ai-form textarea {
  min-width: 0;
  resize: vertical;
  border: 1px solid #3b414a;
  border-radius: 6px;
  background: #20242a;
  color: #fff;
  padding: 10px;
}

.ai-form button {
  background: var(--yellow);
  color: #111;
  border: 0;
}

.empty {
  padding: 22px 16px;
  color: var(--muted);
}

@media (max-width: 900px) {
  :root {
    color-scheme: light;
    --bg: #edf5ef;
    --panel: rgba(247, 251, 248, 0.98);
    --panel-2: #e5eee8;
    --line: rgba(71, 91, 80, 0.22);
    --text: #22332b;
    --muted: #66786f;
    --yellow: #f4c934;
    --yellow-dark: #caa21b;
    --blue: #2f8c72;
  }

  html,
  body {
    overflow: auto;
    min-height: 100%;
    background: #edf5ef;
    color: var(--text);
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    background: #f7fbf8;
    border-bottom-color: rgba(68, 92, 78, 0.18);
  }

  .brand {
    font-size: 20px;
    color: #235b49;
  }

  .brand span {
    color: #6e8178;
  }

  .searchbar select,
  .searchbar input,
  .searchbar button,
  .bottom-search input {
    border-color: rgba(68, 92, 78, 0.28);
    background: #f9fcfa;
    color: var(--text);
  }

  .status,
  .auth-status {
    color: var(--muted);
  }

  .searchbar {
    grid-template-columns: 104px minmax(0, 1fr) 66px;
  }

  .searchbar select,
  .searchbar input,
  .searchbar button,
  .bottom-search input {
    min-height: 40px;
    font-size: 16px;
  }

  .status {
    text-align: left;
  }

  .layout {
    height: auto;
    min-height: calc(100dvh - 112px);
    display: block;
    overflow: visible;
  }

  .stage {
    height: 58svh;
    min-height: 360px;
    max-height: 620px;
    background: #202623;
    border-bottom: 1px solid rgba(68, 92, 78, 0.2);
  }

  .stage.is-playing .center-controls {
    opacity: 0;
    pointer-events: none;
  }

  .stage.is-paused .center-controls,
  .stage:focus-within .center-controls {
    opacity: 1;
  }

  .player {
    inset: 0 0 122px;
    height: calc(100% - 122px);
  }

  .stage::after {
    bottom: 122px;
  }

  .subtitle-overlay {
    bottom: 166px;
    width: calc(100% - 18px);
  }

  .subtitle-row {
    gap: 6px;
  }

  .subtitle-primary {
    font-size: clamp(20px, 5vw, 28px);
  }

  .subtitle-zh {
    margin-top: 8px;
    font-size: clamp(17px, 4.4vw, 22px);
  }

  .ai-pill {
    width: 34px;
    height: 30px;
  }

  .play-btn {
    width: 78px;
    height: 78px;
    font-size: 34px;
  }

  .round-btn {
    width: 52px;
    height: 52px;
    font-size: 42px;
  }

  .thumb-strip {
    height: 76px;
  }

  .thumb {
    flex-basis: 118px;
    height: 76px;
  }

  .bottom-search {
    height: 46px;
    background: #f7fbf8;
    border-top-color: rgba(68, 92, 78, 0.2);
  }

  .lang-badge {
    border-color: rgba(68, 92, 78, 0.35);
    color: #365e50;
    background: #e9f2ec;
  }

  .side-panel {
    display: block;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid rgba(68, 92, 78, 0.22);
    background: var(--panel);
    box-shadow: none;
    overflow: visible;
  }

  .panel-head,
  .catalog,
  .list-title,
  .actions {
    border-color: var(--line);
  }

  .catalog-head,
  .catalog-check,
  .list-title {
    color: #28443a;
  }

  .metrics span,
  .counter,
  .catalog-filters select,
  .catalog-controls input,
  .catalog-controls button,
  .catalog-tabs button,
  .catalog-list button,
  .pager button,
  .actions button,
  .audio-mode-toggle,
  .favorite-btn {
    border-color: rgba(68, 92, 78, 0.28);
    background: #e8efe9;
    color: #22332b;
  }

  .metrics span,
  .line-translation,
  .word-meta,
  .ai-head p {
    color: #60746a;
  }

  .actions .primary-action,
  .audio-mode-toggle.active,
  .catalog-tabs button.active,
  .catalog-list button.active,
  .catalog-list button.catalog-load-all,
  .line-ai,
  .ai-pill,
  .favorite-btn.active {
    background: var(--yellow);
    border-color: var(--yellow);
    color: #17211c;
  }

  .line-item {
    border-bottom-color: rgba(68, 92, 78, 0.14);
  }

  .line-item:hover,
  .line-item.active {
    background: rgba(47, 140, 114, 0.11);
  }

  .panel-head,
  .metrics,
  .actions,
  .catalog,
  .list-title {
    padding-left: 12px;
    padding-right: 12px;
  }

  .actions button {
    height: auto;
    min-height: 44px;
  }

  .catalog-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .catalog-controls {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .catalog-filters select,
  .catalog-controls input,
  .catalog-controls button {
    height: 44px;
    min-height: 44px;
    font-size: 16px;
  }

  .catalog-list {
    max-height: 58svh;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .catalog-list button {
    min-height: 56px;
    height: auto;
    font-size: 13px;
  }

  .list-title {
    position: sticky;
    top: 0;
    z-index: 12;
    flex-wrap: wrap;
    background: var(--panel);
  }

  .subtitle-list {
    max-height: 68svh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .line-item {
    grid-template-columns: 26px 94px minmax(0, 1fr) 34px 38px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 8px;
  }

  .searchbar {
    grid-template-columns: 76px minmax(0, 1fr) 58px;
    gap: 6px;
  }

  .stage {
    height: 56svh;
    min-height: 320px;
  }

  .center-controls {
    gap: 18px;
    top: calc(50% - 46px);
  }

  .play-btn {
    width: 70px;
    height: 70px;
  }

  .round-btn {
    width: 48px;
    height: 48px;
  }

  .subtitle-overlay {
    bottom: 160px;
  }

  .thumb {
    flex-basis: 112px;
  }

  .catalog-list {
    max-height: 42svh;
  }

  .line-item {
    grid-template-columns: 24px 92px minmax(0, 1fr) 34px;
    gap: 7px;
    min-height: 82px;
  }

  .line-ai {
    grid-column: 4;
  }

  .line-item .favorite-btn {
    display: none;
  }

  .word-popup {
    width: calc(100vw - 16px);
  }

  .ai-dialog {
    padding: 8px;
  }

  .ai-card {
    max-height: calc(100dvh - 16px);
  }

  .ai-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    color-scheme: light;
    --bg: #f3f8f5;
    --panel: #ffffff;
    --panel-2: #eef5f0;
    --line: rgba(36, 60, 49, 0.12);
    --text: #18251f;
    --muted: #718176;
    --yellow: #ffd22e;
    --yellow-dark: #d3a900;
    --blue: #2f8b72;
  }

  html,
  body {
    min-height: 100%;
    overflow: auto;
    background:
      radial-gradient(circle at 18% -8%, rgba(124, 211, 166, 0.28), transparent 32%),
      linear-gradient(180deg, #f8fcf9 0%, #edf6f0 42%, #f5f8f4 100%);
    color: var(--text);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand auth"
      "search search"
      "status status";
    gap: 8px;
    padding: 10px 12px 12px;
    background: rgba(248, 252, 249, 0.94);
    border-bottom: 1px solid rgba(44, 76, 62, 0.12);
    box-shadow: 0 8px 28px rgba(36, 60, 49, 0.08);
    backdrop-filter: blur(18px);
  }

  .brand {
    grid-area: brand;
    align-self: center;
    font-size: 22px;
    letter-spacing: 0;
    color: #163d32;
  }

  .brand span {
    color: #2f8b72;
  }

  .auth-status {
    grid-area: auth;
    align-self: center;
    justify-content: flex-end;
    gap: 6px;
    color: #49665a;
  }

  .auth-status button {
    min-width: 60px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #20312a;
    color: #f5fbf7;
    box-shadow: 0 8px 18px rgba(32, 49, 42, 0.18);
  }

  .searchbar {
    grid-area: search;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 58px;
    gap: 8px;
    min-width: 0;
  }

  .searchbar select,
  .searchbar input,
  .searchbar button {
    height: 42px;
    min-height: 42px;
    border-radius: 13px;
    border: 1px solid rgba(45, 74, 61, 0.16);
    background: rgba(255, 255, 255, 0.92);
    color: #1d2c25;
    box-shadow: inset 0 -1px 0 rgba(45, 74, 61, 0.04);
    font-size: 16px;
  }

  .searchbar button {
    border: 0;
    background: #20312a;
    color: #f8fff9;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    word-break: keep-all;
  }

  .status {
    grid-area: status;
    min-height: 18px;
    text-align: left;
    color: #6f8378;
    font-size: 13px;
  }

  .layout {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    background: transparent;
  }

  .stage {
    height: min(66svh, 620px);
    min-height: 430px;
    background: #070908;
    border-radius: 0 0 24px 24px;
    border-bottom: 0;
    box-shadow: 0 18px 42px rgba(16, 32, 24, 0.2);
    overflow: hidden;
  }

  .player {
    inset: 0 0 116px;
    width: 100%;
    height: calc(100% - 116px);
    object-fit: contain;
    background: radial-gradient(circle at 50% 38%, #202625 0%, #111615 48%, #050605 100%);
  }

  .stage::after {
    bottom: 116px;
    height: 160px;
    background: linear-gradient(transparent 6%, rgba(0, 0, 0, 0.52) 76%, rgba(0, 0, 0, 0.76));
  }

  .center-controls {
    top: calc((100% - 116px) / 2);
    gap: 18px;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, visibility 120ms ease;
  }

  .stage.is-paused .center-controls {
    opacity: 1;
    visibility: visible;
  }

  .stage.is-playing .center-controls,
  .stage.is-playing:focus-within .center-controls,
  .stage.is-playing:hover .center-controls {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .stage.is-paused .center-controls .round-btn,
  .stage.is-paused .center-controls .play-btn {
    pointer-events: auto;
  }

  .round-btn,
  .play-btn {
    border: 2px solid rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(10px);
  }

  .round-btn {
    width: 48px;
    height: 48px;
    font-size: 36px;
    padding-bottom: 6px;
  }

  .play-btn {
    width: 72px;
    height: 72px;
    font-size: 31px;
    padding-left: 4px;
  }

  .subtitle-overlay {
    bottom: 132px;
    width: calc(100% - 20px);
    z-index: 24;
  }

  .subtitle-row {
    display: flex;
    justify-content: center;
    gap: 7px;
  }

  .subtitle-primary,
  .subtitle-zh {
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.76);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    text-shadow: none;
  }

  .subtitle-primary {
    max-width: calc(100vw - 96px);
    padding: 8px 12px;
    font-size: clamp(19px, 4.8vw, 26px);
    line-height: 1.24;
  }

  .subtitle-zh {
    max-width: calc(100vw - 28px);
    margin-top: 8px;
    padding: 7px 12px;
    font-size: clamp(16px, 4.2vw, 21px);
    line-height: 1.3;
  }

  .overlay-favorite,
  .ai-pill {
    width: 40px;
    height: 36px;
    border-radius: 11px;
    flex: 0 0 40px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  }

  .ai-pill {
    background: #ffd22e;
    color: #1f1f12;
  }

  .thumb-strip {
    bottom: 54px;
    height: 62px;
    gap: 5px;
    padding: 5px 6px;
    background: #080a09;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .thumb-strip::-webkit-scrollbar {
    display: none;
  }

  .thumb {
    flex: 0 0 110px;
    height: 52px;
    border-radius: 7px;
    border-right: 0;
    scroll-snap-align: start;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .thumb.active {
    outline: 2px solid #ffd22e;
    outline-offset: 0;
  }

  .thumb-number {
    top: 4px;
    left: 5px;
    min-width: 22px;
    height: 20px;
    border-radius: 7px;
    font-size: 12px;
  }

  .thumb-caption {
    left: 7px;
    right: 7px;
    bottom: 5px;
    font-size: 11px;
    line-height: 1.08;
    -webkit-line-clamp: 2;
  }

  .bottom-search {
    height: 54px;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fcf9;
    border-top: 1px solid rgba(44, 76, 62, 0.12);
  }

  .lang-badge {
    width: 64px;
    height: 38px;
    border-radius: 12px;
    border-color: rgba(47, 139, 114, 0.22);
    background: #e9f5ef;
    color: #20624f;
    font-size: 16px;
  }

  .bottom-search input {
    height: 38px;
    border-radius: 12px;
    border-color: rgba(44, 76, 62, 0.14);
    background: #ffffff;
    color: #26382f;
    font-size: 16px;
  }

  .side-panel {
    display: block;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 12px 10px 28px;
  }

  .panel-head,
  .metrics,
  .actions,
  .catalog,
  .list-title,
  .subtitle-list {
    margin: 0 0 12px;
    border: 1px solid rgba(44, 76, 62, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 26px rgba(34, 58, 46, 0.08);
  }

  .panel-head {
    padding: 15px 14px;
  }

  .panel-head h1 {
    font-size: 19px;
    color: #18251f;
  }

  .panel-head p {
    color: #6f8378;
    line-height: 1.35;
  }

  .counter {
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #edf7f1, #e0efe7);
    color: #18372b;
    box-shadow: inset 0 0 0 1px rgba(47, 139, 114, 0.16);
  }

  .counter span {
    color: #6b7f74;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    gap: 8px;
  }

  .metrics span {
    min-height: 42px;
    display: flex;
    align-items: center;
    border-radius: 13px;
    background: #eef5f0;
    color: #30483d;
    padding: 8px 10px;
    font-size: 13px;
  }

  .actions {
    padding: 12px;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions button {
    min-height: 46px;
    height: auto;
    border-radius: 14px;
    border-color: rgba(44, 76, 62, 0.14);
    background: #edf4ef;
    color: #26382f;
    font-size: 15px;
  }

  .actions .primary-action {
    background: linear-gradient(180deg, #ffd84c, #ffc928);
    color: #24200f;
    box-shadow: 0 10px 18px rgba(217, 169, 0, 0.18);
  }

  .catalog {
    padding: 13px;
  }

  .catalog-head,
  .catalog-check,
  .list-title {
    color: #26382f;
  }

  .catalog-head {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .catalog-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .catalog-controls {
    grid-template-columns: minmax(0, 1fr) 66px;
    gap: 7px;
  }

  .catalog-filters select,
  .catalog-controls input,
  .catalog-controls button,
  .catalog-tabs button,
  .catalog-list button,
  .pager button {
    border-radius: 12px;
    border-color: rgba(44, 76, 62, 0.16);
    background: #f5faf7;
    color: #24372e;
  }

  .catalog-filters select,
  .catalog-controls input,
  .catalog-controls button {
    height: 42px;
    min-height: 42px;
    font-size: 15px;
  }

  .catalog-tabs button.active,
  .catalog-list button.active,
  .catalog-list button.catalog-load-all,
  .pager button:not(:disabled):active {
    background: #20312a;
    border-color: #20312a;
    color: #f8fff9;
  }

  .catalog-list button.active .catalog-meaning,
  .catalog-list button.catalog-load-all .catalog-meaning {
    color: rgba(248, 255, 249, 0.72);
  }

  .catalog-check input {
    accent-color: #2f8b72;
  }

  .catalog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 58svh;
    gap: 8px;
    padding-right: 2px;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .catalog-list button {
    min-height: 56px;
    height: auto;
    font-size: 13px;
    background: #f0f6f2;
  }

  .list-title {
    position: sticky;
    top: 104px;
    z-index: 35;
    flex-wrap: wrap;
    padding: 12px;
  }

  .pager {
    order: 3;
    flex-basis: 100%;
  }

  .subtitle-list {
    display: none;
  }

  .line-item {
    grid-template-columns: 26px 92px minmax(0, 1fr) 40px;
    gap: 8px;
    min-height: 88px;
    padding: 10px;
    border-bottom-color: rgba(44, 76, 62, 0.08);
    color: #1e2e26;
  }

  .line-item:last-child {
    border-bottom: 0;
  }

  .line-item:hover,
  .line-item.active {
    background: rgba(47, 139, 114, 0.1);
  }

  .line-no {
    color: #789086;
  }

  .side-thumb {
    width: 92px;
    height: 58px;
    border-radius: 9px;
  }

  .line-original {
    font-size: 13px;
    color: #1e2e26;
  }

  .line-translation {
    color: #5c7167;
  }

  .line-ai {
    width: 38px;
    height: 34px;
    border-radius: 11px;
  }

  .line-item .favorite-btn {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 8px 10px 10px;
  }

  .brand {
    font-size: 20px;
  }

  .searchbar {
    grid-template-columns: 72px minmax(0, 1fr) 54px;
    gap: 7px;
  }

  .searchbar select,
  .searchbar input,
  .searchbar button {
    height: 40px;
    min-height: 40px;
  }

  .stage {
    height: 60svh;
    min-height: 390px;
    border-radius: 0 0 20px 20px;
  }

  .player {
    inset: 0 0 110px;
    height: calc(100% - 110px);
  }

  .stage::after {
    bottom: 110px;
  }

  .center-controls {
    top: calc((100% - 110px) / 2);
    gap: 16px;
  }

  .round-btn {
    width: 44px;
    height: 44px;
    font-size: 32px;
  }

  .play-btn {
    width: 66px;
    height: 66px;
    font-size: 29px;
  }

  .subtitle-overlay {
    bottom: 126px;
    width: calc(100% - 16px);
  }

  .subtitle-primary {
    max-width: calc(100vw - 92px);
    font-size: clamp(18px, 5vw, 24px);
  }

  .subtitle-zh {
    font-size: clamp(15px, 4.4vw, 20px);
  }

  .thumb-strip {
    bottom: 50px;
    height: 60px;
  }

  .thumb {
    flex-basis: 104px;
    height: 50px;
  }

  .bottom-search {
    height: 50px;
    padding: 7px 9px;
  }

  .lang-badge,
  .bottom-search input {
    height: 36px;
  }

  .side-panel {
    padding: 10px 8px 24px;
  }

  .panel-head,
  .metrics,
  .actions,
  .catalog,
  .list-title,
  .subtitle-list {
    border-radius: 16px;
  }

  .catalog-filters {
    grid-template-columns: 1fr;
  }

  .catalog-controls {
    grid-template-columns: minmax(0, 1fr) 62px;
  }

  .catalog-list {
    max-height: 36svh;
  }

  .list-title {
    top: 98px;
  }

  .line-item {
    grid-template-columns: 22px 84px minmax(0, 1fr) 38px;
    gap: 7px;
  }

  .side-thumb {
    width: 84px;
    height: 54px;
  }
}

@media (max-width: 900px) {
  .center-controls {
    top: calc((100% - 116px) * 0.32) !important;
  }

  .subtitle-primary,
  .subtitle-primary *,
  .subtitle-zh,
  .subtitle-zh * {
    color: #ffffff !important;
  }

  .subtitle-primary {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55) !important;
  }

  .subtitle-primary .word-token.active,
  .subtitle-primary .word-token:hover {
    color: #111111 !important;
  }
}

@media (max-width: 560px) {
  .center-controls {
    top: calc((100% - 110px) * 0.3) !important;
  }
}

/* v18 mobile player: clean video, subtitles below, visible thumbnails */
@media (max-width: 900px) {
  .stage {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: #f4fbf6 !important;
    border-radius: 0 0 26px 26px !important;
    box-shadow: 0 18px 40px rgba(28, 64, 48, 0.16) !important;
  }

  .player {
    order: 1 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    max-height: 46svh !important;
    min-height: 220px !important;
    object-fit: contain !important;
    background: linear-gradient(180deg, #14201c, #070b09) !important;
    display: block !important;
  }

  .stage::after {
    display: none !important;
  }

  .center-controls {
    top: clamp(112px, 28vw, 190px) !important;
    gap: 12px !important;
    z-index: 40 !important;
  }

  .stage.is-playing .center-controls,
  .stage.is-playing:focus-within .center-controls,
  .stage.is-playing:hover .center-controls {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .stage.is-paused .center-controls {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .round-btn,
  .play-btn {
    border: 1px solid rgba(255, 255, 255, 0.36) !important;
    background: rgba(20, 32, 28, 0.58) !important;
    color: #ffffff !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
    backdrop-filter: blur(14px) saturate(1.25) !important;
    font-family: "Segoe UI Symbol", "Arial", sans-serif !important;
    line-height: 1 !important;
  }

  .round-btn {
    width: 54px !important;
    height: 42px !important;
    border-radius: 999px !important;
    font-size: 30px !important;
    padding: 0 0 3px !important;
  }

  .play-btn {
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
    font-size: 25px !important;
    padding: 0 0 0 3px !important;
  }

  .subtitle-overlay {
    order: 2 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 12px 12px 10px !important;
    z-index: 10 !important;
    background: #f4fbf6 !important;
    text-align: center !important;
    pointer-events: auto !important;
  }

  .subtitle-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px 44px !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .subtitle-primary,
  .subtitle-primary *,
  .subtitle-zh,
  .subtitle-zh * {
    color: inherit !important;
  }

  .subtitle-primary,
  .subtitle-zh {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 16px !important;
    text-shadow: none !important;
    box-shadow: 0 10px 24px rgba(48, 90, 70, 0.12) !important;
    overflow-wrap: anywhere !important;
  }

  .subtitle-primary {
    padding: 12px 14px !important;
    background: #ffffff !important;
    border: 1px solid rgba(71, 112, 91, 0.18) !important;
    color: #17372e !important;
    font-size: clamp(20px, 5.2vw, 27px) !important;
    line-height: 1.22 !important;
    font-weight: 900 !important;
  }

  .subtitle-zh {
    margin: 8px 0 0 !important;
    padding: 10px 14px !important;
    background: #e8f3ec !important;
    border: 1px solid rgba(71, 112, 91, 0.14) !important;
    color: #213a31 !important;
    font-size: clamp(17px, 4.5vw, 22px) !important;
    line-height: 1.32 !important;
    font-weight: 760 !important;
  }

  .subtitle-primary .word-token.active,
  .subtitle-primary .word-token:hover {
    background: #ffd22e !important;
    color: #111111 !important;
  }

  .overlay-favorite,
  .ai-pill {
    align-self: stretch !important;
    width: 44px !important;
    height: auto !important;
    min-height: 44px !important;
    flex: none !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 18px rgba(35, 82, 62, 0.14) !important;
  }

  .overlay-favorite {
    background: #eff7f1 !important;
    border: 1px solid rgba(71, 112, 91, 0.2) !important;
    color: #264c3f !important;
  }

  .ai-pill {
    background: #ffd22e !important;
    color: #182119 !important;
  }

  .thumb-strip {
    order: 3 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    height: 82px !important;
    z-index: 9 !important;
    margin: 0 10px 10px !important;
    padding: 8px !important;
    gap: 8px !important;
    border: 1px solid rgba(71, 112, 91, 0.15) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
    scrollbar-width: none !important;
  }

  .thumb-strip::-webkit-scrollbar {
    display: none !important;
  }

  .thumb {
    flex: 0 0 124px !important;
    height: 64px !important;
    border-radius: 13px !important;
    border: 1px solid rgba(71, 112, 91, 0.13) !important;
    overflow: hidden !important;
    box-shadow: 0 8px 18px rgba(30, 50, 42, 0.13) !important;
  }

  .thumb.active {
    outline: 3px solid #ffd22e !important;
    outline-offset: -3px !important;
  }

  .thumb-number {
    top: 5px !important;
    left: 6px !important;
    border-radius: 8px !important;
    background: #ffd22e !important;
    color: #162018 !important;
  }

  .thumb-caption {
    left: 8px !important;
    right: 8px !important;
    bottom: 7px !important;
    font-size: 12px !important;
    line-height: 1.12 !important;
    -webkit-line-clamp: 2 !important;
  }

  .bottom-search {
    order: 4 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    height: auto !important;
    min-height: 54px !important;
    margin: 0 10px 12px !important;
    padding: 8px !important;
    border: 1px solid rgba(71, 112, 91, 0.15) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.78) !important;
  }
}

@media (max-width: 560px) {
  .player {
    min-height: 210px !important;
    max-height: 42svh !important;
  }

  .center-controls {
    top: clamp(105px, 28vw, 158px) !important;
  }

  .subtitle-overlay {
    padding: 10px 10px 8px !important;
  }

  .subtitle-row {
    grid-template-columns: minmax(0, 1fr) 40px 40px !important;
    gap: 7px !important;
  }

  .subtitle-primary {
    font-size: clamp(19px, 5.4vw, 25px) !important;
  }

  .subtitle-zh {
    font-size: clamp(16px, 4.7vw, 21px) !important;
  }

  .thumb-strip {
    height: 78px !important;
  }

  .thumb {
    flex-basis: 116px !important;
    height: 60px !important;
  }
}

/* v19 mobile UX: catalog first, stable paging, bounded word popup */
.word-popup {
  max-height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
}

.popup-body {
  overflow: auto;
  max-height: calc(100dvh - 112px);
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  body.mobile-learn-layout .layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  body.mobile-learn-layout .layout > .catalog {
    order: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 45 !important;
    margin: 8px 10px 10px !important;
    padding: 12px !important;
    border: 1px solid rgba(71, 112, 91, 0.18) !important;
    border-radius: 22px !important;
    background: rgba(250, 255, 252, 0.94) !important;
    box-shadow: 0 16px 34px rgba(25, 70, 52, 0.13) !important;
    backdrop-filter: blur(16px) saturate(1.2) !important;
  }

  body.mobile-learn-layout .stage {
    order: 1 !important;
  }

  body.mobile-learn-layout .side-panel {
    order: 2 !important;
    padding-top: 8px !important;
  }

  body.mobile-learn-layout .catalog-head {
    margin-bottom: 8px !important;
    color: #17372e !important;
  }

  body.mobile-learn-layout .catalog-head > span {
    font-size: 15px !important;
    font-weight: 900 !important;
  }

  body.mobile-learn-layout .catalog-tabs {
    display: none !important;
  }

  body.mobile-learn-layout .catalog-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-bottom: 7px !important;
  }

  body.mobile-learn-layout .catalog-filters select,
  body.mobile-learn-layout .catalog-controls input,
  body.mobile-learn-layout .catalog-controls button {
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 13px !important;
    border-color: rgba(71, 112, 91, 0.22) !important;
    background: #ffffff !important;
    color: #1d382f !important;
    font-size: 13px !important;
  }

  body.mobile-learn-layout .catalog-controls {
    grid-template-columns: minmax(0, 1fr) 64px !important;
    gap: 7px !important;
    margin-bottom: 6px !important;
  }

  body.mobile-learn-layout .catalog-controls button,
  body.mobile-learn-layout .pager button {
    background: #123f32 !important;
    border-color: #123f32 !important;
    color: #f8fff9 !important;
    font-weight: 900 !important;
  }

  body.mobile-learn-layout .catalog-check {
    min-height: 24px !important;
    margin: 4px 0 6px !important;
    color: #526b60 !important;
    font-size: 12px !important;
  }

  body.mobile-learn-layout .catalog .pager {
    display: grid !important;
    grid-template-columns: 68px minmax(0, 1fr) 68px !important;
    gap: 7px !important;
    margin: 7px 0 8px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  body.mobile-learn-layout .catalog .pager button {
    height: 34px !important;
    border-radius: 12px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  body.mobile-learn-layout .catalog .pager span {
    height: 34px !important;
    display: grid !important;
    place-items: center !important;
    border: 1px solid rgba(71, 112, 91, 0.16) !important;
    border-radius: 12px !important;
    background: #eef8f2 !important;
    color: #27483d !important;
    font-size: 12px !important;
    font-weight: 900 !important;
  }

  body.mobile-learn-layout .catalog-list {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-template-rows: repeat(4, minmax(54px, auto)) !important;
    grid-auto-columns: minmax(132px, 184px) !important;
    grid-template-columns: none !important;
    gap: 7px !important;
    max-height: 238px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 2px 2px !important;
    scrollbar-width: none !important;
    overscroll-behavior-x: contain !important;
  }

  body.mobile-learn-layout .catalog-list::-webkit-scrollbar {
    display: none !important;
  }

  body.mobile-learn-layout .catalog-list button {
    width: 100% !important;
    min-height: 54px !important;
    height: auto !important;
    border-radius: 12px !important;
    background: #eaf3ee !important;
    border-color: rgba(71, 112, 91, 0.18) !important;
    color: #1d382f !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    align-items: flex-start !important;
  }

  body.mobile-learn-layout .catalog-list button.active,
  body.mobile-learn-layout .catalog-list button.catalog-load-all {
    background: #ffd22e !important;
    border-color: #ffd22e !important;
    color: #182119 !important;
  }

  body.mobile-learn-layout .catalog-list button.catalog-load-all {
    grid-column: auto !important;
    min-width: 148px !important;
  }

  body.mobile-learn-layout .list-title {
    position: static !important;
  }

  body.mobile-learn-layout .list-title .pager {
    display: none !important;
  }

  body.mobile-learn-layout .word-popup {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    border-radius: 16px !important;
  }

  body.mobile-learn-layout .word-phonetics {
    grid-template-columns: 1fr !important;
  }

  body.mobile-learn-layout .word-ipa,
  body.mobile-learn-layout .word-section-body,
  body.mobile-learn-layout .ai-section-body {
    font-size: 13px !important;
  }
}

@media (max-width: 560px) {
  body.mobile-learn-layout .layout > .catalog {
    margin: 6px 8px 8px !important;
    padding: 10px !important;
    border-radius: 20px !important;
  }

  body.mobile-learn-layout .catalog-filters {
    gap: 5px !important;
  }

  body.mobile-learn-layout .catalog-filters select {
    padding: 0 6px !important;
    font-size: 12px !important;
  }

  body.mobile-learn-layout .catalog-list {
    grid-auto-columns: minmax(88px, 132px) !important;
  }
}

/* v21 mobile: lean first screen, loop bar, shelves, larger related videos */
.wordbook-btn {
  height: 42px;
  margin: 0 14px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--yellow);
  color: #111;
  font-weight: 900;
}

.wordbook-btn.active {
  background: #3b414a;
  color: #fff;
}

@media (max-width: 900px) {
  body.mobile-learn-layout .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 8px 12px !important;
    gap: 6px !important;
  }

  body.mobile-learn-layout .brand {
    font-size: 22px !important;
    line-height: 1.1 !important;
  }

  body.mobile-learn-layout .searchbar,
  body.mobile-learn-layout .status,
  body.mobile-learn-layout .bottom-search {
    display: none !important;
  }

  body.mobile-learn-layout .auth-status {
    justify-self: end !important;
    font-size: 12px !important;
  }

  body.mobile-learn-layout .layout > .actions {
    order: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 8px 10px 0 !important;
    padding: 10px !important;
    border: 1px solid rgba(71, 112, 91, 0.18) !important;
    border-radius: 20px !important;
    background: rgba(250, 255, 252, 0.94) !important;
    box-shadow: 0 12px 28px rgba(25, 70, 52, 0.1) !important;
  }

  body.mobile-learn-layout .layout > .actions #copyBtn,
  body.mobile-learn-layout .layout > .actions #reloadSceneBtn {
    display: none !important;
  }

  body.mobile-learn-layout .layout > .actions button,
  body.mobile-learn-layout .layout > .actions .audio-mode-toggle,
  body.mobile-learn-layout .layout > .actions .scene-window-control {
    min-height: 40px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
  }

  body.mobile-learn-layout .layout > .actions .audio-mode-toggle,
  body.mobile-learn-layout .layout > .actions .scene-window-control {
    height: 40px !important;
  }

  body.mobile-learn-layout .layout > .actions #downloadSubsBtn {
    grid-column: span 2 !important;
  }

  body.mobile-learn-layout .layout > .actions #currentLoopBtn {
    background: #ffd22e !important;
    border-color: #ffd22e !important;
    color: #182119 !important;
  }

  body.mobile-learn-layout .layout > .catalog {
    order: 1 !important;
    position: relative !important;
    top: auto !important;
    margin-top: 8px !important;
  }

  body.mobile-learn-layout .stage {
    order: 2 !important;
    border-radius: 24px !important;
    margin: 0 8px !important;
    overflow: hidden !important;
  }

  body.mobile-learn-layout .player {
    min-height: 190px !important;
    max-height: 36svh !important;
  }

  body.mobile-learn-layout .subtitle-overlay {
    padding: 10px 10px 8px !important;
  }

  body.mobile-learn-layout .thumb-strip {
    height: 118px !important;
    margin: 0 10px 12px !important;
    padding: 9px !important;
    gap: 10px !important;
  }

  body.mobile-learn-layout .thumb {
    flex-basis: 174px !important;
    height: 98px !important;
    border-radius: 16px !important;
  }

  body.mobile-learn-layout .thumb-caption {
    font-size: 13px !important;
    -webkit-line-clamp: 3 !important;
  }

  body.mobile-learn-layout .side-panel,
  body.mobile-learn-layout .panel-head,
  body.mobile-learn-layout .metrics,
  body.mobile-learn-layout .list-title,
  body.mobile-learn-layout .subtitle-list {
    display: none !important;
  }

  body.mobile-learn-layout .mobile-shelves {
    order: 3 !important;
    margin: 10px 10px 24px !important;
    padding: 12px !important;
    border: 1px solid rgba(71, 112, 91, 0.18) !important;
    border-radius: 22px !important;
    background: rgba(250, 255, 252, 0.94) !important;
    box-shadow: 0 14px 34px rgba(25, 70, 52, 0.11) !important;
  }

  .mobile-shelf-head {
    display: grid;
    grid-template-columns: 1fr 1fr 96px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-shelf-head button,
  .mobile-shelf-pager button,
  .mobile-fav-card,
  .mobile-word-card {
    border: 1px solid rgba(71, 112, 91, 0.2);
    background: #edf7f1;
    color: #1c382f;
    font-weight: 900;
  }

  .mobile-shelf-head button {
    height: 38px;
    border-radius: 14px;
  }

  .mobile-shelf-head button.active {
    background: #123f32;
    border-color: #123f32;
    color: #fff;
  }

  .mobile-shelf-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-fav-card,
  .mobile-word-card {
    width: 100%;
    min-height: 72px;
    border-radius: 16px;
    padding: 8px;
    text-align: left;
  }

  .mobile-fav-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
  }

  .mobile-fav-card video {
    width: 112px;
    height: 66px;
    border-radius: 12px;
    object-fit: cover;
    background: #111;
  }

  .mobile-fav-card span,
  .mobile-word-card span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-fav-card span {
    -webkit-line-clamp: 3;
    font-size: 13px;
    line-height: 1.25;
  }

  .mobile-word-card strong {
    display: block;
    margin-bottom: 4px;
    color: #102e25;
    font-size: 18px;
  }

  .mobile-word-card span {
    -webkit-line-clamp: 3;
    color: #52685f;
    font-size: 13px;
    line-height: 1.35;
  }

  .mobile-shelf-empty {
    padding: 18px 8px;
    color: #61766d;
    text-align: center;
    font-weight: 800;
  }

  .mobile-shelf-pager {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 70px;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
  }

  .mobile-shelf-pager button {
    height: 34px;
    border-radius: 12px;
  }

  .mobile-shelf-pager button:disabled {
    opacity: 0.45;
  }

  .mobile-shelf-pager span {
    color: #35584b;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
  }
}

@media (max-width: 560px) {
  body.mobile-learn-layout .thumb {
    flex-basis: 158px !important;
    height: 92px !important;
  }

  body.mobile-learn-layout .thumb-strip {
    height: 112px !important;
  }

  .mobile-fav-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .mobile-fav-card video {
    width: 96px;
    height: 58px;
  }
}

/* v22 mobile captions: one subtitle block below video, text-sized background */
@media (max-width: 900px) {
  body.mobile-learn-layout .subtitle-overlay {
    order: 2 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 10px 8px !important;
    background: transparent !important;
    text-align: center !important;
    pointer-events: auto !important;
  }

  body.mobile-learn-layout .subtitle-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.mobile-learn-layout .subtitle-primary,
  body.mobile-learn-layout .subtitle-zh {
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 16px) !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.82) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7) !important;
    box-shadow: none !important;
    box-decoration-break: clone !important;
    -webkit-box-decoration-break: clone !important;
  }

  body.mobile-learn-layout .subtitle-primary {
    flex: 0 1 auto !important;
    display: inline-block !important;
    max-width: calc(100% - 104px) !important;
    padding: 8px 12px !important;
    font-size: clamp(20px, 5.4vw, 28px) !important;
    line-height: 1.24 !important;
    font-weight: 900 !important;
  }

  body.mobile-learn-layout .subtitle-zh {
    display: inline-block !important;
    margin: 7px auto 0 !important;
    padding: 7px 12px !important;
    font-size: clamp(16px, 4.6vw, 22px) !important;
    line-height: 1.32 !important;
    font-weight: 760 !important;
  }

  body.mobile-learn-layout .subtitle-primary .word-token,
  body.mobile-learn-layout .subtitle-primary .word-token:visited {
    color: #ffffff !important;
  }

  body.mobile-learn-layout .subtitle-primary .word-token.active,
  body.mobile-learn-layout .subtitle-primary .word-token:hover {
    color: #111111 !important;
    background: #ffd22e !important;
  }
}

/* v25 login contrast: keep the sign-in card readable in every theme */
.login-screen .login-card {
  background: #11151b !important;
  color: #f6f7f9 !important;
}

.login-screen .login-card input,
.login-screen .login-card input:focus {
  background: #f7fbff !important;
  color: #101820 !important;
  border-color: #5b6572 !important;
  caret-color: #101820 !important;
  -webkit-text-fill-color: #101820 !important;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 32, 0.08) !important;
}

.login-screen .login-card input::placeholder {
  color: #687483 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #687483 !important;
}

.login-screen .login-card input:-webkit-autofill,
.login-screen .login-card input:-webkit-autofill:hover,
.login-screen .login-card input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px #f7fbff inset !important;
  -webkit-text-fill-color: #101820 !important;
  caret-color: #101820 !important;
}

/* v26 login polish */
.login-screen {
  display: grid !important;
  place-items: center !important;
  padding: clamp(18px, 5vw, 48px) !important;
  background:
    linear-gradient(135deg, rgba(230, 246, 236, 0.94), rgba(205, 229, 215, 0.92)),
    #edf6f0 !important;
  color: #17261f !important;
  overflow: auto !important;
}

.login-screen::before {
  content: "";
  position: fixed;
  inset: 18px;
  border: 1px solid rgba(34, 77, 59, 0.1);
  border-radius: 28px;
  pointer-events: none;
}

.login-screen .login-card {
  width: min(440px, 100%) !important;
  gap: 14px !important;
  padding: clamp(22px, 5vw, 34px) !important;
  border: 1px solid rgba(34, 77, 59, 0.18) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #17261f !important;
  box-shadow: 0 26px 70px rgba(24, 64, 45, 0.18) !important;
  backdrop-filter: blur(18px) !important;
}

.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-brand-row > span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(34, 77, 59, 0.18);
  border-radius: 999px;
  background: #eff8f2;
  color: #2d6d58;
  font-size: 13px;
  font-weight: 900;
}

.login-screen .login-brand {
  color: #153e32 !important;
  font-size: clamp(26px, 7vw, 34px) !important;
  line-height: 1 !important;
}

.login-screen .login-brand span {
  color: #2f8b72 !important;
}

.login-copy {
  display: grid;
  gap: 6px;
  margin: 4px 0 2px;
}

.login-copy p {
  min-height: 0 !important;
  margin: 0 !important;
  color: #5e7469 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.login-screen .login-card h2 {
  margin: 0 !important;
  color: #17261f !important;
  font-size: clamp(25px, 6vw, 32px) !important;
  line-height: 1.12 !important;
  font-weight: 950 !important;
}

.login-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.login-field span {
  color: #4c6358;
  font-size: 13px;
  font-weight: 900;
}

.login-screen .login-card input,
.login-screen .login-card input:focus {
  width: 100% !important;
  height: 52px !important;
  min-height: 52px !important;
  border: 1px solid rgba(34, 77, 59, 0.2) !important;
  border-radius: 15px !important;
  background: #f8fcfa !important;
  color: #101820 !important;
  padding: 0 15px !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  outline: none !important;
  caret-color: #173d31 !important;
  -webkit-text-fill-color: #101820 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52), 0 1px 0 rgba(34, 77, 59, 0.05) !important;
}

.login-screen .login-card input:focus {
  border-color: #2f8b72 !important;
  box-shadow: 0 0 0 4px rgba(47, 139, 114, 0.15), inset 0 0 0 1px #ffffff !important;
}

.login-screen .login-card input::placeholder {
  color: #8a9a92 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #8a9a92 !important;
  font-weight: 700 !important;
}

.login-screen .login-card button {
  height: 54px !important;
  margin-top: 4px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #173d31 !important;
  color: #f8fff9 !important;
  font-size: 17px !important;
  font-weight: 950 !important;
  box-shadow: 0 14px 30px rgba(23, 61, 49, 0.22) !important;
}

.login-screen .login-card button:hover,
.login-screen .login-card button:focus {
  background: #205545 !important;
}

.login-screen .login-card button:disabled {
  opacity: 0.72 !important;
  cursor: progress !important;
}

.login-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.login-note span {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid rgba(34, 77, 59, 0.12);
  border-radius: 13px;
  background: #f1f8f4;
  color: #4f665b;
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.login-screen .login-card #loginMessage {
  min-height: 18px !important;
  margin: 0 !important;
  color: #b3261e !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

@media (max-width: 560px) {
  .login-screen {
    place-items: start center !important;
    padding: 18px 14px !important;
  }

  .login-screen::before {
    inset: 8px;
    border-radius: 22px;
  }

  .login-screen .login-card {
    margin-top: 4vh !important;
    border-radius: 22px !important;
  }

  .login-note {
    grid-template-columns: 1fr;
  }
}

.login-screen[hidden] {
  display: none !important;
}

/* v55: catalog cards and scene-window selector final overrides */
.scene-window-control {
  position: relative;
  overflow: hidden;
  background: #20262e;
  border-color: #58616e;
}

.scene-window-control select {
  height: 24px;
  padding: 0 8px;
  background: #10161d;
  color: #f7fbff;
  border-color: #66717f;
  outline: none;
}

.catalog-list button {
  min-height: 68px;
  overflow: visible;
}

.catalog-source,
.catalog-meaning {
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.catalog-source {
  -webkit-line-clamp: 2;
}

.catalog-meaning {
  -webkit-line-clamp: 2;
  line-height: 1.28;
}

@media (max-width: 900px) {
  body.mobile-learn-layout .layout > .actions .scene-window-control {
    grid-column: span 2 !important;
    justify-content: space-between !important;
    padding: 0 10px !important;
    background: #e8f4ee !important;
    border-color: rgba(40, 86, 67, 0.22) !important;
    color: #173d31 !important;
  }

  body.mobile-learn-layout .layout > .actions .scene-window-control select {
    min-width: 92px !important;
    height: 30px !important;
    border-radius: 11px !important;
    background: #ffffff !important;
    color: #173d31 !important;
    border-color: rgba(40, 86, 67, 0.24) !important;
  }

  body.mobile-learn-layout .catalog-list {
    grid-auto-flow: column !important;
    grid-template-rows: repeat(3, minmax(78px, auto)) !important;
    grid-auto-columns: minmax(178px, 230px) !important;
    max-height: 274px !important;
    gap: 9px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.mobile-learn-layout .catalog-list button {
    min-height: 78px !important;
    padding: 10px 12px !important;
    justify-content: flex-start !important;
    gap: 5px !important;
  }

  body.mobile-learn-layout .catalog-list button.catalog-load-all {
    min-width: 178px !important;
    min-height: 78px !important;
    align-items: flex-start !important;
    justify-content: center !important;
    text-align: left !important;
  }

  body.mobile-learn-layout .catalog-source {
    font-size: 13px !important;
    line-height: 1.25 !important;
    -webkit-line-clamp: 2 !important;
  }

  body.mobile-learn-layout .catalog-meaning {
    font-size: 12px !important;
    line-height: 1.3 !important;
    -webkit-line-clamp: 2 !important;
  }
}

@media (max-width: 560px) {
  body.mobile-learn-layout .catalog-list {
    grid-template-rows: repeat(3, minmax(82px, auto)) !important;
    grid-auto-columns: minmax(166px, 204px) !important;
    max-height: 286px !important;
  }

  body.mobile-learn-layout .catalog-list button {
    min-height: 82px !important;
  }
}

/* v58 mobile short-video template */
.mobile-template-switch,
.mobile-shorts-nav,
.mobile-shorts-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .mobile-template-switch[hidden],
  .mobile-shorts-nav[hidden],
  .mobile-shorts-backdrop[hidden] {
    display: none !important;
  }

  .mobile-template-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    height: 34px;
    border: 1px solid rgba(224, 239, 232, 0.28);
    border-radius: 999px;
    background: rgba(12, 22, 18, 0.72);
    color: #f5fff8;
    font-weight: 900;
    font-size: 13px;
    backdrop-filter: blur(14px);
  }

  body.mobile-template-shorts {
    overflow: hidden !important;
    min-height: 100svh !important;
    background: #020403 !important;
    color: #f6fff9 !important;
  }

  body.mobile-template-shorts .topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 150 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    height: 54px !important;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px !important;
    border: 0 !important;
    background: linear-gradient(180deg, rgba(2, 4, 3, 0.82), rgba(2, 4, 3, 0)) !important;
    box-shadow: none !important;
  }

  body.mobile-template-shorts .brand {
    color: #fff8f4 !important;
    font-size: 21px !important;
    letter-spacing: 0 !important;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72) !important;
  }

  body.mobile-template-shorts .brand span {
    color: #c7f0dd !important;
  }

  body.mobile-template-shorts .auth-status {
    display: inline-flex !important;
    justify-content: flex-end !important;
    color: rgba(246, 255, 249, 0.9) !important;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7) !important;
  }

  body.mobile-template-shorts .layout {
    display: block !important;
    width: 100vw !important;
    height: 100svh !important;
    min-height: 100svh !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #020403 !important;
  }

  body.mobile-template-shorts .stage {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1 !important;
    width: 100vw !important;
    height: 100svh !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #020403 !important;
    overflow: hidden !important;
  }

  body.mobile-template-shorts .player {
    width: 100vw !important;
    height: 100svh !important;
    min-height: 100svh !important;
    max-height: none !important;
    object-fit: contain !important;
    background: #020403 !important;
  }

  body.mobile-template-shorts.audio-only-mode .player {
    opacity: 0.18 !important;
    filter: blur(1px) saturate(0.72) !important;
  }

  body.mobile-template-shorts .center-controls {
    z-index: 45 !important;
    gap: 22px !important;
    transition: opacity 0.16s ease, transform 0.16s ease !important;
  }

  body.mobile-template-shorts .stage.is-playing .center-controls {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, -50%) scale(0.94) !important;
  }

  body.mobile-template-shorts .center-controls button {
    border: 1px solid rgba(255, 255, 255, 0.46) !important;
    background: rgba(12, 18, 16, 0.36) !important;
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42) !important;
    backdrop-filter: blur(10px) !important;
  }

  body.mobile-template-shorts .play-btn {
    width: 78px !important;
    height: 78px !important;
    font-size: 32px !important;
  }

  body.mobile-template-shorts .round-btn {
    width: 56px !important;
    height: 56px !important;
    font-size: 28px !important;
  }

  body.mobile-template-shorts .subtitle-overlay {
    position: absolute !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(env(safe-area-inset-bottom) + 148px) !important;
    z-index: 70 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 0 !important;
    transform: none !important;
    pointer-events: none !important;
  }

  body.mobile-template-shorts .subtitle-overlay[hidden] {
    display: none !important;
  }

  body.mobile-template-shorts .subtitle-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: min(96vw, 720px) !important;
    gap: 8px !important;
    pointer-events: auto !important;
  }

  body.mobile-template-shorts .subtitle-primary,
  body.mobile-template-shorts .subtitle-zh {
    width: auto !important;
    max-width: min(92vw, 690px) !important;
    border-radius: 14px !important;
    background: rgba(2, 4, 3, 0.72) !important;
    color: #fff !important;
    text-align: center !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36) !important;
    backdrop-filter: blur(10px) !important;
  }

  body.mobile-template-shorts .subtitle-primary {
    padding: 8px 12px !important;
    font-size: clamp(20px, 6.1vw, 34px) !important;
    line-height: 1.17 !important;
    font-weight: 900 !important;
  }

  body.mobile-template-shorts .subtitle-zh {
    padding: 7px 11px !important;
    font-size: clamp(17px, 4.8vw, 25px) !important;
    line-height: 1.2 !important;
  }

  body.mobile-template-shorts .overlay-favorite,
  body.mobile-template-shorts .ai-pill {
    flex: 0 0 auto !important;
    min-width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34) !important;
  }

  body.mobile-template-shorts .thumb-strip {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(env(safe-area-inset-bottom) + 72px) !important;
    z-index: 60 !important;
    height: 70px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    border: 0 !important;
    background: linear-gradient(180deg, rgba(2, 4, 3, 0), rgba(2, 4, 3, 0.78)) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
  }

  body.mobile-template-shorts .thumb-strip::-webkit-scrollbar {
    display: none !important;
  }

  body.mobile-template-shorts .thumb {
    flex: 0 0 104px !important;
    width: 104px !important;
    height: 54px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    background: rgba(0, 0, 0, 0.62) !important;
  }

  body.mobile-template-shorts .thumb.active {
    border-color: #ffd22e !important;
    box-shadow: 0 0 0 2px rgba(255, 210, 46, 0.42) !important;
  }

  body.mobile-template-shorts .thumb-caption {
    font-size: 11px !important;
    line-height: 1.12 !important;
    -webkit-line-clamp: 2 !important;
  }

  body.mobile-template-shorts .bottom-search,
  body.mobile-template-shorts .mobile-shelves,
  body.mobile-template-shorts .side-panel,
  body.mobile-template-shorts .layout > .actions {
    display: none !important;
  }

  body.mobile-template-shorts .layout > .catalog {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(env(safe-area-inset-bottom) + 78px) !important;
    top: auto !important;
    z-index: 130 !important;
    max-height: min(70svh, 640px) !important;
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid rgba(208, 232, 219, 0.16) !important;
    border-radius: 22px !important;
    background: rgba(11, 16, 15, 0.96) !important;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58) !important;
    color: #f8fff9 !important;
    overflow: auto !important;
    opacity: 0 !important;
    transform: translateY(calc(100% + 100px)) !important;
    pointer-events: none !important;
    transition: opacity 0.18s ease, transform 0.22s ease !important;
    backdrop-filter: blur(18px) saturate(1.12) !important;
  }

  body.mobile-template-shorts.mobile-shorts-drawer-open .layout > .catalog {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(env(safe-area-inset-bottom) + 78px) !important;
    z-index: 132 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    max-height: min(52svh, 430px) !important;
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid rgba(208, 232, 219, 0.18) !important;
    border-radius: 22px !important;
    background: rgba(11, 16, 15, 0.96) !important;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58) !important;
    color: #f8fff9 !important;
    overflow: auto !important;
    pointer-events: auto !important;
    backdrop-filter: blur(18px) saturate(1.12) !important;
  }

  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions::before {
    content: "视频设置";
    grid-column: 1 / -1;
    color: #f8fff9;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: 0;
    padding: 0 2px 2px;
  }

  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions button,
  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions .audio-mode-toggle,
  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions .scene-window-control {
    min-height: 44px !important;
    border: 1px solid rgba(229, 247, 237, 0.16) !important;
    border-radius: 14px !important;
    background: #17201e !important;
    color: #f8fff9 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
  }

  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions button.active,
  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions .audio-mode-toggle.active {
    border-color: #ffd22e !important;
    background: #ffd22e !important;
    color: #151914 !important;
  }

  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions #downloadSubsBtn {
    grid-column: 1 / -1 !important;
  }

  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions .scene-window-control {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 96px !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 10px !important;
  }

  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions .scene-window-control select {
    width: 100% !important;
    height: 34px !important;
    border: 1px solid rgba(229, 247, 237, 0.18) !important;
    border-radius: 10px !important;
    background: #0e1513 !important;
    color: #f8fff9 !important;
  }

  body.mobile-template-shorts .catalog-head,
  body.mobile-template-shorts .catalog-check {
    color: #f8fff9 !important;
  }

  body.mobile-template-shorts .catalog-filters select,
  body.mobile-template-shorts .catalog-controls input,
  body.mobile-template-shorts .catalog-controls button {
    background: #17201e !important;
    border-color: rgba(229, 247, 237, 0.16) !important;
    color: #f8fff9 !important;
  }

  body.mobile-template-shorts .catalog-list {
    grid-template-rows: repeat(3, minmax(78px, auto)) !important;
    grid-auto-columns: minmax(168px, 220px) !important;
    max-height: 282px !important;
  }

  body.mobile-template-shorts .catalog-list button {
    background: #1a2422 !important;
    border-color: rgba(229, 247, 237, 0.14) !important;
    color: #f8fff9 !important;
  }

  body.mobile-template-shorts .catalog-meaning {
    color: #b8d0c4 !important;
  }

  .mobile-shorts-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.44);
  }

  .mobile-shorts-nav:not([hidden]) {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom) + 8px);
    z-index: 145;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
    border: 1px solid rgba(229, 247, 237, 0.16);
    border-radius: 22px;
    background: rgba(9, 14, 13, 0.86);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px) saturate(1.15);
  }

  .mobile-shorts-nav button {
    min-width: 0;
    height: 52px;
    border: 1px solid rgba(229, 247, 237, 0.12);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.07);
    color: #f8fff9;
    font-weight: 900;
  }

  .mobile-shorts-nav button strong,
  .mobile-shorts-nav button span {
    display: block;
    line-height: 1.08;
  }

  .mobile-shorts-nav button strong {
    font-size: 12px;
  }

  .mobile-shorts-nav button span {
    margin-top: 4px;
    color: #b5c9bf;
    font-size: 10px;
  }

  .mobile-shorts-nav button.active {
    border-color: #ffd22e;
    background: #ffd22e;
    color: #151914;
  }

  .mobile-shorts-nav button.active span {
    color: rgba(21, 25, 20, 0.72);
  }

  body.mobile-template-shorts .word-popup {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: calc(env(safe-area-inset-bottom) + 92px) !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    z-index: 180 !important;
  }

  body.mobile-template-shorts .ai-dialog {
    z-index: 190 !important;
  }
}

/* v69 mobile catalog: real scrolling list, no three-row horizontal trap */
@media (max-width: 900px) {
  body.mobile-learn-layout .catalog-list,
  body.mobile-template-shorts .catalog-list {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-columns: auto !important;
    grid-auto-rows: minmax(72px, auto) !important;
    gap: 8px !important;
    max-height: min(52svh, 520px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 3px 8px !important;
    scrollbar-width: thin !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.mobile-template-shorts .layout > .catalog {
    max-height: min(78svh, 700px) !important;
  }

  body.mobile-template-shorts .catalog-list {
    max-height: min(48svh, 455px) !important;
  }

  body.mobile-learn-layout .catalog-list::-webkit-scrollbar,
  body.mobile-template-shorts .catalog-list::-webkit-scrollbar {
    display: block !important;
    width: 5px !important;
  }

  body.mobile-learn-layout .catalog-list::-webkit-scrollbar-thumb,
  body.mobile-template-shorts .catalog-list::-webkit-scrollbar-thumb {
    border-radius: 999px !important;
    background: rgba(98, 132, 116, 0.5) !important;
  }

  body.mobile-learn-layout .catalog-list button,
  body.mobile-template-shorts .catalog-list button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 72px !important;
    height: auto !important;
  }

  body.mobile-learn-layout .catalog-list button.catalog-load-all,
  body.mobile-template-shorts .catalog-list button.catalog-load-all,
  body.mobile-learn-layout .catalog-empty,
  body.mobile-template-shorts .catalog-empty {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
  }
}

@media (max-width: 420px) {
  body.mobile-learn-layout .catalog-list,
  body.mobile-template-shorts .catalog-list {
    grid-template-columns: 1fr !important;
    max-height: min(54svh, 520px) !important;
  }
}

/* v70 mobile shorts: independent controls, larger video, subtitles below video */
@media (max-width: 900px) {
  body.mobile-template-shorts .stage {
    position: fixed !important;
    top: 54px !important;
    right: 0 !important;
    bottom: calc(env(safe-area-inset-bottom) + 72px) !important;
    left: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100vw !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: #020403 !important;
  }

  body.mobile-template-shorts .stage::after {
    display: none !important;
  }

  body.mobile-template-shorts .mobile-shorts-context {
    order: 0 !important;
    flex: 0 0 auto !important;
    margin: 4px 10px 0 !important;
    padding: 7px 10px !important;
    border: 1px solid rgba(204, 238, 221, 0.16) !important;
    border-radius: 14px !important;
    background: rgba(16, 26, 23, 0.82) !important;
    color: #dff8eb !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24) !important;
    backdrop-filter: blur(12px) !important;
  }

  body.mobile-template-shorts .mobile-shorts-context[hidden] {
    display: none !important;
  }

  body.mobile-template-shorts .center-controls,
  body.mobile-template-shorts .stage.is-playing .center-controls,
  body.mobile-template-shorts .stage.is-playing:focus-within .center-controls,
  body.mobile-template-shorts .stage.is-playing:hover .center-controls,
  body.mobile-template-shorts .stage.is-advancing .center-controls {
    order: 1 !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    flex: 0 0 72px !important;
    width: 100% !important;
    height: 72px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 26px !important;
    z-index: 75 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: linear-gradient(180deg, rgba(2, 4, 3, 0.92), rgba(2, 4, 3, 0.68)) !important;
  }

  body.mobile-template-shorts .center-controls button,
  body.mobile-template-shorts .stage.is-playing .center-controls button,
  body.mobile-template-shorts .stage.is-advancing .center-controls button {
    pointer-events: auto !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    background: rgba(16, 24, 21, 0.48) !important;
    color: #fff !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(10px) !important;
  }

  body.mobile-template-shorts .play-btn {
    width: 62px !important;
    height: 62px !important;
    font-size: 27px !important;
    padding-left: 4px !important;
  }

  body.mobile-template-shorts .round-btn {
    width: 50px !important;
    height: 50px !important;
    font-size: 27px !important;
    padding-bottom: 4px !important;
  }

  body.mobile-template-shorts .player {
    order: 2 !important;
    position: relative !important;
    inset: auto !important;
    flex: 1 1 auto !important;
    width: 100vw !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: contain !important;
    background: #020403 !important;
  }

  body.mobile-template-shorts .subtitle-overlay {
    order: 3 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    z-index: 70 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 8px 6px !important;
    background: #020403 !important;
    pointer-events: none !important;
  }

  body.mobile-template-shorts .subtitle-overlay[hidden] {
    display: none !important;
  }

  body.mobile-template-shorts .subtitle-row {
    max-width: 100% !important;
  }

  body.mobile-template-shorts .subtitle-primary,
  body.mobile-template-shorts .subtitle-zh {
    max-width: calc(100vw - 18px) !important;
    border-radius: 12px !important;
    background: rgba(0, 0, 0, 0.72) !important;
    box-shadow: none !important;
  }

  body.mobile-template-shorts .subtitle-primary {
    padding: 7px 10px !important;
    font-size: clamp(19px, 5.2vw, 28px) !important;
    line-height: 1.15 !important;
  }

  body.mobile-template-shorts .subtitle-zh {
    padding: 7px 10px !important;
    font-size: clamp(16px, 4.5vw, 22px) !important;
    line-height: 1.18 !important;
  }

  body.mobile-template-shorts .thumb-strip {
    order: 4 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 72px !important;
    height: 72px !important;
    width: 100vw !important;
    z-index: 60 !important;
    padding: 8px 9px !important;
    background: #020403 !important;
  }
}

/* v71 mobile controls: shelf shortcuts, loop count and reliable vertical catalog */
@media (max-width: 900px) {
  body.mobile-learn-layout .topbar,
  body.mobile-template-shorts .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto auto !important;
    gap: 8px !important;
    padding: 0 10px !important;
  }

  body.mobile-learn-layout .top-shelf-actions,
  body.mobile-template-shorts .top-shelf-actions {
    display: inline-flex !important;
    gap: 5px !important;
  }

  body.mobile-learn-layout .top-shelf-actions button,
  body.mobile-template-shorts .top-shelf-actions button {
    height: 34px !important;
    padding: 0 9px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    background: rgba(238, 255, 246, 0.12) !important;
    color: #effff6 !important;
  }

  body.mobile-learn-layout .top-shelf-actions button.active,
  body.mobile-template-shorts .top-shelf-actions button.active {
    border-color: #ffd22e !important;
    background: #ffd22e !important;
    color: #151914 !important;
  }

  body.mobile-learn-layout.mobile-shelves-open .mobile-shelves,
  body.mobile-template-shorts.mobile-shelves-open .mobile-shelves {
    display: block !important;
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(env(safe-area-inset-bottom) + 78px) !important;
    z-index: 132 !important;
    max-height: min(62svh, 520px) !important;
    overflow: auto !important;
    border: 1px solid rgba(208, 232, 219, 0.18) !important;
    border-radius: 22px !important;
    background: rgba(11, 16, 15, 0.96) !important;
    color: #f8fff9 !important;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58) !important;
    backdrop-filter: blur(18px) saturate(1.12) !important;
  }

  body.mobile-template-shorts.mobile-shelves-open .mobile-shelf-head button,
  body.mobile-template-shorts.mobile-shelves-open .mobile-shelf-pager button,
  body.mobile-template-shorts.mobile-shelves-open .mobile-fav-card,
  body.mobile-template-shorts.mobile-shelves-open .mobile-word-card {
    background: #17201e !important;
    color: #f8fff9 !important;
    border-color: rgba(229, 247, 237, 0.16) !important;
  }

  body.mobile-template-shorts.mobile-shelves-open .mobile-shelf-head button.active {
    background: #ffd22e !important;
    color: #151914 !important;
  }

  body.mobile-template-shorts.mobile-shelves-open .mobile-word-card span,
  body.mobile-template-shorts.mobile-shelves-open .mobile-shelf-pager span,
  body.mobile-template-shorts.mobile-shelves-open .mobile-shelf-empty {
    color: #b8d0c4 !important;
  }

  body.mobile-learn-layout .layout > .actions .loop-repeat-control,
  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions .loop-repeat-control {
    grid-column: 1 / -1 !important;
    min-height: 44px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 118px !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 10px !important;
    border: 1px solid rgba(229, 247, 237, 0.16) !important;
    border-radius: 14px !important;
    background: #17201e !important;
    color: #f8fff9 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
  }

  body.mobile-learn-layout .layout > .actions .loop-repeat-control {
    background: #e8f4ee !important;
    color: #173d31 !important;
    border-color: rgba(40, 86, 67, 0.22) !important;
  }

  body.mobile-learn-layout .layout > .actions .loop-repeat-control select,
  body.mobile-template-shorts.mobile-shorts-actions-open .layout > .actions .loop-repeat-control select {
    width: 100% !important;
    height: 34px !important;
    border: 1px solid rgba(229, 247, 237, 0.18) !important;
    border-radius: 10px !important;
    background: #0e1513 !important;
    color: #f8fff9 !important;
  }

  body.mobile-learn-layout .layout > .actions .loop-repeat-control select {
    background: #fff !important;
    color: #173d31 !important;
    border-color: rgba(40, 86, 67, 0.24) !important;
  }

  body.mobile-learn-layout .catalog-list,
  body.mobile-template-shorts .catalog-list {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-columns: auto !important;
    grid-auto-rows: minmax(72px, auto) !important;
    max-height: min(54svh, 520px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
}
/* v72 catalog word visibility: keep the source word readable even when meaning is a placeholder */
.catalog-list .catalog-source {
  display: block !important;
  min-height: 1.25em !important;
  line-height: 1.25 !important;
  -webkit-line-clamp: unset !important;
}

/* 自动播放被拦时视频上的大播放键 */
.stage-tap-play {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 8;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

.stage-tap-play span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
}

.stage-tap-play[hidden] {
  display: none;
}

@media (max-width: 900px) {
  body.mobile-template-shorts .stage-tap-play {
    top: 28vw !important;
    top: calc(min(56.25vw, 40vh) / 2) !important;
    top: calc(min(56.25vw, 40svh) / 2) !important;
    width: 72px;
    height: 72px;
    font-size: 26px;
  }
}

/* 静音预览时的按钮：提示开声音 */
.stage-tap-play.muted {
  width: auto;
  height: auto;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 22px;
}

.stage-tap-play.muted span {
  font-size: 13px;
}

@media (max-width: 900px) {
  body.mobile-template-shorts .stage-tap-play.muted {
    width: auto;
    height: auto;
  }
}

/* ===== 手机短视频模板布局覆盖：必须放在文件末尾，否则被上面 v70 的 !important 规则盖掉 ===== */
@media (max-width: 900px) {
  body.mobile-template-shorts .player {
    flex: 0 0 auto !important;
    /* 旧内核不认 svh / min()：逐级回退，后面的写法不支持就用前一条 */
    height: 56.25vw !important;
    height: min(56.25vw, 40vh) !important;
    height: min(56.25vw, 40svh) !important;
    min-height: 150px !important;
  }

  body.mobile-template-shorts .stage-loading {
    top: 28vw !important;
    top: calc(min(56.25vw, 40vh) / 2) !important;
    top: calc(min(56.25vw, 40svh) / 2) !important;
  }

  body.mobile-template-shorts .subtitle-overlay {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
  }

  body.mobile-template-shorts .subtitle-query {
    margin: 0 !important;
    padding: 3px 10px !important;
    font-size: 12px !important;
  }

  body.mobile-template-shorts .subtitle-primary {
    font-size: clamp(16px, 4.4vw, 21px) !important;
  }

  body.mobile-template-shorts .subtitle-primary .subtitle-text {
    padding: 5px 10px !important;
    line-height: 1.45 !important;
  }

  body.mobile-template-shorts .subtitle-zh {
    margin-top: 4px !important;
    font-size: clamp(14px, 3.9vw, 18px) !important;
  }

  body.mobile-template-shorts .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay .center-controls {
    flex: 0 0 auto !important;
    height: 54px !important;
    gap: 18px !important;
    margin: 2px 0 0 !important;
    background: transparent !important;
  }

  body.mobile-template-shorts .subtitle-overlay .play-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
  }

  body.mobile-template-shorts .subtitle-overlay .round-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 24px !important;
  }

  body.mobile-template-shorts .scene-bar {
    margin-top: 2px !important;
    gap: 4px !important;
  }

  body.mobile-template-shorts #enterSceneBtn {
    padding: 5px 12px !important;
    font-size: 13px !important;
  }

  body.mobile-template-shorts .scene-crumb {
    font-size: 12px !important;
    padding: 4px 10px !important;
  }
}
/* ===== 词组/短句/句子/习语：单列、整句换行、不截断（放文件末尾，压过上面所有手机端规则） ===== */
.catalog-list.phrase-mode {
  grid-template-columns: 1fr !important;
  grid-template-rows: none !important;
  grid-auto-flow: row !important;
  grid-auto-columns: auto !important;
  grid-auto-rows: auto !important;
  gap: 8px !important;
}

.catalog-list.phrase-mode button:not(.catalog-load-all) {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 12px !important;
  text-align: left !important;
}

.catalog-list.phrase-mode .catalog-source,
.catalog-list.phrase-mode .catalog-meaning {
  display: block !important;
  max-width: 100% !important;
  max-height: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  overflow-wrap: anywhere !important;
}

.catalog-list.phrase-mode .catalog-source {
  font-size: 14px !important;
  line-height: 1.4 !important;
  font-weight: 800 !important;
}

.catalog-list.phrase-mode .catalog-meaning {
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-weight: 600 !important;
  opacity: 0.92;
}

@media (max-width: 900px) {
  .catalog-list.phrase-mode .catalog-source {
    font-size: 15px !important;
  }

  .catalog-list.phrase-mode .catalog-meaning {
    font-size: 13.5px !important;
  }
}
/* phrase-mode 手机端覆盖：特异性要压过 body.mobile-template-shorts / body.mobile-learn-layout 的规则 */
body.mobile-template-shorts .catalog-list.phrase-mode,
body.mobile-learn-layout .catalog-list.phrase-mode {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: none !important;
  grid-auto-flow: row !important;
  grid-auto-columns: auto !important;
  grid-auto-rows: auto !important;
  gap: 8px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.mobile-template-shorts .catalog-list.phrase-mode button:not(.catalog-load-all),
body.mobile-learn-layout .catalog-list.phrase-mode button:not(.catalog-load-all) {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 11px 12px !important;
  text-align: left !important;
}

body.mobile-template-shorts .catalog-list.phrase-mode .catalog-source,
body.mobile-template-shorts .catalog-list.phrase-mode .catalog-meaning,
body.mobile-learn-layout .catalog-list.phrase-mode .catalog-source,
body.mobile-learn-layout .catalog-list.phrase-mode .catalog-meaning {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  overflow-wrap: anywhere !important;
}

body.mobile-template-shorts .catalog-list.phrase-mode .catalog-source,
body.mobile-learn-layout .catalog-list.phrase-mode .catalog-source {
  font-size: 15px !important;
  line-height: 1.4 !important;
  font-weight: 800 !important;
}

body.mobile-template-shorts .catalog-list.phrase-mode .catalog-meaning,
body.mobile-learn-layout .catalog-list.phrase-mode .catalog-meaning {
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  font-weight: 600 !important;
}
/* phrase-mode 最终：用 flex 纵向排列（grid 在这个容器里行高不吃内容，卡片压成 24px） */
.catalog-list.phrase-mode,
body.mobile-template-shorts .catalog-list.phrase-mode,
body.mobile-learn-layout .catalog-list.phrase-mode {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 8px !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}

.catalog-list.phrase-mode > button,
body.mobile-template-shorts .catalog-list.phrase-mode > button,
body.mobile-learn-layout .catalog-list.phrase-mode > button {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.catalog-list.phrase-mode > .catalog-load-all,
body.mobile-template-shorts .catalog-list.phrase-mode > .catalog-load-all,
body.mobile-learn-layout .catalog-list.phrase-mode > .catalog-load-all {
  min-height: 36px !important;
}
/* ===== 手机端「随机推荐」模块（播放键下方空白区） ===== */
.quick-picks {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(229, 247, 237, 0.14);
  border-radius: 16px;
  background: rgba(16, 24, 21, 0.72);
  pointer-events: auto;
}

body.mobile-template-shorts .quick-picks:not([hidden]) {
  display: block;
}

.quick-picks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #b8d0c4;
  font-size: 12px;
  font-weight: 800;
}

.quick-picks-head button {
  padding: 4px 10px;
  border: 1px solid rgba(255, 210, 46, 0.5);
  border-radius: 999px;
  background: rgba(255, 210, 46, 0.14);
  color: #ffd22e;
  font-size: 12px;
  font-weight: 900;
}

.quick-picks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(229, 247, 237, 0.16);
  border-radius: 999px;
  background: #1a2422;
  color: #f8fff9;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.quick-pick-tag {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #cfe3d8;
  font-size: 11px;
  font-weight: 900;
}

.quick-pick-phrases .quick-pick-tag { background: rgba(45, 212, 191, 0.22); color: #8ff0df; }
.quick-pick-slang .quick-pick-tag { background: rgba(255, 112, 102, 0.22); color: #ffb0a8; }

.quick-pick-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 62vw;
}

.quick-pick-zh {
  flex: 0 0 auto;
  color: #9fb4a9;
  font-size: 11px;
  font-weight: 600;
}
/* ===== 手机顶栏：flex 自动换行，logo 不再被挤压；用户名隐藏只留「退出」 ===== */
@media (max-width: 900px) {
  body.mobile-learn-layout .topbar,
  body.mobile-template-shorts .topbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 8px !important;
    padding: 6px 10px !important;
  }

  body.mobile-learn-layout .brand,
  body.mobile-template-shorts .brand {
    flex: 1 0 auto !important;
    min-width: max-content !important;
    font-size: 20px !important;
    line-height: 1.2 !important;
  }

  body.mobile-learn-layout .auth-status,
  body.mobile-template-shorts .auth-status {
    flex: 0 0 auto !important;
    order: 1 !important;
  }

  body.mobile-learn-layout #authUser,
  body.mobile-template-shorts #authUser {
    display: none !important;
  }

  body.mobile-learn-layout .top-shelf-actions,
  body.mobile-template-shorts .top-shelf-actions,
  body.mobile-learn-layout .mobile-template-switch,
  body.mobile-template-shorts .mobile-template-switch {
    flex: 0 0 auto !important;
    order: 2 !important;
  }

  body.mobile-learn-layout .topbar button,
  body.mobile-template-shorts .topbar button {
    height: 30px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }
}

/* ===== 手机视频两侧的贴边箭头：半透明，不挡画面 ===== */
.edge-btn {
  display: none;
}

@media (max-width: 900px) {
  body.mobile-template-shorts .edge-btn {
    position: absolute !important;
    top: 28vw;
    top: calc(min(56.25vw, 40vh) / 2);
    top: calc(min(56.25vw, 40svh) / 2);
    transform: translateY(-50%);
    z-index: 9;
    display: grid !important;
    place-items: center;
    width: 34px;
    height: 56px;
    padding: 0 0 4px;
    border: 0;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0.42;
    transition: opacity 0.15s ease;
  }

  body.mobile-template-shorts .edge-btn:active {
    opacity: 0.9;
  }

  body.mobile-template-shorts .edge-prev {
    left: 0;
    border-radius: 0 12px 12px 0;
  }

  body.mobile-template-shorts .edge-next {
    right: 0;
    border-radius: 12px 0 0 12px;
  }

  /* 有大播放键时箭头让路 */
  body.mobile-template-shorts .stage-tap-play:not([hidden]) ~ .edge-btn {
    opacity: 0.25;
  }
}
/* 视频区顶部跟随顶栏实际高度（JS 写入 --topbar-h） */
@media (max-width: 900px) {
  body.mobile-template-shorts .stage {
    top: var(--topbar-h, 54px) !important;
  }
}
/* 顶栏换行后要真正变高（否则测量仍是 54px，第二行按钮压在视频上） */
@media (max-width: 900px) {
  body.mobile-learn-layout .topbar,
  body.mobile-template-shorts .topbar {
    height: auto !important;
    min-height: 54px !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
/* 手机版字幕层内的顺序：词标签 → 英文 → 中文 → 进入场景 → 播放键 → 随机推荐（播放键紧贴在推荐模块上方） */
@media (max-width: 900px) {
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query { order: 0 !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row { order: 1 !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh { order: 2 !important; }
  body.mobile-template-shorts .subtitle-overlay > .scene-bar { order: 3 !important; }
  body.mobile-template-shorts .subtitle-overlay > .center-controls { order: 4 !important; margin: 8px 0 2px !important; }
  body.mobile-template-shorts .subtitle-overlay > .quick-picks { order: 5 !important; margin-top: 4px !important; }
}
/* ===== 分类放宽提示 ===== */
.catalog-note {
  grid-column: 1 / -1;
  padding: 7px 10px;
  border: 1px dashed rgba(255, 210, 46, 0.45);
  border-radius: 8px;
  background: rgba(255, 210, 46, 0.08);
  color: #ffe27a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

/* ===== 手机版：字幕区预留高度，播放键不随字幕加载上下跳 ===== */
@media (max-width: 900px) {
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query {
    min-height: 26px !important;
    visibility: visible;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query[hidden] {
    display: inline-flex !important;
    visibility: hidden !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row {
    min-height: 64px !important;
    align-items: flex-start !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh {
    min-height: 44px !important;
  }
}

/* ===== 手机版：两侧箭头更醒目、贴边 ===== */
@media (max-width: 900px) {
  body.mobile-template-shorts .edge-btn {
    width: 40px !important;
    height: 68px !important;
    font-size: 40px !important;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.42) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
    opacity: 0.72 !important;
  }
  body.mobile-template-shorts .edge-prev { left: 0 !important; border-left: 0 !important; border-radius: 0 14px 14px 0 !important; }
  body.mobile-template-shorts .edge-next { right: 0 !important; border-right: 0 !important; border-radius: 14px 0 0 14px !important; }
  body.mobile-template-shorts .edge-btn:active { opacity: 1 !important; background: rgba(255, 210, 46, 0.6) !important; color: #111 !important; }

  /* ===== 手机版：视频下方的控制栏 ===== */
  body.mobile-template-shorts .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay .center-controls {
    width: auto !important;
    height: 64px !important;
    gap: 34px !important;
    padding: 0 22px !important;
    margin: 8px auto 2px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, rgba(34, 44, 40, 0.95), rgba(18, 26, 23, 0.95)) !important;
    border: 1px solid rgba(229, 247, 237, 0.16) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4) !important;
  }
  body.mobile-template-shorts .subtitle-overlay .round-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 30px !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f8fff9 !important;
    box-shadow: none !important;
  }
  body.mobile-template-shorts .subtitle-overlay .play-btn {
    width: 54px !important;
    height: 54px !important;
    font-size: 24px !important;
    border: 0 !important;
    background: #ffd22e !important;
    color: #151914 !important;
    box-shadow: 0 6px 18px rgba(255, 210, 46, 0.35) !important;
  }
}
/* ===== 手机版：字幕区固定高度、内部滚动，切片长短变化时下面的播放键纹丝不动 ===== */
@media (max-width: 900px) {
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    overflow: hidden !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row {
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    overflow-y: auto !important;
    align-items: flex-start !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body.mobile-template-shorts .subtitle-primary {
    font-size: 14.5px !important;
  }
  body.mobile-template-shorts .subtitle-primary .subtitle-text {
    padding: 4px 8px !important;
    line-height: 1.4 !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh {
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    overflow-y: auto !important;
    margin-top: 2px !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
  }
}
/* 播放键的顺序在 播放/暂停/衔接 各状态下都固定在中文字幕之下、随机推荐之上（覆盖旧模板 .stage.is-playing .center-controls{order:1}） */
@media (max-width: 900px) {
  body.mobile-template-shorts .stage .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-playing:hover .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-playing:focus-within .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage:focus-within .subtitle-overlay > .center-controls {
    order: 4 !important;
  }
}

/* AI 回复：保留换行 */
.ai-section-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* ===== 手机版再压缩：顶栏一行、进入场景并入播放排、预留高度收紧，保证播放键不被裁 ===== */
@media (max-width: 900px) {
  body.mobile-learn-layout .topbar button,
  body.mobile-template-shorts .topbar button {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }
  body.mobile-learn-layout .brand,
  body.mobile-template-shorts .brand {
    font-size: 18px !important;
  }
  body.mobile-template-shorts .subtitle-overlay {
    gap: 4px !important;
    padding: 4px 8px 4px !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query {
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    font-size: 11px !important;
    padding: 2px 9px !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row {
    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
  }
  body.mobile-template-shorts .subtitle-primary {
    font-size: 14px !important;
  }
  body.mobile-template-shorts .subtitle-primary .subtitle-text {
    padding: 3px 7px !important;
    line-height: 1.35 !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    padding: 4px 10px !important;
  }
  body.mobile-template-shorts .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay .center-controls {
    height: 56px !important;
    gap: 16px !important;
    padding: 0 12px !important;
    margin: 4px auto 0 !important;
  }
  body.mobile-template-shorts .center-controls #enterSceneBtn {
    margin-left: 4px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f8fff9 !important;
    white-space: nowrap !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .scene-bar:has(> #enterSceneBtn:only-child) { display: none !important; }
  body.mobile-template-shorts .subtitle-overlay > .scene-bar { margin-top: 0 !important; }
  body.mobile-template-shorts .subtitle-overlay > .scene-bar > .scene-crumb[hidden] + * { display: none; }
  body.mobile-template-shorts .thumb-strip {
    height: 62px !important;
    padding: 6px 10px !important;
  }
}
@media (max-width: 900px) and (max-height: 600px) {
  body.mobile-template-shorts .thumb-strip { height: 54px !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh { height: 34px !important; min-height: 34px !important; max-height: 34px !important; }
}
/* ===== 窄屏（≤360px，如 iPhone SE）：再省几行，保证播放键完整可见 ===== */
@media (max-width: 360px) {
  body.mobile-template-shorts .mobile-template-switch { display: none !important; }
  body.mobile-learn-layout .brand,
  body.mobile-template-shorts .brand { font-size: 16px !important; }
  body.mobile-learn-layout .topbar button,
  body.mobile-template-shorts .topbar button { padding: 0 7px !important; font-size: 11px !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query { display: none !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row { height: 58px !important; min-height: 58px !important; max-height: 58px !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh { height: 30px !important; min-height: 30px !important; max-height: 30px !important; padding: 2px 8px !important; font-size: 12.5px !important; }
  body.mobile-template-shorts .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay .center-controls { height: 50px !important; gap: 12px !important; margin-top: 2px !important; }
  body.mobile-template-shorts .subtitle-overlay .play-btn { width: 44px !important; height: 44px !important; font-size: 20px !important; }
  body.mobile-template-shorts .subtitle-overlay .round-btn { width: 36px !important; height: 36px !important; font-size: 24px !important; }
  body.mobile-template-shorts .thumb-strip { height: 54px !important; }
}
/* ===== 禁用手机端下拉刷新 / 过度滚动：点播放键时手指轻微下拉会把整页刷新掉 ===== */
html, body {
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
}

@media (max-width: 900px) {
  html, body {
    overscroll-behavior: none !important;
  }
  body.mobile-template-shorts {
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
  body.mobile-template-shorts .stage,
  body.mobile-template-shorts .subtitle-overlay,
  body.mobile-template-shorts .thumb-strip,
  body.mobile-template-shorts .catalog,
  body.mobile-template-shorts .catalog-list {
    overscroll-behavior: contain !important;
  }
  body.mobile-template-shorts button,
  body.mobile-template-shorts .thumb,
  body.mobile-template-shorts .quick-pick,
  body.mobile-template-shorts .edge-btn {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
  }
}
/* ===== 手机版：字幕字号调回来（英文 17 / 中文 15），随机推荐缩小到两行 ===== */
@media (max-width: 900px) {
  body.mobile-template-shorts .subtitle-primary {
    font-size: 17px !important;
  }
  body.mobile-template-shorts .subtitle-primary .subtitle-text {
    padding: 4px 8px !important;
    line-height: 1.35 !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row {
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
  }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    padding: 4px 10px !important;
  }

  body.mobile-template-shorts .quick-picks {
    margin-top: 6px !important;
    padding: 6px 8px 6px !important;
  }
  body.mobile-template-shorts .quick-picks-head {
    margin-bottom: 5px !important;
    font-size: 11px !important;
  }
  body.mobile-template-shorts .quick-picks-head button {
    padding: 2px 8px !important;
    font-size: 11px !important;
  }
  body.mobile-template-shorts .quick-picks-list {
    gap: 5px !important;
    max-height: 68px !important;
    overflow: hidden !important;
  }
  body.mobile-template-shorts .quick-pick {
    padding: 4px 8px 4px 5px !important;
    gap: 5px !important;
    font-size: 12px !important;
  }
  body.mobile-template-shorts .quick-pick-tag {
    padding: 0 5px !important;
    font-size: 10px !important;
  }
  body.mobile-template-shorts .quick-pick-text {
    max-width: 42vw !important;
  }
  body.mobile-template-shorts .quick-pick-zh {
    font-size: 10px !important;
    max-width: 22vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 360px) {
  body.mobile-template-shorts .subtitle-primary { font-size: 16px !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row { height: 70px !important; min-height: 70px !important; max-height: 70px !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh { height: 44px !important; min-height: 44px !important; max-height: 44px !important; font-size: 14px !important; }
}
/* 随机推荐：手机上每行 3 个、共 2 行 */
@media (max-width: 900px) {
  body.mobile-template-shorts .quick-picks-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    max-height: none !important;
  }
  body.mobile-template-shorts .quick-pick {
    display: flex !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 5px 7px 5px 5px !important;
    justify-content: flex-start !important;
  }
  body.mobile-template-shorts .quick-pick-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  body.mobile-template-shorts .quick-pick-zh {
    display: none !important;
  }
}
/* 手机/微信：缩略图不用视频预览，占位块 */
.thumb-still {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1b2622, #0d1512);
}
/* ===== 中文字幕下方的句子解析小字 ===== */
.subtitle-analysis {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  max-width: 100%;
  margin: 6px auto 0;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.62);
  color: #cfd8e3;
  font-size: 12.5px;
  line-height: 1.45;
  pointer-events: auto;
}

.subtitle-analysis[hidden] {
  display: none;
}

.analysis-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
}

.analysis-item b {
  flex: 0 0 auto;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 210, 46, 0.18);
  color: #ffd96b;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 900px) {
  body.mobile-template-shorts .subtitle-overlay > .subtitle-analysis {
    order: 3 !important;
    max-height: 46px !important;
    overflow-y: auto !important;
    margin: 3px auto 0 !important;
    padding: 4px 9px !important;
    font-size: 11.5px !important;
  }
}
/* ============================================================
   字幕布局最终版（覆盖前面所有固定高度的写法）
   目标：① 长字幕不再互相遮挡 ② 播放键位置不随字幕长短跳动
   做法：字幕区整体弹性伸缩 + 内部滚动；控件/推荐固定在底部不参与伸缩
   ============================================================ */

/* 桌面：词标签独占一行，不再压住字幕 */
.subtitle-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.subtitle-query {
  flex: 0 0 auto;
  position: static;
  margin: 0 auto 8px;
}

.subtitle-row {
  flex: 0 0 auto;
  width: 100%;
}

.subtitle-primary,
.subtitle-zh {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* 手机短视频模板 */
@media (max-width: 900px) {
  /* 字幕滚动区：词标签 + 英文 + 中文 + 解析 一起放进来，长了内部滚动 */
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query,
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row,
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh,
  body.mobile-template-shorts .subtitle-overlay > .subtitle-analysis {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
  }

  /* 把可滚动区限制在「视频下方到控件上方」之间 */
  body.mobile-template-shorts .subtitle-overlay {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    padding: 6px 8px 4px !important;
    gap: 0 !important;
  }

  body.mobile-template-shorts .subtitle-overlay > .subtitle-query { order: 0 !important; margin: 0 auto 4px !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row   { order: 1 !important; margin: 0 !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh    { order: 2 !important; margin: 4px 0 0 !important; }
  body.mobile-template-shorts .subtitle-overlay > .subtitle-analysis { order: 3 !important; margin: 4px 0 0 !important; }

  /* 关键：给字幕们套一个统一的滚动容器效果——用 min-height:0 让 flex 正确收缩 */
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row,
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh {
    flex-shrink: 1 !important;
  }

  /* 控件与推荐固定在底部，永远不被挤压、不移动 */
  body.mobile-template-shorts .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay > .center-controls {
    order: 8 !important;
    flex: 0 0 auto !important;
    margin-top: auto !important;
  }

  body.mobile-template-shorts .subtitle-overlay > .scene-bar { order: 9 !important; flex: 0 0 auto !important; }
  body.mobile-template-shorts .subtitle-overlay > .quick-picks { order: 10 !important; flex: 0 0 auto !important; }

  /* 字幕本体：长文换行显示，字号自适应 */
  body.mobile-template-shorts .subtitle-primary {
    font-size: clamp(13px, 4vw, 17px) !important;
  }
  body.mobile-template-shorts .subtitle-primary .subtitle-text {
    padding: 4px 8px !important;
    line-height: 1.38 !important;
  }
  body.mobile-template-shorts .subtitle-zh {
    font-size: clamp(12px, 3.6vw, 15px) !important;
    line-height: 1.4 !important;
    padding: 4px 10px !important;
  }
}

/* 超长字幕兜底：最多显示若干行，再长就省略，保证不溢出压住下面 */
.subtitle-primary .subtitle-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.subtitle-zh {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

@media (max-width: 900px) {
  body.mobile-template-shorts .subtitle-primary .subtitle-text { -webkit-line-clamp: 3; }
  body.mobile-template-shorts .subtitle-zh { -webkit-line-clamp: 2; }
}
/* 手机端修正：字幕块绝不被 flex 压扁（上一版 flex-shrink:1 把英文行压成 22px，内容溢出压住下面） */
@media (max-width: 900px) {
  body.mobile-template-shorts .subtitle-overlay > .subtitle-query,
  body.mobile-template-shorts .subtitle-overlay > .subtitle-row,
  body.mobile-template-shorts .subtitle-overlay > .subtitle-zh,
  body.mobile-template-shorts .subtitle-overlay > .subtitle-analysis,
  body.mobile-template-shorts .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .subtitle-overlay > .scene-bar,
  body.mobile-template-shorts .subtitle-overlay > .quick-picks {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
  }

  /* 字幕层整体可滚动：内容多了滚动查看，不挤压任何子元素 */
  body.mobile-template-shorts .subtitle-overlay {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  /* 控件不再用 margin-top:auto 推到底（滚动容器里会造成错位），正常排在字幕后面 */
  body.mobile-template-shorts .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-playing .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-paused .subtitle-overlay > .center-controls,
  body.mobile-template-shorts .stage.is-advancing .subtitle-overlay > .center-controls {
    margin: 6px auto 0 !important;
  }

  /* 手机上英文最多 3 行、中文 2 行，超出省略，保证总高可控 */
  body.mobile-template-shorts .subtitle-primary .subtitle-text {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
  }
  body.mobile-template-shorts .subtitle-zh {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
  }
}
/* 英语站 ⇄ 西语站 跳转链接（品牌名右侧 + 登录页） */
.brand .site-switch {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 9px;
  border: 1px solid rgba(211, 189, 247, 0.55);
  border-radius: 999px;
  color: #d3bdf7;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
  text-decoration: none;
}
.brand .site-switch:hover { background: rgba(211, 189, 247, 0.16); color: #fff; }
.site-switch[hidden] { display: none !important; }
.login-site-switch {
  display: block;
  margin-top: 12px;
  text-align: center;
  color: #7c5cc4;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
@media (max-width: 900px) {
  .brand .site-switch { margin-left: 6px; padding: 2px 7px; font-size: 11px; }
}