:root {
  --fg: #2b2f3a;            /* 深岩蓝(非纯黑) */
  --muted: #8a8f9c;
  --line: rgba(24, 28, 46, 0.10);
  --accent: #635bff;        /* 友好靛蓝 */
  --surface: rgba(255, 255, 255, 0.72);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  /* 浅色:暖奶白 + 右上一抹冷光,柔和通透 */
  background:
    radial-gradient(1100px 720px at 80% -12%, #e9f0ff 0%, rgba(233,240,255,0) 60%),
    radial-gradient(900px 700px at 8% 110%, #ffeede 0%, rgba(255,238,222,0) 55%),
    #f7f4ee;
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

/* 透明叠层 */
.overlay-online {
  position: fixed; top: 14px; left: 16px; z-index: 20;
  color: var(--muted); font-size: 13px; font-weight: 600; pointer-events: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}
.overlay-qr {
  position: fixed; top: 14px; right: 16px; z-index: 20;
  width: 116px; height: 116px; padding: 7px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(24, 28, 46, 0.12);
}
.overlay-qr svg { width: 100%; height: 100%; display: block; }

/* 飞屏弹幕层(宽屏) */
.danmaku-layer {
  position: fixed; inset: 0 0 76px 0; overflow: hidden;
}
.bullet {
  position: absolute; left: 0;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; will-change: transform;
  font-weight: 700; font-size: 22px; line-height: 1.2;
  cursor: pointer; transition: transform 0.12s ease;
}
.bullet--paused { z-index: 5; }
.bullet__avatar {
  width: 40px; height: 40px; display: inline-block; flex: none;
  border-radius: 50%; box-shadow: 0 1px 5px rgba(24, 28, 46, 0.16);
}
.bullet__avatar svg { width: 100%; height: 100%; display: block; }
.bullet__text { text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7); }
.veh { display: inline-block; flex: none; }

/* 点赞按钮(飞屏 + 聊天通用) */
.like {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(24, 28, 46, 0.06); color: #8a8f9c;
  border: none; border-radius: 999px; padding: 2px 8px;
  font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1;
}
.like__icon { display: block; }
.is-liked .like { color: #e0467a; background: rgba(224, 70, 122, 0.14); }

/* 聊天流(窄屏) */
.chat-list {
  position: fixed; inset: 0 0 76px 0;
  display: none; flex-direction: column; gap: 8px;
  padding: 12px 12px 4px; overflow-y: auto;
}
.chat-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 7px 11px; box-shadow: 0 1px 3px rgba(24, 28, 46, 0.06);
}
.chat-row__avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%; box-shadow: 0 1px 4px rgba(24, 28, 46, 0.14);
}
.chat-row__avatar svg { width: 100%; height: 100%; display: block; }
.chat-row__text { flex: 1; font-size: 16px; font-weight: 600; word-break: break-word; }
.chat-row .like { flex: none; }

/* 底部输入 */
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 66px; z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.composer__avatar {
  width: 44px; height: 44px; flex: none; padding: 0; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 50%;
  overflow: hidden; box-shadow: 0 1px 5px rgba(24, 28, 46, 0.14);
}
.composer__avatar svg { width: 100%; height: 100%; display: block; }
.composer__input {
  flex: 1; height: 46px; padding: 0 16px;
  background: #fff; color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px; font-size: 16px; outline: none;
  box-shadow: 0 1px 3px rgba(24, 28, 46, 0.05);
}
.composer__input::placeholder { color: #aab0bd; }
.composer__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15); }
.composer__send {
  height: 46px; padding: 0 20px; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: 14px;
  font-weight: 700; font-size: 16px;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}
.composer__send:hover { filter: brightness(1.05); }

/* 头像气泡(无用户名) */
.popover {
  position: fixed; left: 16px; bottom: 78px; z-index: 40;
  min-width: 156px; padding: 12px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(24, 28, 46, 0.16);
}
.popover__reroll {
  width: 100%; height: 38px; cursor: pointer; margin-bottom: 8px;
  background: #f1f0fb; color: var(--accent);
  border: 1px solid rgba(99, 91, 255, 0.25); border-radius: 11px; font-size: 14px; font-weight: 600;
}
.popover__reroll:hover { background: #eae8ff; }
.popover__langs { display: flex; gap: 6px; }
.popover__langs button {
  flex: 1; height: 34px; cursor: pointer;
  background: #fff; color: var(--muted);
  border: 1px solid var(--line); border-radius: 9px; font-size: 13px; font-weight: 600;
}
.popover__langs button.active { color: #fff; background: var(--accent); border-color: var(--accent); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%);
  background: rgba(43, 47, 58, 0.92); color: #fff; padding: 10px 16px; border-radius: 12px;
  z-index: 50; font-size: 14px; box-shadow: 0 6px 20px rgba(24, 28, 46, 0.2);
}

/* 模式切换:窄屏 = 聊天流,隐藏飞屏与二维码 */
@media (max-width: 640px) {
  .danmaku-layer { display: none; }
  .chat-list { display: flex; }
  .overlay-qr { display: none; }
}
