:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #0d1016;
  --surface-raised: #121620;
  --line: #242936;
  --line-soft: rgba(255, 255, 255, .075);
  --text: #f4f3ef;
  --muted: #8f96a5;
  --muted-2: #626a79;
  --violet: #9c7cff;
  --violet-strong: #7047ef;
  --green: #79e3b4;
  --danger: #ff8da1;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 72% 25%, rgba(112, 71, 239, .09), transparent 30rem),
    radial-gradient(circle at 0 100%, rgba(51, 76, 110, .08), transparent 34rem),
    var(--bg);
}
button, a, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .38; filter: saturate(.35); }

.topbar {
  min-height: 72px;
  padding: 0 clamp(20px, 4.5vw, 74px);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(7, 9, 13, .72);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: .04em;
}
.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--violet);
  box-shadow: 7px 0 0 rgba(156, 124, 255, .28), 0 7px 0 rgba(156, 124, 255, .28);
  transform: rotate(45deg);
}
.account {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.account-label {
  padding-right: 12px;
  border-right: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.text-button {
  border: 0;
  padding: 5px;
  color: var(--violet);
  background: transparent;
}

main {
  width: min(1480px, calc(100% - clamp(32px, 7vw, 112px)));
  margin: 0 auto;
  padding: clamp(44px, 7vw, 108px) 0 clamp(48px, 6vw, 84px);
}
.intro {
  min-height: min(720px, calc(100vh - 205px));
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  align-items: center;
  gap: clamp(54px, 8vw, 140px);
}
.intro-copy { min-width: 0; }
.eyebrow {
  margin: 0 0 21px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .18em;
}
.eyebrow-dot, .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(156, 124, 255, .09);
}
.live-dot { color: var(--green); box-shadow: 0 0 0 5px rgba(121, 227, 180, .08); }
h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(54px, 6.6vw, 104px);
  line-height: .99;
  letter-spacing: -.065em;
  font-weight: 820;
}
h1 span { display: block; }
.lede {
  max-width: 650px;
  margin: 34px 0 0;
  padding-left: 20px;
  border-left: 1px solid var(--violet-strong);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}
.trust-row {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 11px 24px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .05em;
}
.trust-row span::before { content: "·"; margin-right: 9px; color: var(--violet); }

.setup-panel {
  width: 100%;
  max-width: 500px;
  justify-self: end;
  padding: 5px 0;
}
.setup-head {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.setup-kicker {
  margin: 0 0 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .16em;
}
.setup-head h2 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.setup-step { color: var(--muted-2); font: 600 11px/1 ui-monospace, monospace; }
.invite-notice {
  margin: 24px 0 0;
  padding: 17px 18px;
  border: 1px solid rgba(156, 124, 255, .28);
  background: rgba(112, 71, 239, .08);
  display: grid;
  gap: 7px;
}
.invite-notice strong { font-size: 13px; }
.invite-notice span { color: var(--muted); font-size: 12px; line-height: 1.65; }
.preflight-options { margin-top: 10px; display: grid; }
.setting-button, .setting-field {
  width: 100%;
  min-height: 88px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.setting-button { text-align: left; transition: color .18s ease, padding .18s ease; }
.setting-button:not(:disabled):hover { padding-left: 7px; color: white; }
.setting-copy { display: grid; gap: 7px; }
.setting-copy small { color: var(--muted); font-size: 12px; }
.setting-copy strong { color: var(--text); font-size: 16px; }
.mic-switch-visual {
  position: relative;
  width: 50px;
  height: 28px;
  flex: none;
  border-radius: 999px;
  border: 1px solid rgba(121, 227, 180, .3);
  background: rgba(121, 227, 180, .13);
  transition: .2s ease;
}
.mic-switch-visual::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 3px;
  right: 3px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 4px 14px rgba(121, 227, 180, .25);
  transition: .2s ease;
}
.setting-button[aria-pressed="false"] .mic-switch-visual { border-color: var(--line); background: #181c24; }
.setting-button[aria-pressed="false"] .mic-switch-visual::after { right: 25px; background: #6c7380; box-shadow: none; }
.setting-button[aria-pressed="false"] strong { color: var(--muted); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "⌄";
  position: absolute;
  right: 16px;
  top: 50%;
  pointer-events: none;
  color: var(--violet);
  transform: translateY(-58%);
}
.setting-field select {
  min-width: 112px;
  appearance: none;
  padding: 11px 39px 11px 16px;
  border: 1px solid rgba(156, 124, 255, .42);
  border-radius: 4px;
  color: var(--text);
  background: #10131a;
  outline: none;
}
.setting-field select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(156, 124, 255, .12); }
.mode-switch {
  flex: none;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  gap: 3px;
  background: #0b0e13;
}
.mode-option {
  min-width: 57px;
  padding: 8px 10px;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .04em;
}
.mode-option.active {
  color: white;
  background: var(--violet-strong);
  box-shadow: 0 5px 16px rgba(88, 49, 202, .25);
}
.mode-option:disabled { cursor: wait; }
.actions { margin-top: 30px; }
.primary {
  width: 100%;
  min-height: 61px;
  padding: 15px 21px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: linear-gradient(115deg, #8257f2, #6639e5);
  box-shadow: 0 18px 40px rgba(88, 49, 202, .24);
  font-weight: 760;
  transition: transform .18s ease, filter .18s ease;
}
.primary:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.08); }
.primary span { font-size: 19px; font-weight: 400; }
.hint { margin: 17px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.65; }

.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: clamp(20px, 2.5vw, 38px);
  align-items: start;
}
.stage-column { min-width: 0; }
.stage-head {
  min-height: 74px;
  padding: 0 2px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.stage-head .eyebrow { margin-bottom: 7px; }
.stage-head h2 { margin: 0; font-size: clamp(23px, 2vw, 32px); letter-spacing: -.035em; }
.badge {
  padding: 8px 11px;
  border: 1px solid rgba(121, 227, 180, .2);
  border-radius: 4px;
  color: var(--green);
  background: rgba(121, 227, 180, .07);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .04em;
}
.video-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #020305;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .38);
}
.video-shell video { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: radial-gradient(circle, rgba(112, 71, 239, .06), transparent 32%);
}
.placeholder-mark {
  width: 42px;
  height: 30px;
  margin-bottom: 11px;
  border: 1px solid #3b414e;
  border-radius: 3px;
  position: relative;
}
.placeholder-mark::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 1px;
  left: 13px;
  bottom: -7px;
  background: #3b414e;
  box-shadow: 0 4px 0 #3b414e;
}
.video-placeholder strong { color: #b8bdc7; font-size: 14px; }
.video-placeholder small { color: var(--muted-2); font-size: 11px; }
.video-shell:fullscreen, .video-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #000;
}
.toolbar-wrap { display: flex; justify-content: center; min-height: 82px; }
.toolbar {
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  background: rgba(13, 16, 22, .94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .32);
}
.tool, .danger {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #d7d9df;
  background: transparent;
  font-size: 12px;
  font-weight: 680;
  transition: background .16s ease, color .16s ease;
}
.tool:hover { color: white; background: #1b202a; }
.tool-primary { color: white; background: var(--violet-strong); }
.tool-primary:hover { background: #7d58ee; }
.danger { color: var(--danger); }
.danger:hover { background: rgba(255, 141, 161, .09); }

.side-stack {
  padding-top: 74px;
  display: grid;
  gap: 13px;
}
.side-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(13, 16, 22, .88);
}
.section-title {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.section-title > div { display: flex; align-items: center; gap: 10px; }
.section-title h3 { margin: 0; color: var(--text); font-size: 13px; }
.section-index { color: var(--violet); font: 700 9px/1 ui-monospace, monospace; }
.members { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 7px; }
.member {
  min-width: 0;
  padding: 10px 9px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .025);
}
.member:hover { border-color: var(--line-soft); background: rgba(255, 255, 255, .035); }
.member-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(121, 227, 180, .07); }
.member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.member-role { margin-left: auto; color: var(--muted-2); font-size: 10px; }
.connection-stats { margin-top: 15px; display: grid; gap: 12px; }
.peer-stats { padding: 13px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .018); }
.peer-stats-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.peer-stats-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.peer-stats-head span { flex: none; color: var(--violet); font-size: 9px; }
.diagnostics dl { margin: 11px 0 0; display: grid; gap: 7px; }
.diagnostics dl div { display: flex; justify-content: space-between; gap: 9px; font-size: 10px; }
.diagnostics dt { color: var(--muted-2); }
.diagnostics dd { margin: 0; color: #cdd0d7; }
.empty-stats { margin: 0; color: var(--muted-2); font-size: 11px; line-height: 1.6; }
.status-block {
  padding: 13px 4px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.status-light { width: 5px; height: 5px; margin-top: 5px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(121, 227, 180, .5); }
.status-text { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

footer {
  width: min(1480px, calc(100% - clamp(32px, 7vw, 112px)));
  margin: 0 auto;
  padding: 20px 0 27px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #545b68;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .08em;
}

[hidden] { display: none !important; }
@media (max-width: 1020px) {
  .intro { grid-template-columns: minmax(0, 1fr) minmax(330px, .72fr); gap: 48px; }
  h1 { font-size: clamp(50px, 7vw, 72px); }
  .room-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 820px) {
  main { padding-top: 54px; }
  .intro { min-height: 0; grid-template-columns: 1fr; gap: 62px; }
  .setup-panel { max-width: none; justify-self: stretch; }
  .room-layout { grid-template-columns: 1fr; }
  .side-stack { padding-top: 5px; grid-template-columns: 1fr 1fr; }
  .status-block { grid-column: 1 / -1; }
}
@media (max-width: 580px) {
  .topbar { min-height: 62px; padding: 0 15px; }
  .account { max-width: 54%; gap: 7px; }
  .account-label { display: none; }
  #userName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main, footer { width: min(100% - 26px, 1480px); }
  main { padding: 40px 0 48px; }
  .intro { gap: 48px; }
  h1 { font-size: clamp(43px, 13vw, 59px); line-height: 1.02; }
  .lede { margin-top: 26px; padding-left: 14px; font-size: 13px; }
  .trust-row { margin-top: 27px; gap: 9px 16px; }
  .setting-button, .setting-field { min-height: 79px; }
  .stage-head { min-height: 65px; }
  .badge { max-width: 43%; text-align: center; }
  .video-shell { border-radius: 3px; }
  .toolbar { width: 100%; }
  .toolbar button { flex: 1 1 42%; }
  .toolbar .danger { flex-basis: 100%; }
  .side-stack { grid-template-columns: 1fr; }
  .status-block { grid-column: auto; }
  footer { flex-wrap: wrap; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
