/* Kazumi Web 样式表
 *
 * 设计取向：对齐原版桌面端的 Material 3 观感 ——
 * 大圆角、低饱和容器色、左侧 navigation rail。
 *
 * 所有颜色都来自 theme.js 写入的 CSS 变量（由「种子色 + 明暗」推算），
 * 因此这里不要出现写死的色值：换配色方案时整站要能一起变。
 */

/* ══════════════════════════════════════════════ 基础 */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: "MI Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
               -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, dl, dd, dt, ol, ul, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--primary); color: var(--on-primary); }

/* 滚动条：桌面端把默认那套粗滚动条换掉，不然和 M3 观感差太远 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--outline); background-clip: content-box; }

.ic { flex: none; display: block; }

/* ══════════════════════════════════════════════ 布局骨架 */

.app {
  display: flex;
  min-height: 100vh;
  background: var(--surface-dim);
}

/* ── 左侧导航 ── */

.rail {
  flex: none;
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 20px;
  background: var(--surface-dim);
  position: sticky;
  top: 0;
  height: 100vh;
}

.rail__fab {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 17px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-bottom: 14px;
  transition: transform .16s, filter .16s;
}
.rail__fab:hover { filter: brightness(1.08); transform: translateY(-1px); }
.rail__fab:active { transform: scale(.96); }

.rail__item {
  width: 68px;
  padding: 9px 0 7px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: background .16s, color .16s;
  position: relative;
}
.rail__item span { font-size: 11.5px; letter-spacing: .2px; }
.rail__item:hover { background: var(--surface-high); }
.rail__item.is-on {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.rail__item.is-on span { font-weight: 600; }

/* ── 主区域 ── */

.shell {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-container);
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
  margin: 0;
  min-height: 100vh;
}

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface-container) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
}

.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand__mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--on-primary);
  display: grid; place-items: center;
}
.brand__text { font-weight: 700; font-size: 16px; letter-spacing: .2px; }

.searchbar {
  flex: 1 1 auto;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 21px;
  background: var(--surface-high);
  border: 1px solid transparent;
  transition: border-color .16s, background .16s;
}
.searchbar:focus-within {
  border-color: var(--primary);
  background: var(--surface-highest);
}
.searchbar__icon { color: var(--on-surface-variant); flex: none; }
.searchbar input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
}
.searchbar input::placeholder { color: var(--on-surface-variant); opacity: .8; }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar__clear {
  border: 0; background: transparent; cursor: pointer;
  color: var(--on-surface-variant); padding: 2px 4px; border-radius: 50%;
}
.searchbar__clear:hover { background: var(--surface-highest); }

.topbar__actions { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }

.statusline {
  padding: 8px 20px;
  font-size: 12.5px;
  background: var(--surface-high);
  color: var(--on-surface-variant);
  border-bottom: 1px solid var(--outline-variant);
}
.statusline[data-kind="warn"] {
  background: var(--error-container);
  color: var(--on-error-container);
}
.statusline[data-kind="ok"] { background: var(--secondary-container); color: var(--on-secondary-container); }

.view {
  flex: 1 1 auto;
  padding: 18px 20px 60px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}
.view--full { padding: 0; max-width: none; }

/* ── 底部导航（窄屏）── */

.bottomnav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--surface-container) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--outline-variant);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border-radius: 14px;
  color: var(--on-surface-variant);
  font-size: 11px;
}
.bottomnav__item.is-on { color: var(--on-secondary-container); background: var(--secondary-container); }

/* ══════════════════════════════════════════════ 通用控件 */

.iconbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.iconbtn:hover { background: var(--surface-highest); color: var(--on-surface); }
.iconbtn.is-on { color: var(--primary); background: var(--primary-container); }
.iconbtn--danger:hover { color: var(--error); background: var(--error-container); }
.iconbtn__label { font-size: 12.5px; white-space: nowrap; }
.iconbtn__tag {
  font-size: 11px; padding: 1px 5px; border-radius: 6px;
  background: var(--surface-highest); color: var(--on-surface-variant);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 20px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .16s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 17px; }
.btn--tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn--text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn--text:hover { background: var(--surface-highest); filter: none; }
.btn--text.is-on { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn--ghost { background: var(--surface-highest); color: var(--on-surface); }

.field {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  background: var(--surface-low);
  color: var(--on-surface);
  outline: none;
  resize: vertical;
  transition: border-color .16s;
}
.field:focus { border-color: var(--primary); }
.field::placeholder { color: var(--on-surface-variant); opacity: .75; }
.field--code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
textarea.field { min-height: 90px; }

.switch {
  appearance: none;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--outline-variant);
  position: relative;
  cursor: pointer;
  transition: background .18s;
  margin: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .18s;
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); background: var(--on-primary); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--surface-highest);
  color: var(--on-surface-variant);
  font-size: 11.5px;
  white-space: nowrap;
}
.badge--ok { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.badge--warn { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.badge--err { background: var(--error-container); color: var(--on-error-container); }
.badge--wait { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.badge--q { background: var(--surface-highest); color: var(--on-surface-variant); }
.q--4k { background: var(--primary-container); color: var(--on-primary-container); font-weight: 600; }
.q--fhd { background: var(--secondary-container); color: var(--on-secondary-container); }
.q--hd { background: var(--surface-highest); color: var(--on-surface-variant); }
.q--low { background: var(--error-container); color: var(--on-error-container); }

/* 源优劣等级徽标（来自服务端离线质量报告：优质 / 一般 / 劣质 / 需验证 / 不可用） */
.qbadge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-highest);
  color: var(--on-surface-variant);
}
.qbadge--good { background: color-mix(in srgb, var(--ok) 24%, transparent); color: var(--ok); }
.qbadge--fair { background: var(--surface-highest); color: var(--on-surface-variant); }
.qbadge--poor { background: color-mix(in srgb, var(--warn) 24%, transparent); color: var(--warn); }
.qbadge--captcha { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.qbadge--dead { background: var(--error-container); color: var(--on-error-container); }
.qbadge--untested {
  background: transparent;
  border: 1px dashed var(--outline-variant);
  font-weight: 400;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--filter { margin-bottom: 16px; }
.chip {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--outline-variant);
  border-radius: 17px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .16s, color .16s, border-color .16s;
}
.chip:hover { background: var(--surface-high); }
.chip.is-on {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  border-color: transparent;
}
.chip em {
  font-style: normal;
  font-size: 11px;
  padding: 0 5px;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 20px;
  background: var(--surface-high);
  gap: 2px;
}
.seg__btn {
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  padding: 6px 14px;
  border-radius: 17px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.seg__btn--on { background: var(--secondary-container); color: var(--on-secondary-container); font-weight: 600; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--outline-variant);
  margin: 22px 0 4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition: color .16s, border-color .16s;
}
.tab:hover { color: var(--on-surface); }
.tab.is-on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── 页头 ── */

.pagehead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-bottom: 16px;
}
.pagehead__lead { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pagehead__h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.2px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.pagehead__h1 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-variant);
}
.pagehead__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.pagehead__title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font-size: 26px;
  font-weight: 700;
  padding: 4px 6px 4px 0;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: -.2px;
}
.pagehead__title:hover { background: var(--surface-high); }

.sectionhead {
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin: 26px 0 10px;
  letter-spacing: .3px;
}
.secthead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
}
.secthead h2 { font-size: 14px; font-weight: 600; color: var(--on-surface-variant); }

.viewhint {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  line-height: 1.7;
  margin: 0 0 14px;
}
.viewhint--inline { margin: 0; }
.viewhint b { color: var(--on-surface); }

.footnote {
  margin: 26px auto 0;
  max-width: 720px;
  text-align: center;
  font-size: 12px;
  color: var(--on-surface-variant);
  opacity: .85;
  line-height: 1.8;
}

/* ══════════════════════════════════════════════ 海报网格 */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min, 152px), 1fr));
  gap: 18px 16px;
}
:root[data-cardSize="small"] { --card-min: 122px; }
:root[data-cardSize="medium"] { --card-min: 152px; }
:root[data-cardSize="large"] { --card-min: 188px; }
.grid--small { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
.grid--skeleton { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  cursor: pointer;
  min-width: 0;
  outline: none;
  transition: transform .18s;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); }
.card__poster {
  position: relative;
  aspect-ratio: 3 / 4.2;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-high);
  box-shadow: 0 2px 10px var(--shadow);
}
.card__poster img { width: 100%; height: 100%; object-fit: cover; }
.card__ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 34px; font-weight: 700;
  color: var(--on-surface-variant);
  background: linear-gradient(150deg, var(--surface-high), var(--surface-highest));
}
.card__rating {
  position: absolute;
  left: 7px; bottom: 7px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .58);
  color: #ffd166;
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.card__badge {
  position: absolute;
  right: 7px; top: 7px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-size: 11px;
  backdrop-filter: blur(4px);
}
.card__badge--type[data-type="ok"] { background: color-mix(in srgb, var(--ok) 84%, #000); }
.card__badge--type[data-type="warn"] { background: color-mix(in srgb, var(--warn) 84%, #000); }
.card__badge--type[data-type="primary"] { background: color-mix(in srgb, var(--primary) 84%, #000); }
.card__more {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s;
  backdrop-filter: blur(4px);
}
.card:hover .card__more { opacity: 1; }
.card__meta { padding: 8px 2px 0; }
.card__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__sub {
  font-size: 11.5px;
  color: var(--on-surface-variant);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__group { display: flex; flex-direction: column; gap: 2px; }

.loadmore {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 16px 0;
}
.loadmore__end { font-size: 12.5px; color: var(--on-surface-variant); }

/* ══════════════════════════════════════════════ 行卡片 */

.rowcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: background .16s;
}
.rowcard:hover { background: var(--surface-high); }
.rowcard__poster {
  flex: none;
  width: 62px;
  height: 86px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-highest);
  position: relative;
}
.rowcard__poster img { width: 100%; height: 100%; object-fit: cover; }
.rowcard__ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  color: var(--on-surface-variant);
}
.rowcard__body { flex: 1 1 auto; min-width: 0; }
.rowcard__title {
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rowcard__alias {
  font-size: 12px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rowcard__sub { font-size: 12px; color: var(--on-surface-variant); margin-top: 3px; }
.rowcard__sub--dim { opacity: .72; }

.daylist { display: flex; flex-direction: column; gap: 2px; }

/* ══════════════════════════════════════════════ 时间表 */

.weekbar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 4px 0 18px;
}
.weekday {
  border: 0;
  border-radius: 14px;
  background: var(--surface-high);
  color: var(--on-surface-variant);
  padding: 10px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: background .16s, color .16s;
}
.weekday:hover { background: var(--surface-highest); }
.weekday__name { font-size: 12.5px; }
.weekday__count { font-size: 11px; opacity: .8; }
.weekday.is-today .weekday__name { color: var(--primary); font-weight: 700; }
.weekday.is-on {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.seasonpick { display: flex; flex-direction: column; gap: 6px; }
.seasonpick__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--outline-variant);
}
.seasonpick__year { font-weight: 700; width: 58px; flex: none; font-size: 15px; }
.seasonpick__btns { display: flex; flex-wrap: wrap; gap: 4px; }

/* ══════════════════════════════════════════════ 详情页 */

.detail { position: relative; }
.detail__bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 340px;
  background-size: cover;
  background-position: center 28%;
  opacity: .28;
  filter: blur(46px) saturate(1.5);
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
}
.detail--loading .detail__inner { padding-top: 20px; }
.detail__inner { position: relative; }

.detail__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  margin-bottom: 6px;
}
.detail__bartitle {
  font-size: 16px;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail__hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.detail__poster {
  flex: none;
  width: 200px;
  aspect-ratio: 3 / 4.2;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-high);
  box-shadow: 0 8px 30px var(--shadow);
}
.detail__poster img { width: 100%; height: 100%; object-fit: cover; }
.detail__ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--on-surface-variant);
  font-size: 13px;
}
.detail__head { flex: 1 1 auto; min-width: 0; }
.detail__head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.4px; line-height: 1.25; }
.detail__alias { font-size: 13.5px; color: var(--on-surface-variant); margin-top: 4px; }
.detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.rating {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #ffb400;
  font-size: 13px;
}
.rating b { font-size: 20px; }
.rating em { font-style: normal; font-size: 11.5px; color: var(--on-surface-variant); }
.metachip {
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--surface-high);
  color: var(--on-surface-variant);
  font-size: 12px;
}
.detail__summary {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--on-surface-variant);
  max-width: 780px;
}
.detail__summary.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail__expand {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  padding: 4px 0;
  cursor: pointer;
}
.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}
.detail__hint { font-size: 12px; color: var(--on-surface-variant); margin-top: 10px; }
.detail__tabbody { margin-top: 12px; }

.panel {
  background: var(--surface-low);
  border-radius: 20px;
  padding: 18px;
  margin-top: 16px;
}
.panel__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.panel__title small { font-size: 12px; font-weight: 500; color: var(--on-surface-variant); }

.infolist { display: flex; flex-direction: column; }
.inforow {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--outline-variant);
  font-size: 13px;
}
.inforow:last-child { border-bottom: 0; }
.inforow dt { flex: none; width: 76px; color: var(--on-surface-variant); }
.inforow dd { flex: 1 1 auto; min-width: 0; word-break: break-word; }

.eplist { display: flex; flex-direction: column; }
.eplist li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--outline-variant);
  font-size: 13px;
}
.eplist li:last-child { border-bottom: 0; }
.eplist__no { flex: none; width: 26px; color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.eplist__name { flex: 1 1 auto; min-width: 0; }
.eplist__date { flex: none; font-size: 12px; color: var(--on-surface-variant); }

.comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--outline-variant);
}
.comment:last-child { border-bottom: 0; }
.comment__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--on-surface-variant);
}
.comment__head b { color: var(--on-surface); font-size: 13px; }
.comment__rate { color: #ffb400; }
.comment p { margin-top: 6px; font-size: 13.5px; line-height: 1.75; }

.peoplegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 16px 12px;
}
.person { text-align: center; }
.person__avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-high);
  display: grid; place-items: center;
  color: var(--on-surface-variant);
}
.person__avatar img { width: 100%; height: 100%; object-fit: cover; }
.person__name {
  font-size: 12.5px;
  margin-top: 6px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person__rel { font-size: 11.5px; color: var(--on-surface-variant); }

/* ══════════════════════════════════════════════ 选集 */

/* 🔴 线路按钮必须**换行**，不要改回横向滚动。
 *    侧栏里曾经是 `flex:none` + `overflow-x:auto` + `scrollbar-width:none`
 *    —— 滚动条被藏掉之后，3 条线路只能看到一条半，而鼠标用户没法横向滚
 *    （要 Shift+滚轮），表现就是「线路列表显示不全」。换行是最省事且不会
 *    再退化的做法：线路数是 2~4 的量级，多占一行而已。 */
.roads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.road {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--outline-variant);
  border-radius: 18px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.road span {
  font-size: 11px;
  padding: 0 5px;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.road[aria-selected="true"] {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: transparent;
  font-weight: 600;
}

.epgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
}
.ep {
  height: 42px;
  border: 1px solid var(--outline-variant);
  border-radius: 11px;
  background: transparent;
  color: var(--on-surface);
  cursor: pointer;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: background .14s, border-color .14s;
}
.ep:hover { background: var(--surface-high); }
.ep.is-on, .ep[aria-current="true"] {
  background: var(--primary);
  color: var(--on-primary);
  border-color: transparent;
  font-weight: 600;
}

/* ══════════════════════════════════════════════ 资源搜索结果 */

.srcgroup {
  background: var(--surface-low);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.srcgroup__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.srcgroup__name { font-size: 15px; font-weight: 700; }
.srcgroup__count { font-size: 11.5px; color: var(--on-surface-variant); margin-left: auto; }
.srcgroup__none { font-size: 13px; color: var(--on-surface-variant); }
.srcgroup__more { margin-top: 10px; }
.srcgroup__more summary {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 6px 0;
}

.reslist { display: flex; flex-direction: column; gap: 2px; }
.reslist--dim { opacity: .72; }
.resitem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}
.resitem:hover { background: var(--surface-high); }
.resitem__idx {
  flex: none;
  width: 22px;
  font-size: 12px;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.resitem__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resitem__name b { color: var(--primary); }
.resitem__go { flex: none; color: var(--on-surface-variant); }

.rankwrap { background: var(--surface-low); border-radius: 18px; padding: 14px; }
.rankwrap__hint { font-size: 12.5px; color: var(--on-surface-variant); margin-bottom: 10px; line-height: 1.7; }
.ranklist { display: flex; flex-direction: column; gap: 2px; }
.rankitem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rankitem:hover { background: var(--surface-high); }
.rankitem__no {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: grid; place-items: center;
  font-size: 12.5px;
  font-weight: 700;
}
.rankitem__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rankitem__name { font-size: 14px; font-weight: 600; }
.rankitem__name b { color: var(--primary); }
.rankitem__sub { font-size: 12px; color: var(--on-surface-variant); }
.rankitem__go { flex: none; color: var(--on-surface-variant); }

/* ══════════════════════════════════════════════ 搜索页 */

.bigsearch {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border-radius: 26px;
  background: var(--surface-high);
  border: 1px solid transparent;
  margin-bottom: 18px;
  color: var(--on-surface-variant);
}
.bigsearch:focus-within { border-color: var(--primary); }
.bigsearch input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--on-surface);
}
.bigsearch input::-webkit-search-cancel-button { display: none; }

.idlepanel { margin-bottom: 8px; }
.recentlist { display: flex; flex-direction: column; gap: 2px; }
.recentrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--on-surface-variant);
  text-align: left;
  cursor: pointer;
}
.recentrow:hover { background: var(--surface-high); color: var(--on-surface); }
.recentrow span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recentrow__del {
  font-style: normal;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 7px;
  opacity: 0;
}
.recentrow:hover .recentrow__del { opacity: .7; }
.recentrow__del:hover { background: var(--error-container); color: var(--on-error-container); opacity: 1; }

/* ══════════════════════════════════════════════ 我的 / 设置 */

.statspanel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 24px;
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.statspanel__icon {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--on-primary-container) 12%, transparent);
  display: grid; place-items: center;
}
.stats { display: flex; gap: 34px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; opacity: .82; }

.toolgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.toolcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 0;
  border-radius: 20px;
  background: var(--surface-low);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .16s, transform .16s;
}
.toolcard:hover { background: var(--surface-high); transform: translateY(-2px); }
.toolcard__icon {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.toolcard[data-tone="tertiary"] .toolcard__icon {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}
.toolcard__body { display: flex; flex-direction: column; min-width: 0; }
.toolcard__body b { font-size: 14.5px; }
.toolcard__body em { font-style: normal; font-size: 12px; color: var(--on-surface-variant); }

.entrylist { display: flex; flex-direction: column; gap: 2px; }
.entryrow {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}
.entryrow:hover { background: var(--surface-high); }
.entryrow--static { cursor: default; }
.entryrow--static:hover { background: transparent; }
.entryrow--danger:hover { background: var(--error-container); color: var(--on-error-container); }
.entryrow--danger:hover em { color: inherit; }
.entryrow__icon { flex: none; color: var(--on-surface-variant); }
.entryrow__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.entryrow__body b { font-size: 14px; font-weight: 600; }
.entryrow__body em { font-style: normal; font-size: 12px; color: var(--on-surface-variant); }
.entryrow__go { flex: none; color: var(--on-surface-variant); font-size: 18px; }

.card__group {
  background: var(--surface-low);
  border-radius: 18px;
  overflow: hidden;
}

.settingrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--outline-variant);
}
.settingrow:last-child { border-bottom: 0; }
.settingrow--btn { width: 100%; border: 0; background: transparent; text-align: left; color: inherit; }
.settingrow:hover { background: var(--surface-high); }
.settingrow__icon { flex: none; color: var(--on-surface-variant); }
.settingrow__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.settingrow__body b { font-size: 14px; font-weight: 600; }
.settingrow__body em { font-style: normal; font-size: 12px; color: var(--on-surface-variant); }
.settingrow__check { flex: none; color: var(--primary); }

.palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.palette__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--outline-variant);
  border-radius: 14px;
  background: var(--surface-low);
  color: inherit;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.palette__item:hover { background: var(--surface-high); }
.palette__item.is-on { border-color: var(--primary); background: var(--surface-high); }
.palette__dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.palette__dot--custom {
  display: grid; place-items: center;
  background: var(--surface-highest);
  color: var(--on-surface-variant);
  font-size: 15px;
  line-height: 1;
}
.palette__name { font-size: 12.5px; }

.plugbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.field--search { flex: 1 1 auto; min-height: 38px; height: 38px; padding: 0 14px; border-radius: 19px; }

.pluglist { display: flex; flex-direction: column; gap: 2px; }
.plugrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: background .14s;
}
.plugrow:hover { background: var(--surface-high); }
.plugrow__check { flex: none; display: flex; margin: 0; }
.plugrow__body { flex: 1 1 auto; min-width: 0; }
.plugrow__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.plugrow__url {
  font-size: 11.5px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor { display: flex; flex-direction: column; gap: 12px; }
.editor__test { display: flex; gap: 8px; }
.editor__result { font-size: 13px; }
.editor__result .ok { color: var(--ok); }
.editor__result .warn { color: var(--warn); }

.about { text-align: center; padding: 18px 0 6px; }
.about__logo {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 20px;
  background: var(--primary);
  color: var(--on-primary);
  display: grid; place-items: center;
}
.about h2 { font-size: 22px; font-weight: 700; }
.about__ver { font-size: 12.5px; color: var(--on-surface-variant); margin-top: 4px; }
.about__desc {
  max-width: 560px;
  margin: 14px auto 0;
  font-size: 13px;
  color: var(--on-surface-variant);
  line-height: 1.8;
}

.featurelist { display: flex; flex-direction: column; gap: 2px; }
.featurerow {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
}
.featurerow__mark { flex: none; margin-top: 2px; color: var(--ok); }
.featurerow[data-ok="false"] { opacity: .7; }
.featurerow[data-ok="false"] .featurerow__mark { color: var(--error); }
.featurerow__body { display: flex; flex-direction: column; min-width: 0; }
.featurerow__body b { font-size: 13.5px; }
.featurerow__body em { font-style: normal; font-size: 12px; color: var(--on-surface-variant); }

.histlist { display: flex; flex-direction: column; gap: 2px; }
.hisprog {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, .45);
}
.hisprog i { display: block; height: 100%; background: var(--primary); }

.collectlist { display: flex; flex-direction: column; gap: 2px; }

/* ══════════════════════════════════════════════ 播放页 */

.playpage {
  display: flex;
  gap: 0;
  min-height: 100vh;
  background: var(--surface);
}
.playmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* 🔴 max-height 的预留（顶部 98 + 播放条 64 + 提示行 63 ≈ 190px）只对 16:9 盒子成立。
   嵌入模式（sorani 类）的裁剪区是 950×681.19（1:1.39），会由 play.js 在该元素上
   内联覆盖为 `max-height: 100vh` —— 否则底部 100~140px 连同源站控制条一起被切掉。 */
.playerbox {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 190px);
  background: #000;
  overflow: hidden;
}
.playerbox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 嵌入式源站播放器（sorani 类）：iframe 固定视口 + transform:scale + 负偏移裁剪，
   只露视频内容格。缩放/偏移由 play.js 按服务端实测参数（embedLayout）计算，
   配合 ResizeObserver 随窗口/全屏自适应。 */
.embedplayer { position: absolute; inset: 0; background: #000; }
.embedplayer > iframe { position: absolute; border: 0; }
/* 嵌入模式的操作条：正常文档流，位置在**本工程播放器（.playbar + 提示行）之后**，
   即 .playmain 的最末尾。悬浮在画面内会挡住内容；夹在 #playerbox 与 .playbar
   之间则会占掉「源站控制条该出现的位置」，看起来像提示条挡住了源站控制条。 */
.embedbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface-container);
  color: var(--on-surface-variant);
  font-size: 12.5px;
  letter-spacing: .02em;
}
.embedbar__tip { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embedbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-highest);
  color: var(--on-surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.embedbar__btn:hover { filter: brightness(1.08); }
.embedbar__btn--primary { background: var(--primary); color: var(--on-primary); }

/* 候选地址进度角标：说明「正在试第几个地址」。
   服务端会下发多个候选直链（对应桌面版 mpv 的容错），逐条试播时用它反馈进度，
   否则用户在长候选列表上只会看到黑屏，分不清是在加载还是卡死了。 */
.playerbox__try {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: rgba(255, 255, 255, .92);
  font-size: 12px;
  letter-spacing: .02em;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.playerbox__state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, .86);
  text-align: center;
  padding: 24px;
}
.playerbox__state h3 { font-size: 16px; font-weight: 600; }
.playerbox__state p { font-size: 13px; max-width: 460px; line-height: 1.75; opacity: .86; }
.playerbox__state .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
/* 失败态里露出的源站地址：要能看清、能选中复制（用户可能想自己贴到浏览器） */
.playerbox__foot {
  font-size: 11px;
  max-width: 92%;
  word-break: break-all;
  opacity: .55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: text;
}

.playbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--outline-variant);
}
.playbar__info { flex: 1 1 auto; min-width: 0; }
.playbar__info h1 {
  font-size: 15.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playbar__info p {
  font-size: 12px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playbar__actions { flex: none; display: flex; gap: 2px; }

.playmodes {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 16px;
  flex-wrap: wrap;
}
.playmodes__hint { font-size: 12px; color: var(--on-surface-variant); flex: 1 1 200px; }

.playside {
  flex: none;
  width: 288px;
  border-left: 1px solid var(--outline-variant);
  padding: 16px;
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 0;
  background: var(--surface-low);
}
.playside__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.playside__head h2 { font-size: 15px; font-weight: 600; }
.playside__head span { font-size: 12px; color: var(--on-surface-variant); margin-left: auto; }
.epgrid--side { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }

/* ══════════════════════════════════════════════ 抽屉 / 弹层 */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  opacity: 0;
  transition: opacity .2s;
}
.sheet--in { opacity: 1; }
.sheet__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}
.sheet__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface-container);
  box-shadow: -8px 0 40px var(--shadow);
  transform: translateX(24px);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet--in .sheet__panel { transform: none; }
.sheet[data-side="bottom"] .sheet__panel {
  top: auto;
  width: 100%;
  max-height: 86vh;
  border-radius: 24px 24px 0 0;
  transform: translateY(24px);
}
.sheet[data-side="bottom"].sheet--in .sheet__panel { transform: none; }

.sheet__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--outline-variant);
}
.sheet__head h2 { font-size: 16.5px; font-weight: 700; }
.sheet__head p { font-size: 12.5px; color: var(--on-surface-variant); margin-top: 2px; }
.sheet__head .iconbtn { margin-left: auto; flex: none; }
.sheet__body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 24px; }
.sheet__foot { flex: none; padding: 12px 18px; border-top: 1px solid var(--outline-variant); }

.sheet--modal .sheet__panel { display: none; }
.dialog {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%);
  width: min(440px, calc(100% - 40px));
  background: var(--surface-container);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 20px 60px var(--shadow);
  transition: transform .2s;
}
.sheet--modal.sheet--in .dialog { transform: translate(-50%, -50%); }
.dialog h2 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.dialog p { font-size: 13.5px; color: var(--on-surface-variant); line-height: 1.75; margin-bottom: 16px; }
.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.taglist__item {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--outline-variant);
  border-radius: 18px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
}
.taglist__item:hover { background: var(--surface-high); }
.taglist__item.is-on {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: transparent;
  font-weight: 600;
}

.menu { display: flex; flex-direction: column; gap: 14px; }
.menu__title { font-size: 15px; font-weight: 700; }
.menu__hint { font-size: 12.5px; color: var(--on-surface-variant); line-height: 1.75; }
.menu__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-low);
  border-radius: 16px;
  padding: 6px;
}
.menu__label { font-size: 11.5px; color: var(--on-surface-variant); padding: 6px 10px 2px; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 13.5px;
}
.menu__item:hover { background: var(--surface-high); }
.menu__item .ic { opacity: 0; color: var(--primary); }
.menu__item.is-on .ic { opacity: 1; }
.menu__item--danger { color: var(--error); }
.menu__item--danger:hover { background: var(--error-container); }

.sourcepick { display: flex; flex-direction: column; gap: 10px; }
.sourcepick__list { display: flex; flex-direction: column; gap: 2px; }
.sourcepick__foot { display: flex; gap: 8px; }
.srcrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.srcrow:hover { background: var(--surface-high); }
.srcrow__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.srcrow__body b { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.srcrow__body em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 源质量统计 / 快捷筛选（规则源抽屉 + 规则设置页共用） ── */
.srcstatbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 2px 0 10px;
  font-size: 12.5px;
  color: var(--on-surface-variant);
}
.srcstat__count { color: var(--on-surface); font-weight: 600; }
.srcstat { font-weight: 600; }
.srcstat--good { color: var(--ok); }
.srcstat--fair { color: var(--on-surface-variant); }
.srcstat--poor { color: var(--warn); }
.srcstat--captcha { color: var(--tertiary); }
.srcstat--dead { color: var(--error); }

.srcquick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.srcquick__spacer { flex: 1 1 auto; }
.sourcepick__quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.sourcepick__stats {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 原因行可能较长：允许折行并限制 2 行。
   注意必须写 `.srcrow__body em.srcrow__why` —— 上面的
   `.srcrow__body em { white-space: nowrap }` 优先级更高，否则不生效。 */
.srcrow__body em.srcrow__why {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}
.plugrow__why {
  font-size: 11.5px;
  color: var(--on-surface-variant);
  line-height: 1.45;
  margin-top: 3px;
}
.menu__hint--dim { opacity: .75; }
.viewhint--dim { opacity: .78; }

.srcpick { display: flex; flex-direction: column; gap: 14px; }
.srcpick__loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-surface-variant);
  font-size: 13px;
  padding: 10px 0;
}
.srcpick__hint { font-size: 12.5px; color: var(--on-surface-variant); line-height: 1.75; }
.srcpick__group { display: flex; flex-direction: column; gap: 2px; }
.srcpick__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  padding: 6px 4px;
}
.srcpick__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-low);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.srcpick__item:hover { background: var(--surface-high); }
.srcpick__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srcpick__go { flex: none; font-size: 12px; color: var(--primary); }

.eppick { display: flex; flex-direction: column; }
.eppick__note { font-size: 12px; color: var(--on-surface-variant); margin-top: 14px; }

/* ── 空态 / 骨架 / 加载 ── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  color: var(--on-surface-variant);
}
.emptywrap { display: grid; place-items: center; }
.empty__icon {
  width: 54px; height: 54px;
  border-radius: 18px;
  background: var(--surface-high);
  display: grid; place-items: center;
  margin-bottom: 6px;
}
.empty h3 { font-size: 15px; font-weight: 600; color: var(--on-surface); }
.empty p { font-size: 13px; max-width: 460px; line-height: 1.75; }
.empty[data-tone="error"] .empty__icon { background: var(--error-container); color: var(--on-error-container); }
.empty .btn { margin-top: 10px; }

.skel {
  border-radius: 10px;
  background: linear-gradient(100deg,
    var(--surface-high) 30%, var(--surface-highest) 50%, var(--surface-high) 70%);
  background-size: 240% 100%;
  animation: skel 1.3s ease-in-out infinite;
}
@keyframes skel { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.skel--line { height: 14px; margin-bottom: 10px; }
.skel--line.skel--short { width: 55%; }
.skel--poster { width: 100%; aspect-ratio: 3 / 4.2; border-radius: 14px; margin-bottom: 10px; }
.skel--card { height: 96px; margin-bottom: 10px; }
.card--skel { pointer-events: none; }

.spinner {
  width: 30px; height: 30px;
  border: 3px solid color-mix(in srgb, currentColor 22%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.emptyload {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 30px 4px;
  color: var(--on-surface-variant);
  font-size: 13px;
}

/* ── Toast ── */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(560px, calc(100vw - 40px));
  padding: 11px 18px;
  border-radius: 22px;
  background: var(--surface-highest);
  color: var(--on-surface);
  font-size: 13px;
  box-shadow: 0 8px 28px var(--shadow);
  animation: toastIn .24s cubic-bezier(.2, .8, .2, 1);
}
.toast[data-kind="ok"] { background: var(--ok); color: #04170c; }
.toast[data-kind="warn"] { background: var(--error); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ══════════════════════════════════════════════ 响应式 */

@media (max-width: 1080px) {
  .playside { width: 240px; }
  .detail__poster { width: 168px; }
}

@media (max-width: 900px) {
  .rail { display: none; }
  .shell { border-radius: 0; }
  .bottomnav { display: flex; }
  .view { padding: 14px 14px 84px; }
  .view--full { padding: 0 0 72px; }
  .topbar { padding: 8px 14px; gap: 10px; }
  .brand__text { display: none; }

  .playpage { flex-direction: column; }
  .playside {
    width: auto;
    position: static;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--outline-variant);
  }
  .playerbox { max-height: 56vh; }

  .detail__hero { flex-direction: column; gap: 16px; }
  .detail__poster { width: 148px; }
  .detail__head h1 { font-size: 23px; }
  .pagehead__h1, .pagehead__title { font-size: 21px; }

  .statusline { font-size: 12px; padding: 7px 14px; }
  .databadge { display: none; }
}

@media (max-width: 620px) {
  .iconbtn__label { display: none; }
  .grid { gap: 14px 12px; }
  .weekbar { gap: 4px; }
  .weekday { padding: 8px 2px; border-radius: 11px; }
  .weekday__name { font-size: 11px; }
  .stats { gap: 20px; }
  .stat b { font-size: 20px; }
  .detail__actions .btn { flex: 1 1 auto; }
  .playbar { padding: 8px 10px; gap: 8px; }
  .playmodes { padding: 8px 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
