:root {
  --brand: #0066ff;
  --brand-hover: #0052cc;
  --brand-soft: #e8f1ff;
  --brand-grad: linear-gradient(135deg, #e8f3ff 0%, #f5f9ff 45%, #ffffff 100%);
  --text: #1a1a1a;
  --text-2: #5c667a;
  --text-3: #8a94a6;
  --line: #e6ebf2;
  --card: #ffffff;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 28px rgba(15, 40, 80, 0.08);
  --header-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230,235,242,.9);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 18px; white-space: nowrap;
}
.brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: var(--text-2); font-size: 15px; }
.nav a:hover { color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; font-weight: 600; font-size: 14px; transition: .15s ease;
  white-space: nowrap; user-select: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { color: var(--brand); background: var(--brand-soft); }
.btn-outline {
  background: #fff; color: var(--brand); border-color: #c5d8ff;
}
.btn-outline:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-lg { height: 48px; padding: 0 28px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; }
.menu-toggle {
  display: none; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer;
}
.menu-toggle span {
  display: block; width: 20px; height: 2px; background: #333; margin: 5px auto; border-radius: 2px;
}

/* Hero */
.hero {
  background: var(--brand-grad);
  padding: 72px 0 56px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute; right: -120px; top: -80px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,102,255,.12), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  position: relative; z-index: 1;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(0,102,255,.08); color: var(--brand);
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 16px; font-size: clamp(32px, 5vw, 48px);
  line-height: 1.2; letter-spacing: -.02em;
}
.hero h1 .accent { color: var(--brand); }
.hero-sub {
  margin: 0 0 28px; color: var(--text-2); font-size: 17px; max-width: 520px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero-note { color: var(--text-3); font-size: 13px; }
.hero-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 22px; overflow: hidden;
}
.preview-screen {
  background: linear-gradient(160deg, #0f172a, #1e293b);
  border-radius: 14px; aspect-ratio: 16/10; position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px;
}
.preview-tile {
  background: rgba(255,255,255,.08); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7); font-size: 13px; flex-direction: column; gap: 6px;
}
.preview-tile .avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  display: grid; place-items: center; font-weight: 700; color: #fff;
}
.preview-bar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 8px; background: rgba(15,23,42,.72);
  padding: 8px 12px; border-radius: 999px; backdrop-filter: blur(8px);
}
.preview-bar i {
  width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.12);
  display: grid; place-items: center; color: #fff; font-style: normal; font-size: 12px;
}
.preview-bar i.danger { background: #ef4444; }

/* Quick actions */
.quick {
  margin-top: -28px; position: relative; z-index: 2; padding-bottom: 24px;
}
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 8px;
}
.quick-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 20px 18px; border-radius: 12px; border: 0; background: transparent;
  cursor: pointer; text-align: left; color: inherit; transition: .15s ease;
}
.quick-item:hover { background: var(--brand-soft); }
.quick-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--brand-soft); color: var(--brand);
}
.quick-item strong { font-size: 15px; }
.quick-item span { color: var(--text-3); font-size: 13px; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: #f7f9fc; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { margin: 0 0 12px; font-size: clamp(24px, 3vw, 32px); }
.section-head p { margin: 0; color: var(--text-2); }
.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: 0 2px 10px rgba(15,40,80,.03);
  transition: .2s ease;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-card .icon {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 16px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--brand-soft); color: var(--brand);
}
.feature-card h3 { margin: 0 0 8px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--text-2); font-size: 14px; }
.bullets { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bullet {
  display: flex; gap: 14px; padding: 20px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.bullet .n {
  flex: 0 0 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.bullet h4 { margin: 0 0 4px; font-size: 15px; }
.bullet p { margin: 0; color: var(--text-2); font-size: 13px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); background: #fbfcfe; padding: 36px 0 28px;
  color: var(--text-2); font-size: 13px;
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  align-items: flex-start;
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.footer-brand img { width: 28px; height: 28px; border-radius: 6px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--brand); }
.footer-copy { margin-top: 18px; color: var(--text-3); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(440px, 100%); background: #fff; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 8px;
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: #f1f5f9; cursor: pointer; color: #64748b;
}
.modal-body { padding: 8px 20px 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; outline: none; background: #fff;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,102,255,.12); }
.field .hint { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.err {
  display: none; margin-bottom: 12px; padding: 10px 12px; border-radius: 8px;
  background: #fef2f2; color: #b91c1c; font-size: 13px;
}
.err.show { display: block; }
.auth-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: var(--brand-soft);
  color: var(--brand); font-size: 12px; font-weight: 600;
}

/* Room page */
body.room-page { background: #0b1220; color: #e8eefc; height: 100vh; overflow: hidden; }
.room-top {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: rgba(15,23,42,.9); border-bottom: 1px solid rgba(255,255,255,.06);
}
.room-top .meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.room-top .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-top .rid {
  font-size: 12px; color: #93a4c3; background: rgba(255,255,255,.06);
  padding: 3px 8px; border-radius: 6px;
}
.room-top .status { font-size: 12px; color: #86efac; }
.room-stage {
  height: calc(100vh - 52px - 72px); padding: 12px;
  display: grid; gap: 10px; align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  overflow: auto;
}
.tile {
  position: relative; background: #111a2e; border: 1px solid #24324d;
  border-radius: 12px; min-height: 160px; overflow: hidden;
  aspect-ratio: 16/10;
}
.tile video {
  width: 100%; height: 100%; object-fit: cover; background: #0b1220;
}
.tile .placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center;
  color: #93a4c3; font-size: 13px; background: #111a2e;
}
.tile .placeholder .avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 20px;
}
.tile .label {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px;
  padding: 4px 8px; border-radius: 6px; max-width: calc(100% - 16px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .badge {
  position: absolute; right: 8px; top: 8px; font-size: 11px;
  background: rgba(0,102,255,.85); color: #fff; padding: 2px 6px; border-radius: 4px;
}
.tile.self { outline: 1px solid rgba(59,130,246,.5); }
.room-toolbar {
  height: 72px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(15,23,42,.95); border-top: 1px solid rgba(255,255,255,.06);
  padding: 0 12px;
}
.tool {
  min-width: 56px; height: 48px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.08); color: #e8eefc; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; padding: 0 10px;
}
.tool:hover { background: rgba(255,255,255,.14); }
.tool.off { background: rgba(239,68,68,.18); color: #fecaca; }
.tool.danger { background: #ef4444; color: #fff; }
.tool.danger:hover { background: #dc2626; }
.side-panel {
  position: fixed; right: 12px; top: 64px; bottom: 84px; width: min(320px, calc(100% - 24px));
  background: #111a2e; border: 1px solid #24324d; border-radius: 12px;
  display: none; flex-direction: column; z-index: 50; overflow: hidden;
}
.side-panel.open { display: flex; }
.side-panel .ph {
  padding: 14px 16px; border-bottom: 1px solid #24324d; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.side-panel .pb { padding: 8px; overflow: auto; flex: 1; }
.member {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px;
}
.member:hover { background: rgba(255,255,255,.04); }
.member .av {
  width: 32px; height: 32px; border-radius: 50%; background: #2563eb;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 13px; z-index: 300; display: none;
  max-width: min(90vw, 480px); text-align: center;
}
.toast.show { display: block; }
.stream-hint {
  position: absolute; left: 8px; right: 8px; bottom: 36px;
  font-size: 10px; color: #64748b; word-break: break-all; line-height: 1.3;
  opacity: .85;
}

@media (max-width: 960px) {
  .hero-grid, .feature-grid, .quick-grid, .bullets { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h);
    left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
    padding: 16px; gap: 14px;
  }
  .menu-toggle { display: inline-block; }
}
@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .hero-grid, .feature-grid, .quick-grid, .bullets { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .header-actions .btn-ghost { display: none; }
}
