/* =========================================================
   Show TV 落地页样式
   ---------------------------------------------------------
   数值全部取自原站 showtv.my 的内联样式：
     底色 #000 · 主色 #ec4899 (pink) · 玫瑰 #f43f5e · 浅粉 #f472b6
     在线绿 #22c55e / #4ade80
   断点：640px（平板）· 1024px（桌面）
   已剔除原站里未被任何标记使用的 .brand-dot* 三条规则。
   ========================================================= */

:root {
  --bg: #000;
  --ink: #fff;
  --pink: #ec4899;
  --rose: #f43f5e;
  --pink-light: #f472b6;
  --green: #22c55e;
  --lime: #4ade80;
}

/* ---------------- Reset ---------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  position: fixed;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 根容器 ---------------- */
.root {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
}

/* ---------------- 桌面氛围光 ---------------- */
.ambient {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: none;
}

@media (min-width: 640px) {
  .ambient {
    display: block;
  }
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.ambient-glow-1 {
  left: -160px;
  top: -160px;
  width: 384px;
  height: 384px;
  background: rgba(236, 72, 153, 0.1);
}

.ambient-glow-2 {
  right: -160px;
  top: 33%;
  width: 384px;
  height: 384px;
  background: rgba(168, 85, 247, 0.1);
}

.ambient-glow-3 {
  bottom: -160px;
  left: 33%;
  width: 384px;
  height: 384px;
  background: rgba(236, 72, 153, 0.08);
}

/* ---------------- 顶栏 ---------------- */
.header {
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

@media (min-width: 640px) {
  .header {
    padding: 12px 16px;
  }
}

@media (min-width: 1024px) {
  .header {
    padding: 12px 32px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 640px) {
  .brand {
    gap: 12px;
  }
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

@media (min-width: 640px) {
  .brand-logo {
    width: 36px;
    height: 36px;
  }
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

@media (min-width: 640px) {
  .brand-title {
    font-size: 24px;
  }
}

.brand-title span {
  background: linear-gradient(to right, var(--pink-light), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------------- 在线人数 ---------------- */
.online-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: count-up-anim 0.6s ease-out forwards;
}

@media (min-width: 640px) {
  .online-badge {
    gap: 8px;
    padding: 8px 16px;
  }
}

.online-dot-wrap {
  position: relative;
  display: flex;
}

.online-dot-pulse {
  position: absolute;
  display: inline-flex;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--lime);
  opacity: 0.75;
  animation: live-pulse 1.5s ease-in-out infinite;
}

.online-dot {
  position: relative;
  display: inline-flex;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lime);
}

@media (min-width: 640px) {
  .online-dot-pulse,
  .online-dot {
    width: 8px;
    height: 8px;
  }
}

.online-text {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 640px) {
  .online-text {
    font-size: 14px;
  }
}

.online-count {
  font-weight: 700;
  color: var(--ink);
}

/* ---------------- 卡片流 ---------------- */
.carousel-main {
  position: relative;
  z-index: 10;
  flex: 1;
  overflow: hidden;
}

.carousel {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  overflow: hidden;
}

.carousel-fade-top,
.carousel-fade-bottom {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  height: 48px;
}

.carousel-fade-top {
  top: 0;
  background: linear-gradient(to bottom, var(--bg), transparent);
}

.carousel-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--bg), transparent);
}

.carousel-track {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: layout paint style;
}

.carousel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.stream-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  contain: layout style paint;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  aspect-ratio: 1;
}

@media (min-width: 640px) {
  .stream-card {
    border-radius: 16px;
  }
}

.stream-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.stream-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 40%, transparent 100%);
}

.live-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: heartbeat 1.5s ease-in-out infinite;
}

.stream-info {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stream-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

@media (min-width: 640px) {
  .stream-name {
    font-size: 16px;
  }
}

.stream-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.stream-tag {
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 640px) {
  .stream-tag {
    font-size: 10px;
  }
}

/* ---------------- 底部 CTA ---------------- */
.cta-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  pointer-events: none;
}

.cta-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
}

@media (min-width: 640px) {
  .cta-inner {
    padding: 64px 16px 20px;
  }
}

.cta-title {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
}

@media (min-width: 640px) {
  .cta-title {
    font-size: 24px;
  }
}

@media (min-width: 1024px) {
  .cta-title {
    font-size: 30px;
  }
}

.cta-subtitle {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(244, 114, 182, 0.8);
  text-align: center;
}

@media (min-width: 640px) {
  .cta-subtitle {
    margin-top: 8px;
    font-size: 14px;
  }
}

.cta-btn-wrap {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

@media (min-width: 640px) {
  .cta-btn-wrap {
    margin-top: 16px;
  }
}

/* 双层扩散光圈 */
.ring-ping,
.ring-ping-delay {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  pointer-events: none;
  animation: ring-ping-anim 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.ring-ping {
  background: rgba(236, 72, 153, 0.3);
}

.ring-ping-delay {
  background: rgba(236, 72, 153, 0.2);
  animation-delay: 0.75s;
}

.cta-btn {
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100vw - 48px);
  border-radius: 12px;
  background: linear-gradient(to right, var(--pink), var(--rose));
  padding: 16px 64px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  border: none;
  cursor: pointer;
  animation: cta-flash 1.5s ease-in-out infinite;
}

@media (min-width: 640px) {
  .cta-btn {
    width: auto;
    border-radius: 16px;
    padding: 20px 40px;
    font-size: 20px;
    gap: 12px;
  }
}

.cta-btn svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 640px) {
  .cta-btn svg {
    width: 24px;
    height: 24px;
  }
}

.cta-disclaimer {
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}

@media (min-width: 640px) {
  .cta-disclaimer {
    margin-top: 12px;
    font-size: 12px;
  }
}

/* ---------------- 动画 ---------------- */
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  15% {
    transform: scale(1.4);
    opacity: 1;
  }
  30% {
    transform: scale(1);
    opacity: 1;
  }
  45% {
    transform: scale(1.3);
    opacity: 1;
  }
  60% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes cta-flash {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4), 0 0 40px rgba(236, 72, 153, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 40px rgba(236, 72, 153, 0.8), 0 0 80px rgba(236, 72, 153, 0.4),
      0 0 120px rgba(236, 72, 153, 0.2);
    transform: scale(1.04);
  }
}

@keyframes ring-ping-anim {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(1.35, 1.8);
    opacity: 0;
  }
}

@keyframes count-up-anim {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------- 下载弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  animation: modal-fade 0.25s ease-out;
}

.modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 340px;
  background: #121216;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px;
  animation: modal-pop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 弹窗媒体区：换任何图都锁成竖版 5:6，并自带播放按钮覆盖层 */
.modal-media {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 5 / 6;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0c;
}

.modal-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* 压一层暗角，让按钮在任何亮度的图上都立得住 */
.modal-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.5) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* 播放按钮：纯 CSS + SVG，不属于图片，换图不会丢 */
.modal-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.modal-play svg {
  position: relative;
  z-index: 2;
  box-sizing: content-box;
  width: 30px;
  height: 30px;
  padding: 20px;
  border-radius: 50%;
  fill: #fff;
  background: linear-gradient(135deg, var(--pink-light), var(--pink) 55%, var(--rose));
  box-shadow:
    0 10px 28px rgba(236, 72, 153, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

/* 两道扩散光环 */
.modal-play::before,
.modal-play::after {
  content: "";
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  animation: play-ring 2.8s ease-out infinite;
}

.modal-play::after {
  animation-delay: 1.4s;
}

@keyframes play-ring {
  0% {
    transform: scale(0.78);
    opacity: 0.9;
  }
  70% {
    opacity: 0.15;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

.modal-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  line-height: 1.25;
}

.modal-note {
  margin: -6px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 1.5;
}

.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  background: linear-gradient(to right, var(--pink), var(--rose));
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  padding: 14px 0;
  animation: cta-flash 1.5s ease-in-out infinite;
}

.modal-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
