/* 小涵音频工作室 · 实时语音沟通站 */

[hidden] {
  display: none !important;
}

.voice-page {
  min-height: 100vh;
}

.voice-hero {
  display: grid;
  grid-template-columns: minmax(0, 780px);
  gap: 0;
  align-items: center;
  padding: 66px 0 44px;
}

.voice-hero h1 {
  margin: 0;
  font-size: clamp(42px, 5.8vw, 72px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.voice-hero h1 em {
  font-style: normal;
  background: linear-gradient(110deg, #b3a7ff 0%, #8a7cff 42%, #5cc8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.voice-lead {
  max-width: 590px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.voice-lead strong {
  color: var(--text);
  font-weight: 600;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.signal-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(154, 140, 255, 0.12), transparent 62%),
    var(--panel);
  box-shadow: var(--shadow);
}

.signal-head,
.signal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.signal-foot {
  justify-content: flex-start;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.signal-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 190px;
  padding: 26px 8px;
}

.signal-body-3 {
  gap: 8px;
  padding-left: 0;
  padding-right: 0;
}

.signal-body-3 .signal-node {
  width: 86px;
  padding: 14px 5px;
}

.signal-body-3 .signal-node strong {
  font-size: 13px;
}

.signal-body-3 .signal-wire {
  min-width: 12px;
}

.signal-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 104px;
  padding: 16px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.signal-node span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.signal-node strong {
  font-size: 14px;
  font-weight: 600;
}

.signal-wire {
  position: relative;
  flex: 1;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(154, 140, 255, 0.2), rgba(92, 200, 255, 0.2));
}

.signal-wire i {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #b3a7ff, #5cc8ff, transparent);
  animation: signal-run 2.4s ease-in-out infinite;
}

@keyframes signal-run {
  0% { left: -40%; }
  100% { left: 100%; }
}

.entry-section {
  padding: 10px 0 54px;
}

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

.entry-card {
  position: relative;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(100% 120% at 0% 0%, rgba(154, 140, 255, 0.08), transparent 55%),
    var(--panel);
}

.entry-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.entry-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.entry-card h2 {
  margin: 14px 0 8px;
  font-size: 28px;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.entry-card > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.field > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  background: rgba(154, 140, 255, 0.06);
}

.field select {
  cursor: pointer;
}

.field select option {
  color: #f2f0ff;
  background: #12102a;
}

.entry-card .btn {
  width: 100%;
  margin-top: 20px;
}

.entry-card .form-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.feature-section {
  padding: 8px 0 78px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.feature {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.feature .num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.feature h3 {
  margin: 10px 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(92, 200, 255, 0.2);
  border-radius: 13px;
  background: rgba(92, 200, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.notice strong {
  color: var(--text);
}

/* --- prejoin --------------------------------------------------------------- */
.prejoin-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 34px 18px;
}

.prejoin-card {
  width: min(660px, 100%);
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(110% 100% at 0% 0%, rgba(154, 140, 255, 0.1), transparent 55%),
    var(--panel);
  box-shadow: var(--shadow);
}

.prejoin-card .brand {
  display: flex;
  width: fit-content;
  margin-bottom: 30px;
}

.prejoin-card h1 {
  margin: 0;
  font-size: clamp(32px, 4.6vw, 46px);
  font-weight: 640;
  letter-spacing: -0.04em;
}

.prejoin-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.room-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--accent-2);
  background: rgba(92, 200, 255, 0.06);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.prejoin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  margin-top: 22px;
}

.prejoin-grid .field.full {
  grid-column: 1 / -1;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.level-meter {
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.level-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.08s linear;
}

.level-label {
  min-width: 40px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  text-align: right;
}

.prejoin-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.prejoin-actions .btn {
  flex: 1;
}

.prejoin-note {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.7;
}

.mic-hint {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.7;
}

.mic-hint.error {
  color: var(--danger);
}

.prejoin-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 12px;
}

/* --- call ------------------------------------------------------------------ */
.call-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 6, 18, 0.72);
  backdrop-filter: blur(16px);
}

.call-header-left,
.call-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.room-chip strong {
  color: var(--accent-2);
  font-weight: 500;
}

.room-chip #seatCount {
  color: var(--accent);
  font-family: var(--mono);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.status-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-chip.online i {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.status-chip.warn i {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.status-chip.error i {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.quality-chip {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.call-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 24px;
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(80% 80% at 50% 0%, rgba(154, 140, 255, 0.06), transparent 65%),
    rgba(10, 8, 23, 0.55);
  overflow: hidden;
}

.participants {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: center;
  padding: 24px;
}

.participant {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 210px;
  padding: 24px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(100% 100% at 50% 0%, rgba(154, 140, 255, 0.08), transparent 65%),
    rgba(255, 255, 255, 0.025);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.participant.speaking {
  border-color: rgba(154, 140, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(154, 140, 255, 0.2), 0 0 34px rgba(154, 140, 255, 0.16);
}

.participant.waiting {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.015);
  opacity: 0.72;
}

.participant.waiting .avatar {
  border-style: dashed;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.03);
  font-size: 24px;
}

.participant.waiting .peer-name {
  color: var(--muted);
}

.avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text);
  background: linear-gradient(145deg, rgba(154, 140, 255, 0.22), rgba(92, 200, 255, 0.1));
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.participant.speaking .avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(154, 140, 255, 0.1);
}

.participant .peer-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant .peer-role {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.participant .mic-flag {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(8, 6, 18, 0.5);
  font-family: var(--mono);
  font-size: 8px;
}

.participant .mic-flag.off {
  color: var(--danger);
  border-color: rgba(255, 107, 157, 0.3);
  background: rgba(255, 107, 157, 0.08);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(8, 6, 18, 0.55);
}

.control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.control-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.control-btn.active {
  color: #fff;
  border-color: rgba(154, 140, 255, 0.5);
  background: linear-gradient(135deg, rgba(154, 140, 255, 0.3), rgba(92, 200, 255, 0.18));
}

.control-btn.danger {
  color: var(--danger);
  border-color: rgba(255, 107, 157, 0.25);
}

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

.control-btn svg {
  width: 15px;
  height: 15px;
}

.control-select {
  min-height: 40px;
  max-width: 190px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

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

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.panel-head strong {
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--panel-solid);
}

.stat-item span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.stat-item strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 550;
}

.stat-item strong.good {
  color: var(--accent);
}

.stat-item strong.warn {
  color: #fbbf24;
}

.stat-item strong.bad {
  color: var(--danger);
}

.chat-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 260px;
}

.chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding: 12px 14px;
}

.chat-empty {
  margin: auto 0;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 92%;
}

.chat-message.self {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-meta {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.chat-text {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.chat-message.self .chat-text {
  border-color: rgba(154, 140, 255, 0.25);
  background: rgba(154, 140, 255, 0.1);
  color: var(--text);
}

.chat-form {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.chat-form input:focus {
  border-color: var(--accent);
}

.chat-form button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(154, 140, 255, 0.14);
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1100px) {
  .voice-hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 48px;
  }

  .signal-card {
    max-width: 560px;
  }

  .call-main {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .chat-panel {
    min-height: 240px;
  }
}

@media (max-width: 820px) {
  .entry-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

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

  .prejoin-grid .field.full {
    grid-column: auto;
  }

  .call-header {
    padding: 12px 16px;
  }

  .call-main {
    padding: 12px 14px 18px;
  }

  .participants {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .participant {
    min-height: 160px;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .chat-log {
    max-height: 220px;
  }

  .controls {
    justify-content: flex-start;
  }

  .control-select {
    max-width: 150px;
  }
}

@media (max-width: 560px) {
  .prejoin-card {
    padding: 24px;
  }

  .prejoin-actions {
    flex-direction: column;
  }

  .signal-body {
    min-height: 150px;
  }

  .signal-node {
    width: 84px;
  }

  .call-header-left .brand-text small {
    display: none;
  }

  .room-chip {
    display: none;
  }
}
