/* BuBu 语音 —— YY 风格主题基础 */
@font-face {
  font-family: 'Baloo2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../../vendor/fonts/baloo2-latin-800.woff2') format('woff2');
}

:root {
  /* 底色 */
  --bg-0: #0b0e14;     /* 页面最底 */
  --bg-1: #131722;     /* 侧栏 / 面板 */
  --bg-2: #1b2130;     /* 卡片 */
  --bg-3: #232b3d;     /* 悬浮 / 输入框 */
  --bg-4: #2c3549;     /* 按下 */
  --fg-0: #eaf0ff;     /* 主文字 */
  --fg-1: #9fb0cc;     /* 次要 */
  --fg-2: #63718c;     /* 弱化 / 占位 */
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --accent-glow: rgba(56, 189, 248, 0.45);

  /* 品牌渐变 */
  --brand-1: #7dd3fc;
  --brand-2: #38bdf8;
  --brand-3: #0ea5e9;
  --brand-grad: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 48%, var(--brand-3) 100%);

  /* 状态色 */
  --ok: #35d07f;
  --warn: #f0b429;
  --danger: #ef4b5c;
  --danger-dim: #c2323f;

  /* 马甲颜色 */
  --role-owner: #ff3b6b;     /* 房主 */
  --role-admin: #ff8a3d;     /* 橙马 */
  --role-fenma: #ffd23d;     /* 粉马 */
  --role-lanma: #4d8cff;     /* 蓝马 */
  --role-none: #63718c;      /* 游客 */
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --sidebar-w: 220px;
  --chat-w: 320px;

  /* 阴影 */
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.5);
}

/* 品牌标牌 */

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  line-height: 1.1;
  user-select: none;
}

.brand-en {
  display: inline-block;
  font-family: 'Baloo2', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.005em;
  /* 结尾留一点空间 */
  padding-right: 0.06em;

  background-image: var(--brand-grad);
  background-size: 220% 220%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;

  /* 渐变缓慢流动 —— 这就是"灵动"的那一 */
  animation: brand-flow 7s ease-in-out infinite;
}

.brand-cn {
  font-size: 0.86em;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--fg-1);
  white-space: nowrap;
}

@keyframes brand-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* 尊重系统的"减少动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  .brand-en {
    animation: none;
  }
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 桌面端不需要整页滚动 */
  overflow: hidden;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--fg-2);
}

/* 通用组件 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-3);
  color: var(--fg-0);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.06s, opacity 0.15s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover:not(:disabled) {
  background: var(--bg-4);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #04212a;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: #3adeeb;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #f56473;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--bg-4);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-3);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--bg-4);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--fg-0);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder {
  color: var(--fg-2);
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.card {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

/* 马甲色点 */
.role-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

/* 文本省略 */
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 滚动区域 */
.scroll-y {
  overflow-y: auto;
  overflow-x: hidden;
}

/* 麦位 */

.seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  cursor: default;
  user-select: none;
}

.seat-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--fg-1);
  /* 空位用虚线 */
  border: 2px dashed var(--bg-4);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.seat.occupied .seat-avatar {
  border-style: solid;
  border-color: var(--role-color, var(--bg-4));
  color: var(--fg-0);
}

/* 正在说话 */
.seat.speaking .seat-avatar {
  box-shadow: 0 0 0 3px var(--ok), 0 0 18px rgba(53, 208, 127, 0.55);
  transform: scale(1.04);
}

.seat.self .seat-avatar {
  border-color: var(--accent);
}

/* 官方账号 */
.seat.official .seat-avatar {
  background: #14110a;
  border-color: #f5c242;
  border-width: 3px;
  box-shadow: 0 0 0 1px rgba(245, 194, 66, 0.45), 0 0 14px rgba(245, 194, 66, 0.35);
  color: #f5c242;
}

/* 官方账号在麦上说话时 */
.seat.official.speaking .seat-avatar {
  box-shadow: 0 0 0 2px #f5c242, 0 0 22px rgba(245, 194, 66, 0.7);
}

.seat.official .seat-name {
  color: #f5c242;
  font-weight: 600;
}

.seat.locked .seat-avatar {
  border-style: dashed;
  border-color: var(--warn);
  cursor: not-allowed;
}

.seat-name {
  font-size: 12px;
  color: var(--fg-1);
  max-width: 84px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat.occupied .seat-name {
  color: var(--fg-0);
}

/* 麦位名字后面的等级图标 */
.seat-name-level {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-left: 2px;
  flex-shrink: 0;
}

/* 麦位序号 / 静音角标 */
.seat-badge {
  position: absolute;
  right: -2px;
  bottom: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 2px solid var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--fg-1);
}
.seat-badge.muted {
  color: var(--danger);
  background: rgba(239, 75, 92, 0.18);
}

/* 空位中间的加号 */
.seat-empty-icon {
  font-size: 24px;
  color: var(--fg-2);
  line-height: 1;
}

/* 提示条 */

.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  color: var(--fg-0);
  font-size: 13px;
  box-shadow: var(--shadow-2);
  animation: toast-in 0.18s ease-out;
}
.toast.err {
  background: var(--danger);
  color: #fff;
}
.toast.ok {
  background: var(--ok);
  color: #04231a;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 无障碍 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* 头像上的等级 / 官方徽章 */
.settings-avatar-wrap {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 56px;
}
.settings-avatar-wrap .settings-avatar {
  width: 56px;
  height: 56px;
}
.avatar-level-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.14);
  object-fit: contain;
  pointer-events: none;
}
.avatar-official-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.14);
  object-fit: contain;
  pointer-events: none;
}

/* 麦位上的等级 / 官方徽章 */
.seat-level-badge {
  position: absolute;
  right: -3px;
  bottom: 14px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.14);
  object-fit: contain;
  pointer-events: none;
}
.seat-official-badge {
  position: absolute;
  right: -3px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  object-fit: contain;
  pointer-events: none;
}

/* 频道设置页面 */
.cs-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-0);
  color: var(--fg-0);
}
.cs-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--bg-3);
  flex-shrink: 0;
}
.cs-back {
  color: var(--fg-1);
  gap: 6px;
  font-size: 13px;
}
.cs-back:hover { color: var(--fg-0); }
.cs-top-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cs-top-sep { color: var(--fg-2); font-size: 16px; }
.cs-top-name { color: var(--fg-0); font-size: 15px; font-weight: 600; }
.cs-load {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--fg-2);
}
.cs-spin {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cs-spin 0.8s linear infinite;
}
@keyframes cs-spin { to { transform: rotate(360deg); } }
.cs-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.cs-nav {
  width: 200px;
  background: var(--bg-1);
  border-right: 1px solid var(--bg-3);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
}
.cs-nav-grp {
  padding: 12px 16px 4px;
  font-size: 10px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.cs-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--fg-1);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  font-family: inherit;
}
.cs-nav-btn:hover { background: var(--bg-2); color: var(--fg-0); }
.cs-nav-btn.on {
  background: var(--bg-2);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.cs-nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.cs-nav-spacer { flex: 1; }
.cs-nav-danger { color: var(--danger) !important; }
.cs-nav-danger.on { border-left-color: var(--danger); background: rgba(239,75,92,0.1); }
.cs-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}
.cs-card {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 860px;
}
.cs-card-danger { border-color: rgba(239,75,92,0.3); }
.cs-h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-0);
}
.cs-h2-icon { font-size: 18px; }
.cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.cs-head .cs-h2 { margin-bottom: 0; }
.cs-desc {
  color: var(--fg-2);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.7;
}
.cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cs-field { display: flex; flex-direction: column; gap: 6px; }
.cs-field label {
  font-size: 12px;
  color: var(--fg-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cs-field-full { grid-column: 1 / -1; }
.cs-static {
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: var(--radius);
  color: var(--fg-1);
  font-size: 14px;
  font-family: monospace;
}
.cs-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--fg-1);
}
.cs-check input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.cs-save { margin-top: 20px; }
.cs-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--fg-2);
  font-size: 14px;
}
.cs-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cs-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.cs-pill {
  padding: 5px 14px;
  border: 1px solid var(--bg-3);
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  font-size: 12px;
  cursor: pointer;
  color: var(--fg-1);
  font-family: inherit;
  transition: all 0.15s;
}
.cs-pill:hover { border-color: var(--accent); color: var(--fg-0); }
.cs-pill.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cs-rows { display: flex; flex-direction: column; gap: 8px; }
.cs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--bg-3);
  transition: border-color 0.15s;
}
.cs-row:hover { border-color: var(--bg-4); }
.cs-row-main { flex: 1; min-width: 0; }
.cs-row-name { font-size: 14px; font-weight: 600; color: var(--fg-0); display: block; }
.cs-row-desc { font-size: 12px; color: var(--fg-2); margin-top: 2px; display: block; }
.cs-row-tags { display: flex; gap: 6px; flex-shrink: 0; }
.cs-row-acts { display: flex; gap: 4px; flex-shrink: 0; }
.cs-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--bg-3);
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--fg-1);
  font-weight: 600;
}
.cs-tag.warn { background: rgba(240,180,41,0.15); color: var(--warn); }
.cs-btn-del { color: var(--danger) !important; }
.cs-btn-del:hover { background: rgba(239,75,92,0.1) !important; }
.cs-code {
  display: inline-block;
  padding: 8px 14px;
  background: var(--bg-0);
  border: 1px solid var(--bg-3);
  border-radius: var(--radius);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px;
  color: var(--accent);
  word-break: break-all;
  letter-spacing: 1px;
}
.cs-invite {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-3);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cs-invite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cs-invite-label {
  font-size: 12px;
  color: var(--fg-2);
  font-weight: 600;
  min-width: 60px;
}
.cs-invite-exp { color: var(--warn); font-size: 13px; }
.cs-btn-row { display: flex; gap: 10px; margin-top: 16px; }
.cs-perm {
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--bg-3);
  overflow: hidden;
}
.cs-perm-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-3);
  font-size: 13px;
}
.cs-perm-row:last-child { border-bottom: none; }
.cs-perm-head {
  background: var(--bg-3);
  font-weight: 700;
  color: var(--fg-1);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cs-perm-row > span:first-child { flex: 1; color: var(--fg-0); }
.cs-perm-row > span { width: 90px; text-align: center; }
.cs-perm-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.cs-inline { display: flex; gap: 8px; align-items: center; }
.cs-kw-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cs-kw {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-2);
  border: 1px solid var(--bg-3);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--fg-0);
}
.cs-kw button {
  background: none;
  border: none;
  color: var(--fg-2);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}
.cs-kw button:hover { color: var(--danger); }
.cs-members { display: flex; flex-direction: column; gap: 6px; }
.cs-member {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--bg-3);
}
.cs-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.cs-member-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}
.cs-member-avatar-text {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.cs-member-info { flex: 1; min-width: 0; }
.cs-member-name { font-size: 14px; font-weight: 600; color: var(--fg-0); }
.cs-member-meta { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--fg-2); }
.cs-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.cs-member-acts { display: flex; gap: 4px; flex-shrink: 0; }
.cs-btn-disband {
  background: var(--danger) !important;
  color: #fff !important;
  font-weight: 700;
  padding: 12px 28px;
  font-size: 15px;
}
.cs-btn-disband:hover { background: var(--danger-dim) !important; }

/* 弹窗 */
.cs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.cs-modal {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2);
}
.cs-modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-3);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-0);
}
.cs-modal-b { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.cs-modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--bg-3);
}
.cs-err { color: var(--danger); font-size: 13px; margin: 0; }

/* 弹窗遮罩层 */
.cs-modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.cs-modal-sm { max-width: 360px; }

/* 角色选择器 */
.cs-role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.cs-role-btn {
  padding: 6px 14px;
  border: 2px solid var(--bg-3);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.cs-role-btn:hover {
  border-color: var(--primary);
  background: rgba(99,102,241,0.1);
}
