:root {
  --bg: #111a20;
  --bg-soft: #17222a;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --line: #dfe6ee;
  --text: #1f2b36;
  --muted: #6c7a89;
  --brand: #0f7cff;
  --brand-dark: #095fc4;
  --ok: #18a058;
  --warn: #f59e0b;
  --danger: #dd3f35;
  --shadow: 0 10px 30px rgba(13, 28, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  background: #eef3f8;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 36px;
  color: #fff;
  background: #121d24;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #0f7cff, #14c8ff);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  justify-content: flex-end;
  font-size: 14px;
  -webkit-overflow-scrolling: touch;
}

.nav-pill,
.link-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  transition: 0.18s ease;
}

.nav-pill,
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-pill .fa,
.link-btn .fa {
  width: 14px;
  text-align: center;
  font-size: 14px;
}

.nav-pill span,
.link-btn span {
  white-space: nowrap;
}

.nav-pill {
  color: #eef6ff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-pill.app-nav.active {
  color: #fff;
  background: #1d1d1f;
}

.user-pill {
  white-space: nowrap;
}

.mobile-menu-btn,
.mobile-nav-head,
.mobile-nav-overlay {
  display: none;
}

.link-btn {
  color: #fff;
  background: transparent;
}

.primary-btn {
  color: #fff;
  background: var(--brand);
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.ghost-btn {
  color: var(--brand);
  border: 1px solid rgba(15, 124, 255, 0.28);
  background: #fff;
}

.danger-btn {
  color: #fff;
  background: var(--danger);
}

.hero {
  min-height: calc(100vh - 68px);
  color: #fff;
  background:
    linear-gradient(120deg, rgba(14, 24, 30, 0.92), rgba(18, 29, 36, 0.78)),
    radial-gradient(circle at 82% 20%, rgba(20, 200, 255, 0.22), transparent 26%),
    linear-gradient(135deg, #101820, #18252e);
}

.hero-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0 52px;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 740px;
  margin: 22px 0 34px;
  color: #c7d4df;
  font-size: 20px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.feature-grid,
.scene-grid,
.stats-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 64px;
}

.scene-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 26px;
}

.feature-card,
.scene-card,
.stat-card,
.panel,
.login-card,
.audio-card {
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.feature-card,
.scene-card {
  padding: 22px;
}

.feature-card {
  color: #e8f3ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.feature-card h3,
.scene-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.feature-card p,
.scene-card p {
  margin: 0;
  color: #b7c7d4;
  line-height: 1.7;
}

.scene-card {
  color: var(--text);
}

.scene-card p {
  color: var(--muted);
}

.footer {
  padding: 28px 24px;
  color: #8fa1ad;
  text-align: center;
  background: #121d24;
}

.main {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 44px;
}

.top-console {
  position: sticky;
  top: 0;
  z-index: 12;
  width: 100%;
  margin: 0;
  padding: 0;
  background: rgba(245, 245, 247, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(180%) blur(18px);
}

.top-console-inner {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 14px 0 10px;
}

.top-console .ops-summary {
  margin-bottom: 10px;
}

.top-console + .main {
  padding-top: 18px;
}

.top-console-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-console-utils {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-head h1,
.page-title h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.muted {
  color: var(--muted);
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stat-card {
  padding: 22px;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
}

.stat-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}

.tab {
  padding: 10px 18px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.tab.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.panel {
  padding: 22px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #52606d;
  background: #f3f6fa;
  font-weight: 600;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 24%, rgba(15, 124, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #101820, #17222a);
}

.login-card {
  width: min(420px, calc(100% - 36px));
  padding: 32px;
}

.login-card h1 {
  margin: 0 0 24px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #52606d;
  font-size: 14px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.audio-layout,
.live-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.notice {
  padding: 14px 16px;
  border-radius: 8px;
  color: #6b4a10;
  background: #fff7df;
  line-height: 1.8;
}

.audio-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.audio-card {
  padding: 16px;
}

.audio-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #0b6fd3;
  background: #eaf4ff;
  font-size: 12px;
}

.live-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.language {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.language.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

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

.switch {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.switch.on {
  color: #fff;
  border-color: var(--ok);
  background: var(--ok);
}

.log {
  display: grid;
  gap: 10px;
}

.log-item {
  padding: 12px;
  border-left: 3px solid var(--brand);
  background: var(--panel-soft);
  line-height: 1.6;
}

.live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.player-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.player-box audio {
  width: 100%;
}

.subtitle {
  min-height: 54px;
  padding: 12px;
  border-radius: 6px;
  color: #24313d;
  background: #fff;
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(18, 29, 36, 0.94);
  box-shadow: var(--shadow);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.42);
}

.modal {
  width: min(560px, 100%);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-body {
  padding: 22px;
  line-height: 1.8;
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    padding: 14px 18px;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .feature-grid,
  .scene-grid,
  .stats-grid,
  .two-col,
  .audio-layout,
  .live-layout,
  .audio-list {
    grid-template-columns: 1fr;
  }

  .language-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dense dashboard mode */
.topbar {
  height: 56px;
  padding: 0 24px;
}

.brand {
  gap: 10px;
  font-size: 18px;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.nav-actions {
  gap: 8px;
}

.nav-pill,
.link-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  padding: 8px 12px;
}

.main {
  padding: 16px 0 28px;
}

.dashboard-head {
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-head h1,
.page-title h1 {
  margin-bottom: 4px;
  font-size: 22px;
}

.stats-grid {
  gap: 12px;
  margin-bottom: 12px;
}

.stat-card,
.panel {
  padding: 14px;
}

.stat-value {
  margin-top: 6px;
  font-size: 24px;
}

.tabs {
  gap: 8px;
  margin: 12px 0;
}

.tab {
  padding: 8px 14px;
}

th,
td {
  padding: 9px 10px;
}

.field {
  gap: 6px;
  margin-bottom: 10px;
}

.field input,
.field textarea,
.field select {
  padding: 9px 10px;
}

.field textarea {
  min-height: 84px;
}

.two-col,
.audio-layout,
.live-layout {
  gap: 12px;
}

.live-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.notice {
  padding: 10px 12px;
  line-height: 1.55;
}

.audio-list {
  gap: 10px;
}

.audio-card {
  padding: 12px;
}

.language-grid,
.switch-row,
.log {
  gap: 8px;
}

.language,
.switch {
  padding: 7px 10px;
}

.log-item {
  padding: 9px 10px;
  line-height: 1.45;
}

.live-actions {
  gap: 8px;
  margin: 10px 0;
}

.player-box {
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
}

.subtitle {
  min-height: 42px;
  padding: 9px;
  line-height: 1.55;
}

.ops-summary,
.room-strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 22px;
  background: #17202a;
  color: #eef7fb;
}

.profile-strip {
  display: flex;
  gap: 14px;
  align-items: center;
}

.live-room-header {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(300px, 1.4fr) minmax(260px, .9fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px 22px;
  border-radius: 16px;
  background: #fff;
}

.live-room-meta h1 {
  margin: 0;
  color: #1d1d1f;
  font-size: 22px;
  line-height: 1.1;
}

.live-room-meta p {
  margin: 4px 0 0;
  font-size: 12px;
}

.avatar-dot {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #19d2b3, #4f6cff);
  color: #fff;
  font-weight: 800;
}

.metric span,
.metric small {
  display: block;
  color: #9eb2bf;
}

.metric b {
  font-size: 25px;
}

.room-table {
  overflow: hidden;
  border-radius: 8px;
  background: #1b242e;
}

.room-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr .8fr 1.7fr;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  color: #dbe6ee;
}

.room-row:nth-child(odd) {
  background: #26313d;
}

.room-head {
  background: #303b47 !important;
  color: #aebdca;
  font-weight: 700;
}

.room-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tiny-link {
  border: 0;
  background: transparent;
  color: #18d4b2;
  cursor: pointer;
}

.status {
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: #5a6572;
}

.status.running {
  background: #0fbf8f;
}

.status.ready {
  background: #2378ff;
}

.status.inactive {
  background: #8b4b4b;
}

.warn-btn {
  border: 1px solid #f4b549;
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff2d8;
  color: #8a4b00;
  font-weight: 700;
}

.live-title,
.panel-head,
.modal-head,
.modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.room-strip {
  grid-template-columns: 1fr 360px;
}

.room-select-line {
  display: grid;
  gap: 6px;
}

.live-console {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, .8fr);
  gap: 14px;
}

.live-form,
.live-side {
  background: #17202a;
  color: #ecf4f8;
}

.live-form .field label,
.live-side h2 {
  color: #f2f7fb;
}

.live-form textarea,
.live-form input,
.live-form select {
  background: #0f1720;
  border-color: #50606f;
  color: #edf6fa;
}

.counter,
.queue-meter {
  display: block;
  margin-top: 4px;
  color: #1ed6b1;
  text-align: right;
  font-size: 12px;
}

.live-monitor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 122, 255, 0.24);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.live-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 84px 18px 24px;
  background: rgba(245, 245, 247, 0.58);
  backdrop-filter: saturate(160%) blur(10px);
}

.live-lock-panel {
  display: grid;
  gap: 14px;
  width: min(760px, 100%);
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
}

.live-lock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.live-lock-head strong {
  display: block;
  color: #1d1d1f;
  font-size: 18px;
}

.live-lock-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.live-stop-btn {
  flex: 0 0 auto;
  min-width: 118px;
}

.live-monitor-head,
.live-monitor-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-monitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #0b6fd3;
  background: #eaf4ff;
  font-size: 12px;
  white-space: nowrap;
}

.live-monitor-badge.is-caching {
  padding-left: 10px;
  background: #e8f7ee;
  color: #167245;
  box-shadow: 0 0 0 0 rgba(22, 114, 69, 0.18);
  animation: cacheBadgePulse 1.35s ease-in-out infinite;
}

.live-monitor-badge.is-caching::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid rgba(22, 114, 69, 0.22);
  border-top-color: #167245;
  flex: 0 0 auto;
  animation: cacheBadgeSpin 0.85s linear infinite;
}

@keyframes cacheBadgeSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cacheBadgePulse {
  50% {
    box-shadow: 0 0 0 5px rgba(22, 114, 69, 0.08);
  }
}

.live-monitor-current {
  display: grid;
  gap: 6px;
}

.live-status-warning {
  display: none;
  padding: 7px 9px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 8px;
  color: #b42318;
  background: #fff1f0;
  font-size: 12px;
  line-height: 1.45;
}

.live-status-warning.show {
  display: block;
}

.live-monitor-current span,
.live-monitor-grid span {
  color: var(--muted);
  font-size: 12px;
}

.live-monitor-current p {
  max-height: 112px;
  margin: 0;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.65;
}

.live-monitor-progress-row progress {
  width: 100%;
  height: 10px;
  accent-color: var(--brand);
}

#liveProgressText {
  min-width: 96px;
  color: var(--muted);
  text-align: right;
  font-size: 12px;
}

.live-monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.live-monitor-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: #f5f5f7;
}

.live-monitor-grid b {
  display: block;
  overflow: hidden;
  color: #1d1d1f;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.inline-send {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 10px;
}

.wide {
  width: 100%;
}

.floating-player {
  position: sticky;
  top: 70px;
  border: 1px solid #2a8cff;
  background: #d7dbe1;
  color: #10202b;
}

.script-modal {
  width: min(820px, calc(100vw - 32px));
  min-height: 70vh;
}

.wide-modal {
  width: min(760px, calc(100vw - 32px));
}

.script-modal textarea {
  min-height: 160px;
}

.script-modal #scriptResult {
  min-height: 220px;
}

.modal-log {
  max-height: 60vh;
  overflow: auto;
}

.audio-workbench {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.voice-tip {
  margin: 10px 0;
  padding: 12px;
  border-radius: 6px;
  background: #d9f5df;
  color: #235d31;
}

.voice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
  align-items: center;
}

.compact-list {
  max-height: 620px;
  overflow: auto;
}

@media (max-width: 980px) {
  .ops-summary,
  .room-strip,
  .live-console,
  .audio-workbench,
  .room-row {
    grid-template-columns: 1fr;
  }

  .voice-row {
    grid-template-columns: 1fr;
  }
}

/* Apple light theme */
:root {
  --bg: #f5f5f7;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f5f5f7;
  --line: #e5e5ea;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --brand: #007aff;
  --brand-dark: #005ecb;
  --ok: #34c759;
  --warn: #ff9f0a;
  --danger: #ff3b30;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
}

body,
.app-shell,
.main,
.login-page {
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

.topbar,
.footer {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
  backdrop-filter: saturate(180%) blur(18px);
}

.footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.brand-mark,
.avatar-dot {
  border-radius: 12px;
  background: #1d1d1f;
  color: #fff;
}

.nav-pill,
.link-btn {
  color: #1d1d1f;
  background: #f2f2f7;
}

.primary-btn,
.danger-btn,
.ghost-btn,
.tab,
.language,
.switch,
.warn-btn {
  border-radius: 999px;
}

.primary-btn {
  background: var(--brand);
}

.danger-btn {
  background: var(--danger);
}

.ghost-btn {
  color: var(--brand);
  border-color: #d6d6dc;
  background: #fff;
}

.hero {
  color: #1d1d1f;
  background: linear-gradient(180deg, #fff, #f5f5f7);
}

.hero-subtitle,
.feature-card p,
.scene-card p,
.muted {
  color: var(--muted);
}

.feature-card,
.scene-card,
.stat-card,
.panel,
.login-card,
.audio-card,
.modal,
.ops-summary,
.room-strip,
.live-form,
.live-side {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow);
}

.feature-card {
  color: var(--text);
}

.panel,
.feature-card,
.scene-card,
.stat-card,
.login-card,
.audio-card,
.modal,
.room-table,
.player-box,
.notice,
.toast {
  border-radius: 16px;
}

.ops-summary,
.room-strip {
  padding: 18px 22px;
}

.metric span,
.metric small,
.room-head,
.field label {
  color: var(--muted);
}

.metric b {
  color: #1d1d1f;
}

.tabs {
  padding: 4px;
  width: fit-content;
  border-radius: 999px;
  background: #e9e9ee;
}

.tab {
  border: 0;
  background: transparent;
}

.tab.active {
  color: #fff;
  background: #1d1d1f;
}

.room-table {
  background: #fff;
  border: 1px solid var(--line);
}

.room-row {
  color: #1d1d1f;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.room-row:nth-child(odd) {
  background: #fafafa;
}

.room-head {
  background: #f5f5f7 !important;
}

.tiny-link,
.counter,
.queue-meter {
  color: var(--brand);
}

.status {
  color: #fff;
}

.status.running {
  background: var(--ok);
}

.status.ready {
  background: var(--brand);
}

.status.inactive {
  background: #8e8e93;
}

.warn-btn {
  border-color: #ffd699;
  background: #fff7e8;
  color: #9a5a00;
}

.live-console {
  align-items: start;
}

.live-form .field label,
.live-side h2 {
  color: #1d1d1f;
}

.live-form textarea,
.live-form input,
.live-form select,
.field input,
.field textarea,
.field select {
  color: #1d1d1f;
  border-color: #d2d2d7;
  border-radius: 12px;
  background: #fff;
}

.live-form textarea:focus,
.live-form input:focus,
.live-form select:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.language,
.switch {
  background: #fff;
  border-color: #d2d2d7;
  color: #1d1d1f;
}

.language.active,
.switch.on {
  color: #fff;
  border-color: #1d1d1f;
  background: #1d1d1f;
}

.log-item {
  border-left: 0;
  border-radius: 12px;
  background: #f5f5f7;
}

.player-box,
.floating-player {
  color: #1d1d1f;
  border-color: var(--line);
  background: #f5f5f7;
}

.subtitle {
  color: #1d1d1f;
  background: #fff;
}

.notice {
  color: #7a5200;
  background: #fff7e8;
}

.voice-tip {
  background: #eefaf1;
  color: #1f6b35;
}

table,
th,
td {
  background: #fff;
  color: #1d1d1f;
}

th {
  background: #f5f5f7;
  color: var(--muted);
}

.toast {
  color: #fff;
  background: rgba(29, 29, 31, 0.92);
}

.modal-mask {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.tiktok-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f5f5f7;
}

.tiktok-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tiktok-panel p {
  margin: 4px 0 0;
}

.tiktok-event-grid {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.tiktok-panel label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  color: #1d1d1f;
}

.tiktok-panel .mini-field {
  color: var(--muted);
  font-size: 12px;
}

.tiktok-panel .mini-field input {
  width: 72px;
  height: 30px;
  padding: 0 8px;
}

.tiktok-panel .wide-mini-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.tiktok-panel .wide-mini-field input {
  width: 100%;
}

.interject-bullet {
  padding: 11px 14px;
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: 14px;
  color: #004a99;
  background: #eaf4ff;
  font-weight: 700;
  line-height: 1.45;
}

.interject-bullet[hidden] {
  display: none;
}

.interject-bullet.pulse {
  animation: interjectPulse 0.55s ease;
}

@keyframes interjectPulse {
  0% {
    transform: translateY(-4px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .tiktok-panel {
    grid-template-columns: 1fr;
  }
}

/* Voice library layout fix */
.audio-workbench {
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  align-items: start;
}

.audio-workbench > .panel {
  min-width: 0;
  overflow: visible;
}

.audio-workbench .compact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 620px;
  overflow: auto;
  padding: 2px 8px 2px 2px;
}

.audio-workbench .audio-card.voice-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  grid-template-areas:
    "voice-info voice-actions"
    "voice-preview voice-preview";
  gap: 14px;
  align-items: start;
  width: 100%;
  min-height: 0;
  padding: 14px 16px;
  overflow: visible;
}

.audio-workbench .audio-card.voice-row.preview-open {
  z-index: 2;
  min-height: 222px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.1);
}

.audio-workbench .audio-card.voice-row > div {
  min-width: 0;
}

.audio-workbench .audio-card.voice-row > div:first-child {
  grid-area: voice-info;
  align-self: center;
}

.audio-workbench .audio-title,
.audio-workbench .voice-row .tag,
.audio-workbench .voice-row .muted {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.audio-workbench .audio-title {
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-workbench .voice-row .tag {
  max-width: 100%;
  white-space: nowrap;
}

.audio-workbench .voice-row .muted {
  margin: 8px 0 0;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: anywhere;
}

.audio-workbench .voice-row .ghost-btn {
  width: 104px;
  min-width: 104px;
  height: 38px;
  padding: 0 14px;
}

.audio-workbench .voice-row audio {
  width: 100%;
  max-width: 100%;
  margin-top: 10px;
}

.voice-actions {
  grid-area: voice-actions;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  align-self: center;
  width: auto;
  min-width: 0;
}

.voice-preview-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  width: auto;
  min-width: 0;
}

.voice-preview-controls select {
  width: 220px;
  max-width: 28vw;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.voice-preview-controls .ghost-btn {
  width: 72px !important;
}

.audio-workbench .voice-row .voice-actions .ghost-btn {
  width: 104px;
}

.tag.ready {
  color: #057a55;
  background: #e7f8ef;
}

.tag.inactive {
  color: #b42318;
  background: #fff1f0;
}

.voice-upload-progress {
  display: grid;
  gap: 9px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid #d6e8ff;
  border-radius: 14px;
  background: #f5faff;
}

.voice-upload-progress[hidden] {
  display: none;
}

.voice-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #1d1d1f;
}

.voice-upload-head span {
  color: var(--brand);
  font-size: 13px;
  white-space: nowrap;
}

.voice-upload-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e5e5ea;
}

.voice-upload-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .22s ease;
}

.voice-upload-progress[data-stage="clone"] .voice-upload-track i {
  width: 100% !important;
  background: linear-gradient(90deg, #007aff, #34c759, #007aff);
  background-size: 200% 100%;
  animation: voiceProgress 1.2s linear infinite;
}

.voice-upload-progress[data-stage="done"] {
  border-color: #bfe8ce;
  background: #f1fbf4;
}

.voice-upload-progress[data-stage="failed"] {
  border-color: #ffd0cc;
  background: #fff5f4;
}

.voice-upload-progress p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.voice-preview-box {
  grid-area: voice-preview;
  align-self: stretch;
  display: grid;
  gap: 6px;
  margin-top: 0;
  padding: 10px 12px 8px;
  border: 1px solid #d6e8ff;
  border-radius: 14px;
  background: #f5faff;
  overflow: hidden;
  min-height: 0;
}

.voice-preview-box .voice-upload-head {
  min-height: 20px;
}

.voice-preview-box .voice-upload-head strong,
.voice-preview-box .voice-upload-head span {
  line-height: 1.2;
}

.voice-preview-box .voice-upload-track {
  height: 7px;
}

.voice-preview-box p {
  margin: 2px 0 0;
  line-height: 1.35;
  font-size: 13px;
}

.voice-preview-player {
  overflow: hidden;
  height: 34px;
  margin-top: 2px;
  border-radius: 999px;
}

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

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

.voice-preview-box audio {
  display: block;
  width: 100%;
  height: 34px;
  margin: 0;
}

@keyframes voiceProgress {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1180px) {
  .audio-workbench {
    grid-template-columns: 1fr;
  }
}

/* Activation card management */
.head-actions,
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activation-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
}

.activation-form {
  align-self: start;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.bulk-toolbar .select-all,
.range-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bulk-toolbar input[type="number"] {
  width: 68px;
  height: 34px;
  padding: 6px 8px;
}

.check-col {
  width: 42px;
  text-align: center;
}

.row-check {
  width: 16px;
  height: 16px;
}

.batch-card-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.compact-head {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
}

.compact-head h3 {
  margin: 0;
  font-size: 15px;
}

.admin-user-workbench {
  display: block;
}

.admin-user-list-full {
  width: 100%;
}

.user-detail-modal {
  width: min(1180px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.user-detail-body {
  overflow: auto;
  max-height: calc(92vh - 76px);
}

.user-detail-body h3 {
  margin: 18px 0 10px;
}

.admin-table th,
.admin-table td {
  vertical-align: top;
}

.primary-btn:disabled,
.danger-btn:disabled,
.ghost-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .activation-workbench {
    grid-template-columns: 1fr;
  }
}

/* Responsive app shell */
@media (max-width: 860px) {
  body {
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    height: 56px;
    min-height: 56px;
    padding: 10px 14px;
    gap: 10px;
    align-items: center;
  }

  .brand {
    min-width: 0;
    font-size: 17px;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 0;
    border-radius: 12px;
    color: #1d1d1f;
    background: #f2f2f7;
    font-size: 20px;
    font-weight: 800;
  }

  .mobile-nav-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 18;
    background: rgba(0, 0, 0, .22);
  }

  .mobile-nav-head {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 10px;
  }

  .nav-actions {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 19;
    width: min(300px, 86vw);
    height: 100dvh;
    padding: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, .98);
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 44px rgba(0, 0, 0, .15);
    transform: translateX(-105%);
    transition: transform .2s ease;
    -webkit-overflow-scrolling: touch;
  }

  .nav-actions.open {
    transform: translateX(0);
  }

  .nav-actions .nav-pill,
  .nav-actions .link-btn {
    width: 100%;
    min-height: 42px;
    text-align: left;
    white-space: nowrap;
  }

  .nav-actions::-webkit-scrollbar,
  .tabs::-webkit-scrollbar {
    display: none;
  }

  .main {
    width: min(100% - 20px, 1280px);
    padding: 12px 0 28px;
  }

  .top-console {
    width: 100%;
  }

  .live-lock-overlay {
    padding: 64px 10px 14px;
  }

  .live-lock-panel {
    max-height: calc(100vh - 78px);
    padding: 12px;
    border-radius: 16px;
  }

  .live-lock-head {
    align-items: stretch;
    flex-direction: column;
  }

  .live-stop-btn {
    width: 100%;
  }

  .live-monitor {
    padding: 12px;
  }

  .live-monitor-progress-row {
    align-items: stretch;
    flex-direction: column;
  }

  #liveProgressText {
    min-width: 0;
    text-align: left;
  }

  .live-monitor-grid {
    grid-template-columns: 1fr;
  }

  .top-console-inner {
    width: min(100% - 20px, 1280px);
    padding: 10px 0;
  }

  .top-console + .main {
    padding-top: 12px;
  }

  .top-console-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .top-console-utils {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ops-summary {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
  }

  .ops-summary .profile-strip {
    grid-column: 1 / -1;
  }

  .ops-summary .primary-btn,
  .ops-summary .danger-btn {
    width: 100%;
  }

  .tabs {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 38px;
  }

  .panel {
    padding: 14px;
  }

  .panel-head,
  .live-title,
  .modal-head,
  .modal-foot {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .head-actions,
  .room-actions,
  .table-actions {
    width: 100%;
  }

  .head-actions .primary-btn,
  .head-actions .ghost-btn,
  .room-actions .primary-btn,
  .room-actions .ghost-btn,
  .room-actions .danger-btn {
    min-height: 40px;
  }

  .room-table {
    display: grid;
    gap: 10px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .room-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .room-row:nth-child(odd) {
    background: #fff;
  }

  .room-head {
    display: none;
  }

  .room-row > span,
  .room-row > div {
    min-width: 0;
  }

  .room-actions {
    justify-content: flex-start;
  }

  .room-strip,
  .live-console,
  .two-col,
  .audio-workbench,
  .activation-workbench,
  .stats-grid,
  .feature-grid,
  .scene-grid {
    grid-template-columns: 1fr;
  }

  .live-form,
  .live-side {
    min-width: 0;
  }

  .language-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .switch-row,
  .inline-send {
    flex-wrap: wrap;
  }

  .inline-send input,
  .inline-send button {
    min-width: 0;
  }

  .field,
  .field input,
  .field textarea,
  .field select,
  .inline-send,
  .activation-form,
  .activation-list,
  .activation-workbench,
  .panel {
    max-width: 100%;
    min-width: 0;
  }

  .field input,
  .field textarea,
  .field select {
    display: block;
  }

  .audio-workbench .audio-card.voice-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "voice-info"
      "voice-actions"
      "voice-preview";
  }

  .voice-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .voice-preview-controls {
    flex: 1 1 100%;
    width: 100%;
  }

  .audio-workbench .voice-row .voice-actions .ghost-btn {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
  }

  .voice-preview-controls select {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }

  .compact-list {
    max-height: none;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 28px);
    overflow: auto;
  }

  .modal-mask {
    padding: 14px 10px;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 8px 10px;
  }

  .nav-actions {
    width: min(286px, 88vw);
    padding: 12px;
  }

  .brand-mark,
  .avatar-dot {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .nav-pill,
  .link-btn,
  .primary-btn,
  .ghost-btn,
  .danger-btn,
  .warn-btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  .main {
    width: calc(100% - 12px);
    padding-top: 8px;
  }

  .top-console {
    width: 100%;
  }

  .top-console-inner {
    width: calc(100% - 12px);
    padding: 8px 0;
  }

  .ops-summary {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .profile-strip {
    gap: 10px;
  }

  .metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  .metric b {
    font-size: 22px;
  }

  .page-title h1,
  .dashboard-head h1 {
    font-size: 22px;
  }

  .tabs {
    padding: 3px;
  }

  .tab {
    padding: 8px 12px;
  }

  .panel,
  .audio-card,
  .room-row {
    border-radius: 12px;
  }

  .language-grid {
    grid-template-columns: 1fr 1fr;
  }

  .live-actions,
  .head-actions,
  .room-actions,
  .inline-send {
    display: grid;
    grid-template-columns: 1fr;
  }

  .live-actions button,
  .head-actions button,
  .room-actions button,
  .inline-send button,
  .wide {
    width: 100%;
  }

  .field textarea {
    min-height: 112px;
  }
}

.topbar .nav-pill.app-nav.active {
  color: #fff;
  background: #1d1d1f;
}

/* Live room compact console */
.main {
  width: min(1880px, calc(100% - 28px));
  padding: 12px 0 22px;
}

.live-title {
  margin-bottom: 10px;
}

.room-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px 22px;
}

.live-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 10px;
  align-items: stretch;
}

.live-form {
  padding: 20px 24px 12px;
}

.live-form .field {
  gap: 6px;
  margin-bottom: 10px;
}

.live-form .field label {
  font-size: 13px;
  font-weight: 700;
}

.live-form input,
.live-form select,
.live-form textarea {
  padding: 10px 12px;
}

.live-form #topic,
.live-form #productInfo {
  height: clamp(220px, 31vh, 320px);
  min-height: 190px;
}

.live-form .two-col {
  gap: 24px 80px;
}

.language-grid {
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
}

.language,
.switch {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.switch-row {
  gap: 8px;
}

.inline-send {
  grid-template-columns: minmax(0, 1fr) 80px;
}

.tiktok-panel {
  margin: 6px 0;
  padding: 10px 12px;
}

.live-actions {
  display: grid;
  grid-template-columns: minmax(220px, 380px);
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
}

.live-actions .wide {
  width: 100%;
}

.live-runtime-bar {
  margin-top: 6px;
}

.live-runtime-bar audio,
.live-runtime-bar .subtitle,
.live-runtime-bar .queue-meter {
  display: none;
}

.live-hidden-log {
  display: none;
}

.barrage-side-panel {
  display: flex;
  min-height: 0;
  max-height: calc(100vh - 178px);
  padding: 14px;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 66px;
}

.barrage-side-panel.pulse {
  animation: barragePulse 0.65s ease;
}

@keyframes barragePulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.28); }
  100% { box-shadow: 0 0 0 14px rgba(0, 122, 255, 0); }
}

.barrage-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.barrage-side-head strong {
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
}

.log-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 3px;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  background: #f5f5f7;
}

.log-tab {
  min-width: 0;
  border: 0;
  border-radius: 9px;
  padding: 8px 6px;
  background: transparent;
  color: #6e6e73;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.log-tab.active {
  color: #1d1d1f;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.barrage-side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.barrage-side-stats span {
  padding: 8px 10px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  background: #f5f5f7;
  color: var(--muted);
  font-size: 12px;
}

.barrage-side-stats b {
  display: block;
  margin-top: 2px;
  color: #1d1d1f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barrage-live-log {
  flex: 1;
  min-height: 360px;
  max-height: none;
  overflow: auto;
}

.barrage-live-log.is-hidden {
  display: none;
}

.live-lock-overlay {
  position: fixed;
  inset: auto auto auto 50%;
  top: 48%;
  z-index: 45;
  width: min(780px, calc(100vw - 32px));
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.live-lock-panel {
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.live-monitor.live-monitor-compact {
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 122, 255, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.12);
}

.live-monitor-compact .live-monitor-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
}

.live-monitor-robot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #007aff;
  background: #eaf4ff;
  font-weight: 800;
  font-size: 12px;
}

.live-monitor-compact .live-monitor-head strong {
  display: inline-block;
  margin-right: 8px;
  font-size: 14px;
}

.live-monitor-compact .live-stop-btn {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
}

.live-monitor-compact .live-monitor-current p {
  max-height: 42px;
  padding: 7px 9px;
  border: 1px solid rgba(52, 199, 89, 0.18);
  font-size: 13px;
  line-height: 1.45;
  background: #effaf1;
  color: #173b22;
}

.live-interject-status {
  display: none;
  padding: 8px 10px;
  border: 1px solid rgba(255, 59, 48, 0.28);
  border-radius: 10px;
  color: #fff;
  background: #ff3b30;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(255, 59, 48, 0.22);
}

.live-interject-status.show {
  display: block;
}

.live-interject-status[data-status="waiting"] {
  background: #ff9500;
}

.live-interject-status[data-status="playing"] {
  background: #d70015;
}

.live-interject-status[data-status="done"] {
  background: #34c759;
  border-color: rgba(52, 199, 89, 0.28);
  box-shadow: 0 8px 22px rgba(52, 199, 89, 0.2);
}

.live-monitor-compact .live-monitor-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
}

.live-monitor-compact .live-monitor-progress-row progress {
  height: 7px;
}

.live-monitor-compact .live-monitor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px 10px;
  font-size: 12px;
}

.live-monitor-compact .live-monitor-grid span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-monitor-compact .live-monitor-grid b {
  color: #1d1d1f;
  font-size: 12px;
}

@media (max-width: 900px) {
  .main {
    width: min(100% - 20px, 1280px);
  }

  .room-strip,
  .live-room-header,
  .live-console,
  .live-form .two-col,
  .live-actions,
  .tiktok-panel {
    grid-template-columns: 1fr;
  }

  .live-form {
    padding: 14px;
  }

  .live-form #topic,
  .live-form #productInfo {
    height: 180px;
  }

  .barrage-side-panel {
    position: static;
    max-height: none;
  }

  .barrage-live-log {
    min-height: 260px;
    max-height: 45vh;
  }

  .live-lock-overlay {
    top: auto;
    right: 10px;
    bottom: 78px;
    left: 10px;
    width: auto;
    transform: none;
  }

  .live-monitor-compact .live-monitor-head {
    grid-template-columns: 34px minmax(0, 1fr) 56px;
  }

  .live-monitor-compact .live-monitor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 901px) {
  .topbar {
    height: 52px;
    padding: 0 24px;
  }

  .brand {
    gap: 8px;
    font-size: 20px;
  }

  .nav-pill,
  .link-btn,
  .primary-btn,
  .ghost-btn,
  .danger-btn {
    padding: 8px 12px;
  }

  .main {
    width: min(1880px, calc(100% - 32px));
    padding: 8px 0 10px;
  }

  .live-title {
    margin-bottom: 6px;
  }

  .live-title h1 {
    margin: 0;
    font-size: 22px;
  }

  .live-title p {
    margin: 2px 0 0;
    font-size: 12px;
  }

  .warn-btn {
    padding: 8px 14px;
  }

  .room-strip {
    min-height: 62px;
    margin-bottom: 8px;
    padding: 10px 22px;
  }

  .live-room-header {
    grid-template-columns: minmax(180px, .8fr) minmax(320px, 1.4fr) minmax(280px, .9fr);
    min-height: 62px;
    margin-bottom: 8px;
    padding: 10px 22px;
  }

  .profile-strip {
    gap: 10px;
  }

  .avatar-dot {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 13px;
  }

  .profile-strip strong {
    font-size: 16px;
  }

  .profile-strip p,
  .room-select-line label {
    margin: 2px 0 0;
    font-size: 12px;
  }

  .room-select-line {
    gap: 4px;
  }

  .live-form {
    padding: 14px 24px 8px;
  }

  .live-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .label-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .inline-mode-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f2f2f7;
    color: #1d1d1f;
    font-size: 12px;
    font-weight: 600;
  }

  .mini-script-btn {
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid #d2d2d7;
    border-radius: 999px;
    color: #1d1d1f;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .mini-script-btn:hover {
    border-color: #007aff;
    color: #007aff;
  }

  .live-form .two-col {
    gap: 14px 80px;
  }

  .live-form .field {
    gap: 4px;
    margin-bottom: 7px;
  }

  .live-form .field label {
    font-size: 13px;
    line-height: 1.25;
  }

  .live-form input,
  .live-form select {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 10px;
  }

  .live-form textarea {
    padding: 10px 12px;
    border-radius: 10px;
    line-height: 1.42;
  }

  .live-form #topic,
  .live-form #productInfo {
    height: clamp(190px, 28vh, 260px);
    min-height: 176px;
  }

  .counter,
  .queue-meter {
    margin-top: 2px;
    font-size: 11px;
  }

  .live-options-row {
    align-items: start;
  }

  .switch-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .language-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .language,
  .switch {
    min-height: 26px;
    padding: 4px 8px;
    border-width: 1px;
    font-size: 12px;
    line-height: 1;
  }

  .language::before,
  .switch::before {
    width: 12px;
    height: 12px;
  }

  .tiktok-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 4px 0;
    padding: 7px 10px;
    font-size: 12px;
  }

  .tiktok-panel-head {
    align-items: center;
  }

  .tiktok-panel p {
    margin: 2px 0 0;
    font-size: 11px;
  }

  .tiktok-event-grid {
    grid-template-columns: auto minmax(170px, 1fr) auto minmax(170px, 1fr);
    gap: 8px;
  }

  .live-actions {
    grid-template-columns: minmax(260px, 380px);
    gap: 8px;
    margin: 4px 0 0;
  }

  .live-close-main {
    background: #ff3b30;
  }

  .live-close-main:hover {
    background: #d70015;
  }

  .inline-send {
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 8px;
  }

  .language,
  .switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .live-runtime-bar {
    margin-top: 0;
  }
}

@media (min-width: 901px) and (max-height: 920px) {
  .topbar {
    height: 46px;
  }

  .main {
    padding-top: 6px;
  }

  .room-strip {
    min-height: 54px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .live-form #topic,
  .live-form #productInfo {
    height: clamp(160px, 25vh, 228px);
    min-height: 150px;
  }

  .live-form {
    padding-top: 12px;
  }

  .live-form .field {
    margin-bottom: 5px;
  }
}

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

.password-wrap input {
  padding-right: 44px;
}

.password-eye {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: #52606d;
  background: transparent;
}

.password-eye:hover {
  color: var(--brand);
  background: #eef5ff;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

@media (max-width: 720px) {
  .three-col {
    grid-template-columns: 1fr;
  }
}
