:root {
  --bg: #0f1220;
  --panel: #1a1f33;
  --panel-2: #222945;
  --accent: #0066ff;
  --accent-soft: rgba(0, 102, 255, .18);
  --ok: #00e676;
  --warn: #ffb020;
  --danger: #ff4d5a;
  --text: #e7ecf5;
  --dim: #8a93ad;
  --line: #2a3250;
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
}
.hidden { display: none !important; }
.dim { color: var(--dim); }
button { font-family: inherit; }

/* ================= 入会首页 ================= */
.join-page { max-width: 960px; margin: 0 auto; padding: 0 20px; animation: fadeUp .5s ease;
  min-height: 100vh; display: flex; flex-direction: column; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.join-nav { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav-tip { color: var(--dim); font-size: 13px; }

/* 元素整体重心下移：黄金分割点 ≈ 61.8%（上留 38.2%） */
.hero { text-align: center; padding: calc(38.2vh) 0 8px; }
.hero-title { margin: 0 0 12px; font-size: 40px; line-height: 1.35; letter-spacing: 2px; font-weight: 500; }
.hero-title .em { font-weight: 900; font-size: 52px; color: var(--accent); letter-spacing: 6px; margin-right: 10px; }

.cta-box { display: flex; gap: 10px; justify-content: center; align-items: stretch; }
.code-field { position: relative; }
.code-field input {
  width: 280px; font-size: 40px; padding: 12px 18px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--field); color: var(--text);
  text-align: center; letter-spacing: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.code-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-field input:disabled { opacity: .45; }
.code-hint { position: absolute; left: 4px; bottom: -22px; font-size: 12px; color: var(--dim); white-space: nowrap; }
/* 「会议号」高亮小字：点击 = 刷新随机会议号 */
.code-label {
  color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: 2px;
  text-decoration: none; cursor: pointer; transition: opacity .15s, letter-spacing .15s;
  display: inline-block;
}
.code-label:hover { opacity: .75; letter-spacing: 3px; }
.cta-box button {
  padding: 0 30px; border: 0; border-radius: 14px; background: var(--accent);
  color: #fff; font-size: 17px; font-weight: 600; cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.cta-box button:hover:not(:disabled) { transform: scale(1.02); box-shadow: 0 4px 22px var(--accent-soft); }
.cta-box button:disabled { opacity: .4; cursor: default; }

.id-row { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
/* 入会页身份行：头像与输入框同高（44px） */
.id-pick { display: flex; align-items: center; gap: 10px; position: relative; }
.id-pick input {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); font-size: 14px; width: 200px; outline: none;
}
.id-pick input:focus { border-color: var(--accent); }
.join-status { min-height: 18px; font-size: 13px; color: var(--warn); }
.join-status.ok { color: var(--ok); }
.join-status.err { color: var(--danger); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 44px 0 30px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; text-align: left; }
.feature-ico { font-size: 24px; margin-bottom: 8px; }
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.6; }

.join-footer { display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: flex-end; margin-top: auto; padding: 18px 0 12px; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.join-footer .foot-slogan { text-align: center; }
.join-footer .foot-slogan .dim { font-size: 11px; letter-spacing: 2px; }
.join-footer .foot-slogan .em-line {
  margin-top: 6px; font-size: 14px; font-weight: 800; color: var(--accent);
  letter-spacing: 4px;
}
/* 入会页密码行 */
.pass-row { margin-top: 14px; }
.pass-row input {
  width: 100%; box-sizing: border-box; text-align: center;
  background: var(--field); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 10px 14px; font-size: 14px; font-family: inherit;
  outline: none; letter-spacing: 1px;
}
.pass-row input:focus { border-color: var(--accent); }

/* ---- 头像下拉菜单 ---- */
.avatar-menu {
  position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 50;
  width: 264px; padding: 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0,0,0,.45); animation: fadeUp .18s ease;
}
.avatar-menu .am-sec { font-size: 11px; color: var(--dim); letter-spacing: 1px; margin: 2px 0 8px; }
.avatar-menu .am-sec:not(:first-child) { margin-top: 14px; }
.am-emoji { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.am-item { display: inline-flex; align-items: center; justify-content: center; }
.am-emoji-item {
  width: 28px; height: 28px; font-size: 17px; border-radius: 8px; cursor: pointer;
  transition: background .12s, transform .12s;
}
.am-emoji-item:hover { background: var(--accent-soft); transform: scale(1.12); }
.am-colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.am-color-item { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .12s, border-color .12s; }
.am-color-item:hover { transform: scale(1.15); border-color: #fff; }
.am-custom { margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.am-custom button {
  flex: 1; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); font-size: 13px; cursor: pointer;
}
.am-custom button:hover { border-color: var(--accent); }
.am-custom input[type=color] {
  width: 40px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--field); cursor: pointer;
}
/* 头像：emoji 类型 */
.avatar.av-emoji { background: var(--panel-2); font-size: 1.2em; }
.avatar-lg.av-emoji { font-size: 22px; }
/* footer 标语内 mic 图标 */
.mic-ico { width: 15px; height: 15px; vertical-align: -2px; margin-left: 2px; }
.sec-badge { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; }

/* ================= 头像（主流工具风格：字母 + 品牌色） ================= */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; user-select: none;
}
.avatar-lg { width: 40px; height: 40px; font-size: 16px; cursor: pointer; transition: transform .15s; } /* 与昵称输入框同高 */
.avatar-lg:hover { transform: scale(1.08); }
.avatar-md { width: 28px; height: 28px; font-size: 12px; }
/* 品牌色系：Google Meet / Zoom / Slack / Teams / Discord / QQ / WeChat / 飞书 / 钉钉 / Notion */
.av-0 { background: #ea4335; } .av-1 { background: #0b5cff; } .av-2 { background: #611f69; }
.av-3 { background: #4b53bc; } .av-4 { background: #5865f2; } .av-5 { background: #12b7f5; }
.av-6 { background: #07c160; } .av-7 { background: #3370ff; } .av-8 { background: #ff6a00; }
.av-9 { background: #37352f; } .av-10 { background: #7c4dff; } .av-11 { background: #ff4081; }

/* ================= 会议页 ================= */
.panel { max-width: 1200px; margin: 0 auto; padding: 18px 20px 24px; }
.room-header { display: flex; justify-content: space-between; align-items: baseline; }
.room-header h2 { font-size: 24px; letter-spacing: 6px; margin: 0; }
.room-copy { font-size: 12px; margin-left: 14px; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.conn-status { font-size: 13px; color: var(--dim); }
#connBadge.ok { color: var(--ok); }
#connBadge.turn { color: var(--warn); }
#connBadge.wait { color: var(--dim); }

.room-body { display: flex; gap: 14px; align-items: flex-start; }
.video-grid {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin: 14px 0;
}
.tile {
  background: #000; border-radius: 14px; aspect-ratio: 4/3; position: relative; overflow: hidden;
  border: 1px solid var(--line);
}
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile .tile-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; background: var(--panel);
}
.tile .tile-empty .avatar { width: 64px; height: 64px; font-size: 26px; }
.tile .tile-empty .tile-status { font-size: 12px; color: var(--dim); }
.tile .name {
  position: absolute; left: 8px; bottom: 6px; font-size: 12px; color: #fff;
  background: rgba(0,0,0,.55); padding: 2px 8px; border-radius: 6px; max-width: 80%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile.muted::after {
  content: "🔇"; position: absolute; right: 8px; top: 8px; font-size: 14px;
  background: rgba(255,77,90,.7); border-radius: 6px; padding: 2px 6px;
}
.tile.has-screen { border-color: var(--accent); }

/* 侧栏与会者 */
.sidebar { width: 240px; flex: none; background: var(--panel); border-radius: 14px; padding: 14px 16px; }
.sidebar h3 { margin: 0; font-size: 14px; }
.peer-list { list-style: none; padding: 0; margin: 10px 0 0; max-height: 520px; overflow-y: auto; }
.peer-list li {
  padding: 7px 4px; display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; border-radius: 8px;
}
.peer-list li:hover { background: var(--panel-2); }
.peer-list .p-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.peer-list .p-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-list .p-state { font-size: 11px; color: var(--dim); }
.peer-list .p-rename { background: none; border: 0; cursor: pointer; font-size: 13px; opacity: .55; padding: 2px 4px; }
.peer-list .p-rename:hover { opacity: 1; }
.peer-list li.muted .p-name { color: var(--dim); }
.peer-list li.locked .p-name { color: var(--danger); }
.peer-list .p-crown { font-size: 11px; }
.peer-list .p-actions { display: flex; gap: 4px; flex: none; margin-left: 8px; }
.peer-list .p-act {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--dim);
  font-size: 10px; padding: 2px 6px; border-radius: 7px; cursor: pointer;
  transition: all .12s; font-family: inherit;
}
.peer-list .p-act:hover { color: var(--text); border-color: var(--accent); }
.peer-list .p-act.danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

/* 主持人控制面板（侧栏底部） */
.host-panel {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.host-panel .hp-title { font-size: 12px; font-weight: 700; color: var(--dim); letter-spacing: 2px; }
.host-panel .hp-btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; cursor: pointer;
  transition: all .15s; font-family: inherit; text-align: left;
}
.host-panel .hp-btn:hover { border-color: var(--accent); }
.host-panel .hp-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.host-panel .hp-btn.small { padding: 4px 10px; font-size: 11px; }
.host-panel .hp-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.host-panel .hp-label { font-size: 11px; color: var(--dim); flex: none; }
.host-panel .hp-chip {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--dim);
  border-radius: 12px; padding: 3px 10px; font-size: 11px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.host-panel .hp-chip:hover { border-color: var(--accent); color: var(--text); }
.host-panel .hp-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.host-panel #roomPassInput {
  flex: 1; min-width: 90px; background: var(--field); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 6px 8px; font-size: 12px;
  font-family: inherit; outline: none;
}
.host-panel #roomPassInput:focus { border-color: var(--accent); }
.host-panel .hp-invite { display: flex; flex-direction: column; gap: 6px; }
.host-panel .hp-invite code {
  font-size: 10px; color: var(--accent); word-break: break-all;
  background: var(--field); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; max-height: 72px; overflow-y: auto;
}
.host-panel .hp-tip { font-size: 10px; color: var(--dim); margin: 0; line-height: 1.6; }

/* 控制条 */
.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--panel); border-radius: 16px; padding: 12px 16px; }
.local-box { display: flex; align-items: center; gap: 10px; }
.local-video { width: 88px; height: 64px; background: #000; border-radius: 10px; object-fit: cover; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.grow { flex: 1; justify-content: center; }

.ctrl {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-width: 92px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ctrl:hover { transform: translateY(-2px); border-color: var(--accent); }
.ctrl-ico { height: 28px; display: inline-flex; align-items: center; }
.ctrl-ico svg { width: 26px; height: 26px; }
.ctrl-ico.off svg { opacity: .9; }
.ctrl-label { font-size: 12px; color: var(--dim); }
.ctrl.on { background: var(--accent); border-color: var(--accent); }
.ctrl.on .ctrl-label { color: #fff; }
.ctrl.on svg { color: #fff; }
.ctrl.off-toggle .ctrl-label { color: var(--danger); }
.ctrl.small { min-width: 0; flex-direction: row; gap: 6px; padding: 10px 16px; font-size: 14px; }
.ctrl.danger { color: var(--danger); border-color: rgba(255, 77, 90, .4); }
.ctrl.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.ctrl.phone-on { background: var(--danger); border-color: var(--danger); }
.ctrl.phone-on .ctrl-label { color: #fff; }
.ctrl.phone-on .ctrl-ico svg { color: #fff; }
.ctrl.disabled-look { opacity: .55; }

/* ================= 拨号盘 ================= */
.modal {
  position: fixed; inset: 0; background: rgba(5, 8, 18, .72); z-index: 50;
  display: flex; align-items: center; justify-content: center; animation: fadeUp .25s ease;
}
.modal-card {
  width: 340px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px 20px 20px; box-shadow: 0 18px 60px rgba(0,0,0,.5);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 12px; }
.dial-display {
  background: #0d1020; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-align: center; min-height: 76px; display: flex;
  flex-direction: column; justify-content: center; gap: 6px;
}
.dial-number { font-size: 26px; letter-spacing: 3px; min-height: 32px; }
.dial-status { font-size: 12px; color: var(--dim); min-height: 16px; }
.dial-status.ringing { color: var(--warn); }
.dial-status.talking { color: var(--ok); }
.dial-status.err { color: var(--danger); }

.dial-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.dial-key {
  padding: 14px 0; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 18px; cursor: pointer;
  transition: background .12s, transform .1s;
}
.dial-key small { display: block; font-size: 9px; color: var(--dim); letter-spacing: 2px; margin-top: 2px; }
.dial-key:hover { background: #2b345c; }
.dial-key:active { transform: scale(.96); }
.dial-key.call { background: var(--ok); color: #04150c; border-color: var(--ok); font-weight: 700; }
.dial-key.hangup { background: var(--danger); color: #fff; border-color: var(--danger); font-weight: 700; }
.dial-key:disabled { opacity: .4; cursor: default; }
.dial-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.dial-actions .dial-key { font-size: 15px; }
.dial-tip { margin: 12px 0 0; font-size: 12px; color: var(--dim); line-height: 1.6; }

/* 响应式 */
@media (max-width: 860px) {
  .room-body { flex-direction: column; }
  .sidebar { width: 100%; }
  .hero-title { font-size: 30px; }
  .hero-title .em { font-size: 38px; }
  .features { grid-template-columns: 1fr; }
  .code-field input { width: 220px; font-size: 30px; letter-spacing: 8px; }
  .ctrl { min-width: 76px; padding: 8px 8px; }
}

/* ================= 页面风格切换条（调试） ================= */
.theme-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 12px; }
.theme-bar .tb-item {
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
  font-size: 11px; padding: 4px 10px; border-radius: 14px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.theme-bar .tb-item:hover { color: var(--text); border-color: var(--accent); }
.theme-bar .tb-item.active {
  color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 700;
}

/* 玻璃拟态模式（风格 3）：卡片加 backdrop-blur */
body.theme-glass .tile,
body.theme-glass .modal-card { backdrop-filter: blur(14px); }
body.theme-glass .brand, body.theme-glass .hero, body.theme-glass .cta-box { backdrop-filter: blur(6px); }
