﻿/* HOVOD — mobile visual system
 * Reference implementation: dark cinematic UI, restrained teal accent,
 * 16:9 media surfaces, compact typography, bottom five-position navigation.
 *
 * 全屏自适应模型（2026-09-17 重写）
 * ------------------------------------------------------------------
 * 旧模型把**整站外壳**锁在 --shell(430px) 的居中列里：`#app{max-width:430px}`。
 * 后果（实测，见 scripts/verify-responsive.mjs）：
 *   - 1280×800 下 #app 只有 430px，两侧各空 425px；欢迎页背景图退化成一条竖条
 *   - 每屏都固定多出 28px（`.screen` 的 padding-bottom 叠在 100vh 之上）→ 落地页无故可滚
 *   - 视口高度用 vh（移动端"最大视口"），与浏览器 UI 收放后的可见高度不一致
 * 新模型分三层，各自承担一件事：
 *   ① 外壳 #app / .nav  →  满幅（width:100%，无 max-width）
 *   ② 视口高度          →  --app-h（dvh 优先，vh 兜底）
 *   ③ 内容可读列        →  --content（只在大屏生效，约束"内容"而非"外壳"）
 * 外加安全区（刘海 / 底部横条）由 --safe-top / --safe-bottom 统一承担。
 */

:root {
  /* KhmerCosmos theme — navy / emerald / gold */
  --bg: #060a14;
  --bg-elevated: #0a1020;
  --surface: #0d1628;
  --surface-2: #111d35;
  --surface-3: #1a2a4a;
  --line: #1e3a5c;
  --line-soft: rgba(201,168,76,.12);
  --text: #f0e8d8;
  --muted: #8a9ab5;
  --dim: #5a6a85;
  --accent: #c9a84c;
  --accent-2: #e8d08a;
  --accent-ink: #1a1208;
  --accent-soft: rgba(201,168,76,.12);
  --navy: #1a3a6c;
  --navy-deep: #0d1f3c;
  --emerald: #0f5c4a;
  --emerald-deep: #0a3a2e;
  --gold: #c9a84c;
  --gold-light: #e8d08a;
  --danger: #ff6868;
  --ok: #55d98a;
  --radius: 14px;
  --radius-sm: 10px;
  --shell: 430px;
  --content: 720px;
  --nav-h: 72px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-h: 100vh;
}
@supports (height: 100dvh) {
  :root { --app-h: 100dvh; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  padding: 0;
  background: #040610;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

body { min-height: var(--app-h); }

button, input, textarea, select { font: inherit; }
button { -webkit-appearance: none; }

#app {
  width: 100%;
  /* 满幅：不再 max-width:var(--shell)。大屏的可读性由下方 --content 承担。 */
  max-width: none;
  min-height: var(--app-h);
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  overflow-x: hidden;
}

.screen { display: none; min-height: var(--app-h); padding-bottom: 28px; }
.screen.active { display: block; }
.screen.has-nav { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 20px); }
/* 欢迎页自带底部留白，且高度就是整屏 → 不吃 .screen 的 28px，否则永远多出 28px 可滚 */
.screen.is-welcome { padding-bottom: 0; }

/* ---------- Shared ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(58px + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  background: rgba(6,10,20,.92);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(201,168,76,.12);
}
.topbar .title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
}
.topbar .side {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}
.topbar .side:hover { background: rgba(255,255,255,.06); }
.brand-mark {
  font-weight: 900 !important;
  letter-spacing: .08em !important;
  font-size: 22px !important;
}

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 2px 12px rgba(201,168,76,.15), inset 0 1px 0 rgba(232,208,138,.15);
}
.btn:hover { filter: brightness(1.1); box-shadow: 0 4px 18px rgba(201,168,76,.25), inset 0 1px 0 rgba(232,208,138,.2); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.ghost {
  background: rgba(201,168,76,.06);
  color: var(--gold-light);
  border-color: rgba(201,168,76,.35);
}
.btn.sm { min-height: 36px; padding: 7px 14px; font-size: 13px; }
.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255,104,104,.45);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, textarea:focus { border-color: rgba(201,168,76,.7); box-shadow: 0 0 0 3px rgba(201,168,76,.1); }
textarea { min-height: 96px; resize: vertical; }
label.field {
  display: block;
  margin: 16px 0 7px;
  color: #a5afbd;
  font-size: 13px;
  font-weight: 600;
}
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tiny { font-size: 12px; }
.msg { margin-top: 12px; font-size: 13px; white-space: pre-wrap; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid rgba(201,168,76,.15);
  border-radius: var(--radius);
  padding: 16px;
}
.section { padding: 16px; }
.empty { padding: 56px 22px; text-align: center; color: var(--dim); }

/* ---------- ① Welcome ---------- */
/* 背景 = 所有者提供的真实背景图 + 压暗层。
   压暗层不是装饰：它保证白色字标与文案在任何底图上都有足够对比度。
   注：此处原本是一套纯 CSS 拼出的「月亮 + 山峦」场景（.welcome-scene / .welcome-moon
   / .mountain / .welcome-page::after）。那只是**没有背景图时的替代品**；
   真实资产到位后移除，避免两套背景叠加。 */
.welcome-page {
  position: relative;
  min-height: var(--app-h);
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: calc(34px + var(--safe-top)) clamp(20px, 5vw, 40px) calc(30px + var(--safe-bottom));
  background:
    linear-gradient(180deg, rgba(6,10,20,.62) 0%, rgba(6,10,20,.30) 34%, rgba(6,10,20,.56) 72%, rgba(6,10,20,.88) 100%),
    radial-gradient(110% 55% at 50% 4%, rgba(201,168,76,.12), transparent 58%),
    url("./assets/login-bg.jpg") center/cover no-repeat,
    linear-gradient(180deg, #0d1f3c 0%, #0a1525 44%, #060a14 100%);
}
/* 外壳满幅后，可读性约束落在内容上：大屏把文案/按钮收成居中一列。
   只作用于直系内容块，不动绝对定位的装饰光斑。 */
.welcome-page > .welcome-brand,
.welcome-page > .welcome-copy,
.welcome-page > .welcome-actions,
.welcome-page > .welcome-props {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}
.welcome-glow {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .18;
  pointer-events: none;
}
.welcome-glow-a { top: 12%; left: -80px; background: #3370a8; }
.welcome-glow-b { right: -90px; top: 34%; background: #13c9b5; opacity: .08; }
.welcome-brand { position: relative; text-align: center; margin-top: 4px; }
/* 品牌字标改用所有者提供的 logo 资产（透明 PNG），不再用文字模拟。
   宽度用 clamp，保证窄屏不溢出、宽屏不过度放大。 */
.welcome-logo-img {
  display: block;
  width: clamp(188px, 58vw, 262px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 6px 26px rgba(0,0,0,.45));
}
.welcome-tagline {
  margin-top: 10px;
  color: rgba(231,238,246,.72);
  letter-spacing: .16em;
  font-size: 12px;
}
.welcome-copy {
  margin-top: auto;
  padding-top: 70px;
  text-align: center;
}
.welcome-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: .02em;
}
.welcome-copy p {
  margin: 10px 0 0;
  color: #d0d8e2;
  font-size: 15px;
}
.welcome-actions { margin-top: 34px; }
.welcome-actions .btn + .btn { margin-top: 10px; }
.welcome-primary { min-height: 50px; }
.welcome-secondary { min-height: 50px; border-color: rgba(201,168,76,.4); background: rgba(6,10,20,.5); }
.welcome-props {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 34px;
  color: #7d8898;
  font-size: 12px;
  letter-spacing: .04em;
}
.welcome-props i { width: 3px; height: 3px; border-radius: 50%; background: #4d5968; }

/* Auth sheet */
.auth-sheet[hidden] { display: none; }
.auth-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  opacity: 0;
  transition: opacity .18s ease;
}
.auth-sheet.show { opacity: 1; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(8px); }
.auth-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(var(--shell), 100%);
  padding: 28px 24px calc(24px + var(--safe-bottom));
  background: linear-gradient(180deg, var(--surface-2), var(--navy-deep));
  border: 1px solid rgba(201,168,76,.2);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  transform: translate(-50%, 20px);
  transition: transform .2s ease;
  box-shadow: 0 -20px 70px rgba(0,0,0,.5);
}
.auth-sheet.show .auth-panel { transform: translate(-50%, 0); }
.auth-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  font-size: 25px;
  cursor: pointer;
}
.auth-brand-img { display: block; width: 86px; height: auto; margin-bottom: 2px; }
.auth-panel h2 { margin: 8px 0 2px; font-size: 25px; }
.auth-panel-sub { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.auth-switch {
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
/* 验证码行：输入框自适应 + 按钮不换行（窄屏下按钮文字较长，必须 nowrap） */
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1 1 auto; min-width: 0; }
.code-row .btn { flex: 0 0 auto; white-space: nowrap; }
/* 验证状态行（设置页 / 个人中心） */
.verify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.verify-row:last-child { border-bottom: 0; }
.verify-row .vk { color: var(--muted); font-size: 13px; }
.verify-row .vv { font-size: 14px; }
.verify-row .vv.ok { color: var(--accent); }
.verify-row .vv.no { color: var(--muted); }
.verify-row .vact {
  border: 1px solid rgba(255,255,255,.16);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.verify-row .vact[disabled] { opacity: .5; cursor: default; }

/* ---------- ② Feed ---------- */
.tabs {
  display: flex;
  gap: 18px;
  overflow-x:auto;
  padding: 5px 20px 0;
  border-bottom: 1px solid rgba(201,168,76,.1);
}
.tabs button {
  position: relative;
  flex: 0 0 auto;
  padding: 11px 2px 12px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
.tabs button.on { color: var(--gold-light); }
.tabs button.on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201,168,76,.5);
}

.work-card {
  margin: 14px 14px 18px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.work-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid rgba(201,168,76,.15);
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(0,0,0,.3));
}
.work-cover .ph { color: #667383; font-size: 13px; }
.work-cover .badge {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(6px);
  font-size: 11px;
}
.work-body { padding: 10px 2px 0; }
.work-head { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #27303c;
  color: #a5b0c0;
  font-size: 13px;
  font-weight: 750;
  border: 1px solid rgba(255,255,255,.07);
}
.avatar.lg { width: 82px; height: 82px; font-size: 28px; border: 3px solid var(--bg); }
.work-head .name { flex: 1; min-width: 0; font-size: 13px; font-weight: 650; }
.work-title {
  margin: 9px 0 3px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
}
.work-desc { color: #929dab; font-size: 13px; margin: 0 0 6px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,.25);
  font-size: 11px;
}
.stats-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 9px;
  color: #778394;
  font-size: 12px;
}
.stats-row span { display: inline-flex; align-items: center; gap: 3px; }
.stats-row .dim { margin-left: auto; }

/* ---------- ③ Playback ---------- */
.player-wrap { position: relative; background: #000; }
.player-wrap video, .player-wrap .video-fallback {
  width: 100%;
  max-height: 72vh;
  display: block;
  background: #000;
}
.video-fallback {
  aspect-ratio: 9 / 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}
.rail {
  position: absolute;
  right: 11px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}
.rail button {
  min-width: 42px;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  text-shadow: 0 2px 8px #000;
}
.rail button .ico { font-size: 28px; line-height: 1; }
.rail button.on { color: #ff4761; }
.progress { height: 2px; background: #27303a; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); }
.time-row { display: flex; justify-content: space-between; padding: 7px 14px; color: #7c8796; font-size: 11px; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.comment .body { flex: 1; font-size: 14px; }
.comment .meta { margin-top: 3px; color: var(--dim); font-size: 11px; }
.comment-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(10,16,32,.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(201,168,76,.12);
}
.comment-bar input { border-radius: 999px; }

/* ---------- ④ Profile ---------- */
.cover {
  position: relative;
  height: 172px;
  background:
    radial-gradient(circle at 75% 20%, rgba(201,168,76,.15), transparent 28%),
    linear-gradient(150deg, var(--navy), var(--navy-deep) 75%);
  overflow: hidden;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(7,11,16,.72));
  pointer-events: none;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .edit { position: absolute; right: 12px; bottom: 10px; z-index: 2; }
.profile-head {
  padding: 0 16px;
  margin-top: -42px;
  position: relative;
  z-index: 2;
}
.profile-head .avatar { box-shadow: 0 6px 25px rgba(0,0,0,.4); }
.profile-name { margin: 10px 0 4px; font-size: 22px; font-weight: 800; }
.profile-bio { margin: 0 0 15px; color: #909bab; font-size: 13px; white-space: pre-wrap; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 2px 16px 16px;
}
.stat-grid div { text-align: center; }
.stat-grid .n { font-size: 17px; font-weight: 750; }
.stat-grid .k { margin-top: 2px; color: #7d8898; font-size: 11px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
}
.grid .cell {
  position: relative;
  aspect-ratio: 1 / 1.12;
  overflow: hidden;
  background: #161d26;
}
.grid .cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid .cell .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 7px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  color: #fff;
  font-size: 10px;
}

/* ---------- ⑤ Publish ---------- */
.cover-picker {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: none;
  border: 1px dashed rgba(201,168,76,.35);
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(26,58,108,.34), rgba(6,10,20,.9)),
    radial-gradient(circle at 70% 25%, rgba(201,168,76,.12), transparent 30%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
}
.cover-picker::before { content: "▣"; font-size: 24px; color: var(--text); }
.cover-picker img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.cover-picker > div { position: relative; z-index: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.chip.on { border-color: rgba(201,168,76,.7); color: var(--gold-light); background: var(--accent-soft); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 8px; }
.seg button {
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.seg button.on { border-color: rgba(201,168,76,.65); color: var(--gold-light); background: var(--accent-soft); }
.pick-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 8px 9px 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.pick-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ⑥ Me ---------- */
.menu {
  margin: 15px 14px;
  background: var(--surface);
  border: 1px solid rgba(201,168,76,.15);
  border-radius: 18px;
  overflow: hidden;
}
.menu button {
  width: 100%;
  min-height: 61px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 17px;
  border: 0;
  border-bottom: 1px solid #28313c;
  background: transparent;
  color: #eef2f7;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}
.menu button:last-child { border-bottom: 0; }
.menu button:hover { background: rgba(255,255,255,.035); }
.menu button .ico { width: 22px; text-align: center; color: #9cabc0; font-size: 17px; }
.menu button .arrow { margin-left: auto; color: #69778a; font-size: 22px; line-height: 1; }
.menu button.danger { color: var(--danger); }
.menu button.danger .ico { color: var(--danger); }

.foot-brand { padding: 40px 0 26px; text-align: center; }
.foot-brand .logo { color: var(--gold); font-weight: 900; letter-spacing: .22em; font-size: 15px; }
.foot-brand .tag { margin-top: 7px; color: var(--dim); font-size: 10px; letter-spacing: .18em; }

/* ---------- Bottom nav ---------- */
/* ⚠️ 这一条必须存在，且必须放在 .nav 规则之前。
   UA 的 `[hidden]{display:none}` 与 `.nav{display:grid}` **特异性相同**，
   而作者样式优先于 UA 样式 —— 所以只写 `.nav{display:grid}` 会让 hidden 彻底失效。
   这不是理论问题：欢迎页（非 tab 屏）的 nav.hidden 一直是 true，
   但导航照常渲染，并把落地页的 CTA 与底部文案压在下面（实测 props 被遮 42px）。
   `.auth-sheet[hidden]` 早就做了同样处理，nav 当时漏了。 */
.nav[hidden] { display: none; }

.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: 100%;
  max-width: none;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(180deg, rgba(10,16,32,.96), rgba(6,10,20,.98));
  backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid rgba(201,168,76,.15);
}
.nav button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-size: 10px;
}
.nav button .ico { font-size: 22px; line-height: 1; }
.nav button.on { color: var(--gold); }
.nav button.mid .ico {
  width: 56px;
  height: 34px;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--accent-ink);
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(201,168,76,.35);
  border: 1.5px solid rgba(232,208,138,.4);
}
.nav button.mid span + span { display: none; }
.nav button.nav-static { opacity: .72; cursor: default; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px);
  z-index: 120;
  width: max-content;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: #27313d;
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  text-align: center;
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}
#toast.show { opacity: 1; }
#toast.err { background: #3a171b; color: #ffd0d0; }
#toast.ok { background: #102d23; color: #c6f8d9; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 全屏自适应的断点 ---------- */

/* 短视口（横屏手机 / 小窗）：实测 844×390 下原版溢出 127px、底部文案被导航遮 141px。
   这里压缩纵向节奏，让落地页在 390px 高内也完整呈现。 */
@media (max-height: 620px) {
  .welcome-page {
    padding-top: calc(18px + var(--safe-top));
    padding-bottom: calc(18px + var(--safe-bottom));
  }
  .welcome-logo-img { width: clamp(140px, 34vw, 200px); }
  .welcome-copy { padding-top: 20px; }
  .welcome-copy h1 { font-size: 24px; }
  .welcome-actions { margin-top: 18px; }
  .welcome-props { margin-top: 18px; }
}

/* 宽屏（平板 / 桌面）：外壳已满幅，这里只做两件事 ——
   ① 顶栏/底栏等内容仍横贯全宽，但**内容**收进 --content 居中列；
   ② 卡片类区块限宽居中，避免 16:9 封面被拉成巨幅。 */
@media (min-width: 760px) {
  .topbar,
  .comment-bar,
  .tabs {
    padding-inline: max(14px, calc((100% - var(--content)) / 2 + 14px));
  }
  .nav { grid-template-columns: repeat(5, minmax(0, 140px)); justify-content: center; }
  .work-card,
  .player-wrap,
  .section,
  .menu,
  .profile-head,
  .stat-grid,
  .foot-brand { max-width: var(--content); margin-inline: auto; }
  .grid { grid-template-columns: repeat(5, 1fr); }
  .welcome-copy h1 { font-size: 34px; }
}

@media (min-width: 1180px) {
  .grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 360px) {
  .tabs { gap: 20px; }
  .stats-row { gap: 9px; }
}

/* ---------- HOVOD multilingual switcher ---------- */
#locale-switcher{display:none;position:fixed;top:max(12px,env(safe-area-inset-top));right:12px;z-index:1200;font-size:12px}
#locale-switcher .locale-current{height:34px;min-width:58px;padding:0 12px;border:1px solid var(--line,#283341);border-radius:999px;background:rgba(15,22,31,.82);backdrop-filter:blur(14px);color:var(--text,#f5f7fa);font:inherit;cursor:pointer}
#locale-switcher .locale-current:hover,#locale-switcher .locale-current:focus-visible{border-color:var(--accent,#16d6c6)}
#locale-switcher .locale-menu{display:none;position:absolute;right:0;top:40px;min-width:112px;padding:6px;border:1px solid var(--line,#283341);border-radius:14px;background:rgba(12,18,26,.97);box-shadow:0 14px 40px rgba(0,0,0,.35)}
#locale-switcher.open .locale-menu{display:grid;gap:3px}
#locale-switcher .locale-menu button{border:0;border-radius:9px;background:transparent;color:#aab5c5;text-align:left;padding:9px 10px;font:inherit;cursor:pointer}
#locale-switcher .locale-menu button:hover,#locale-switcher .locale-menu button.on{background:rgba(22,214,198,.12);color:#16d6c6}
@media (max-width:520px){#locale-switcher{top:max(8px,env(safe-area-inset-top));right:10px}.topbar{padding-right:76px}}

/* ---- ⑦ 消息（Communication OS；COMM-CORE-04）---- */
.comm-conn{display:flex;align-items:center;gap:8px;padding:6px 0;font-size:13px}
.comm-conn .dot{width:8px;height:8px;border-radius:50%;background:#4a5568;flex:none}
.comm-conn .dot.on{background:#22c55e;box-shadow:0 0 6px rgba(34,197,94,.7)}
.comm-conn-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.comm-conv-list{display:flex;flex-direction:column}
.comm-conv{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:13px 4px;background:none;border:0;border-bottom:1px solid rgba(255,255,255,.06);color:inherit;font:inherit;cursor:pointer}
.comm-conv:active{background:rgba(255,255,255,.05)}
.comm-conv-main{flex:1;min-width:0}
.comm-conv-title{font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.comm-conv-side{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex:none}
.comm-thread{display:flex;flex-direction:column;gap:10px;padding:14px}
.comm-msg{max-width:78%;align-self:flex-start}
.comm-msg.me{align-self:flex-end}
.comm-msg .msg-body{background:rgba(255,255,255,.08);border-radius:14px 14px 14px 4px;padding:9px 12px;font-size:14px;line-height:1.5;word-break:break-word;white-space:pre-wrap}
.comm-msg.me .msg-body{background:linear-gradient(180deg,var(--navy),var(--navy-deep));color:var(--gold-light);border:1px solid rgba(201,168,76,.25);border-radius:14px 14px 4px 14px}
.comm-msg .tiny{margin-top:3px}

/* Auth submit: extra breathing room above button when followed by confirm-password field */
.auth-panel .btn#w-auth-submit, .auth-panel form > .btn { margin-top: 18px; }


/* Social login row */
.welcome-social { display: flex; gap: 8px; margin-top: 12px; align-items: center; justify-content: center; }
.welcome-social > * { flex: 0 1 auto; transform: scale(0.85); transform-origin: center; }
.social-row { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 16px; padding: 0 20px; }
.social-btn { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.2); cursor: pointer; }
.tg-slot { overflow: hidden; }
.tg-slot iframe { transform: scale(0.5); transform-origin: center; width: 48px !important; height: 48px !important; }
/* Hide original Telegram widget, only show scaled version in slot */
body > iframe[src*="telegram.org"]:not(.in-slot) { display: none; }
.tg-slot { overflow: hidden !important; width: 48px !important; height: 48px !important; position: relative; }
.tg-slot iframe { transform: scale(0.5) !important; transform-origin: top left !important; width: 96px !important; height: 48px !important; border: 0 !important; }
/* Immersive feed */
.feed-video-wrap { position: fixed; inset: 0; background: #000; overflow: hidden; }
.feed-video-wrap video { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.music-disc { width: 44px; height: 44px; border-radius: 50%; background: #111; border: 2px solid #333; animation: rotateDisc 6s linear infinite; display: flex; align-items: center; justify-content: center; }
@keyframes rotateDisc { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* Work page vinyl disc — paused by default, spins while playing */
#disc { animation: rotateDisc 20s linear infinite; animation-play-state: paused; will-change: transform; }
#disc.spinning { animation-play-state: running; }
/* Hide all scrollbars */
*{scrollbar-width:none;-ms-overflow-style:none}
*::-webkit-scrollbar{display:none}
