/* DY Video Station - dark UI */
:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel2: #1e242d;
  --border: #262e3a;
  --text: #e6ebf2;
  --muted: #8a94a6;
  --accent: #4f8cff;
  --accent2: #7ab8ff;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
}

/* ── topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
}
.brand-text h1 { font-size: 18px; font-weight: 700; }
.sub { font-size: 12px; color: var(--muted); }
.search-wrap { flex: 1; max-width: 420px; }
#search {
  width: 100%;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
#search:focus { border-color: var(--accent); }

/* ── layout ── */
.layout {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  min-height: 0;
}
.player-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.list-panel {
  width: 380px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.list-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.video-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.video-list::-webkit-scrollbar { width: 8px; }
.video-list::-webkit-scrollbar-thumb { background: #2c3542; border-radius: 4px; }

/* ── player shell ── */
.player-shell {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  pointer-events: none;
}
.empty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--accent2);
}
.video-empty p { font-size: 14px; }

/* ── controls ── */
.controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  opacity: 0;
  transition: opacity .25s;
}
.player-shell:hover .controls,
.player-shell.buffering .controls { opacity: 1; }
.ctl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.ctl-btn:hover { background: rgba(255,255,255,.14); }
.ctl-btn.speed { font-size: 12px; font-weight: 600; min-width: 42px; }
.ctl-btn.dl { text-decoration: none; font-size: 15px; }
.time-current, .time-total {
  font-size: 12px;
  color: #dfe6f0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.spacer { flex: 1; }
.progress-wrap {
  flex: 1;
  cursor: pointer;
  padding: 6px 0;
  position: relative;
}
.progress-bar {
  height: 4px;
  background: rgba(255,255,255,.28);
  border-radius: 2px;
  position: relative;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
}
.progress-hover {
  position: absolute; top: -6px; bottom: -6px;
  width: 1px; background: rgba(255,255,255,.5);
  display: none;
}
.progress-wrap.hover .progress-hover { display: block; }
.progress-thumb {
  position: absolute; top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  display: none;
  box-shadow: 0 0 4px rgba(0,0,0,.5);
}
.progress-wrap.dragging .progress-thumb,
.progress-bar:hover ~ .progress-thumb { display: block; }
.video-title {
  position: absolute;
  top: 12px; left: 14px; right: 14px;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity .25s;
}
.player-shell:hover .video-title { opacity: 1; }

/* ── video list item ── */
.v-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.v-item:hover { background: var(--panel2); }
.v-item.active { background: rgba(79,140,255,.14); }
.v-thumb {
  width: 120px; height: 68px;
  flex-shrink: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #1c232d, #131922);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
}
.v-thumb .dur {
  position: absolute;
  right: 4px; bottom: 4px;
  font-size: 11px;
  background: rgba(0,0,0,.75);
  padding: 1px 5px;
  border-radius: 4px;
  color: #fff;
}
.v-info { flex: 1; min-width: 0; }
.v-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
}
.v-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
  font-size: 13px;
}

/* ── footer ── */
.foot {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ── responsive ── */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .list-panel { width: 100%; max-height: 320px; }
  .player-shell { aspect-ratio: 16/10; }
}
