/* 云舍 YS-SKIN v1 · 仅样式改造，选择器与原版保持一致 */

:root {
  --ink: #0B1220;
  --muted: #5B6472;
  --line: #E6E9F0;
  --paper: #F6F8FC;
  --panel: #FFFFFF;
  --brand: #2B5CFF;
  --brand-deep: #1B48E0;
  --accent: #7C5CFF;
  --live: #12B76A;
  --stage: #0B1220;
  --stage-2: #16233F;
  --mint: #B9C8FF;
  --purple: #7C5CFF;
  --wash: #EEF3FF;
  --danger: #E5484D;
  --radius: 16px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:active { transform: translateY(1px); }
code {
  font-family: ui-monospace, Consolas, monospace;
  background: var(--wash);
  color: var(--brand-deep);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}
[hidden],
.modal[hidden],
.apply-box[hidden],
.toast[hidden],
.view[hidden],
.side-panel[hidden],
.err[hidden],
.owner-only[hidden] {
  display: none !important;
}

#app { min-height: 100%; }
.view { min-height: 100vh; animation: viewIn 0.45s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ========== Login：品牌全幅 + 表单 ========== */
.login-view {
  display: grid;
  grid-template-columns: 1.35fr minmax(320px, 420px);
  min-height: 100vh;
  background: #0B1220;
}
.login-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 56px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(124, 92, 255, 0.30), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 15%, rgba(43, 92, 255, 0.42), transparent 50%),
    linear-gradient(160deg, #0B1220 0%, #101C36 48%, #16233F 100%);
}
.hero-waves {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-waves span {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: 50%;
  animation: rip 6s var(--ease) infinite;
}
.hero-waves span:nth-child(2) { width: 280px; height: 280px; animation-delay: 0.6s; }
.hero-waves span:nth-child(3) { width: 400px; height: 400px; animation-delay: 1.2s; }
.hero-waves span:nth-child(4) { width: 540px; height: 540px; animation-delay: 1.8s; }
@keyframes rip {
  0% { transform: scale(0.86); opacity: 0.55; }
  70% { opacity: 0.12; }
  100% { transform: scale(1.18); opacity: 0; }
}
.hero-copy { position: relative; z-index: 1; max-width: 520px; color: #EAF0FF; }
.hero-brand {
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 18px;
}
.hero-line {
  margin: 0;
  font-size: 1.15rem;
  color: rgba(234, 240, 255, 0.72);
  letter-spacing: 0.12em;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 40px 36px;
  background: var(--panel);
}
.login-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.login-sub { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }
.login-panel label,
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.login-panel input,
.modal-card input,
.modal-card select,
.lobby-tools input,
.lobby-tools select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.login-panel input:focus,
.modal-card input:focus,
.modal-card select:focus,
.lobby-tools input:focus,
.lobby-tools select:focus {
  border-color: #2B5CFF;
  box-shadow: 0 0 0 3px rgba(43, 92, 255, 0.14);
}
.cred-tip {
  margin: 4px 0;
  padding: 12px 14px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-2, #3D4657);
}
.cred-title { font-weight: 700; margin-bottom: 2px; }
.cred-sub { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
#btn-login, .primary {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #2B5CFF, #7C5CFF);
  color: #fff;
  font-weight: 650;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
#btn-login:hover, .primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(43, 92, 255, 0.10);
}
.err { color: var(--danger); margin: 0; font-size: 0.88rem; }

/* ========== Lobby ========== */
.lobby-view {
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(43, 92, 255, 0.08), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(124, 92, 255, 0.07), transparent 50%),
    var(--paper);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand-sm {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.me-label { color: var(--muted); font-size: 0.88rem; }
.ghost {
  border: 1px solid rgba(43, 92, 255, 0.35);
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--brand-deep);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.lobby-main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 72px; }
.lobby-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: 0.01em;
  color: var(--ink);
}
.lobby-head p { margin: 0 0 22px; color: var(--muted); }
.lobby-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}
.lobby-tools input { min-width: 220px; flex: 1; }
.room-stat { color: var(--muted); font-size: 0.85rem; margin-left: auto; }

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.room-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: inherit;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  animation: cardIn 0.5s var(--ease) both;
}
.room-card:nth-child(2) { animation-delay: 0.04s; }
.room-card:nth-child(3) { animation-delay: 0.08s; }
.room-card:nth-child(4) { animation-delay: 0.12s; }
.room-card:nth-child(5) { animation-delay: 0.16s; }
.room-card:nth-child(6) { animation-delay: 0.2s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.room-card:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 92, 255, 0.35);
  box-shadow: 0 16px 36px rgba(43, 92, 255, 0.12);
}
.room-card .cover-chip {
  width: 72px;
  min-height: 100%;
  border-radius: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14), transparent),
    linear-gradient(160deg, #2B5CFF, #7C5CFF);
  color: #fff;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.room-card .body { padding: 14px 14px 14px 0; min-width: 0; }
.room-card h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.room-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 650;
}
.badge.live { background: #E7F6EF; color: #0E9F60; }
.badge.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: blink 1.4s ease infinite;
}
.badge.idle { background: #F2F4F8; color: var(--muted); }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ========== Room stage ========== */
.room-view {
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(43, 92, 255, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 70%, rgba(124, 92, 255, 0.20), transparent 55%),
    linear-gradient(165deg, #0B1220 0%, var(--stage) 40%, var(--stage-2) 100%);
  color: #E7ECFA;
}
.room-top {
  background: rgba(11, 18, 32, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  color: #E7ECFA;
}
.room-top .ghost {
  background: transparent;
  color: #DCE5FF;
  border-color: rgba(255, 255, 255, 0.16);
}
.room-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.room-cover {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2B5CFF, #7C5CFF);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.room-title-text { min-width: 0; }
.room-title-wrap h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #F2F5FF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-topic {
  margin: 3px 0 0;
  color: rgba(185, 200, 255, 0.75);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}
.status-dot {
  font-size: 0.82rem;
  color: var(--mint);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2B5CFF;
  box-shadow: 0 0 0 0 rgba(43, 92, 255, 0.5);
  animation: livePulse 1.8s ease infinite;
}
.status-dot.idle { color: rgba(185, 200, 255, 0.55); }
.status-dot.idle::before {
  background: #6B7896;
  animation: none;
  box-shadow: none;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(43, 92, 255, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(43, 92, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 92, 255, 0); }
}
.like-count {
  font-variant-numeric: tabular-nums;
  color: #A99BFF;
  font-weight: 650;
  font-size: 0.9rem;
}
.like-count::before { content: "赞 "; color: rgba(169, 155, 255, 0.7); font-weight: 500; }

.room-body {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 360px);
  min-height: calc(100vh - 66px);
}
.stage {
  position: relative;
  padding: 28px 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(124, 92, 255, 0.16), transparent 70%),
    linear-gradient(165deg, #0B1220 0%, #16233F 100%);
}
.stage-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(124, 92, 255, 0.22), transparent 68%);
  pointer-events: none;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}
.seat-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  flex: 1;
  align-content: center;
}
.seat {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #D7DEF5;
  position: relative;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.seat:hover { transform: translateY(-2px); border-color: rgba(124, 92, 255, 0.45); }
.seat.filled {
  background: rgba(43, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.35);
}
.seat.locked { opacity: 0.4; }
.seat.speaking {
  border-color: rgba(43, 92, 255, 0.8);
  background: rgba(43, 92, 255, 0.18);
  box-shadow: 0 0 24px rgba(43, 92, 255, 0.35);
}
.seat.speaking .avatar {
  animation: speakBounce 0.9s ease-in-out infinite;
}
.seat.speaking::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 20px;
  border: 1px solid rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 18px rgba(43, 92, 255, 0.35);
  animation: seatRing 1.2s ease-out infinite;
  pointer-events: none;
}
@keyframes speakBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes seatRing {
  from { transform: scale(0.96); opacity: 0.8; }
  to { transform: scale(1.08); opacity: 0; }
}
.seat .avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2B5CFF, #7C5CFF);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}
.seat .name { font-size: 0.86rem; font-weight: 500; }
.seat .tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(11, 18, 32, 0.5);
  letter-spacing: 0.02em;
}
.seat .mute-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
  color: #FF8FA3;
}
.seat .empty-label { color: rgba(185, 200, 255, 0.55); font-size: 0.82rem; }

.stage-bar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 10px 0 8px;
}
.ctl {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #E7ECFA;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 550;
  min-width: 88px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.ctl:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.ctl:disabled { opacity: 0.38; cursor: not-allowed; }
.ctl.accent { background: linear-gradient(135deg, #2B5CFF, #7C5CFF); border-color: transparent; color: #fff; }
.ctl.on { background: var(--brand); border-color: transparent; }

.side {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(11, 18, 32, 0.55);
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(8px);
}
.side-tabs { display: flex; padding: 14px 14px 0; gap: 6px; }
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(185, 200, 255, 0.55);
  padding: 10px;
  border-radius: 10px;
  font-weight: 550;
}
.tab.active {
  background: rgba(43, 92, 255, 0.22);
  color: #fff;
}
.side-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px 14px 14px;
}
.chat-list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 2px;
}
.chat-item {
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(231, 236, 250, 0.88);
  animation: chatIn 0.25s var(--ease);
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.chat-item .who {
  color: #9DB2FF;
  font-weight: 650;
  margin-right: 6px;
}
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 18, 32, 0.45);
  color: #fff;
  padding: 11px 12px;
  outline: none;
}
.chat-form input:focus { border-color: rgba(43, 92, 255, 0.8); }
.chat-form button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2B5CFF, #7C5CFF);
  color: #fff;
  padding: 0 16px;
  font-weight: 650;
}
.audience-list { overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.aud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}
.aud-row .info { display: flex; align-items: center; gap: 10px; }
.aud-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2B5CFF, #7C5CFF);
  color: #fff;
  font-weight: 650;
}
.aud-row button {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

/* Modal / toast */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: viewIn 0.25s var(--ease);
}
.modal-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.14);
  color: var(--ink);
}
.modal-card h3 { margin: 0; font-size: 1.2rem; color: var(--ink); }
.modal-sub { margin: -4px 0 4px; color: var(--muted); font-size: 0.88rem; }
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(11, 18, 32, 0.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  z-index: 50;
  font-size: 0.9rem;
  animation: viewIn 0.25s var(--ease);
}
.apply-box {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(320px, calc(100vw - 40px));
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(11, 18, 32, 0.14);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: viewIn 0.28s var(--ease);
}
.apply-box .actions { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 960px) {
  .login-view { grid-template-columns: 1fr; }
  .login-hero { min-height: 42vh; padding: 36px 28px; }
  .hero-brand { font-size: 2.6rem; }
  .room-body { grid-template-columns: 1fr; }
  .side {
    min-height: 300px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .seat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .seat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .modal-row { grid-template-columns: 1fr; }
  .room-stat { margin-left: 0; width: 100%; }
}
