/*
 * TV 直播平台 - 主播端样式
 * 布局：顶部状态栏 + 左列画面预览/直播控制 + 右列观众互动 + 直播源管理 + 设置
 * 设计规范：暗色专业风格，全站禁止使用 emoji
 */

:root {
  --bg: #0b0d12;
  --bg-soft: #10131a;
  --card: #151923;
  --card-hover: #1a1f2b;
  --border: #232a38;
  --border-soft: #1c222e;
  --text: #e8ebf0;
  --text-2: #a6adba;
  --text-3: #6b7280;
  --brand: #e5484d;
  --brand-2: #ff6b4a;
  --ok: #30a46c;
  --warn: #f5a524;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

[hidden] { display: none !important; }

/* ---------- 登录 ---------- */

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 18% -8%, rgba(229, 72, 77, 0.13), transparent 60%),
    radial-gradient(800px 400px at 110% 110%, rgba(49, 71, 136, 0.16), transparent 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
}

.login-brand { text-align: center; margin-bottom: 26px; }

.login-mark { color: var(--brand); display: inline-flex; }

.login-title { font-size: 21px; font-weight: 800; letter-spacing: 0.5px; margin-top: 10px; }

.login-sub { font-size: 13px; color: var(--text-3); margin-top: 5px; }

.login-form .field { margin-bottom: 16px; }

.login-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
}

/* ---------- 表单控件 ---------- */

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

.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.field-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

textarea.field-input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.6; }

.field-mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
}

.field-input:focus {
  border-color: rgba(229, 72, 77, 0.55);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.14);
}

.field-input::placeholder { color: var(--text-3); }

.field-tip { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a6adba' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

select.field-input option { background: var(--card); color: var(--text); }

.pwd-wrap { position: relative; }

.pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pwd-toggle:hover { color: var(--text-2); background: var(--card-hover); }

.form-error {
  font-size: 12.5px;
  color: #ff8589;
  margin: 2px 0 12px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, filter 0.16s, background 0.16s, border-color 0.16s, color 0.16s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(229, 72, 77, 0.32);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-ghost {
  background: var(--card);
  border-color: var(--border);
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: #33405a; background: var(--card-hover); }

.btn-live {
  background: linear-gradient(135deg, #e5484d, #ff6b4a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(229, 72, 77, 0.32);
}

.btn-live:hover:not(:disabled) { filter: brightness(1.08); }

.btn-danger {
  background: rgba(229, 72, 77, 0.14);
  border-color: rgba(229, 72, 77, 0.4);
  color: #ff8589;
}

.btn-danger:hover:not(:disabled) { background: rgba(229, 72, 77, 0.22); }

.btn-block { width: 100%; height: 42px; font-size: 14.5px; letter-spacing: 2px; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }

/* ---------- 主播端框架 ---------- */

.studio-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.studio-top-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); min-width: 0; }

.brand-mark { display: inline-flex; align-items: center; flex-shrink: 0; }

.brand-mark img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.brand-name em { font-style: normal; color: var(--brand); margin-left: 1px; }

.brand-side {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.studio-status { display: flex; align-items: center; gap: 10px; }

.studio-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
}

.studio-stat b { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.studio-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.studio-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 22px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.studio-foot {
  border-top: 1px solid var(--border-soft);
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-soft);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.card-hint { font-size: 12px; color: var(--text-3); }

.card-body { padding: 18px; }

.state-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3.5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--bg);
  flex-shrink: 0;
}

.state-badge[data-state="live"] {
  color: #ffb3b5;
  border-color: rgba(240, 67, 74, 0.45);
  background: rgba(240, 67, 74, 0.12);
}

/* ---------- 主网格布局 ---------- */

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch; /* 两列等高，避免右侧聊天卡比左侧高造成空白 */
}

.studio-grid-2 { grid-template-columns: 1fr 1fr; }

.studio-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; height: 100%; }

/* ---------- 画面预览（与观众端播放器一致） ---------- */

/* 预览卡整列全宽：按内容（整列宽 x 16:9）自然定高，不拉伸 */
.preview-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  flex: 1 1 auto; /* 基线为 16:9 内容高度，有剩余空间时生长填满 */
  background: #000;
  overflow: hidden;
}

/* ---------- 播放器控制条（观众端同款） ---------- */

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: linear-gradient(to top, rgba(6, 8, 11, 0.92), rgba(6, 8, 11, 0));
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 8;
}

.player-box:hover .controls,
.player-box:focus-within .controls { opacity: 1; }

.controls[hidden] { display: none; }

.ctrl-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #dfe3ea;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s, color 0.16s;
  flex-shrink: 0;
}

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

.volume-wrap { display: flex; align-items: center; gap: 4px; }

.volume {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  outline: none;
  cursor: pointer;
  transition: width 0.25s;
}

.volume-wrap:hover .volume,
.volume:focus { width: 78px; }

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
}

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

.ctrl-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-left: 6px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls-spacer { flex: 1; }

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #1a1206;
  background: linear-gradient(135deg, #ffd98a, #f5a524);
  border-radius: 5px;
  flex-shrink: 0;
  user-select: none;
}

.quality-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1a1206;
}

.spinner { display: inline-flex; gap: 7px; margin-bottom: 4px; }

.spinner span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: studio-bounce 1s infinite ease-in-out;
}

.spinner span:nth-child(2) { animation-delay: 0.15s; }
.spinner span:nth-child(3) { animation-delay: 0.3s; }

@keyframes studio-bounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.overlay-text { color: var(--text-2); font-size: 14px; }

.preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8, 10, 14, 0.92);
  text-align: center;
  padding: 20px;
  z-index: 5;
}

.preview-overlay[hidden] { display: none; }

.preview-offline-icon { color: #3a4356; }

.preview-offline-text { color: var(--text-3); font-size: 13px; max-width: 300px; }

/* ---------- 直播控制 ---------- */

.control-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}

.control-actions { display: flex; gap: 10px; }

.play-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-soft);
}

.play-line { font-size: 13px; color: var(--text-3); }

.play-line b { color: var(--text); font-weight: 600; }

/* ---------- 观众互动 ---------- */

.chat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
}

.studio-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-chat-list::-webkit-scrollbar { width: 6px; }
.studio-chat-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.chat-empty {
  margin: auto;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
  padding: 30px 0;
}

/* 聊天消息行（与观众端一致风格） */
.chat-row {
  position: relative;
  padding: 9px 12px 9px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  line-height: 1.5;
}

.chat-row.role-admin { background: rgba(245, 165, 36, 0.08); border-color: rgba(245, 165, 36, 0.3); }
.chat-row.role-system { background: rgba(255, 255, 255, 0.03); border-color: var(--border-soft); }

.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.chat-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
}

.role-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.role-badge.admin { background: linear-gradient(135deg, #ffd98a, #f5a524); color: #1a1206; }
.role-badge.system { background: rgba(255, 255, 255, 0.08); color: var(--text-3); }

.chat-text {
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-del {
  position: absolute;
  right: 8px;
  top: 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  font-size: 11.5px;
  cursor: pointer;
  opacity: 0;
  padding: 2px 6px;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.chat-row:hover .chat-del { opacity: 1; }
.chat-del:hover { color: #ff8589; background: rgba(229, 72, 77, 0.12); }

.studio-chat-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
}

.chat-input {
  flex: 1;
  height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  min-width: 0;
}

.chat-input:focus {
  border-color: rgba(229, 72, 77, 0.55);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.14);
}

.chat-input::placeholder { color: var(--text-3); }

.chat-send {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter 0.16s, transform 0.12s;
}

.chat-send:hover { filter: brightness(1.1); }
.chat-send:active { transform: translateY(1px); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 表单网格 ---------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 4px;
}

.field-wide { grid-column: 1 / -1; }

.form-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- 单选与 Logo 上传 ---------- */

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}

.radio-label:hover { color: var(--text); border-color: #33405a; }

.radio-label input { accent-color: var(--brand); cursor: pointer; }

.radio-label:has(input:checked) {
  color: var(--text);
  border-color: rgba(229, 72, 77, 0.55);
  background: rgba(229, 72, 77, 0.1);
}

.logo-upload-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.logo-upload-row .field-input[type="file"] {
  padding: 8px 12px;
  height: auto;
  cursor: pointer;
}

.logo-upload-row .field-input[type="file"]::file-selector-button {
  height: 30px;
  padding: 0 12px;
  margin-right: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-2);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s;
}

.logo-upload-row .field-input[type="file"]::file-selector-button:hover { color: var(--text); }

.logo-preview {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- 直播源表单 ---------- */

.source-form {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

/* ---------- 表格 ---------- */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.col-name { width: 140px; }
.col-type { width: 90px; }
.col-url { min-width: 180px; }

.url-cell {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  vertical-align: middle;
}
.col-headers { width: 110px; }
.col-ops { width: 190px; text-align: right; }

.src-name { font-weight: 600; color: var(--text); }

.src-url {
  color: var(--text-3);
  font-size: 12.5px;
  word-break: break-all;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.4px;
}

.tag-hls { color: #7cc4ff; background: rgba(80, 150, 230, 0.14); border: 1px solid rgba(80, 150, 230, 0.3); }
.tag-flv { color: #ffc978; background: rgba(245, 165, 36, 0.12); border: 1px solid rgba(245, 165, 36, 0.3); }

.tag-live-now {
  margin-left: 8px;
  color: #ffb3b5;
  background: rgba(240, 67, 74, 0.13);
  border: 1px solid rgba(240, 67, 74, 0.35);
}

.tag-headers { color: #8fe3bd; background: rgba(48, 164, 108, 0.12); border: 1px solid rgba(48, 164, 108, 0.3); }

.ops { display: inline-flex; gap: 6px; justify-content: flex-end; }

.empty-row td {
  text-align: center;
  color: var(--text-3);
  padding: 30px 12px;
  font-size: 13px;
}

/* ---------- 全局提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 200;
  background: #20262f;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease-out;
}

.toast.toast-error { border-color: rgba(229, 72, 77, 0.5); color: #ffb3b5; }
.toast.toast-ok { border-color: rgba(48, 164, 108, 0.5); color: #8fe3bd; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .studio-grid, .studio-grid-2 { grid-template-columns: 1fr; }
  .chat-card { max-height: 520px; }
  .control-row { grid-template-columns: 1fr; }
  .studio-top-inner { padding: 0 14px; }
  .studio-main { padding: 16px 14px 30px; }
}

/* 手机端适配 */
@media (max-width: 640px) {
  .studio-top-inner { height: auto; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .studio-top-right { flex-wrap: wrap; justify-content: flex-end; }
  .brand-side { display: none; }
  .studio-main { padding: 12px 12px 26px; gap: 16px; }
  .studio-col { gap: 16px; }

  /* 播放器全宽，16:9 画面优先 */
  .preview-card .card-head { padding: 10px 12px; }
  .player-box { min-height: 0; }

  /* 控制条改为可横向滚动，避免按钮挤压换行 */
  .controls {
    height: 52px;
    gap: 2px;
    padding: 0 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    opacity: 1; /* 触屏无 hover，控制条常显 */
  }
  .controls::-webkit-scrollbar { display: none; }
  .ctrl-btn { width: 38px; height: 38px; flex-shrink: 0; }
  .ctrl-label { display: none; }
  .quality-badge { display: none; }
  .volume-wrap:hover .volume,
  .volume:focus { width: 56px; }

  /* 开播控制：表单单列、按钮全宽 */
  .live-control-card .card-body { padding: 14px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .control-actions { width: 100%; }
  .control-actions .btn { flex: 1; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; }

  /* 直播源表格窄屏处理 */
  .table th, .table td { padding: 8px 8px; font-size: 12.5px; }
  .table .col-url, .table .col-headers { display: none; }

  /* 聊天区限高，避免撑满整页 */
  .chat-card { max-height: 420px; min-height: 0; }
  .chat-card .card-head { padding: 10px 12px; }
  .studio-chat-bar { padding: 10px; }

  .login-card { padding: 28px 20px 22px; }
}

@media (max-width: 420px) {
  .view-site-btn-text { display: none; }
  .ops { flex-direction: column; gap: 4px; }
  .ops .btn { width: 100%; }
}

@media (max-width: 640px) {
  .studio-top-inner { padding: 0 14px; gap: 8px; }
  .studio-main { padding: 16px 14px 30px; }
  .form-grid { grid-template-columns: 1fr; }
}
