/* LibreTV 的示意画面: 浏览器窗口 + 浮在右下角的「换源」面板 (展示按码率排序) */

.tv-mock {
  position: relative;
  width: min(100%, 540px);
  padding: 1rem 0 4.5rem;
}

.browser {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 14px;
  background: var(--tv-surface);
  box-shadow:
    0 50px 90px -40px #000,
    0 30px 60px -30px var(--tv-glow);
  transform: perspective(1400px) rotateY(-8deg) rotateX(3deg);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid var(--stage-rule);
}

.browser-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.18);
}

.browser-url {
  margin: 0 auto;
  padding: 0.15rem 1.2rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.3);
  color: var(--stage-text-2);
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.browser-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--tv-bg);
}

.tv-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgb(0 184 230 / 0.35);
  border-radius: 999px;
  background: var(--tv-chip);
  color: var(--stage-text);
  font-size: 0.66rem;
}

/* 打字光标 */
.tv-search span::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.9em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: var(--tv-accent-2);
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

.tv-search b {
  color: var(--tv-accent);
  font-size: 0.58rem;
  font-weight: 600;
}

.tv-player {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 50%, rgb(0 0 0 / 0.6)),
    radial-gradient(ellipse 55% 70% at 72% 40%, oklch(72% 0.13 60 / 0.85), transparent),
    radial-gradient(ellipse 60% 80% at 20% 70%, oklch(48% 0.12 230 / 0.9), transparent),
    linear-gradient(160deg, #1b3550, #0b101a);
}

.tv-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  clip-path: circle(50%);
}

.tv-play::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 12px 0 0 15px;
  border-block: 7px solid transparent;
  border-left: 11px solid #fff;
}

.tv-progress {
  position: absolute;
  right: 10px;
  bottom: 8px;
  left: 10px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
}

.tv-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--tv-accent), var(--tv-pink));
  transform-origin: left;
  animation: progress 20s linear infinite;
}

.tv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tv-grid span {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent 55%, rgb(0 0 0 / 0.55)),
    linear-gradient(160deg, oklch(55% 0.12 var(--h)), oklch(24% 0.06 calc(var(--h) + 30)));
}

.tv-grid span:nth-child(1) { --h: 220; }
.tv-grid span:nth-child(2) { --h: 10; }
.tv-grid span:nth-child(3) { --h: 160; }
.tv-grid span:nth-child(4) { --h: 280; }

/* ── 换源面板 ── */
.tv-sources {
  position: absolute;
  right: -0.5rem;
  bottom: 0;
  width: 230px;
  padding: 0.85rem;
  border: 1px solid rgb(95 225 255 / 0.18);
  border-radius: 16px;
  background: rgb(20 28 41 / 0.82);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 28px 48px -20px #000;
  animation: float-flat 7s ease-in-out infinite;
}

@keyframes float-flat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.tv-sources-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  color: var(--stage-text);
  font-size: 0.72rem;
  font-weight: 700;
}

.tv-sources-title span {
  color: var(--stage-text-3);
  font-size: 0.6rem;
  font-weight: 500;
}

.tv-sources ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv-sources li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  padding: 0.4rem 0.55rem;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.04);
  color: var(--stage-text-2);
  font-size: 0.62rem;
}

.tv-sources li span {
  flex: 1;
}

.tv-sources em {
  padding: 0.05rem 0.4rem;
  border-radius: 5px;
  background: rgb(0 184 230 / 0.14);
  color: var(--tv-accent-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-style: normal;
}

.tv-sources li.is-current {
  background: rgb(0 184 230 / 0.16);
  box-shadow: inset 0 0 0 1px rgb(0 184 230 / 0.45);
  color: var(--stage-text);
}

.tv-sources li.is-current em {
  background: linear-gradient(90deg, var(--tv-accent), var(--tv-pink));
  color: #06131d;
  font-weight: 700;
}

.tv-sources b {
  color: var(--tv-accent-2);
  font-size: 0.56rem;
}

.tv-sources li.is-dead {
  opacity: 0.4;
}

.tv-sources li.is-dead em {
  background: rgb(255 255 255 / 0.08);
  color: var(--stage-text-3);
}

/* 测速扫过 */
.tv-sources li:not(.is-dead)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(95 225 255 / 0.12), transparent);
  transform: translateX(-100%);
  animation: sweep 3.6s ease-in-out infinite;
}

.tv-sources li:nth-child(2)::after { animation-delay: 0.25s; }
.tv-sources li:nth-child(3)::after { animation-delay: 0.5s; }

@keyframes sweep {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 480px) {
  .tv-sources {
    width: 200px;
    right: -0.25rem;
  }
  .browser {
    transform: none;
  }
}
