/* ---------- 口令页 ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 48px; gap: 36px; }
.gate-hero { position: relative; margin: 0; width: min(1120px, 100%); aspect-ratio: 2.67; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: 0 40px 120px -40px rgba(58, 168, 255, 0.55), 0 0 0 6px rgba(120, 200, 255, 0.04); animation: rise 0.9s cubic-bezier(.2, .7, .2, 1) both; }
.gate-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gate-hero-glow { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(2, 7, 19, 0.55)); pointer-events: none; }
.gate-body { width: min(620px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; animation: rise 0.9s 0.15s cubic-bezier(.2, .7, .2, 1) both; }
.gate-title { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: 0.12em; }
.gate-sub { margin: 10px 0 0; color: var(--muted); letter-spacing: 0.3em; font-size: 14px; }
.gate-when { margin: 22px 0 18px; display: inline-flex; align-items: center; gap: 10px; color: var(--cyan); font-size: 14px; letter-spacing: 0.08em; }
.gate-when .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.gate-form { width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 8px; border-radius: 18px; }
.gate-form .field { min-width: 0; text-align: center; letter-spacing: 0.12em; font-size: 16px; border-color: transparent; background: rgba(2, 10, 30, 0.6); }
.gate-note { margin: 12px 0 0; color: var(--faint); font-size: 12px; letter-spacing: 0.06em; }
.gate-err { min-height: 1.4em; margin: 8px 0 0; color: var(--bad); font-size: 14px; }
@media (max-width: 560px) { .gate-form { grid-template-columns: 1fr; } }

/* 头像：圆形渐变底 + 白色生肖造型（雪碧图 12 格） */
.av { position: relative; display: inline-block; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 8px -2px rgba(0, 0, 0, 0.5); }
.av i { position: absolute; inset: 13%; background: url("/assets/zodiac.webp") no-repeat; background-size: 1200% 100%; background-position: calc(var(--i) * 100% / 11) 0; }
@media (min-width: 760px) { .gate { justify-content: center; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- 顶栏 ---------- */
.watch { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 20px; padding: 16px 28px; border-bottom: 1px solid rgba(140, 215, 255, 0.08); background: linear-gradient(180deg, rgba(2, 7, 19, 0.7), rgba(2, 7, 19, 0)); }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-12 { font-size: 34px; font-weight: 800; font-style: italic; letter-spacing: -0.04em; line-height: 1; padding-right: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: 0.3em; }
.brand-text i { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 0.32em; }
.top-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 14px; padding-left: 20px; border-left: 1px solid var(--line); }
.top-title span { font-size: 18px; font-weight: 600; letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title small { color: var(--muted); font-size: 13px; letter-spacing: 0.16em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.audience b { color: var(--text); font-size: 15px; }
.sep { margin: 0 6px; opacity: 0.5; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); font-size: 12px; letter-spacing: 0.12em; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.on { color: #fff; background: rgba(255, 77, 109, 0.16); border-color: rgba(255, 77, 109, 0.5); }
.pill.on .pill-dot { background: var(--live); box-shadow: 0 0 10px var(--live); animation: beat 1.6s infinite; }
.pill.warn { color: var(--warn); border-color: rgba(255, 194, 75, 0.4); }
@keyframes beat { 50% { opacity: 0.35; } }

/* ---------- 主体 ---------- */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 20px 28px 28px; max-width: 1760px; width: 100%; margin: 0 auto; align-items: start; }
.stage-wrap { min-width: 0; }
.stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px rgba(140, 225, 255, 0.28), 0 30px 90px -30px rgba(58, 168, 255, 0.55), 0 0 120px -50px rgba(70, 240, 228, 0.5);
}
.stage::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 9; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.stage:fullscreen, .stage:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; }
video.on { opacity: 1; z-index: 1; }
.watermark { position: absolute; inset: 0; pointer-events: none; z-index: 3; background-repeat: repeat; }
.hint { margin: 12px 4px 0; color: var(--faint); font-size: 12px; line-height: 1.7; }

/* 封面：倒计时 / 等待信号 / 暂停 */
.cover { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center; }
.cover-bg { position: absolute; inset: 0; background: var(--ink-0) url("/media/poster") center / cover no-repeat; }
.cover-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 70% at 50% 55%, rgba(2, 7, 19, 0.55), rgba(2, 7, 19, 0.88)); backdrop-filter: blur(3px); }
.cover-body { position: relative; padding: 24px; }
.cover-kicker { color: var(--cyan); letter-spacing: 0.5em; font-size: clamp(12px, 1.3vw, 15px); margin-bottom: 14px; padding-left: 0.5em; }
.cover-big { font-size: clamp(34px, 6.4vw, 92px); font-weight: 700; letter-spacing: 0.04em; line-height: 1; background: linear-gradient(180deg, #fff 30%, #9fdcff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 60px rgba(58, 168, 255, 0.35); }
.cover-big .unit { font-size: 0.32em; letter-spacing: 0.1em; margin: 0 0.35em 0 0.15em; color: var(--muted); -webkit-text-fill-color: var(--muted); vertical-align: 0.6em; }
.cover-big.text { font-size: clamp(20px, 3.2vw, 42px); letter-spacing: 0.12em; font-weight: 600; }
.cover-small { margin-top: 16px; color: var(--muted); font-size: clamp(12px, 1.2vw, 15px); letter-spacing: 0.12em; }
.cover.loading .cover-big::after { content: ""; display: inline-block; width: 0.9em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.unmute { position: absolute; z-index: 7; left: 50%; bottom: 76px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 22px; border: 0; background: rgba(255, 255, 255, 0.94); color: #04122c; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(-50%) translateY(-4px); } }

/* 控制条 */
.controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-between; align-items: center; padding: 28px 14px 12px; background: linear-gradient(180deg, transparent, rgba(0, 4, 14, 0.78)); opacity: 0; transition: opacity 0.25s; }
.stage:hover .controls, .stage.show-ctl .controls { opacity: 1; }
.ctl-left, .ctl-right { display: flex; align-items: center; gap: 6px; }
.ctl { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: #fff; }
.ctl:hover { background: rgba(255, 255, 255, 0.12); }
.ctl svg { width: 22px; height: 22px; }
.ctl.txt { font-size: 15px; font-weight: 700; }
.ctl.txt.off { color: var(--faint); text-decoration: line-through; }
.ctl-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: #fff; padding: 0 8px; }
.ctl-live .pill-dot { background: var(--live); box-shadow: 0 0 8px var(--live); }
.quality { position: relative; }
.quality:empty { display: none; }
.q-cur { height: 32px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.q-cur::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; vertical-align: 2px; }
.q-menu { display: none; position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 96px; padding: 4px; border-radius: 10px; background: rgba(6, 18, 44, 0.96); border: 1px solid var(--line-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
.quality.open .q-menu { display: flex; flex-direction: column; gap: 2px; }
.q-menu button { height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: rgba(255, 255, 255, 0.8); font-size: 13px; text-align: left; white-space: nowrap; }
.q-menu button:hover { background: rgba(255, 255, 255, 0.08); }
.q-menu button.on { color: var(--cyan); font-weight: 700; }
.stage.q-open .controls, .stage:has(.quality.open) .controls { opacity: 1; }

/* 弹幕 */
.danmaku-layer { position: absolute; inset: 0 0 18% 0; z-index: 4; pointer-events: none; overflow: hidden; }
.danmaku-layer.off { display: none; }
.dm { position: absolute; left: 100%; white-space: nowrap; font-size: clamp(15px, 1.7vw, 26px); font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6); will-change: transform; animation: fly linear forwards; }
.dm { display: inline-flex; align-items: center; gap: 0.35em; }
.dm.mine { padding: 2px 12px 2px 3px; border-radius: 99px; border: 1.5px solid var(--cyan); background: rgba(2, 20, 40, 0.35); }
.dm .av { width: 1.3em; height: 1.3em; }
.dm-who { font-size: 0.6em; font-weight: 600; color: var(--cyan); margin-right: 0.2em; }
.dm-who .place, .who .place { opacity: 0.45; font-weight: 400; }
@keyframes fly { from { transform: translateX(0); } to { transform: translateX(var(--dist)); } }

/* 全屏时的点赞按钮 */
.fs-like { display: none; position: absolute; right: 22px; bottom: 76px; z-index: 7; width: 56px; height: 56px; border-radius: 50%; border: 0; color: #fff; background: var(--grad); box-shadow: 0 10px 30px -6px rgba(58, 168, 255, 0.9); }
.fs-like svg { width: 26px; height: 26px; }
.stage:fullscreen .fs-like, .stage:-webkit-full-screen .fs-like { display: grid; place-items: center; }
.fs-like-num { display: none; position: absolute; right: 22px; bottom: 54px; z-index: 7; width: 56px; text-align: center; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); pointer-events: none; }
.stage:fullscreen .fs-like-num, .stage:-webkit-full-screen .fs-like-num { display: block; }

/* ---------- 侧栏：点赞 + 弹幕 ---------- */
.side { display: flex; flex-direction: column; height: calc((100vw - 56px - 360px) * 9 / 16); max-height: calc(1760px * 9 / 16); min-height: 460px; padding: 18px; position: sticky; top: 16px; }
.like-box { position: relative; display: flex; align-items: center; gap: 14px; padding: 4px 4px 18px; border-bottom: 1px solid var(--line); -webkit-user-select: none; user-select: none; }
.stage { -webkit-user-select: none; user-select: none; }
.like-btn { position: relative; width: 60px; height: 60px; flex-shrink: 0; border-radius: 50%; border: 0; color: #fff; background: var(--grad); box-shadow: 0 10px 34px -8px rgba(58, 168, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35); transition: transform 0.12s; }
.like-btn svg { width: 28px; height: 28px; }
.like-btn:active, .like-btn.pop { transform: scale(0.9); }
.like-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.like-meta b { font-size: 30px; font-weight: 800; line-height: 1; }
.like-meta span { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }
.hearts { position: absolute; left: 0; bottom: 18px; width: 60px; height: 0; pointer-events: none; }
.heart { position: absolute; left: 50%; bottom: 30px; width: 22px; height: 22px; margin-left: -11px; color: var(--cyan); animation: float 1.4s ease-out forwards; }
@keyframes float { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -130px) scale(1.15) rotate(var(--rot)); } }

.feed-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 4px 8px; font-size: 13px; letter-spacing: 0.24em; color: var(--muted); }
.feed-head small { letter-spacing: 0.04em; font-size: 12px; color: var(--faint); }
.feed { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0 2px; list-style: none; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(140, 215, 255, 0.2) transparent; mask-image: linear-gradient(180deg, transparent, #000 24px); -webkit-mask-image: linear-gradient(180deg, transparent, #000 24px); }
.feed li { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: rgba(120, 200, 255, 0.05); font-size: 14px; line-height: 1.5; word-break: break-all; animation: rise 0.3s both; }
.feed li:first-child { margin-top: auto; }
.feed li .av { margin-top: 1px; width: 32px; height: 32px; }
.feed li .body { min-width: 0; }
.feed li .who { display: block; color: var(--cyan); font-size: 12px; line-height: 1.3; margin-bottom: 1px; }
.me { display: flex; align-items: center; gap: 8px; padding-top: 12px; font-size: 13px; color: var(--muted); }
.me-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.me-edit { border: 0; background: none; color: var(--azure); font-size: 12px; padding: 4px 0; }
.feed li.mine { background: rgba(70, 240, 228, 0.1); }
.say { display: flex; gap: 8px; padding-top: 8px; }
.say .field { flex: 1; min-width: 0; height: 40px; font-size: 14px; }
.say .btn { height: 40px; }

/* 后台关了弹幕功能：侧栏只剩点赞 */
.no-dm .feed-head, .no-dm .feed, .no-dm .me, .no-dm .say, .no-dm #dmLayer, .no-dm #dmToggle, .no-dm #nick, .no-dm .gate-note { display: none; }
.no-dm .layout { align-content: start; }
.no-dm .side { height: auto; min-height: 0; align-self: start; }
.no-dm .like-box { padding-bottom: 4px; border-bottom: 0; }
/* 横屏：去掉侧栏，画面占满整行（高度不超出一屏），点赞浮在画面右下角 */
@media (min-width: 1101px), (orientation: landscape) {
  .no-dm .layout { grid-template-columns: minmax(0, 1fr); }
  .no-dm .side { display: none; }
  .no-dm .stage-wrap { width: 100%; max-width: calc((100vh - 120px) * 16 / 9); margin: 0 auto; }
  .no-dm .fs-like { display: grid; place-items: center; }
  .no-dm .fs-like-num { display: block; }
}
/* 手机横屏这种矮屏：画面按整屏高度算，往上滑一点头部就让开 */
@media (orientation: landscape) and (max-height: 520px) {
  .no-dm .layout { padding-top: 8px; padding-bottom: 8px; }
  .no-dm .stage-wrap { max-width: calc((100vh - 16px) * 16 / 9); }
  .no-dm .fs-like { width: 44px; height: 44px; right: 14px; bottom: 64px; }
  .no-dm .fs-like svg { width: 20px; height: 20px; }
  .no-dm .fs-like-num { width: 44px; right: 14px; bottom: 46px; font-size: 12px; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; padding: 12px 16px 24px; gap: 14px; }
  .side { height: auto; min-height: 0; position: static; }
  .feed { max-height: 280px; min-height: 120px; }
}
@media (max-width: 760px) {
  .top { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .top-title { order: 3; flex-basis: 100%; border-left: 0; padding-left: 0; flex-direction: column; gap: 2px; }
  .top-title span { font-size: 16px; }
  .top-meta { margin-left: auto; gap: 8px; }
  .audience .places { display: none; }
  .layout { gap: 10px; }
  .hint { margin-bottom: 0; }
  .stage { border-radius: 12px; margin: 0 -4px; }
  .controls { opacity: 1; padding: 20px 8px 6px; }
  .ctl { width: 34px; height: 34px; }
  .q-cur { padding: 0 9px; font-size: 12px; }
  .unmute { bottom: 60px; }
  .gate { padding-top: 20px; gap: 26px; }
  .gate-hero { border-radius: 14px; }
  .gate-title { font-size: 24px; }
}
