/* 直播聚合 · 纯前端版 样式（自包含，不依赖任何外部 CSS 框架） */
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f242e;
  --line: #2a2f3a;
  --text: #e6e8ec;
  --muted: #9aa3b2;
  --brand: #ff4d6d;
  --brand-2: #ff8a5b;
  --accent: #38bdf8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
}
.topbar .brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.topbar .hint { font-size: 12px; opacity: .9; }
.topbar .spacer { flex: 1; }
.topbar a.update { color: #fff; opacity: .92; font-size: 12px; text-decoration: none; }
.menu-btn {
  display: none; background: rgba(0,0,0,.18); color: #fff; border: 0;
  border-radius: 6px; padding: 6px 10px; font-size: 16px; cursor: pointer;
}

/* 布局 */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  width: 200px; flex: 0 0 200px;
  background: var(--panel); border-right: 1px solid var(--line);
  height: calc(100vh - 52px); overflow-y: auto; position: sticky; top: 52px;
}
.sidebar .nav { list-style: none; margin: 0; padding: 8px; }
.sidebar .nav li { margin: 2px 0; }
.sidebar .nav a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar .nav a:hover { background: var(--panel-2); }
.sidebar .nav a.active { background: var(--brand); color: #fff; }
.sidebar .sidebar-bottom { padding: 12px; }
.sidebar .sidebar-bottom img { width: 100%; border-radius: 8px; opacity: .85; }

.main { flex: 1; padding: 16px; min-width: 0; }
.section-title { font-size: 15px; margin: 4px 0 14px; color: var(--muted); }

/* 直播网格（等价于原版 placeholders） */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.room {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.room:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.room .thumb {
  position: relative; width: 100%; aspect-ratio: 16 / 10; background: #000;
  overflow: hidden;
}
.room .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #111 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><rect width="40" height="40" fill="%23111"/><circle cx="20" cy="20" r="8" fill="%23333"/></svg>') center/40px no-repeat;
}
.room .thumb .live {
  position: absolute; top: 8px; left: 8px; background: var(--brand);
  color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px;
}
.room .title {
  padding: 9px 10px; font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 状态提示 */
.state { padding: 40px 16px; text-align: center; color: var(--muted); }
.state.error { color: #ff9a9a; }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%;
  margin: 0 auto 12px; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 播放页 */
.player-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.player-box {
  background: #000; border-radius: 12px; overflow: hidden;
  aspect-ratio: 16 / 9; position: relative;
}
.player-box video { width: 100%; height: 100%; background: #000; display: block; }
/* video.js 会包一层 .video-js，必须让它撑满黑框，否则只显示默认 300x150 小窗 */
.player-box .video-js { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.player-meta { margin: 14px 0; }
.player-meta h2 { margin: 0 0 6px; font-size: 18px; }
.player-meta .src { color: var(--muted); font-size: 12px; word-break: break-all; }
.player-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 8px; cursor: pointer; text-decoration: none;
  font-size: 13px;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.player-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 20px; text-align: center;
}

/* 移动端适配（替代原 m.php / zblist.php 的移动端页面） */
@media (max-width: 768px) {
  .menu-btn { display: inline-block; }
  .layout { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 52px; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .2s; width: 220px;
    box-shadow: 0 0 30px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.5); z-index: 55;
  }
  .sidebar-backdrop.show { display: block; }
  .main { padding: 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .topbar .hint { display: none; }
}
