/* ===== 云一起看 · 深色影院主题 ===== */
:root {
  --bg: #0d0f1a;
  --bg2: #151827;
  --panel: #1b1f30;
  --panel2: #222740;
  --line: #2c3252;
  --txt: #e8eaf2;
  --muted: #9aa0bf;
  --accent: #6c8cff;
  --accent2: #ff6b9d;
  --ok: #2ec4b6;
  --danger: #ff5c7a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1f3a 0%, var(--bg) 60%);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

#app { min-height: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: rgba(20, 24, 40, 0.7);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.brand.small { font-size: 16px; }
.sub { color: var(--muted); font-size: 13px; }
.room-meta { color: var(--muted); font-size: 12px; }
.topbar .btn { margin-left: auto; }
.topbar .roombar .btn + .btn { margin-left: 8px; }

/* 卡片 / 大厅 */
.lobby {
  max-width: 980px;
  margin: 28px auto;
  padding: 0 18px;
  display: grid;
  gap: 18px;
}
.lobby.center { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 420px; width: 100%; }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--txt); }

.rooms-list { display: grid; gap: 12px; }
.room-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.room-name { font-weight: 700; }
.room-meta { color: var(--muted); font-size: 12px; }
.room-card .btn { margin-left: auto; }

.form { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; padding: 2px 4px; border-left: 2px solid var(--accent); background: rgba(108, 140, 255, 0.08); }
.err { color: var(--danger); font-size: 13px; margin: 0 0 10px; }
.link { display: inline-block; margin-top: 10px; font-size: 13px; }

/* 输入与按钮 */
.inp {
  width: 100%;
  background: #11141f;
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.18); }
.btn {
  background: var(--panel2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #7b94ff, #5a78f0); border-color: #5a78f0; color: #fff; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.tiny { padding: 2px 7px; font-size: 12px; border-radius: 8px; }
.btn.icon { width: 42px; height: 42px; padding: 0; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }

/* 房间布局 */
.room-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* 媒体区 */
.media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.media-el { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.media-el.comic { object-fit: contain; }
.now-playing {
  position: absolute; left: 10px; bottom: 10px; z-index: 5;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 8px; max-width: 80%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.empty-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; text-align: center; padding: 20px;
}

/* 弹幕层 */
.danmaku-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.danmaku {
  position: absolute; left: 0; top: 5%;
  white-space: nowrap; font-weight: 700; font-size: 18px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  will-change: transform;
}

/* 播放控制条 */
.playback-bar {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px;
}
.pb-left { display: flex; gap: 8px; }
.pb-mid { flex: 1; display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; accent-color: var(--accent); }
.time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 弹幕 / 表情输入行 */
.input-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* 顶部工具条（弹幕输入框移至舞台顶部时使用） */
.input-bar {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.danmaku-inp { flex: 1; min-width: 180px; }
.reaction-bar { display: flex; gap: 6px; }
.react {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  width: 34px; height: 34px; font-size: 17px; cursor: pointer;
}
.react:hover { border-color: var(--accent2); transform: translateY(-1px); }

/* 侧栏面板 */
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.list { display: grid; gap: 8px; max-height: 240px; overflow: auto; }
.muted { color: var(--muted); font-size: 13px; }

.add-row { display: grid; gap: 8px; margin-bottom: 12px; }

/* 播放列表项 */
.pl-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; cursor: pointer;
}
.pl-item:hover { border-color: var(--accent); }
.pl-item.active { border-color: var(--ok); background: #1d2a2a; }
.pl-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-type { color: var(--muted); font-size: 11px; text-transform: uppercase; }

/* 成员项 */
.mem-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mem-role { margin-left: 2px; padding: 1px 6px; font-size: 11px; border-radius: 999px; background: rgba(255,255,255,0.12); color: #ffd166; flex: none; }
.mem-item .btn.tiny { margin-left: auto; }
.mem-item .btn.tiny + .btn.tiny { margin-left: 4px; }

/* 危险操作按钮（解散/踢人） */
.btn.danger { background: linear-gradient(180deg, #ff7a7a, #e0524f); border-color: #e0524f; color: #fff; font-weight: 700; }

/* 聊天 */
.chat-panel { display: flex; flex-direction: column; }
.chat-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; margin-bottom: 10px; }
.chat-line { font-size: 13px; word-break: break-word; }
.chat-name { font-weight: 700; }
.chat-input { display: flex; gap: 8px; }
.chat-input .inp { flex: 1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: rgba(20, 24, 40, 0.96); border: 1px solid var(--line);
  color: var(--txt); padding: 10px 16px; border-radius: 10px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 响应式 */
@media (max-width: 880px) {
  .room-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}
