/* ============================================================
   在线视频解析 · 科技感主题
   ============================================================ */
:root {
  --bg: #050816;
  --panel: rgba(13, 20, 42, 0.72);
  --panel-border: rgba(0, 240, 255, 0.18);
  --cyan: #00f0ff;
  --blue: #5b8cff;
  --purple: #7b5cff;
  --text: #e6f7ff;
  --text-dim: #8aa0c8;
  --danger: #ff4d6d;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- 动态背景 ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 35%, transparent 85%);
  animation: gridMove 18s linear infinite;
}
@keyframes gridMove {
  from { background-position: 0 0; }
  to   { background-position: 44px 44px; }
}

.bg-glow {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.glow-a {
  width: 480px; height: 480px;
  top: -140px; left: -120px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.35), transparent 70%);
  animation: floatA 12s ease-in-out infinite alternate;
}
.glow-b {
  width: 520px; height: 520px;
  bottom: -180px; right: -140px;
  background: radial-gradient(circle, rgba(123, 92, 255, 0.4), transparent 70%);
  animation: floatB 14s ease-in-out infinite alternate;
}
@keyframes floatA { to { transform: translate(90px, 60px) scale(1.12); } }
@keyframes floatB { to { transform: translate(-80px, -50px) scale(1.08); } }

#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- 布局 ---------- */
.page {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 34px 0 40px;
}

/* ---------- 顶部 ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(123, 92, 255, 0.12));
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.25);
}
.brand-name {
  font-size: 24px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--blue) 55%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-slogan {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-top: 2px;
}
.status-pill {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: #7dffd4;
  padding: 7px 14px;
  border: 1px solid rgba(0, 255, 170, 0.3);
  border-radius: 999px;
  background: rgba(0, 255, 170, 0.07);
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00ffaa;
  box-shadow: 0 0 10px #00ffaa;
  animation: blink 1.6s infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- 通用面板 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ---------- 输入卡片 ---------- */
.parse-card { padding: 22px; margin-bottom: 20px; }
.input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(4, 10, 28, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 12px;
  padding: 7px 8px 7px 16px;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12), 0 0 26px rgba(0, 240, 255, 0.18);
}
.input-icon { color: var(--cyan); display: flex; flex-shrink: 0; }
#videoUrl {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 10px 0;
}
#videoUrl::placeholder { color: #5f76a0; }

.btn-primary {
  flex-shrink: 0;
  position: relative;
  border: none;
  border-radius: 10px;
  padding: 12px 30px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #04101e;
  cursor: pointer;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.35);
  transition: transform .15s, box-shadow .2s, filter .2s;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: shine 3.2s infinite;
}
@keyframes shine { 0%, 55% { left: -80%; } 100% { left: 130%; } }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 32px rgba(0, 240, 255, 0.55); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.loading { filter: brightness(.8); pointer-events: none; }

.quick-tips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
}
.quick-tips em {
  font-style: normal;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(123, 92, 255, 0.3);
  color: #b9c9ff;
  background: rgba(123, 92, 255, 0.08);
}

/* ---------- 线路 ---------- */
.lines-panel { padding: 16px 20px; margin-bottom: 20px; }
.lines-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.lines-label { font-size: 14px; font-weight: 700; color: var(--cyan); letter-spacing: 1px; }
.lines-hint { font-size: 12px; color: var(--text-dim); }
.line-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.line-tab {
  padding: 8px 20px;
  font-size: 13px;
  color: #b9c9e8;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  background: rgba(5, 12, 32, 0.7);
  transition: all .18s;
}
.line-tab:hover { border-color: var(--cyan); color: var(--cyan); }
.line-tab.active {
  color: #04101e;
  font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  border-color: transparent;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.4);
}

/* ---------- 播放器 ---------- */
.player-panel { padding: 16px 18px 18px; }
.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.player-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 6px;
  color: #04101e;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}
#playerTip {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-actions { display: flex; gap: 10px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--cyan);
  cursor: pointer;
  border-radius: 9px;
  border: 1px solid rgba(0, 240, 255, 0.28);
  background: rgba(0, 240, 255, 0.06);
  transition: all .18s;
}
.btn-ghost:hover { background: rgba(0, 240, 255, 0.16); box-shadow: 0 0 16px rgba(0, 240, 255, 0.25); }

.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #02050f;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.1), inset 0 0 60px rgba(0, 0, 0, 0.6);
}
#playerFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-dim);
}
.player-placeholder p {
  font-size: 15px;
  letter-spacing: 5px;
  color: #6f86b8;
}
.player-placeholder span { font-size: 12px; }
.ph-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.15);
  border-top-color: var(--cyan);
  animation: spin 1.4s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 全屏时铺满 */
.player-box:fullscreen { border: none; border-radius: 0; aspect-ratio: auto; }
.player-box:fullscreen #playerFrame { height: 100vh; }
.player-box:-webkit-full-screen { border: none; border-radius: 0; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: #5d729c;
  line-height: 2;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%) translateY(20px);
  min-width: 200px;
  max-width: 80vw;
  padding: 12px 22px;
  font-size: 13px;
  text-align: center;
  color: var(--text);
  background: rgba(10, 18, 40, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(255, 77, 109, 0.5); box-shadow: 0 0 24px rgba(255, 77, 109, 0.25); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .page { width: 94vw; padding-top: 22px; }
  .input-wrap { flex-wrap: wrap; padding: 10px 12px; }
  #videoUrl { width: 100%; flex-basis: 100%; }
  .btn-primary { width: 100%; }
  .brand-name { font-size: 20px; }
  .btn-ghost span, .btn-ghost { font-size: 12px; }
  #playerTip { white-space: normal; }
}
