/* ============================================================
   NOIR — watch together
   monochrome / editorial / quiet luxury
   ============================================================ */

:root {
  --bg: #070707;
  --bg-soft: #0b0b0b;
  --panel: #0d0d0d;
  --line: #191919;
  --line-strong: #2a2a2a;
  --line-bright: #3d3d3d;
  --text: #efefef;
  --text-soft: #c9c9c9;
  --muted: #8a8a8a;
  --muted-2: #565656;
  --muted-3: #3a3a3a;
  --white: #ffffff;
  --radius: 3px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --serif: Georgia, "Times New Roman", "Songti SC", serif;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

::selection { background: #fff; color: #000; }

/* ---------- 通用控件 ---------- */

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), transform .12s var(--ease);
}

.btn:hover { background: var(--white); border-color: var(--white); color: #000; }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--white);
  border-color: var(--white);
  color: #000;
}

.btn.primary:hover { background: #d6d6d6; border-color: #d6d6d6; }

.ghost {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}

.ghost:hover { color: var(--white); border-color: var(--line-bright); }

input {
  font-family: var(--sans);
  outline: none;
}

.gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.brand {
  font-size: 42px;
  font-weight: 200;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--white);
  line-height: 1;
}

.brand .dot { color: var(--muted-3); }

.brand.small {
  font-size: 15px;
  letter-spacing: .3em;
  text-indent: .3em;
  font-weight: 300;
}

.field { display: flex; flex-direction: column; gap: 9px; }

.field label {
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.field input {
  width: 100%;
  padding: 13px 15px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  letter-spacing: .16em;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.field input::placeholder { color: var(--muted-3); letter-spacing: .06em; }
.field input:focus {
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, .02);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .035);
}

.field-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--muted-3);
}

#roomInput { text-transform: uppercase; letter-spacing: .3em; }
.gate-actions .btn { flex: 1; padding: 13px 18px; }

.hint {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .04em;
  color: var(--muted-2);
}

.gate-footer .line { flex: 1; height: 1px; background: var(--line); }

/* ---------- 顶栏 ---------- */

.app { height: 100vh; display: flex; flex-direction: column; }
.app.hidden { display: none; }

.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 62px;
  padding: 0 30px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 7, .92);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-meta .label {
  font-size: 9px;
  letter-spacing: .3em;
  color: var(--muted-3);
}

.room-meta .code {
  font-size: 13px;
  letter-spacing: .32em;
  color: var(--text-soft);
  font-weight: 400;
}

.status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}

.status b { font-weight: 400; color: var(--text-soft); }
.status .divider { color: var(--muted-3); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dot.connecting { background: var(--muted-2); animation: breathe 1.4s infinite; }
.dot.online { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .5); }
.dot.reconnecting { background: var(--muted); animation: breathe .8s infinite; }

@keyframes breathe {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* ---------- 舞台 ---------- */

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
}

.player-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  padding: 26px;
}

.video-shell {
  position: relative;
  width: 100%;
  max-height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  background: #000;
}

.video-shell video.visible { display: block; }

/* 禁止浏览器/内置内核自带的视频控件出现（Via、X5 等内核会自己加一套） */
.video-shell video::-webkit-media-controls,
.video-shell video::-webkit-media-controls-panel,
.video-shell video::-webkit-media-controls-enclosure,
.video-shell video::-webkit-media-controls-play-button,
.video-shell video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
}

/* 长按倍速提示 */
.hold-badge {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  font-size: 11px;
  letter-spacing: .08em;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 2px;
  pointer-events: none;
  z-index: 6;
}

.hold-badge.hidden { display: none; }

/* 房主操作提示（暂停 / 倍速 / 换片） */
.player-notice {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -6px);
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: .06em;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
  z-index: 7;
}

.player-notice.show { opacity: 1; transform: translate(-50%, 0); }

.watch-time {
  margin: 0;
  padding: 8px 0 2px;
  font-size: 13px;
  letter-spacing: .04em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ---------- 弹幕 ---------- */

.danmaku-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}

.danmaku-layer.hidden { display: none; }

.danmaku-layer.paused .danmaku { animation-play-state: paused; }

.danmaku {
  position: absolute;
  left: 100%;
  white-space: nowrap;
  color: #fff;
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 500;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .55);
  animation: dm-move linear forwards;
  will-change: transform;
}

@keyframes dm-move {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--dm-travel, -2200px)); }
}

/* 房主正在挑片源时，观众看到的等待页 */
.wait-host {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .1em;
  z-index: 7;
}

.wait-host.hidden { display: none; }

.wait-host span { animation: wait-pulse 1.8s ease-in-out infinite; }

@keyframes wait-pulse {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

/* 空状态 */

.video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  text-align: center;
  padding: 40px;
  overflow-y: auto;
  background:
    radial-gradient(700px 380px at 50% 0%, rgba(255, 255, 255, .035), transparent 70%),
    #000;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}

.video-empty > * { flex-shrink: 0; }

/* 播放中切换片源时，让画面透出一点 */
.video-empty.on-top {
  background: rgba(7, 7, 7, .92);
  backdrop-filter: blur(6px);
  z-index: 8;
}

/* 片源面板打开时，控制条不参与显示，避免压在面板上面 */
.video-empty:not(.hidden) ~ .controls {
  opacity: 0 !important;
  pointer-events: none !important;
}

.video-empty.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.empty-mark {
  font-size: 26px;
  color: var(--muted-3);
  margin-bottom: 18px;
}

.empty-title {
  font-size: 13px;
  letter-spacing: .42em;
  text-indent: .42em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 14px;
}

.empty-copy {
  max-width: 430px;
  margin: 0 0 26px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted-2);
}

.btn.hidden { display: none; }

.url-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}

/* 手机端才显示的小标签（视频地址： / 选择视频源：） */
.fs-label { display: none; }

.url-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  letter-spacing: .04em;
  transition: border-color .2s;
}

.url-row input:focus { border-color: var(--line-bright); }
.url-row input::placeholder { color: var(--muted-3); }
.url-row .btn {
  padding: 10px 18px;
  letter-spacing: .12em;
}

/* 解析中：按钮里换成转圈动画，尺寸不变 */
.url-row .btn { position: relative; }

.url-row .btn.loading {
  color: transparent;
  letter-spacing: 0;
}

.url-row .btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(0, 0, 0, .25);
  border-top-color: rgba(0, 0, 0, .85);
  border-radius: 50%;
  animation: url-btn-spin .7s linear infinite;
}

@keyframes url-btn-spin {
  to { transform: rotate(360deg); }
}

/* 候选视频源列表 */

.candidates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 460px;
  max-height: 190px;
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.candidates.hidden { display: none; }

/* 解析结果选择框（只在手机端使用，桌面用原来的候选列表） */
.src-select {
  display: none;
  align-items: center;
  gap: 8px;
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 10px auto 0;
}

.src-select.hidden { display: none; }

.src-select-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.src-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 13px;
  background: #0d0d0d;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .2s;
}

.src-select-btn:hover { border-color: #5a5a5a; }

/* 没解析出源之前：置灰、不能点 */
.src-select-btn:disabled,
.src-select .btn:disabled {
  opacity: .4;
  cursor: default;
  pointer-events: none;
}

.src-select-btn:disabled { border-color: var(--line); color: var(--muted); }

.src-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 没解析时框里显示的占位说明 */
.src-select-label:empty::before {
  content: '网址解析视频列表';
  color: var(--muted-2);
}

.src-select-caret { color: var(--muted); font-size: 11px; }

.src-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow-y: auto;
  background: #111;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .7);
  z-index: 30;
}

.src-select-menu.hidden { display: none; }

.src-select-menu button {
  display: block;
  width: 100%;
  padding: 11px 13px;
  background: none;
  border: none;
  text-align: left;
  color: #cfcfcf;
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.src-select-menu button:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.cand-title {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted-2);
  margin-bottom: 2px;
}

.cand-btn {
  appearance: none;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  padding: 9px 12px;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all .2s var(--ease);
}

.cand-btn:hover {
  background: var(--white);
  color: #000;
  border-color: var(--white);
}

.upload-progress.hidden { display: none; }

/* 控制条 */

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 20px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .88));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 5;
}

/* 桌面（有精确指针）才用 hover 显示控制条，触屏规则在 mobile.css */
.controls.pinned { opacity: 1; transform: none; }

/* 未载入影片时不显示控制条 */
.video-empty:not(.hidden) ~ .controls { opacity: 0; pointer-events: none; }

/* 弹幕输入（控制行中间居中） */

.danmaku-bar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 8px;
  min-width: 0;
}

.danmaku-bar input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 2px;
  color: #fff;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: .03em;
  transition: border-color .2s, background .2s;
}

.danmaku-bar input::placeholder { color: rgba(255, 255, 255, .35); }
.danmaku-bar input:focus { border-color: rgba(255, 255, 255, .55); background: rgba(0, 0, 0, .6); }

.danmaku-bar .send-dm {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .25);
  color: #eee;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .16em;
  padding: 7px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s var(--ease);
}

.danmaku-bar .send-dm:hover {
  background: var(--white);
  border-color: var(--white);
  color: #000;
}

.danmaku-bar .icon-btn { color: rgba(255, 255, 255, .45); }
.danmaku-bar .icon-btn.active { color: #fff; }

.progress {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.progress .track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, .16);
  transition: height .15s;
}

.progress:hover .track { height: 5px; }

.progress .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--white);
}

.progress .knob {
  position: absolute;
  left: 0%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%) scale(0);
  transition: transform .15s var(--ease);
  pointer-events: none;
}

.progress:hover .knob,
.progress.dragging .knob { transform: translate(-50%, -50%) scale(1); }

/* 观众：进度条完全锁定，不给点也不给拖 */
.progress.locked { pointer-events: none; cursor: default; }
.progress.locked .knob { display: none; }

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
}

.control-left,
.control-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* 小屏相关规则见 mobile.css */

.icon-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}

.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.vol-slider {
  position: relative;
  width: 16px;
  height: 92px;
}

.vol-range {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 2px;
  margin: 0;
  padding: 0;
  background: linear-gradient(to right,
    #fff 0,
    #fff calc(var(--vol, .5) * 100%),
    rgba(255, 255, 255, .22) calc(var(--vol, .5) * 100%),
    rgba(255, 255, 255, .22) 100%);
  outline: none;
  cursor: pointer;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.vol-range::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
}

.vol-range::-moz-range-track {
  height: 2px;
  background: transparent;
}

.vol-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #fff;
  /* 轨道 2px、圆点 10px：上移 4px 让圆心正好落在轨道中线上 */
  margin-top: -4px;
}

.vol-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #fff;
}

.time {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time-sep { margin: 0 4px; color: var(--muted-3); }

/* ---------- 侧栏 ---------- */

.side {
  width: 336px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.side-title {
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--muted);
}

.side-sub {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted-3);
  margin-left: auto;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  align-self: flex-start;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
  animation: msgIn .3s var(--ease) both;
  word-break: break-word;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.msg .who {
  display: block;
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted-3);
}

.msg .text {
  display: inline-block;
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  color: var(--text-soft);
  background: transparent;
}

.msg.self {
  align-self: flex-end;
  align-items: flex-end;
}

.msg.self .who { color: var(--muted); }
.msg.self .text { border-color: rgba(255, 255, 255, .32); }

.msg.system {
  align-self: center;
  display: block;
  border: none;
  padding: 2px 0;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .03em;
  text-align: center;
}

.msg.system .sys-name {
  color: rgba(255, 255, 255, .8);
}

/* 弹幕消息（聊天区同步显示） */

.danmaku-msg {
  padding-left: 0;
  border-left: none;
}

.danmaku-msg .who { color: var(--muted-2); }

.dm-tag {
  display: inline-block;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--muted-3);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
}

.dm-switch {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .2em;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  margin-left: 10px;
  transition: all .2s var(--ease);
}

.dm-switch:hover { color: var(--white); border-color: var(--line-bright); }
.dm-switch.active {
  color: #fff;
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, .06);
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 13px;
  font-size: 12px;
  letter-spacing: .03em;
  transition: border-color .2s;
}

.chat-form input:focus { border-color: var(--line-strong); }
.chat-form input::placeholder { color: var(--muted-3); }

.send {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 0 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all .2s var(--ease);
}

.send:hover {
  background: var(--white);
  border-color: var(--white);
  color: #000;
}

.send.dm-send {
  font-size: 10px;
  letter-spacing: .1em;
  padding: 0 10px;
  min-width: 34px;
  justify-content: center;
}

/* ---------- 提示条 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: #fff;
  color: #000;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 12px;
  letter-spacing: .05em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 100;
  max-width: 80vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 响应式（全部在 mobile.css 里） ---------- */

/* 真·系统全屏时铺满屏幕 */
.video-shell:fullscreen {
  width: 100%;
  height: 100%;
  max-height: none;
  border: none;
  border-radius: 0;
}

.video-shell:fullscreen video { object-fit: contain; }

/* 全屏时控制条：桌面靠鼠标移动短暂显示；触屏用点击切换 */
.video-shell:fullscreen .controls,
.video-shell.web-fs .controls { opacity: 0; transform: translateY(4px); pointer-events: none; }
.video-shell:fullscreen .controls.pinned,
.video-shell.web-fs .controls.pinned { opacity: 1; transform: none; pointer-events: auto; }

/* 页面内全屏（手机用）：不走系统全屏 API，避免被浏览器自带的视频播放器接管 */
.video-shell.web-fs {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-height: none;
  z-index: 300;
  background: #000;
  border-radius: 0;
  border: none;
}

.video-shell.web-fs video { object-fit: contain; }

/* ============================================================
   夜之子 · 登录 / 大厅 / 房间分区
   ============================================================ */

.view { height: 100vh; height: 100dvh; }
.view.hidden { display: none; }

/* ---------- 登录 / 注册 ---------- */

.auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow-y: auto;
  background:
    radial-gradient(1100px 640px at 76% -12%, rgba(255, 255, 255, .055), transparent 62%),
    radial-gradient(820px 520px at 6% 112%, rgba(255, 255, 255, .028), transparent 62%),
    var(--bg);
}

.auth-inner {
  width: 100%;
  max-width: 420px;
  animation: rise .8s var(--ease) both;
}

.auth-tabs {
  display: flex;
  gap: 26px;
  margin: 40px 0 26px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .24em;
  padding: 0 0 13px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}

.auth-tab:hover { color: var(--text-soft); }
.auth-tab.active { color: #fff; border-color: #fff; }

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form.hidden { display: none; }
.auth-submit { margin-top: 8px; padding: 14px; }

.pw-wrap { position: relative; display: flex; }
.pw-wrap input { width: 100%; padding-right: 46px; }

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted-3);
  cursor: pointer;
  padding: 8px;
  display: flex;
  border-radius: 2px;
  transition: color .2s;
}

.pw-toggle:hover, .pw-toggle.on { color: var(--text-soft); }

.form-error {
  min-height: 16px;
  margin: 0;
  font-size: 11px;
  letter-spacing: .04em;
  color: #d18a8a;
}

.form-error:empty { min-height: 0; }

.code-input {
  text-transform: uppercase;
  letter-spacing: .42em !important;
  font-size: 17px !important;
}

/* ---------- 大厅 ---------- */

.lobby-view { display: flex; flex-direction: column; background: var(--bg); }
.lobby-view.hidden { display: none; }

.lobby-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
}

.user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, .5);
}

.lobby {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  overflow-y: auto;
}

.lobby-head { margin-bottom: 34px; }

.lobby-title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 300;
  letter-spacing: .24em;
  text-indent: .24em;
}

.lobby-sub {
  margin: 0;
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--muted-2);
}

.lobby-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.lobby-tab {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .16em;
  padding: 0 0 14px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}

.lobby-tab:hover { color: var(--text-soft); }
.lobby-tab.active { color: #fff; border-color: #fff; }

.lobby-panel { display: flex; flex-direction: column; gap: 18px; }
.lobby-panel.hidden { display: none; }

.panel-row { display: flex; align-items: center; justify-content: space-between; }

.panel-label {
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.room-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}

.room-row:last-child { border-bottom: none; }
.room-row:hover { background: #111; }

.room-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-soft);
  letter-spacing: .03em;
  margin-bottom: 7px;
}

.room-row-meta {
  display: flex;
  gap: 16px;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted-3);
}

.room-row-code { color: var(--muted); letter-spacing: .3em; }

.small-btn { padding: 8px 16px !important; font-size: 11px !important; letter-spacing: .12em !important; }

.lobby-empty {
  margin: 0;
  padding: 30px 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--muted-3);
  border: 1px dashed var(--line);
  border-radius: 3px;
}

.lobby-empty.hidden { display: none; }

.quick-join {
  display: flex;
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.quick-code-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: .42em;
  text-transform: uppercase;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.quick-code-input::placeholder {
  color: var(--muted-3);
  letter-spacing: .04em;
  font-size: 12px;
  text-transform: none;
}

.quick-code-input:focus {
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, .02);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .035);
}

.quick-join-btn {
  padding: 13px 26px !important;
  flex-shrink: 0;
}

/* ---------- 类型选择 ---------- */

.segmented {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  overflow: hidden;
}

.seg-btn {
  flex: 1;
  appearance: none;
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .12em;
  padding: 12px 6px;
  cursor: pointer;
  transition: all .2s var(--ease);
}

.seg-btn:last-child { border-right: none; }
.seg-btn:hover { color: #fff; }
.seg-btn.active { background: #fff; color: #000; }

/* ---------- 房间顶栏扩展 ---------- */

.room-name {
  font-size: 13px;
  color: var(--text);
  letter-spacing: .04em;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-badge {
  font-size: 9px;
  letter-spacing: .16em;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
}

.room-badge.friend { color: #e6e6e6; border-color: var(--line-bright); }
.room-badge.private { color: #fff; border-color: #555; }

.leave-btn { margin-left: 8px; }

/* 小屏相关规则见 mobile.css */

/* ---------- 观众模式（公开房） ---------- */

.icon-btn:disabled,
.btn:disabled,
select:disabled {
  opacity: .28;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn.primary:disabled:hover {
  background: var(--white);
  color: #000;
  border-color: var(--white);
}

.spectator-hint {
  margin: 10px 0 0;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted-2);
}

.spectator-hint.hidden { display: none; }

#sourceControls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#sourceControls.hidden { display: none; }

/* ---------- 用户名按钮 ---------- */

.user-name-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .06em;
  cursor: pointer;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}

.user-name-btn:hover { color: #fff; border-color: var(--line-bright); }

/* ---------- 官方标识 ---------- */

.official-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  padding: 0 7px;
  font-size: 9px;
  line-height: 1;
  letter-spacing: .08em;
  text-indent: .08em;
  color: #000;
  background: #fff;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- 个人资料弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  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, .7);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0b0b0b;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  animation: rise .35s var(--ease) both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--text-soft);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.inline-row { display: flex; gap: 8px; }
.inline-row input { flex: 1; min-width: 0; }

.security-question {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: .03em;
}

/* ---------- 搜索房间 ---------- */

.search-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result.hidden { display: none; }

.search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  animation: rise .35s var(--ease) both;
}

.search-row .room-row-meta { gap: 14px; }
.search-row .lock-tag { color: var(--muted); }

/* 房间锁图标 */
.room-lock {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  flex-shrink: 0;
}

.room-lock svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* ---------- 弹幕开关图标状态 ---------- */

.dm-slash { display: none; }
#btnDanmaku:not(.active) { color: var(--muted-2); }
#btnDanmaku:not(.active) .dm-slash { display: block; }

/* 手机端专用：控制条里的弹幕开关（桌面不显示，桌面用控制条里的弹幕栏按钮） */
#btnDanmakuMini { display: none; color: rgba(255, 255, 255, .45); }
#btnDanmakuMini.active { color: #fff; }
#btnDanmakuMini:not(.active) .dm-slash { display: block; }

/* ---------- 密码弹窗 ---------- */

.modal-card.small-card { max-width: 360px; }

.pw-room {
  margin: 0;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
}

.modal-actions {
  align-items: center;
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.modal-actions .btn { flex: 1; }

/* ---------- 管理成员 ---------- */

.who-clickable {
  cursor: pointer;
  transition: color .2s;
}

.who-clickable:hover { color: #fff; }

.mod-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mod-actions .btn { width: 100%; }

.mod-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.mod-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.mod-check input {
  accent-color: #fff;
  width: 14px;
  height: 14px;
}

.mod-cancel { margin-top: 2px; }

/* ---------- 用户资料卡 ---------- */

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.profile-label {
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
}

.profile-value {
  color: var(--text-soft);
}

.online-bar.hidden { display: none; }
.online-more.hidden { display: none; }

/* ---------- 房间内成员列表 ---------- */

.room-members {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  min-height: 34px;
  white-space: nowrap;
  overflow: visible;
  cursor: pointer;
}

.members-label {
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--muted-2);
  flex-shrink: 0;
}

.members-names {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
}

.members-pop {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(8, 8, 8, .98);
  border-bottom: 1px solid var(--line-strong);
  padding: 10px 22px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 2;
  color: var(--text-soft);
  white-space: normal;
  cursor: default;
}

.members-pop.hidden { display: none; }

.members-pop div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 音量弹出面板 / 清晰度与倍速菜单 ---------- */

.vol-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.vol-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 3px;
  padding: 10px 8px 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s, visibility .18s;
  z-index: 40;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .65);
}

.vol-percent {
  font-size: 11px;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* 静音快捷按钮：只在手机端（音量弹层）显示 */
.vol-mute {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 2px;
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .06em;
  padding: 6px 10px;
  white-space: nowrap;
  cursor: pointer;
}

.vol-mute:active { background: rgba(255, 255, 255, .16); }

/* 悬停展开弹层的规则在 desktop.css（触屏不适用） */

.pop-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ctrl-text {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .06em;
  padding: 4px 6px;
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s, background .2s;
}

.ctrl-text:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.ctrl-text:disabled { opacity: .35; cursor: default; }

.ctrl-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 92px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 3px;
  padding: 4px;
  z-index: 40;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .65);
}

.ctrl-pop.hidden { display: none; }

.ctrl-pop button {
  appearance: none;
  background: transparent;
  border: none;
  width: 100%;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .06em;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
}

.ctrl-pop button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.ctrl-pop button.active { background: var(--white); color: #000; }

/* ---------- 免责协议勾选 ---------- */
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted-2);
  cursor: pointer;
  user-select: none;
}

.agree-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  flex: 0 0 14px;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}

.agree-row input[type="checkbox"]:checked {
  background: var(--white);
  border-color: var(--white);
}

.agree-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid #000;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

.agree-row span { flex: 1 1 auto; }

.agree-row.agree-warn { color: #fff; }
.agree-row.agree-warn input[type="checkbox"] { border-color: #fff; }
.agree-row.agree-warn { animation: agree-shake .4s; }

@keyframes agree-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.footer-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link:hover { color: var(--text); }

/* 免责协议弹窗 */
.disclaimer-card {
  max-width: 620px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.disclaimer-card .modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.disclaimer-card .modal-actions .btn {
  flex: 0 0 auto;
  width: auto;
  padding: 9px 26px;
}

.disclaimer-body {
  overflow-y: auto;
  gap: 0;
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted-2);
}

.disclaimer-body p { margin: 0 0 12px; }
.disclaimer-body p:last-child { margin-bottom: 0; }
.disclaimer-body b { color: var(--text); font-weight: 500; }
.disclaimer-foot { color: var(--muted); }

