/* ==========================================================================
   小云影视 · 网页版   样式
   视觉方向：暗场影院 + 暖金强调色。移动端优先，宽屏按断点加列。
   ========================================================================== */

:root {
  --bg: #08090b;
  --bg-soft: #0b0d11;
  --panel: #0f1217;
  --panel-2: #141922;
  --line: #232a35;
  --line-soft: #1a2029;
  --txt: #eef1f6;
  --txt-2: #b9c3d3;
  --mut: #8b97a8;
  --gold: #ffb445;
  --gold-2: #f2913a;
  --gold-dim: rgba(255, 180, 69, 0.14);
  --danger: #ff6b6b;
  --radius: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --topbar-bg: rgba(8, 9, 11, 0.82);
  --btn-bg: #171c25;
  --btn-hover: #1e2531;
  --line-strong: #333c4c;
  --input-bg: #0c1015;
  --cover-bg: #10151d;
  --panel-3: #1a212b;
  --fade-to: rgba(10, 12, 16, 0.95);
  --veil-a: rgba(8, 9, 11, 0.94);
  --veil-b: rgba(8, 9, 11, 0.55);
  color-scheme: dark;
  --bar-h: 58px;
  --font: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system,
    "Segoe UI", sans-serif;
}


:root[data-theme="light"] {
  --bg: #f6f5f2;
  --bg-soft: #efeee9;
  --panel: #ffffff;
  --panel-2: #f4f2ee;
  --panel-3: #eae7e1;
  --line: #dcd7ce;
  --line-soft: #e8e4dc;
  --line-strong: #bfb9ae;
  --txt: #1b1c1f;
  --txt-2: #45474c;
  --mut: #75777d;
  --gold: #b8730d;
  --gold-2: #9a5c05;
  --gold-dim: rgba(184, 115, 13, 0.12);
  --danger: #c23a3a;
  --shadow: 0 14px 34px rgba(30, 26, 18, 0.12);
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --btn-bg: #f3f1ec;
  --btn-hover: #e9e5dd;
  --input-bg: #ffffff;
  --cover-bg: #e7e2d8;
  --fade-to: rgba(255, 255, 255, 0.95);
  --veil-a: rgba(255, 255, 255, 0.94);
  --veil-b: rgba(255, 255, 255, 0.58);
  color-scheme: light;
}


:root[data-theme="light"] .card-meta {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.72) 40%, #ffffff 100%);
}

:root[data-theme="light"] .card-meta .name {
  color: #14161a;
}

:root[data-theme="light"] .card-meta .sub,
:root[data-theme="light"] .card-meta .hint {
  color: #5c5f65;
}

:root[data-theme="light"] .hero-glow,
:root[data-theme="light"] .detail-glow {
  opacity: 0.5;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(1000px 480px at 84% -12%, rgba(255, 168, 60, 0.10), transparent 62%),
    radial-gradient(820px 420px at 8% -10%, rgba(70, 132, 255, 0.07), transparent 60%),
    var(--bg);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 82% -10%, rgba(255, 168, 60, 0.09), transparent 62%),
    radial-gradient(900px 460px at 10% -8%, rgba(70, 132, 255, 0.06), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg use + svg {
  display: inline;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
}

::selection {
  background: var(--gold-dim);
}

/* ============================== 顶栏 ============================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.theme-btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  color: var(--txt-2);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.theme-btn:hover {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--txt);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

.theme-btn .ico-moon { display: none; }
:root[data-theme="light"] .theme-btn .ico-sun { display: none; }
:root[data-theme="light"] .theme-btn .ico-moon { display: inline-block; }

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

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--gold);
  flex: 0 0 auto;
  border-radius: 7px;
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.brand-text b {
  font-size: 16px;
  letter-spacing: 0.5px;
}

.brand-text em {
  font-style: normal;
  font-size: 11px;
  color: var(--mut);
  letter-spacing: 1px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--txt-2);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav a svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  flex: 0 0 auto;
}

.nav a:hover {
  background: var(--panel-2);
  color: var(--txt);
}

.nav a[aria-current="page"] {
  color: var(--gold);
  background: var(--gold-dim);
}

/* 手机上只留图标 */
@media (max-width: 560px) {
  .nav a span {
    display: none;
  }

  .nav a {
    padding: 0 10px;
  }
}

/* ============================== 主体 ============================== */

.view {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

@media (min-width: 820px) {
  .view {
    padding: 26px 26px 60px;
  }
}

.footer {
  flex: 0 0 auto;
  padding: 16px 14px 26px;
  color: #5e6a7b;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}

/* ============================== 通用元件 ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--txt);
  font-size: 14px;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--btn-hover);
  border-color: #2e3746;
}

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

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.btn-gold {
  background: linear-gradient(180deg, #ffc163, var(--gold-2));
  border-color: transparent;
  color: #221604;
  font-weight: 600;
}

.btn-gold:hover {
  background: linear-gradient(180deg, #ffcd7c, #f79a41);
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--mut);
}

.btn-ghost:hover {
  color: var(--txt);
  background: var(--btn-hover);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--txt-2);
  font-size: 13.5px;
  white-space: nowrap;
  transition: all 0.16s ease;
}

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

.chip[aria-pressed="true"] {
  color: #211603;
  background: linear-gradient(180deg, #ffc163, var(--gold-2));
  border-color: transparent;
  font-weight: 600;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--mut);
  letter-spacing: 0.4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--txt);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #545e6d;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.section {
  margin: 0 0 26px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.3px;
}

.section-head .hint {
  color: var(--mut);
  font-size: 12.5px;
}

.card-surface {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
}

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--mut);
  border: 1px dashed #2a3240;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.8;
}

.empty strong {
  display: block;
  color: var(--txt-2);
  font-size: 15px;
  margin-bottom: 4px;
}

/* ============================== 首页 ============================== */

.site-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.site-bar .label {
  font-size: 12.5px;
  color: var(--mut);
  letter-spacing: 0.6px;
}

.continue-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: thin;
}

.continue-item {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 236px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.continue-item:hover {
  border-color: #333b49;
  background: var(--panel-2);
}

.continue-item img {
  width: 44px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--cover-bg);
  flex: 0 0 auto;
}

.continue-item .t {
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.4;
}

.continue-item .t b {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-item .t span {
  color: var(--mut);
  font-size: 12px;
}

/* 网格：每个断点显式定列数 */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 560px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 820px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1140px) {
  .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1400px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 180, 69, 0.35);
  outline: none;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--cover-bg);
}

.card .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #2c3542;
}

.card .fallback svg {
  width: 34px;
  height: 34px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
}

.card-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 30px 9px 9px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 42%, rgba(0, 0, 0, 0.92) 100%);
}

.card-meta .name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta .sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: #b9c3d3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #1b1204;
  background: linear-gradient(180deg, #ffc163, var(--gold-2));
  font-weight: 600;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 0;
}

.pager .info {
  color: var(--mut);
  font-size: 13px;
  min-width: 64px;
  text-align: center;
}

/* ============================== 详情 ============================== */

.detail-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  margin-bottom: 22px;
}

.detail-hero .glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 150%;
  background-position: center;
  background-size: cover;
  filter: blur(46px) saturate(120%);
  opacity: 0.42;
  transform: scale(1.06);
}

.detail-hero .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--veil-a) 30%, var(--veil-b) 100%);
}

.detail-inner {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 18px;
}

@media (min-width: 700px) {
  .detail-inner {
    gap: 26px;
    padding: 26px;
  }
}

.detail-poster {
  flex: 0 0 auto;
  width: 104px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--cover-bg);
  aspect-ratio: 2 / 3;
}

@media (min-width: 700px) {
  .detail-poster {
    width: 168px;
  }
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-info h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: 0.4px;
}

@media (min-width: 700px) {
  .detail-info h1 {
    font-size: 27px;
  }
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-row span {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--txt-2);
  font-size: 12px;
  line-height: 1.7;
}

.desc {
  color: var(--txt-2);
  font-size: 14px;
  line-height: 1.75;
  max-height: 5.4em;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.desc.open {
  max-height: 40em;
}

.desc::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2.2em;
  background: linear-gradient(transparent, var(--fade-to));
  transition: opacity 0.2s ease;
}

.desc.open::after {
  opacity: 0;
}

.desc-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--gold);
  font-size: 13px;
  height: 22px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.episode-block {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  margin-bottom: 18px;
}

.line-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

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

@media (min-width: 560px) {
  .ep-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .ep-list {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.ep {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--txt-2);
  font-size: 13px;
  text-align: center;
  overflow: hidden;
  transition: all 0.16s ease;
}

.ep:hover {
  border-color: rgba(255, 180, 69, 0.5);
  color: var(--txt);
  background: var(--panel-3);
}

.ep.playing {
  border-color: transparent;
  background: linear-gradient(180deg, #ffc163, var(--gold-2));
  color: #1b1204;
  font-weight: 600;
}

/* ============================== 播放 ============================== */

.player-shell {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line-soft);
  aspect-ratio: 16 / 9;
  max-height: 78vh;
}

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.player-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  color: var(--txt-2);
  font-size: 14px;
  line-height: 1.7;
  background: rgba(6, 7, 9, 0.92);
}

.player-fallback a {
  color: var(--gold);
  text-decoration: underline;
}

/* 自动播放被拦截时的「点击播放」遮罩 */
.tap-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  background: rgba(4, 5, 7, 0.72);
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.tap-play-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffc163, var(--gold-2));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.16s ease;
}

.tap-play:hover .tap-play-icon {
  transform: scale(1.06);
}

.tap-play-icon svg {
  width: 26px;
  height: 26px;
  fill: #221604;
  stroke: none;
}

.play-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 12px;
}

.play-head .title {
  min-width: 0;
  flex: 1 1 auto;
}

.play-head h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.play-head p {
  margin: 2px 0 0;
  color: var(--mut);
  font-size: 13px;
}

.play-nav {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.play-nav .btn {
  padding: 0 12px;
}

/* ============================== 搜索 ============================== */

.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-box .field {
  flex: 1 1 auto;
  min-width: 0;
}

.search-box .btn {
  flex: 0 0 auto;
  align-self: flex-end;
  height: 42px;
}

.search-group {
  margin-bottom: 22px;
}

.search-group .g-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.search-group .g-head b {
  font-size: 14px;
  font-weight: 650;
}

.search-group .g-head span {
  color: var(--mut);
  font-size: 12px;
}

/* ============================== 排行榜 ============================== */

.today-time {
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--txt-2);
  background: var(--panel-2);
  font-variant-numeric: tabular-nums;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 26px 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
}

.rank-row:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.rank-no {
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.rank-no.top1 {
  color: #2a1a00;
  background: linear-gradient(180deg, #ffd479, #e5a72c);
}

.rank-no.top2 {
  color: #1c2226;
  background: linear-gradient(180deg, #e8edf2, #b8c3cc);
}

.rank-no.top3 {
  color: #241408;
  background: linear-gradient(180deg, #e7b58a, #c07c46);
}

.rank-cover {
  position: relative;
  display: block;
  width: 52px;
  height: 72px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--cover-bg);
}

.rank-cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-cover .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 4px;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  color: var(--mut);
  background: var(--panel-3);
  word-break: break-all;
}

.rank-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rank-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta {
  font-size: 12.5px;
  color: var(--mut);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-heat {
  font-size: 12px;
  color: var(--gold);
}

@media (max-width: 560px) {
  .rank-row {
    grid-template-columns: 24px 46px minmax(0, 1fr);
  }
  .rank-cover {
    width: 46px;
    height: 64px;
  }
  .rank-row > .btn-sm {
    display: none;
  }
}

/* ============================== 设置 ============================== */

.set-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  margin-bottom: 16px;
}

.set-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
}

.set-card .sub {
  margin: 0 0 14px;
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.7;
}

.set-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.set-row .field {
  flex: 1 1 200px;
  min-width: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
  margin-bottom: 8px;
  font-size: 13.5px;
}

.list-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
}

.list-item .dot.off {
  background: #55606f;
}

.list-item .name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item .api {
  color: var(--mut);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.list-item .tag {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--mut);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mut);
  transition: all 0.16s ease;
}

.icon-btn:hover {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

.switch input {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #232a35;
  position: relative;
  cursor: pointer;
  transition: background-color 0.18s ease;
  margin: 0;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd3df;
  transition: transform 0.18s ease;
}

.switch input:checked {
  background: var(--gold-2);
}

.switch input:checked::after {
  transform: translateX(18px);
  background: #fff;
}

.switch span {
  font-size: 14px;
  color: var(--txt-2);
}

/* ============================== 骨架屏 / 加载 / toast ============================== */

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 560px) {
  .skeleton-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 820px) {
  .skeleton-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.skeleton-line {
  height: 14px;
  width: 120px;
  border-radius: 6px;
  background: var(--panel-2);
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-card {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  background: var(--panel-3);
  animation: pulse 1.4s ease-in-out infinite;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  max-width: min(520px, 88vw);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--txt);
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 60;
  text-align: center;
}

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

/* ============================== 无障碍 / 动效 ============================== */

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

:focus-visible {
  outline: 2px solid rgba(255, 180, 69, 0.65);
  outline-offset: 2px;
}

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

/* 年份筛选 + 播放器画质选择（新增） */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.filter-label {
  font-size: 13px;
  color: var(--mut);
  letter-spacing: 0.4px;
}

.chip-sel {
  min-height: 38px;
  padding: 6px 30px 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px 14px;
  color: var(--txt);
  font-size: 14px;
  appearance: none;
  cursor: pointer;
}

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

.quality-wrap {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

.quality-sel {
  min-height: 34px;
  padding: 5px 28px 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 14, 18, 0.82) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cfd6e2' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center / 13px 13px;
  color: #e7ecf4;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.quality-sel:hover { border-color: rgba(255, 180, 69, 0.6); }
.ch.off {
  opacity: 0.42;
  filter: grayscale(0.4);
}
.ch.off::after {
  content: "离线";
  margin-left: 6px;
  font-size: 11px;
  color: #ff9d6b;
}
/* 播放页头部在窄屏不要被按钮挤成竖排 */
.play-head {
  flex-wrap: wrap;
}

.play-head .title h1,
.play-head .title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-nav {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 560px) {
  .play-head .title {
    flex: 1 1 100%;
  }
  .play-nav {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .play-nav .btn {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* 继续观看横滑条不显示滚动条（桌面端很难看） */
.continue-row {
  scrollbar-width: none;
}
.continue-row::-webkit-scrollbar {
  display: none;
}
/* 筛选行：年份 / 地区 / 语言 三列 + 类型标签 */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.filter-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-sel.no-cap {
  opacity: 0.72;
}

.filter-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--mut);
}

.chip-row .filter-label {
  align-self: center;
  margin-right: 2px;
}

/* 4K 档位提示更醒目一点 */
.quality-sel {
  font-variant-numeric: tabular-nums;
}
/* ==========================================================================
   播放历史 & 播放源检测
   ========================================================================== */

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
.btn-sm svg {
  width: 14px;
  height: 14px;
}

.hist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hist-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
}

.hist-row:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.hist-cover {
  position: relative;
  display: block;
  width: 64px;
  height: 88px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--cover-bg);
}

.hist-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hist-cover .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--mut);
}

.hist-info {
  min-width: 0;
}

.hist-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-name:hover {
  color: var(--gold);
}

.hist-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--mut);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 3px;
  background: var(--panel-3);
  overflow: hidden;
}

.hist-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
}

.hist-act {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.src-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.src-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1.1fr) minmax(0, 1.6fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
  color: var(--txt-2);
  text-decoration: none;
  font-size: 13.5px;
}

.src-row:hover {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--txt);
}

.src-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a5364;
}

.src-row .dot.ok {
  background: #46c97a;
  box-shadow: 0 0 0 3px rgba(70, 201, 122, 0.16);
}

.src-row .dot.mid {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 180, 69, 0.14);
}

.src-row .dot.slow {
  background: #ff9f43;
}

.src-row .dot.bad {
  background: #5a6473;
}

.src-row .src-name {
  font-weight: 600;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.src-row .src-name em {
  font-style: normal;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 20px;
  color: var(--gold);
  background: var(--gold-dim);
}

.src-row .src-mid {
  color: var(--mut);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.src-row .src-ms {
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--mut);
}

.src-row .src-ms.ok {
  color: #46c97a;
}

.src-row .src-ms.mid {
  color: var(--gold);
}

.src-row .src-ms.slow {
  color: #ff9f43;
}

@media (max-width: 560px) {
  .hist-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .hist-cover {
    width: 54px;
    height: 74px;
  }
  .hist-act {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-start;
  }
  .src-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 4px;
  }
  .src-row .src-mid {
    grid-column: 2 / 4;
  }
}

@media (max-width: 560px) {
  .nav a svg {
    display: none;
  }
  .nav a {
    padding: 0 8px;
    gap: 0;
  }
}

/* ============================== 设置 · 自定义规则 ============================== */

textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.rules-demo {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--card);
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}

/* ============================== 播放器：工具栏 / 弹幕 / 设置 ============================== */

.player-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.dm-send-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1 1 260px;
  min-width: 0;
}

.dm-send-wrap input {
  flex: 1 1 160px;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  font-size: 13px;
}

.dm-send-wrap select {
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  font-size: 13px;
}

.player-shell {
  position: relative;
}

.dm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.p-dlg-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 16px;
}

.p-dlg {
  width: min(680px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.p-dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.p-dlg-head h3 {
  margin: 0;
  font-size: 16px;
}

.p-dlg-body {
  padding: 10px 16px 16px;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.p-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13.5px;
  color: var(--mut);
}

.p-row.wide {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.p-row span {
  color: var(--txt);
}

.p-row b {
  color: var(--gold);
  font-weight: 600;
}

.p-row select,
.p-row input[type='number'],
.p-row input[type='text'] {
  height: 32px;
  min-width: 140px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  font-size: 13px;
}

.p-row input[type='range'] {
  width: 190px;
  accent-color: var(--gold);
}

.p-row input[type='color'] {
  width: 44px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
}

.p-sep {
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.p-dlg-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 520px) {
  .p-row {
    flex-direction: column;
    align-items: stretch;
  }
  .p-row input[type='range'] {
    width: 100%;
  }
  .dm-send-wrap select {
    display: none;
  }
}
