/* 咕咕嘎吱直播 GuguGazhi Live —— 全站样式（参照 B 站直播视觉） */
:root {
  --pink: #fb7299;
  --pink-deep: #ff5c8a;
  --pink-weak: #fff0f4;
  --blue: #23ade5;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #18191c;
  --text-2: #61666d;
  --text-3: #9499a0;
  --line: #e3e5e7;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0, 0, 0, .06);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .12);
  --live: #ff4e6a;
  --footer-h: 90px; /* 全站 .footer 的实际占位高度，用于内容区 min-height 计算 */
  /* 全站内容区统一宽度与左右留白 —— 顶部导航 / 首页 / 关注 / 创作中心 / 管理后台 / 直播间
     必须共用这两个变量，否则各页内容区左右边缘对不齐（曾经 1680 与 1400 混用） */
  --content-max: 1680px;
  --content-pad: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
/* 页脚吸底（内容不足一屏时页脚仍停在底部）：
   ⚠️ 不要用 `body { display:flex }` + `.footer { margin-top:auto }` 实现——
      body 变成列方向 flex 容器后，横向成为交叉轴，而 `align-items:stretch`
      **遇到 auto 外边距会失效**；`.container`/`.studio-wrap` 这类
      `margin:0 auto` 的居中容器因此退化为 shrink-to-fit，
      宽度塌成内容宽（首页曾塌到 810px / 关注页 320px），与顶部导航宽度对不上。
   正确做法：给内容容器本身一个 min-height，把页脚自然顶下去。 */
.container,
.studio-wrap,
.auth-wrap { min-height: calc(100vh - 56px - var(--footer-h)); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }
img { display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d0d3d8; border-radius: 4px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 var(--content-pad);
  height: 56px; display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--pink); letter-spacing: .5px; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pink), #ff9db8); color: #fff; font-size: 16px;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav-links a:hover { background: var(--pink-weak); color: var(--pink); }
.nav-links a.active { color: var(--pink); background: var(--pink-weak); }
.header-search { flex: 1; max-width: 420px; display: flex; }
.header-search input {
  flex: 1; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-right: none;
  border-radius: 8px 0 0 8px; outline: none; background: var(--bg);
}
.header-search input:focus { border-color: var(--pink); }
.header-search button {
  width: 52px; border: none; border-radius: 0 8px 8px 0; background: var(--pink); color: #fff; font-size: 13px;
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.user-chip:hover { background: var(--bg); }

/* 头像 */
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700;
  flex: none; user-select: none;
}

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 8px; padding: 7px 16px; font-size: 13px; transition: .15s;
}
.btn:hover { color: var(--pink); border-color: var(--pink); }
.btn.primary {
  background: linear-gradient(90deg, var(--pink), var(--pink-deep)); border: none; color: #fff; font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.big { padding: 10px 26px; font-size: 15px; border-radius: 10px; }
.btn.ghost-pink { border-color: var(--pink); color: var(--pink); background: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 首页 ---------- */
.hero {
  max-width: 1280px; margin: 18px auto 0; padding: 0 20px;
}
.hero-banner {
  border-radius: 14px; padding: 34px 40px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #ff758c 0%, #ff7eb3 45%, #ffa6c1 100%);
  box-shadow: var(--shadow);
}
.hero-banner h1 { margin: 0 0 8px; font-size: 26px; }
.hero-banner p { margin: 0 0 18px; opacity: .92; }
.hero-banner .btn { background: #fff; color: var(--pink); border: none; font-weight: 700; }
.hero-banner .deco { position: absolute; right: 36px; top: 50%; transform: translateY(-50%); font-size: 88px; opacity: .25; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 16px var(--content-pad) 60px; }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }
.chip {
  padding: 5px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.chip:hover { color: var(--pink); border-color: var(--pink); }
.chip.active { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.room-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: .18s; cursor: pointer; position: relative;
}
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.room-card .cover {
  aspect-ratio: 16/9; position: relative; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 54px;
}
.room-card .cover .cat-badge {
  position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.35); color: #fff;
  font-size: 12px; padding: 2px 9px; border-radius: 999px; backdrop-filter: blur(2px);
}
.room-card .cover .state-badge {
  position: absolute; right: 10px; top: 10px; font-size: 12px; padding: 2px 9px; border-radius: 999px; color: #fff;
  display: flex; align-items: center; gap: 5px;
}
.state-badge.live { background: var(--live); }
.state-badge.live .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.state-badge.off { background: rgba(0,0,0,.45); }
@keyframes pulse { 50% { opacity: .3; } }
.room-card .info { padding: 10px 12px 12px; }
.room-card .info .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card .info .m { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--text-3); font-size: 12px; }
.room-card .info .m .avatar { width: 20px; height: 20px; font-size: 11px; }
.room-card .info .m .pop { margin-left: auto; }
.empty-tip { text-align: center; color: var(--text-3); padding: 60px 0; }

.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font-size: 18px; font-weight: 700; }
.section-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--pink); }

/* ---------- 直播间 ---------- */
.room-wrap { max-width: var(--content-max); margin: 0 auto; padding: 14px var(--content-pad) 40px; display: flex; gap: 14px; align-items: flex-start; }
.player-col { flex: 1; min-width: 0; }
.player-box {
  position: relative; background: #0e0e10; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/9; box-shadow: var(--shadow);
}
.player-box video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain; background: #000; display: block;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}
.danmaku-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.player-hud {
  position: absolute; left: 0; right: 0; top: 0; padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(rgba(0,0,0,.55), transparent); color: #fff; font-size: 13px;
  opacity: 0; transition: .2s; z-index: 5;
}
.player-box:hover .player-hud { opacity: 1; }
.hud-live { background: var(--live); border-radius: 4px; padding: 1px 8px; font-size: 12px; display: flex; gap: 5px; align-items: center; }
.hud-live .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.hud-btn {
  margin-left: auto; background: rgba(255,255,255,.18); color: #fff; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; backdrop-filter: blur(2px);
}
.hud-btn:hover { background: rgba(255,255,255,.3); }
.player-state {
  position: absolute; inset: 0; display: grid; place-items: center; color: #aab; text-align: center; z-index: 4;
  background: radial-gradient(ellipse at center, #1a1a1e 0%, #0e0e10 100%);
}
.player-state .big { font-size: 52px; margin-bottom: 10px; }
.player-state .tip { color: #889; font-size: 13px; margin-top: 6px; }
.player-state .actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; }
.gift-fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.gift-physics-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8; }

/* 豪华电影级暗场聚光（大礼物触发） */
.fx-spotlight-dim {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(circle at 50% 40%, rgba(255,235,170,0.18) 0%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.85) 100%);
  animation: spotlightFade 2.8s ease-out forwards;
}
@keyframes spotlightFade {
  0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 0.9; } 100% { opacity: 0; }
}

/* 豪华礼物通知横幅 (VIP Banner) */
.fx-gift-banner {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(255, 30, 95, 0.96) 0%, rgba(255, 120, 30, 0.96) 50%, rgba(255, 205, 40, 0.98) 100%);
  padding: 10px 28px; border-radius: 999px;
  box-shadow: 0 10px 36px rgba(255, 75, 120, 0.55), 0 0 0 3px rgba(255, 255, 255, 0.75), inset 0 2px 8px rgba(255,255,255,0.6);
  color: #fff; font-size: 16px; font-weight: 700; text-shadow: 0 2px 5px rgba(0,0,0,0.35);
  animation: bannerSlide 3.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  pointer-events: none; white-space: nowrap; z-index: 15;
}
.fx-gift-banner .fb-ico { font-size: 32px; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.35)); animation: icoPop 0.55s infinite alternate; }
.fx-gift-banner .fb-uname { color: #fff; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.fx-gift-banner .fb-count { font-size: 22px; color: #fff; font-weight: 900; margin-left: 6px; text-shadow: 0 0 14px #ffe600, 0 0 24px #ff5900; }
@keyframes bannerSlide {
  0% { transform: translate(-50%, -70px) scale(0.65); opacity: 0; }
  12% { transform: translate(-50%, 0) scale(1.06); opacity: 1; }
  18% { transform: translate(-50%, 0) scale(1); }
  85% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50px) scale(0.8); opacity: 0; }
}
@keyframes icoPop { from { transform: scale(1); } to { transform: scale(1.25) rotate(10deg); } }

/* 尊贵超跑特效：大跑车划过屏幕 + 尾部霓虹光条 */
.fx-car-wrap {
  position: absolute; bottom: 40px; left: -180px; font-size: 96px;
  animation: carDrive 2.5s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  filter: drop-shadow(0 0 22px rgba(255, 60, 60, 0.85)); z-index: 12;
}
.fx-car-lights {
  position: absolute; font-size: 40px; transform: translate(-45px, 20px);
  animation: carLights 0.12s infinite alternate;
}
@keyframes carDrive {
  0% { transform: translateX(0) scale(0.6); opacity: 0; }
  10% { opacity: 1; }
  55% { transform: translateX(50vw) scale(1.15); opacity: 1; }
  100% { transform: translateX(115vw) scale(1.35); opacity: 0.9; }
}
@keyframes carLights { from { opacity: 0.7; } to { opacity: 1; filter: drop-shadow(0 0 12px #ff0055); } }

/* 梦幻城堡降临特效 */
.fx-castle-wrap {
  position: absolute; top: 35%; left: 50%; transform: translate(-50%, -50%);
  font-size: 130px; animation: castleDescend 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 0 35px rgba(255, 215, 0, 0.85)); z-index: 12; pointer-events: none;
}
@keyframes castleDescend {
  0% { transform: translate(-50%, -80%) scale(0.3); opacity: 0; filter: blur(6px) drop-shadow(0 0 50px #fff); }
  20% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; filter: blur(0) drop-shadow(0 0 40px #ffd700); }
  30% { transform: translate(-50%, -50%) scale(1); }
  85% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(1.25); opacity: 0; filter: blur(8px); }
}

/* 火箭特效升级：超大火箭 + 喷射尾焰与流光 */
.fx-rocket-wrap {
  position: absolute; bottom: -80px; left: -100px; font-size: 96px;
  animation: rocketFlight 2.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
  filter: drop-shadow(0 0 24px rgba(255, 120, 0, 0.9)); z-index: 12;
}
.fx-rocket-flame {
  position: absolute; font-size: 42px; transform: translate(-32px, 32px) rotate(45deg);
  animation: flameFlicker 0.12s infinite alternate;
}
@keyframes rocketFlight {
  0% { transform: translate(0, 0) rotate(45deg) scale(0.65); opacity: 0.2; }
  15% { opacity: 1; }
  100% { transform: translate(125vw, -85vh) rotate(45deg) scale(1.35); opacity: 0.95; }
}
@keyframes flameFlicker { from { opacity: 0.7; transform: translate(-30px, 30px) scale(0.9) rotate(45deg); } to { opacity: 1; transform: translate(-36px, 36px) scale(1.25) rotate(45deg); } }

/* ✈️ 私人飞机：爬升穿屏 */
.fx-plane-wrap {
  position: absolute; bottom: 10px; left: -140px; font-size: 84px;
  animation: planeFly 2.6s cubic-bezier(0.3, 0.1, 0.4, 1) forwards;
  filter: drop-shadow(0 0 20px rgba(120, 200, 255, 0.85)); z-index: 12;
}
.fx-plane-trail { position: absolute; font-size: 32px; transform: translate(-40px, 18px); opacity: .75; }
@keyframes planeFly {
  0% { transform: translate(0, 0) rotate(-8deg) scale(.7); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(120vw, -70vh) rotate(-12deg) scale(1.25); opacity: .95; }
}

/* 🛥️ 豪华游艇：底部巡航 */
.fx-yacht-wrap {
  position: absolute; bottom: 6px; left: -160px; font-size: 88px;
  animation: yachtSail 2.6s cubic-bezier(0.35, 0.05, 0.4, 1) forwards;
  filter: drop-shadow(0 0 18px rgba(80, 180, 255, 0.8)); z-index: 12;
}
.fx-yacht-wave { position: absolute; font-size: 34px; transform: translate(-38px, 26px); animation: waveBob .5s infinite alternate; }
@keyframes yachtSail {
  0% { transform: translateX(0) scale(.7); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateX(125vw) scale(1.2); opacity: .95; }
}
@keyframes waveBob { from { transform: translate(-38px, 26px) rotate(-6deg); } to { transform: translate(-38px, 22px) rotate(6deg); } }

/* 🎈 告白气球：缓缓升空 */
.fx-balloon-wrap {
  position: absolute; bottom: -120px; left: 46%; font-size: 92px;
  animation: balloonRise 3s ease-in forwards;
  filter: drop-shadow(0 0 22px rgba(255, 120, 180, 0.85)); z-index: 12;
}
@keyframes balloonRise {
  0% { transform: translateY(0) scale(.7) rotate(-6deg); opacity: 0; }
  15% { opacity: 1; }
  60% { transform: translateY(-45vh) scale(1.05) rotate(6deg); }
  100% { transform: translateY(-95vh) scale(1.15) rotate(-4deg); opacity: .9; }
}

/* 💍 永恒钻戒：闪耀降临 */
.fx-ring-wrap {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: 110px;
  animation: ringDrop 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 0 30px rgba(255, 235, 140, 0.95)); z-index: 12;
}
@keyframes ringDrop {
  0% { transform: translate(-50%, -180%) scale(.4) rotate(-40deg); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15) rotate(8deg); opacity: 1; }
  35% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(1.3) rotate(0); opacity: 0; }
}

/* 🛸 神秘飞碟：悬停扫光 */
.fx-ufo-wrap {
  position: absolute; top: 28%; left: 50%; transform: translateX(-50%); font-size: 100px;
  animation: ufoHover 3s ease-in-out forwards;
  filter: drop-shadow(0 0 26px rgba(120, 255, 190, 0.9)); z-index: 12;
}
.fx-ufo-beam {
  position: absolute; left: 50%; top: 62px; width: 90px; height: 200px; margin-left: -45px;
  background: linear-gradient(rgba(140, 255, 200, .55), rgba(140, 255, 200, 0));
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  animation: beamPulse .7s infinite alternate;
}
@keyframes ufoHover {
  0% { transform: translate(-50%, -60px) scale(.6); opacity: 0; }
  20% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -18px) scale(1.05); opacity: 1; }
  80% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -70px) scale(.9); opacity: 0; }
}
@keyframes beamPulse { from { opacity: .35; } to { opacity: .85; } }

/* 🌈 七彩祥云：横贯长虹 */
.fx-rainbow-wrap {
  position: absolute; top: 32%; left: -30%; font-size: 130px;
  animation: rainbowSweep 3s ease-out forwards;
  filter: drop-shadow(0 0 26px rgba(255, 255, 255, 0.8)); z-index: 12;
}
@keyframes rainbowSweep {
  0% { transform: translateX(0) scale(.7); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(160vw) scale(1.15); opacity: .9; }
}

/* 🌌 银河星系：星云扩张 */
.fx-galaxy-wrap {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: 120px;
  animation: galaxyExpand 3.2s ease-out forwards;
  filter: drop-shadow(0 0 34px rgba(150, 120, 255, 0.95)); z-index: 12;
}
@keyframes galaxyExpand {
  0% { transform: translate(-50%, -50%) scale(.2) rotate(0); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1) rotate(60deg); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1.15) rotate(200deg); opacity: .95; }
  100% { transform: translate(-50%, -50%) scale(1.5) rotate(320deg); opacity: 0; }
}

/* 🔥 涅槃凤凰：浴火腾空 */
.fx-phoenix-wrap {
  position: absolute; bottom: -140px; left: 44%; font-size: 100px;
  animation: phoenixRise 3s cubic-bezier(0.25, 0.9, 0.3, 1) forwards;
  filter: drop-shadow(0 0 28px rgba(255, 120, 30, 0.95)); z-index: 12;
}
.fx-phoenix-wing { position: absolute; font-size: 40px; transform: translate(38px, 6px); animation: wingFlap .28s infinite alternate; }
@keyframes phoenixRise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  18% { opacity: 1; }
  60% { transform: translateY(-50vh) scale(1.1); }
  100% { transform: translateY(-100vh) scale(1.3); opacity: .9; }
}
@keyframes wingFlap { from { transform: translate(38px, 6px) scale(1); } to { transform: translate(44px, 0) scale(1.18); } }

/* 🐉 至尊金龙：盘旋巡游 */
.fx-dragon-wrap {
  position: absolute; top: 26%; left: -20%; font-size: 110px;
  animation: dragonWander 3.2s ease-in-out forwards;
  filter: drop-shadow(0 0 28px rgba(255, 200, 40, 0.95)); z-index: 12;
}
@keyframes dragonWander {
  0% { transform: translate(0, 0) scale(.65) rotate(-12deg); opacity: 0; }
  15% { opacity: 1; }
  35% { transform: translate(35vw, 10vh) scale(1) rotate(10deg); }
  65% { transform: translate(70vw, -8vh) scale(1.08) rotate(-8deg); }
  100% { transform: translate(125vw, 4vh) scale(1.2) rotate(8deg); opacity: .95; }
}

/* 🎆 盛世烟花：中心爆裂火花 */
.fx-spark {
  position: absolute; font-size: 22px; pointer-events: none;
  animation: sparkBurst 1.7s cubic-bezier(0.15, 0.85, 0.3, 1) forwards;
  filter: drop-shadow(0 0 8px currentColor); z-index: 13;
}
@keyframes sparkBurst {
  0% { transform: translate(0, 0) scale(.3); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.35); opacity: 0; }
}

/* 粒子喷涌与星星/爱心特效 */
.fx-combo-item {
  position: absolute; font-size: 34px; pointer-events: none;
  animation: comboRise 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.35));
}
@keyframes comboRise {
  0% { transform: translateY(0) scale(0.4) rotate(0); opacity: 0; }
  15% { transform: translateY(-40px) scale(1.25) rotate(-10deg); opacity: 1; }
  75% { transform: translateY(-180px) scale(1.05) rotate(15deg); opacity: 0.9; }
  100% { transform: translateY(-260px) scale(0.8) rotate(30deg); opacity: 0; }
}

.room-toolbar { display: flex; align-items: flex-start; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.room-toolbar .titles { flex: 1; min-width: 260px; }
.room-toolbar h1 { margin: 0; font-size: 19px; }
.room-toolbar .meta { color: var(--text-3); font-size: 12px; margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.anchor-card {
  display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--radius);
  padding: 10px 14px; box-shadow: var(--shadow);
}
.anchor-card .avatar { width: 44px; height: 44px; font-size: 18px; }
.anchor-card .nm { font-weight: 700; }
.anchor-card .sub { color: var(--text-3); font-size: 12px; }
.announce {
  margin-top: 12px; background: #fffbe8; border: 1px solid #ffe58f; border-radius: var(--radius);
  padding: 8px 14px; color: #8c6e1a; font-size: 13px;
}

/* 聊天侧栏 */
.chat-col {
  width: 340px; flex: none; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; height: calc(100vh - 90px); position: sticky; top: 70px;
}
.chat-tabs { display: flex; border-bottom: 1px solid var(--line); }
.chat-tabs .tab { flex: 1; text-align: center; padding: 10px 0; cursor: pointer; color: var(--text-3); font-weight: 600; border-bottom: 2px solid transparent; }
.chat-tabs .tab.active { color: var(--pink); border-color: var(--pink); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 14px; }
.chat-item { margin-bottom: 8px; font-size: 13px; word-break: break-all; }
.chat-item .uname { color: var(--blue); font-weight: 600; margin-right: 6px; }
.chat-item.sys { color: var(--text-3); font-size: 12px; }
.chat-item.gift-msg .gift-ico { font-size: 16px; margin: 0 2px; }
.chat-input-zone { border-top: 1px solid var(--line); padding: 10px 12px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input {
  flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; outline: none;
}
.chat-input-row input:focus { border-color: var(--pink); }
.chat-opt-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.chat-opt-row label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.like-btn { margin-left: auto; background: none; border: none; color: var(--pink); font-size: 13px; display: flex; gap: 4px; align-items: center; }

/* 礼物栏（参考主流直播平台：横向礼物卡片 + 折叠箭头 + 右侧两行钱包） */
.gift-dock {
  margin-top: 12px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px 12px; display: flex; align-items: center; gap: 0;
  position: relative; min-height: 86px;
}
/* 横向礼物卡片列表（超出可横向滚动）
   右对齐：首个卡片 margin-left:auto —— 有富余空间时整体靠右紧贴折叠按钮；
   内容溢出时 auto 外边距自动归零、恢复左对齐，横向滚动不会出现「开头滚不到」的问题。 */
.gd-list {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.gd-list > :first-child { margin-left: auto; }
.gd-list::-webkit-scrollbar { height: 5px; }
.gd-list::-webkit-scrollbar-thumb { background: #e6e6ec; border-radius: 3px; }
.gd-list::-webkit-scrollbar-thumb:hover { background: var(--pink); }
.gift-item {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 6px 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; width: 76px;
  transition: background .15s, border-color .15s, transform .15s;
}
.gift-item:hover { background: var(--pink-weak); border-color: #ffd3e0; transform: translateY(-2px); }
.gift-item.sel { background: var(--pink-weak); border-color: var(--pink); }
.gift-item .ico { font-size: 32px; line-height: 1.15; }
.gift-item .nm {
  font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; line-height: 1.3;
}
.gift-item .price { font-size: 11px; color: var(--text-3); line-height: 1.3; }
.gift-item.sel .price { color: var(--pink); font-weight: 600; }

/* 折叠箭头分隔 */
.gd-divider { flex: none; width: 1px; height: 46px; background: var(--line); margin: 0 8px; }
.gd-toggle {
  flex: none; width: 30px; height: 56px; border: none; background: none; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-3); transition: background .15s, color .15s;
}
.gd-toggle:hover { background: var(--pink-weak); color: var(--pink); }
.gd-chevron { font-size: 17px; line-height: 1; display: block; transition: transform .22s; }
.gd-toggle.active .gd-chevron { transform: rotate(180deg); }

/* 右侧两行钱包块（右对齐） */
.gd-side {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  gap: 5px; margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--line);
}
.gd-wallet {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2);
  background: var(--pink-weak); border-radius: 999px; padding: 3px 12px; white-space: nowrap;
}
.gd-wallet b { color: var(--pink); font-size: 14px; }
.gd-claim {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--blue);
  background: #eef6ff; border-radius: 999px; padding: 3px 12px; white-space: nowrap; transition: .15s;
}
.gd-claim:hover { background: #e0efff; }

.gift-pop {
  position: absolute; right: 12px; bottom: calc(100% + 8px); background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 14px; width: 250px; z-index: 20; display: none;
}
.gift-pop.show { display: block; }
/* 更多礼物面板展开时，数量气泡左移避让（两者都在礼物栏上方，互不遮挡） */
.gift-pop.show.shifted { right: 424px; }
@media (max-width: 900px) {
  .gift-pop.show.shifted { right: 12px; bottom: calc(100% + 8px); }
}
@media (max-width: 760px) {
  .gift-more-panel { width: calc(100vw - 32px); right: 8px; }
  .gmp-body { grid-template-columns: repeat(4, 1fr); max-height: 44vh; }
}
.gift-pop .row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gift-pop .row .ico { font-size: 30px; }
.count-ctrl { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.count-ctrl button { width: 30px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #f8f9fa; cursor: pointer; font-size: 14px; }
.count-ctrl button:hover { background: #e9ecef; }
.count-ctrl input { flex: 1; text-align: center; height: 28px; border: 1px solid var(--line); border-radius: 6px; outline: none; font-size: 14px; font-weight: 600; color: var(--pink); }
.count-ctrl input:focus { border-color: var(--pink); }
.gift-quick-counts { display: flex; gap: 4px; margin-bottom: 8px; justify-content: space-between; }
.gq-btn {
  flex: 1; padding: 3px 0; border-radius: 5px; border: 1px solid var(--line); background: #fff;
  font-size: 11px; cursor: pointer; color: var(--text-2); font-family: Consolas, monospace;
}
.gq-btn:hover { border-color: var(--pink); color: var(--pink); }
.gq-btn.active { background: var(--pink-weak); border-color: var(--pink); color: var(--pink); font-weight: 600; }
.chat-time {
  font-size: 11px; color: var(--text-3); margin-right: 6px; font-family: Consolas, Monaco, monospace; opacity: 0.75; flex: none;
}
.wallet-chip { margin-left: auto; color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.wallet-chip b { color: var(--pink); }

/* 更多礼物面板（全部礼物网格，在礼物栏按钮上方弹出） */
.gift-more-panel {
  position: absolute; right: 12px; bottom: calc(100% + 8px); width: 400px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 22; display: none;
  overflow: hidden;
}
.gift-more-panel.show { display: block; animation: gmpIn .18s ease-out; }
@keyframes gmpIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.gmp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.gmp-title { font-size: 14px; font-weight: 700; }
.gmp-close { border: none; background: none; font-size: 19px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 0 4px; }
.gmp-close:hover { color: var(--pink); }
.gmp-body {
  max-height: 320px; overflow-y: auto; padding: 10px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.gmp-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-align: center;
}
.gmp-item:hover { background: var(--pink-weak); border-color: #ffd3e0; }
.gmp-item.sel { background: var(--pink-weak); border-color: var(--pink); }
.gmp-item .gi-ico { font-size: 26px; line-height: 1.2; }
.gmp-item .gi-nm { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gmp-item .gi-price { font-size: 11px; color: var(--pink); font-weight: 600; }

/* ---------- 创作中心（主播端） ---------- */
/* 布局原则：所有分区都是「通栏」的单一大卡片，卡内再用网格切分。
   这样不存在两列各自堆叠导致的「底部参差不齐 / 大片留白」问题。 */
.studio-wrap { max-width: var(--content-max); margin: 0 auto; padding: 20px var(--content-pad) 60px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.panel h3 .tag { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--pink-weak); color: var(--pink); }

/* —— 顶部状态横幅（深色，突出直播间身份与开播状态） —— */
.sd-hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 16px; border-radius: var(--radius);
  background: linear-gradient(120deg, #1f2130 0%, #2c2340 45%, #3a2247 100%);
  box-shadow: 0 8px 26px rgba(40, 25, 60, .28); color: #fff;
}
.sd-hero-ava { flex: none; display: grid; place-items: center; border-radius: 50%; overflow: hidden; }
.sd-hero-ava .avatar { border: 2px solid rgba(255,255,255,.35); }
.sd-hero-main { min-width: 0; flex: 1; }
.sd-hero-title { font-size: 20px; font-weight: 800; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; color: rgba(255,255,255,.62); font-size: 12.5px; }
.sd-hero-meta i { width: 1px; height: 11px; background: rgba(255,255,255,.22); display: inline-block; }
.sd-hero-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.sd-hero .state-pill.live { background: rgba(255,78,106,.22); color: #ff9db1; }
.sd-hero .state-pill.live .dot { background: #ff5c7d; }
.sd-hero .state-pill.rest { background: rgba(255,255,255,.14); color: rgba(255,255,255,.72); }
.sd-hero-btn {
  border-color: rgba(255,255,255,.3); color: #fff; background: rgba(255,255,255,.1);
}
.sd-hero-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }

/* —— 指标卡（通栏一行 6 个） —— */
.sd-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sd-stats .stat-card {
  display: flex; align-items: center; gap: 11px; background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat-card .sc-ico {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px;
  background: var(--pink-weak);
}
.stat-card .sc-body { min-width: 0; }
.stat-card .v { font-size: 19px; font-weight: 800; color: var(--text); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card .k { font-size: 12px; color: var(--text-3); margin-top: 1px; white-space: nowrap; }

/* —— 通栏内的两列等高栅格 —— */
.sd-cols-2 { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.sd-cols-2 > .panel { margin-bottom: 16px; }
/* 等高：面板撑满列高，内部可伸缩区域吃掉剩余空间 */
.panel.sd-fill { display: flex; flex-direction: column; }
.panel.sd-fill .sd-feed-body { flex: 1; min-height: 240px; height: auto; }
.sd-table-wrap { flex: 1; overflow-y: auto; }
.sd-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 26px 0; }
.sd-empty-ico { font-size: 34px; opacity: .5; }
.sd-empty-txt { color: var(--text-2); font-size: 13px; }
.sd-empty-sub { color: var(--text-3); font-size: 12px; }

/* —— 推流设置：WHIP / RTMP 左右并排对比 —— */
.sd-note {
  font-size: 13px; margin-bottom: 14px; padding: 9px 13px; border-radius: 9px;
  background: var(--pink-weak); color: var(--text-2); line-height: 1.6;
}
.sd-stream-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sd-stream-box { border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px 6px; background: #fff; }
.sd-stream-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.sd-stream-badge {
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: #eef0f2; color: var(--text-3);
}
.sd-stream-name { font-weight: 700; font-size: 14.5px; }
.sd-stream-tag.rec { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--pink); color: #fff; }
.sd-stream-desc { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.sd-hint { color: var(--text-3); font-size: 12.5px; line-height: 1.75; margin: 2px 0 8px; }
.sd-warn { color: var(--live); font-size: 12.5px; line-height: 1.75; margin: 4px 0 10px; }
.sd-guide { margin-top: 14px; }
.sd-key-warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sd-key-warn > span { font-size: 12px; color: var(--text-3); flex: 1; min-width: 260px; line-height: 1.7; }

/* —— 直播间设置：横向表单网格（通栏，标题占 2/3 宽，分区占 1/3） —— */
.sd-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.sd-form-grid .field { margin-bottom: 0; }
.sd-form-grid .span-2 { grid-column: span 2; }
.sd-form-grid .span-all { grid-column: 1 / -1; }
.sd-form-grid .field input:not([type="range"]),
.sd-form-grid .field select { max-width: none; } /* 网格本身已限宽，无需再压 */
.sd-form-grid .cover-palette { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.sd-form-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sd-form-tip { font-size: 12px; color: var(--text-3); }

/* —— 直播间设置 + 直播间预览（左设置宽 / 右预览窄，两卡等高） —— */
.sd-room-row { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr); }
.sd-room-row > .panel { margin-bottom: 16px; display: flex; flex-direction: column; }
/* 左卡表单本来只有 3 列，缩窄后标题占 2/3、分区 1/3 依然合理 */
.sd-room-row .sd-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rv-panel .rv-actions { margin-top: auto; padding-top: 14px; }

.rv-cover-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}
.rv-cover { position: absolute; inset: 0; transition: background .25s; }
.rv-badge-cat {
  position: absolute; left: 10px; bottom: 10px; font-size: 11px; color: #fff;
  background: rgba(0, 0, 0, .42); padding: 2px 9px; border-radius: 999px; backdrop-filter: blur(2px);
}
.rv-badge-state {
  position: absolute; right: 10px; top: 10px; font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
}
.rv-badge-state.live { background: var(--live); color: #fff; }
.rv-badge-state.live .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.rv-badge-state.off { background: rgba(255, 255, 255, .85); color: var(--text-3); }
.rv-title {
  margin-top: 12px; font-weight: 700; font-size: 15px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rv-meta { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.rv-ann-wrap {
  margin-top: 12px; padding: 9px 11px; border-radius: 9px; background: #fffbe8;
  border: 1px solid #ffe58f;
}
.rv-ann-label { font-size: 11px; color: #a8842e; display: block; margin-bottom: 3px; }
.rv-ann {
  font-size: 12.5px; color: #8c6e1a; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; outline: none; background: #fff;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--pink); }
/* 创作中心的表单项限制最大宽度：容器加宽后，输入框拉满整行会显得空旷难读 */
.studio-wrap .field input:not([type="range"]):not([type="checkbox"]),
.studio-wrap .field select { max-width: 460px; }

/* 个人设置 / 账号概览：左列(个人设置+修改密码) 与 右列(账号概览) 严格等高
   —— 左列两卡用 flex 填满列高，右列同高拉伸，因此「两卡合计 = 账号概览」。 */
.profile-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: 16px; align-items: stretch;
}
.profile-grid > .panel,
.profile-col > .panel { margin-bottom: 0; }
.profile-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.profile-col > .panel { flex: 1 1 auto; display: flex; flex-direction: column; }
.profile-grid > .ov-panel { display: flex; flex-direction: column; }
/* 卡片内的操作按钮吸底：卡片被拉高时按钮贴在底边，视觉上更整齐 */
.profile-grid .ov-actions { margin-top: auto; }
.profile-grid .avatar-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
/* 修改密码：三列并排 */
.pwd-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.pwd-row .field { margin-bottom: 0; }
.pwd-row .field input { max-width: none; }

/* 账号概览 */
.ov-hero { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.ov-hero-txt { min-width: 0; }
.ov-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; }
.ov-sub { color: var(--text-3); font-size: 12px; margin-top: 3px; }
.ov-list { display: flex; flex-direction: column; gap: 9px; }
.ov-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.ov-k { color: var(--text-3); flex: none; }
.ov-v { text-align: right; word-break: break-all; }
.ov-coin { color: var(--pink); font-size: 15px; }
.ov-link { color: var(--blue); }
.ov-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }

.key-box {
  background: #faf7f8; border: 1px dashed #f3c1d3; border-radius: 8px; padding: 10px 12px;
  font-family: Consolas, monospace; font-size: 12.5px; word-break: break-all; color: #b0436a;
}
.copy-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.copy-row .key-box { flex: 1; margin: 0; }
.copy-row .btn { flex: none; }
.cover-palette { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-swatch { width: 56px; height: 34px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.cover-swatch.sel { border-color: var(--pink); box-shadow: 0 0 0 2px #fff inset; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat-card { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.stat-card .v { font-size: 20px; font-weight: 800; color: var(--pink); }
.stat-card .k { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.state-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.state-pill.live { background: #ffe9ee; color: var(--live); }
.state-pill.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.2s infinite; }
.state-pill.rest { background: #eef0f2; color: var(--text-3); }
.msg-feed { height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.msg-feed .chat-item { margin-bottom: 6px; }
table.history { width: 100%; border-collapse: collapse; font-size: 13px; }
table.history th, table.history td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.history th { color: var(--text-3); font-weight: 500; }
.obs-guide summary { cursor: pointer; color: var(--blue); font-size: 13px; user-select: none; }
.obs-guide ol { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); font-size: 13px; }
.obs-guide li { margin-bottom: 6px; }
.obs-guide code { background: var(--bg); border-radius: 4px; padding: 1px 6px; font-size: 12px; color: #b0436a; }

/* ---------- 登录 ---------- */
/* 登录卡按设计固定 380px 居中；外层容器沿用全站留白变量，保持边距一致 */
.auth-wrap { display: grid; place-items: center; padding: 30px var(--content-pad); }
.auth-card {
  width: 380px; max-width: 94vw; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px 30px 26px;
}
.auth-card .logo { justify-content: center; margin-bottom: 4px; font-size: 22px; }
.auth-card .sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 20px; }
.auth-tabs { display: flex; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth-tabs .tab { flex: 1; text-align: center; padding: 10px 0; cursor: pointer; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; }
.auth-tabs .tab.active { color: var(--pink); border-color: var(--pink); }
.auth-err { color: var(--live); font-size: 13px; min-height: 20px; margin: 4px 0; text-align: center; }

/* ---------- Toast ---------- */
#toast-zone { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(24, 25, 28, .88); color: #fff; padding: 9px 20px; border-radius: 999px; font-size: 13px;
  animation: toastIn .25s ease-out; box-shadow: var(--shadow-lg); max-width: 70vw;
}
.toast.err { background: rgba(255, 78, 106, .95); }
.toast.ok { background: rgba(80, 190, 130, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 弹窗 / 其他 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: grid; place-items: center; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 400px; max-width: 92vw; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 16px; }
.footer { text-align: center; color: var(--text-3); font-size: 12px; padding: 30px 0 40px; }
.footer a { color: var(--blue); }
/* 直播间页脚：桌面端由沉浸式布局接管高度，这里定义窄屏（可滚动）下的常规样式 */
.room-footer { text-align: center; color: var(--text-3); font-size: 12px; padding: 18px 20px 26px; line-height: 1.6; }
.room-footer a { color: var(--blue); }
.room-footer a:hover { text-decoration: underline; }

/* ---------- 手机端自适应 ---------- */

/* ---------- 管理后台 ---------- */
.btn.mini { padding: 3px 9px; font-size: 12px; border-radius: 6px; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.btn.danger { border-color: #ffb3c0; color: var(--live); }
.btn.danger:hover { background: #fff0f3; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin th, table.admin td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin th { color: var(--text-3); font-weight: 500; white-space: nowrap; }
table.admin td .avatar { width: 24px; height: 24px; font-size: 12px; display: inline-grid; vertical-align: middle; margin-right: 6px; }
table.admin .actions { display: flex; gap: 5px; flex-wrap: nowrap; }
table.admin td:first-child { white-space: nowrap; }
table.admin .cell-sub { color: var(--text-3); font-size: 12px; }
table.admin .user-cell { display: flex; flex-direction: column; gap: 2px; }
table.admin .user-cell .u-line { display: flex; align-items: center; gap: 6px; }
table.admin .user-cell .uid-line { font-size: 11px; color: var(--text-3); margin-left: 30px; }
table.admin .badge { white-space: nowrap; }
table.admin td.nowrap { white-space: nowrap; }
table.admin .cell-room { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.badge.admin { background: #fff3e0; color: #e08a00; }
.badge.banned { background: #ffe9ee; color: var(--live); }
.badge.ok { background: #e8f7ef; color: #23b26d; }
.badge.live { background: var(--live); color: #fff; }
.badge.off { background: #eef0f2; color: var(--text-3); }
.switch { position: relative; display: inline-block; width: 46px; height: 25px; flex: none; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #cdd1d6; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--pink); }
.switch input:checked + .slider::before { transform: translateX(21px); }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.setting-row .info b { display: block; }
.setting-row .info span { font-size: 12px; color: var(--text-3); }
.admin-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.admin-toolbar .tip { color: var(--text-3); font-size: 12px; margin-left: auto; }

/* ---------- 在线用户卡片（管理后台：平台设置右侧，与左卡等高、列表内部滚动） ---------- */
/* .sd-cols-2 已在创作中心定义为 align-items:stretch + 1.32fr/1fr。
   管理后台首屏两卡等宽，等高由 JS 精确设定（见 admin.js 的 fitOnlineList）。 */
.admin-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.admin-top > .panel { margin-bottom: 16px; display: flex; flex-direction: column; }
/* 兜底上限：在线人数很多时也不把左侧平台设置撑高 */
.admin-top .ou-panel { max-height: 620px; }
.admin-top .ou-list { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.admin-top .ou-empty { flex: 1; }

.ou-panel .ou-list {
  display: flex; flex-direction: column; gap: 2px;
  padding-right: 4px;
}
.ou-panel .ou-list::-webkit-scrollbar { width: 6px; }
.ou-panel .ou-list::-webkit-scrollbar-thumb { background: #e0e2e5; border-radius: 3px; }
.ou-panel .ou-list::-webkit-scrollbar-thumb:hover { background: var(--pink); }
.ou-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; font-size: 13px;
}
.ou-row:hover { background: var(--pink-weak); }
.ou-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, .16); }
.ou-dot.guest { background: #c8ccd1; box-shadow: 0 0 0 3px rgba(200, 204, 209, .2); }
.ou-main { min-width: 0; flex: 1; }
.ou-line1 { display: flex; align-items: center; gap: 6px; }
.ou-user { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ou-room {
  flex: none; font-size: 11px; color: var(--blue); background: #eef7fd;
  padding: 0 6px; border-radius: 999px; font-family: Consolas, monospace;
}
.ou-line2 { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.ou-ip { font-family: Consolas, Monaco, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ou-sep { flex: none; opacity: .5; }
.ou-region { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ou-dur {
  flex: none; font-family: Consolas, Monaco, monospace; font-size: 12px;
  color: var(--text-2); background: var(--bg); padding: 2px 8px; border-radius: 6px;
}
.ou-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 30px 0; }
.ou-empty-ico { font-size: 32px; opacity: .5; }
.ou-empty-txt { color: var(--text-2); font-size: 13px; }
.ou-empty-sub { color: var(--text-3); font-size: 12px; }

/* ---------- 播放器控制条 ---------- */
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  display: flex; align-items: center; gap: 6px; padding: 26px 12px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .74));
  opacity: 0; transition: .2s;
}
.player-box:hover .player-controls, .player-box.show-controls .player-controls { opacity: 1; }
.pc-btn { background: none; border: none; color: #fff; font-size: 13px; padding: 4px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.pc-btn:hover { background: rgba(255, 255, 255, .16); }
.pc-left, .pc-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pc-right { margin-left: auto; }
.pc-volume { display: flex; align-items: center; gap: 2px; }
.pc-volume input[type=range] { width: 70px; }
.pc-livetime { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; margin-left: 6px; cursor: default; }
.pc-livetime .lt-dur { display: inline; background: rgba(255,255,255,.16); padding: 2px 8px; border-radius: 6px; } /* 开播持续时间常显 */
.pc-livetime .lt-icon { font-size: 14px; }
.player-box input[type=range] { accent-color: var(--pink); cursor: pointer; height: 4px; }

/* 弹幕设置面板（参照 B 站样式） */
.dm-cfg-pop {
  position: absolute; right: 12px; bottom: 56px; z-index: 8; width: 300px; max-width: calc(100% - 24px);
  background: rgba(24, 25, 28, .94); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--shadow-lg); color: #eee;
}
.dm-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.dm-row:last-child { margin-bottom: 0; }
.dm-k { width: 58px; flex: none; color: #ccc; }
.dm-row input[type=range] { flex: 1; }
.dm-v { width: 44px; text-align: right; color: var(--pink); font-size: 12px; }

/* 实时统计信息面板 (Stats for Nerds) —— 置于播放器右上角 */
.player-stats-pop {
  position: absolute; right: 14px; top: 14px; z-index: 9; width: 290px; max-width: calc(100% - 28px);
  background: rgba(14, 14, 16, 0.88); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-lg); color: #e1e1e3;
  backdrop-filter: blur(8px); font-size: 12px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, monospace;
}
.psp-header {
  display: flex; align-items: center; justify-content: space-between; font-weight: 600;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff; font-size: 13px;
}
.psp-close {
  background: none; border: none; color: #888; font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.psp-close:hover { color: #fff; }
.psp-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.psp-row:last-child { margin-bottom: 0; }
.psp-k { color: #9a9aa2; }
.psp-v { font-family: Consolas, Monaco, "Courier New", monospace; font-weight: 500; }
.psp-v.highlight { color: #52c41a; font-weight: 600; }
.psp-v.warning { color: #ff4d4f; font-weight: 600; }

/* 网页全屏：播放器 + 右侧聊天栏铺满页面 */
.room-wrap.webwide-mode {
  position: fixed; inset: 0; z-index: 300; margin: 0; padding: 0;
  max-width: none; background: #0e0e10; align-items: stretch;
}
.room-wrap.webwide-mode .player-col { display: flex; flex-direction: column; min-width: 0; }
.room-wrap.webwide-mode .player-box { flex: 1; aspect-ratio: auto; height: auto; min-height: 0; border-radius: 0; }
.room-wrap.webwide-mode .room-toolbar,
.room-wrap.webwide-mode .announce,
.room-wrap.webwide-mode .gift-dock { display: none; }
.room-wrap.webwide-mode .chat-col { width: 340px; flex: none; height: auto; position: static; border-radius: 0; border-left: 1px solid #222; }
/* 桌面端标准直播间沉浸式全屏布局（锁定最大播放器尺寸，杜绝起播前后跳动，消除外层滚动条） */
/* 桌面端直播间：纯 CSS 定尺寸的沉浸式布局
   ─ 播放器尺寸只由「视口尺寸」决定，与页面内容（公告有无、标题长短、消息多少）无关，
     因此刷新页面时首帧就是最终尺寸，不会出现「先小后大」的跳动（与 B 站一致）。
   ─ 常量 --room-chrome = 播放器以外占用的总高度：
       头部 56 + 容器上下内边距 20 + 列内 3 段间距 30 + 信息栏 72 + 公告条 46 + 礼物栏 80 + 页脚 34 = 338 */
@media (min-width: 1001px) {
  body.page-room {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    --room-chrome: 338px;
  }
  body.page-room #site-header { flex: none; }
  body.page-room .room-wrap {
    flex: 1;
    /* 与其它页面 .container 同一内容宽度与边距，视觉语言统一（参考 B 站直播间比例） */
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    min-height: 0;
    padding: 12px var(--content-pad) 8px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    gap: 12px;
    align-items: stretch;
  }
  body.page-room .player-col {
    flex: 0 0 auto;
    /* 取「列可用宽度」与「可用高度换算出的 16:9 宽度」中的较小值 —— 全部由 CSS 算，首帧即终态 */
    width: min(calc(100% - 332px), calc((100vh - var(--room-chrome)) * 16 / 9));
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  body.page-room .player-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex: none;
    border-radius: var(--radius);
    background: #000;
    overflow: hidden;
  }
  body.page-room .player-box video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
  }
  /* 信息栏高度锁定为常量，避免标题换行导致高度漂移进而顶动播放器 */
  body.page-room .room-toolbar {
    flex: none;
    margin-top: 0;
    padding: 8px 14px;
    height: 72px;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
  }
  body.page-room .room-toolbar .titles { min-width: 0; flex: 1; }
  body.page-room .room-toolbar h1 {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 4px; font-size: 17px;
  }
  body.page-room .room-toolbar .meta { white-space: nowrap; overflow: hidden; margin: 0; }
  body.page-room .anchor-card { flex: none; padding: 6px 10px; }
  /* 公告条固定高度，同样不参与高度漂移 */
  body.page-room .announce {
    flex: none;
    margin-top: 0;
    height: 46px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  body.page-room .gift-dock {
    flex: none;
    /* margin-top:auto 把礼物栏推到播放器列的最底部 —— 这样它的下边缘恒等于右列聊天栏
       卡片的下边缘（两者都贴齐 .room-wrap 内容区底部），多余的纵向空间留在礼物栏上方。 */
    margin-top: auto;
    height: 80px;
    min-height: 0;
    box-sizing: border-box;
    padding: 4px 10px;
  }
  /* 聊天栏：缩小到 300~440px，把宽度让给播放器 */
  body.page-room .chat-col {
    width: auto;
    flex: 1 1 auto;
    min-width: 300px;
    max-width: 440px;
    height: 100%;
    min-height: 0;
    position: static;
    box-shadow: var(--shadow);
  }
  body.page-room .chat-list {
    flex: 1;
    overflow-y: auto;
  }
  /* 直播间页脚：常驻底部，不产生滚动 */
  body.page-room .room-footer {
    flex: none;
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.6;
    padding: 6px 20px 8px;
  }
  body.page-room .room-footer a { color: var(--blue); }
  body.page-room .room-footer a:hover { text-decoration: underline; }
}

/* 头像图片 */
.avatar img { border-radius: 50%; }

/* 触屏设备没有 hover：悬停元素常显 */
@media (hover: none) {
  .player-controls, .player-hud { opacity: 1; }
}

/* ---------- 手机端自适应 ---------- */
@media (max-width: 1000px) {
  .room-wrap { flex-direction: column; }
  .chat-col { width: 100%; height: 46vh; position: static; }
  .studio-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
}
/* 移动端不提供统计功能：浮窗会遮挡画面，且移动端无排障诉求 */
@media (max-width: 1000px) {
  #btnStats, .player-stats-pop { display: none !important; }
}
/* 创作中心：窄屏降级为单列 */
@media (max-width: 1100px) {
  .profile-grid { grid-template-columns: 1fr !important; }
  .sd-cols-2 { grid-template-columns: 1fr; }
  .sd-room-row { grid-template-columns: 1fr; }
  .sd-stream-grid { grid-template-columns: 1fr; }
  .sd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sd-form-grid { grid-template-columns: 1fr; }
  .sd-form-grid .span-2 { grid-column: auto; }
  .sd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-hero { padding: 14px 16px; }
  .sd-hero-title { font-size: 17px; }
}
@media (max-width: 760px) {
  body { font-size: 13px; }
  .site-header .inner { height: 48px; gap: 8px; padding: 0 10px; }
  .logo { font-size: 16px; }
  .logo .mark { width: 26px; height: 26px; font-size: 14px; }
  .nav-links { display: none; }
  .header-right { gap: 6px; }
  .user-chip span:not(.avatar) { display: none; }
  .hero { margin-top: 10px; padding: 0 10px; }
  .hero-banner { padding: 20px; border-radius: 10px; }
  .hero-banner h1 { font-size: 18px; }
  .hero-banner .deco { display: none; }
  .container { padding: 10px 10px 40px; }
  .chip-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; margin: 12px 0 10px; }
  .chip { flex: none; }
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .room-card .cover { font-size: 34px; }
  .room-card .info { padding: 8px 10px 10px; }
  .room-wrap { padding: 10px 10px 30px; gap: 10px; }
  .player-col { width: 100%; }
  .room-toolbar h1 { font-size: 16px; }
  .anchor-card { width: 100%; }
  .chat-col { height: 52vh; }
  .gift-dock { padding: 8px 10px; }
  .pc-btn { padding: 6px; font-size: 13px; }
  .pc-btn .pc-txt { display: none; } /* 手机端按钮只留图标，避免重叠 */
  .pc-volume input[type=range] { width: 46px; }
  .pc-livetime { font-size: 12px; gap: 5px; margin-left: 2px; }
  .player-controls { gap: 2px; padding: 16px 8px 6px; flex-wrap: nowrap; }
  .dm-cfg-pop { right: 10px; }
  .studio-wrap { padding: 12px 10px 40px; }
  .panel { padding: 14px; }
  table.admin, table.history { display: block; overflow-x: auto; white-space: nowrap; }
  .msg-feed { height: 220px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .footer { padding: 20px 10px 30px; }
  #toast-zone { width: 90vw; }
  .player-controls { opacity: 1; padding: 18px 8px 6px; } /* 手机端常显 */
}
