/* ============================================
   Ownlo 设计令牌 (Design Tokens)
   ============================================ */
:root {
  /* 色板:夜间集市感的深墨绿黑 + 暖金(币感) + 洋红(打赏高亮) */
  --ink-950: #0A1512;
  --ink-900: #101F1A;
  --ink-800: #172A23;
  --surface: #1D3129;
  --line: rgba(255,255,255,0.08);

  --gold: #F2A93B;
  --gold-dim: #B87F2A;
  --magenta: #E23FA0;

  --ink-text: #F4F1EA;
  --ink-text-dim: rgba(244,241,234,0.62);
  --ink-text-faint: rgba(244,241,234,0.38);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font-display: 'Space Grotesk', 'PingFang SC', 'Noto Sans SC', sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Noto Sans SC', sans-serif;
}

@font-face {
  font-family: 'Space Grotesk';
  src: local('Space Grotesk');
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ink-950);
  color: var(--ink-text);
  font-family: var(--font-body);
  overscroll-behavior: none;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh; /* 移动端弹出软键盘时,动态视口高度会正确收缩,避免弹层被键盘遮住 */
  height: var(--app-vh, 100dvh); /* JS 根据 visualViewport 实时计算的高度,兼容不支持 dvh 的浏览器内核(如部分 WebView/X5) */
  overflow: hidden;
  background: var(--ink-950);
}

.hidden { display: none !important; }

/* ============================================
   登录页
   ============================================ */
.lang-selector {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-text);
  font-size: 12.5px;
  padding: 6px 8px;
  backdrop-filter: blur(6px);
}
.lang-selector option { color: #17130A; }

/* 阿拉伯语/乌尔都语等RTL语言的基础布局调整 */
[dir="rtl"] .login-content { text-align: right; }
[dir="rtl"] .lang-selector { right: auto; left: 16px; }
[dir="rtl"] .btn-primary,
[dir="rtl"] .btn-secondary { flex-direction: row-reverse; }
[dir="rtl"] .action-rail { right: auto; left: 12px; }
[dir="rtl"] .feed-card__body { padding: 0 18px 28px 88px; }

/* ============================================
   语言选择页(本轮新增):App 冷启动的第一屏
   ============================================ */
.screen--language-gate {
  position: relative;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(242,169,59,0.16), transparent 60%),
    linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 70%);
}

.language-gate-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 28px;
}

.language-gate-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--gold);
  text-align: center;
  margin-bottom: 10px;
}

.language-gate-hint {
  text-align: center;
  color: var(--ink-text-dim);
  font-size: 13.5px;
  margin: 0 0 28px;
}

.language-gate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.language-gate-option {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  color: var(--ink-text);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.language-gate-option:active { transform: scale(0.97); }
.language-gate-option:hover,
.language-gate-option:focus-visible {
  background: rgba(242,169,59,0.14);
  border-color: var(--gold-dim);
  outline: none;
}

.screen--login {
  position: relative;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(242,169,59,0.16), transparent 60%),
    linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 70%);
}

.screen--login-inner {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 28px 56px;
}

.login-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226,63,160,0.28), transparent 70%);
  filter: blur(10px);
}

.login-content { position: relative; z-index: 1; width: 100%; }

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--gold);
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.brand-tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-text-faint);
  text-transform: uppercase;
}

.login-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  max-width: 20ch;
}

.login-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-text-dim);
  margin: 0 0 32px;
  max-width: 34ch;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #17130A;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible {
  outline: 2px solid var(--ink-text);
  outline-offset: 2px;
}

.pi-glyph {
  font-family: var(--font-display);
  font-size: 18px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--ink-text-faint);
  font-size: 12.5px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-alt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--ink-text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-secondary:active { background: rgba(255,255,255,0.09); }
.btn-secondary:focus-visible {
  outline: 2px solid var(--ink-text);
  outline-offset: 2px;
}

.alt-ic {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.phone-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-size: 15px;
  margin-bottom: 14px;
}
.phone-input::placeholder { color: var(--ink-text-faint); }

.login-foot {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-text-faint);
  text-align: center;
}

/* ============================================
   Feed 主界面
   ============================================ */
.screen--feed {
  position: relative;
  height: 100%;
}

.feed-list {
  height: calc(100% - 64px);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  /* 本轮新增:只把纵向滚动交给浏览器原生处理(切视频),横向的触摸移动不再被
     系统手势(比如部分浏览器的"边缘滑动返回上一页")抢走,让 JS 能接管横向滑动
     来切换下面新增的"关注/推荐/直播广场"标签,两者互不干扰。 */
  touch-action: pan-y;
}

/* 本轮新增:首页顶部"关注/推荐/直播广场"标签(参照抖音首页布局),悬浮在
   视频画面上方,和右上角私信/通知图标分开摆放,避免互相遮挡。 */
.feed-tabbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  display: flex;
  gap: 16px;
}
.feed-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.feed-tab.is-active {
  color: #fff;
  position: relative;
}
.feed-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--magenta);
}

.feed-empty-note {
  padding: 40vh 32px 0;
  text-align: center;
  color: var(--ink-text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}

.feed-card {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.feed-card__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.feed-card__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink-950);
  -webkit-touch-callout: none; /* 避免长按时弹出系统自带的"保存视频"菜单,和净屏手势打架 */
  -webkit-user-select: none;
  user-select: none;
}

/* 长按视频进入"净屏模式":文字、按钮、进度条淡出,只留视频本身。
   本轮改成"持续净屏"模式:松手后不会自动恢复,需要再点一下画面或者滑动切换视频才会淡入恢复——
   刻意不学抖音"文字按钮常驻挡画面"的做法,参考的是别的App常见的长按看净屏手势,
   同时也不是"按住才净屏、一松手就变回去"这种一闪而过的效果。 */
.feed-card__scrim,
.feed-card__body,
.action-rail,
.feed-card__progress,
.feed-card__pause-icon,
.chat-fab,
.bottom-nav {
  transition: opacity 0.15s ease;
}
.feed-card.is-peeking .feed-card__scrim,
.feed-card.is-peeking .feed-card__body,
.feed-card.is-peeking .action-rail,
.feed-card.is-peeking .feed-card__progress,
.feed-card.is-peeking .feed-card__pause-icon {
  opacity: 0;
  pointer-events: none;
}
#app.is-peeking-feed .chat-fab,
#app.is-peeking-feed .bottom-nav {
  opacity: 0;
  pointer-events: none;
}

/* 点击视频暂停后显示的中央播放图标(呼应抖音的暂停态反馈) */
.feed-card.is-paused .feed-card__pause-icon {
  display: flex;
}
.feed-card__pause-icon {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.feed-card__pause-icon::after {
  content: "▶";
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
}

.feed-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,21,18,0) 40%, rgba(10,21,18,0.92) 100%);
  z-index: 1;
}

.feed-card__body {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 88px 28px 18px;
}

.creator-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.creator-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

.creator-name {
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}

.follow-pill {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-950);
  background: var(--gold);
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
}

.feed-caption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-text);
  margin: 0 0 4px;
}

.feed-sound {
  font-size: 12.5px;
  color: var(--ink-text-dim);
}

/* 右侧操作栏 */
.action-rail {
  position: absolute;
  right: 12px;
  bottom: 100px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--ink-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
}

.action-btn__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.action-btn--tip .action-btn__icon {
  background: linear-gradient(135deg, var(--magenta), #B32E77);
}

/* 本轮把评论图标从抽象的"◆"换成一个原创绘制的对话气泡 SVG,辨识度更高,
   同时保持自己画的通用对话气泡形状(不是照抄抖音那个特定图标的具体造型) */
.action-btn__icon svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   个人主页
   ============================================ */
.screen--profile {
  position: relative;
  height: 100%;
  background: var(--ink-950);
}
.profile-scroll {
  height: calc(100% - 64px);
  overflow-y: auto;
  padding-bottom: 24px;
}
.profile-header {
  position: relative;
  padding: 32px 24px 20px;
  text-align: center;
  background: radial-gradient(120% 60% at 50% 0%, rgba(242,169,59,0.12), transparent 60%);
}
.profile-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--ink-text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  border: 3px solid var(--ink-800);
}
.profile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
}
.profile-handle {
  color: var(--ink-text-faint);
  font-size: 13px;
  margin: 2px 0 12px;
}
.profile-bio {
  color: var(--ink-text-dim);
  font-size: 13.5px;
  margin: 0 0 18px;
  line-height: 1.5;
}
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 18px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  /* "关注"/"粉丝"这两项本轮改成了 <button>(可以点开看名单),"获赞"还是 <div>——
     这几条把 button 的默认外观(背景/边框/内边距)清掉,让它看起来和原来的纯展示项一样 */
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.stat-item:disabled,
div.stat-item {
  cursor: default;
}
.stat-item strong {
  font-family: var(--font-display);
  font-size: 17px;
}
.stat-item span {
  font-size: 11.5px;
  color: var(--ink-text-faint);
  /* 加了第四项"互关"之后,部分语言的翻译比较长(比如阿拉伯语/乌尔都语),
     这里限制最大宽度并省略号截断,避免把整排统计撑变形或挤到换行。 */
  max-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 本轮把"编辑资料"和"账号绑定"、"关注"和"私信"分别改成一行两个按钮并排,
   之前是单个按钮 margin:0 auto 居中,现在用一个 flex 容器包裹,两个按钮各占一半、之间留一点间距 */
.profile-header__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}
.profile-edit-btn,
.profile-bind-btn,
.profile-follow-btn,
.profile-message-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 13.5px;
  white-space: nowrap;
}
.profile-bind-btn,
.profile-message-btn {
  min-width: 0;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--ink-950);
  z-index: 2;
  /* 本轮新增"收藏"、"历史浏览"两个标签页后一共 5 个,窄屏放不下还用 flex:1 平分
     会挤得很窄、文字容易换行,改成横向可滚动、按内容宽度排列,和抖音"我的钱包/
     订单"那种多标签横条一个思路。 */
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
  flex: 0 0 auto;
  padding: 13px 14px;
  background: none;
  border: none;
  color: var(--ink-text-faint);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.profile-tab.is-active {
  color: var(--ink-text);
  border-bottom-color: var(--gold);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}
.profile-grid-item {
  aspect-ratio: 9 / 13;
  position: relative;
  overflow: hidden;
  background: var(--ink-800);
  cursor: pointer;
}
.profile-grid-item__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-grid-item__play {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.profile-grid-item__views {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 11px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.profile-earnings-panel {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
}
.profile-earnings-hint {
  color: var(--ink-text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}
.earnings-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  color: var(--gold);
  margin-bottom: 8px;
}
.earnings-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-text-dim);
}

/* 底部导航(全局共享组件,固定在 #app 底部) */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: var(--ink-900);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 20;
}

.nav-item {
  background: none;
  border: none;
  color: var(--ink-text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  cursor: pointer;
}
.nav-item.is-active { color: var(--gold); }
.nav-ic { font-size: 20px; }

.nav-item--create .nav-ic {
  width: 40px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-950);
  font-size: 18px;
  font-weight: 700;
}

/* ============================================
   打赏弹层
   ============================================ */
/* ⚠️ 本轮关键修复:这里之前是 z-index:10,比下面 .bottom-nav 的 z-index:20 还低。
   .tip-sheet 是评论区/编辑资料/账号绑定/作品播放等所有底部弹层共用的基础类,
   z-index 比底部导航栏低,意味着弹层最下面一截(通常正好是评论输入框、
   保存按钮这些最关键的功能按钮所在的位置)会被常驻的底部导航栏盖在下面——
   这正是"评论区/个人资料弹层功能键被遮盖"反馈的根因,不是 overflow/滚动本身的问题,
   而是这块区域从一开始就在视觉上被压在导航栏下面,滚动到底也够不着。
   现在把所有弹层统一提到 40,确保在底部导航栏(20)之上;上传进度遮罩层
   (upload-overlay)本来就该盖住一切,相应地也从 30 提到 50,继续保持在最上层。 */
.tip-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
}
.tip-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,21,18,0.6);
}
.tip-sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--ink-900);
  border-radius: 22px 22px 0 0;
  padding: 10px 20px 28px;
  border-top: 1px solid var(--line);
  max-height: 86vh;
  max-height: 86dvh; /* 键盘弹出时跟随可视视口收缩,保证确认/保存按钮始终可滚动到 */
  max-height: calc(var(--app-vh, 86dvh) * 0.86); /* JS 计算的可视视口高度,兼容不支持 dvh 的浏览器内核 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tip-sheet__handle {
  width: 36px; height: 4px;
  background: var(--line);
  border-radius: 999px;
  margin: 6px auto 16px;
}
.tip-sheet__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}
.tip-currency-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.currency-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-text-dim);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.currency-btn.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(242,169,59,0.08);
}
.tip-amounts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.amount-chip, .wallet-amount-chip {
  padding: 12px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.amount-chip.is-active, .wallet-amount-chip.is-active {
  border-color: var(--magenta);
  background: rgba(226,63,160,0.12);
  color: var(--magenta);
}
/* 本轮新增:自定义打赏数量的输入框(点"自定义"这个chip展开) */
.tip-amount-custom-row { margin-bottom: 20px; }
.tip-amount-custom-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-size: 15px;
}
.tip-amount-custom-input::placeholder { color: var(--ink-text-faint); }
.btn-tip-confirm {
  background: linear-gradient(135deg, var(--magenta), #B32E77);
  color: var(--ink-text);
}

.tip-sheet__note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-text-faint);
  text-align: center;
}
.age-gate-note {
  text-align: left;
  margin: 0 0 14px;
}
.age-gate-error {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--magenta);
  text-align: center;
  line-height: 1.5;
}

/* ============================================
   上传进度遮罩层
   ============================================ */
.upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(10,21,18,0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-overlay__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.upload-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: upload-spin 0.8s linear infinite;
}
@keyframes upload-spin {
  to { transform: rotate(360deg); }
}
.upload-overlay__panel p {
  color: var(--ink-text);
  font-size: 14px;
}

/* ============================================
   聊天入口悬浮按钮
   ============================================ */
/* 本轮改造:私信图标右上角新增了一个并排的"通知"图标,两个圆形按钮包在这个
   横向容器里,容器本身固定在右上角,替代原来"只有一个按钮"时直接把 position:
   absolute 写在 .chat-fab 自己身上的做法。 */
.feed-top-icons {
  position: absolute;
  top: 16px;
  right: 14px;
  z-index: 5;
  display: flex;
  gap: 10px;
}
.chat-fab {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  color: var(--ink-text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-fab__icon {
  width: 21px;
  height: 21px;
}
.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--magenta);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   聊天列表 / 聊天详情 通用界面
   ============================================ */
.screen--chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ink-950);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.chat-header-spacer { flex: 1; }
.chat-back {
  background: none;
  border: none;
  color: var(--ink-text);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
}
/* 本轮新增:会话详情页头部的"清空聊天记录"按钮,顶到最右边,兼职替代了原来
   纯占位的 .chat-header-spacer(标题左右各有一个可点的元素,视觉更平衡)。 */
.chat-header-action {
  flex: 1;
  text-align: right;
  background: none;
  border: none;
  color: var(--ink-text-dim);
  font-size: 17px;
  cursor: pointer;
  padding: 4px 6px;
}
.chat-header-action:active { color: var(--ink-text); }

.conversation-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.conversation-item:active { background: rgba(255,255,255,0.04); }

/* 本轮修复:之前这里永远是一个纯色渐变圆(没有图、没有首字母、点了没反应)。
   现在和评论区/关注列表用同一套"有头像图用图,没有就首字母+固定底色"的规则,
   并且是可点击的(data-action="open-creator"),跳转到对方主页。 */
.conversation-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #17130A;
  cursor: pointer;
  overflow: hidden;
}
.conversation-avatar .comment-item__avatar-img { width: 100%; height: 100%; object-fit: cover; }

.conversation-meta { flex: 1; min-width: 0; }
.conversation-name {
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 3px;
}
.conversation-last {
  font-size: 13px;
  color: var(--ink-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--magenta);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 本轮新增:会话列表每一行右侧的"清空该会话"按钮,平时颜色很淡,不抢眼,
   点了要二次确认(见 app.js 里的 confirm 弹窗),避免误触。 */
.conversation-clear-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 15px;
  opacity: 0.45;
  cursor: pointer;
  padding: 6px;
}
.conversation-clear-btn:active { opacity: 0.85; }

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-bubble {
  position: relative;
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.message-bubble__text { white-space: pre-wrap; word-break: break-word; }
/* 本轮新增:单条消息删除按钮,只有自己发的消息(message-bubble--out)才会渲染出来,
   平时很淡,不干扰阅读,点击需要二次确认。 */
.message-bubble__delete {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 12px;
  opacity: 0.4;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
.message-bubble__delete:active { opacity: 0.9; }
.message-bubble--in {
  align-self: flex-start;
  background: var(--ink-800);
  border-bottom-left-radius: 4px;
}
.message-bubble--out {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #17130A;
  border-bottom-right-radius: 4px;
}

.message-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  align-items: center;
}
/* 本轮新增:私信输入框、评论输入框共用的表情按钮样式 */
.emoji-toggle-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--ink-800);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.emoji-toggle-btn:active { background: rgba(255,255,255,0.08); }
.message-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-size: 14px;
}
.message-input::placeholder { color: var(--ink-text-faint); }
.send-btn {
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: var(--gold);
  color: #17130A;
  font-weight: 600;
  cursor: pointer;
}

/* ===== 新增:点赞/关注/评论/编辑资料/静音切换 相关样式 ===== */

.action-btn.is-active .action-btn__icon {
  background: var(--magenta);
  color: #fff;
}

.follow-pill.is-following {
  background: transparent;
  border: 1px solid var(--ink-text-faint);
  color: var(--ink-text-dim);
}

.sound-toggle {
  /* 按要求隐藏声音开关按钮——和抖音一致,视频默认就带声音,不需要一个单独的开关。
     元素本身留着不删,是因为 app.js 里仍然会往它身上写文字/绑定点击,只是不再显示。 */
  display: none;
}

/* ============================================
   右侧操作栏新增按钮:收藏 / 分享 / 音乐圆盘
   ============================================ */
.action-btn--music {
  margin-top: 4px;
}
.action-btn--music .action-btn__icon {
  background: radial-gradient(circle at 35% 35%, #4a3420, #1a1208 70%);
  border: 2px solid var(--gold-dim);
  animation: music-disc-spin 4s linear infinite;
}
.feed-card.is-paused .action-btn--music .action-btn__icon {
  animation-play-state: paused;
}
@keyframes music-disc-spin {
  to { transform: rotate(360deg); }
}

/* 本轮新增:横屏全屏观看胶囊按钮。参照抖音/番茄小说等平台的做法——只在源视频本身
   是横拍(宽>高)时才出现在视频画面中下方居中位置,竖拍视频完全不显示这个按钮。
   之前的版本把它塞进右侧竖排点赞/收藏那一栏里,位置和交互形式都跟其它平台不一样,
   容易被当成竖排图标的一部分而漏点/误触。 */
.feed-fullscreen-pill {
  position: absolute;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px 7px 12px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.feed-fullscreen-pill.hidden { display: none; }
/* 本轮新增:?debug=1 调试模式下显示每条视频实际解码宽高,排查全屏按钮误判用 */
.debug-video-dims {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255,0,0,0.65);
  color: #fff;
  font-size: 11px;
  font-family: monospace;
  pointer-events: none;
}
.feed-fullscreen-pill__icon { width: 15px; height: 15px; display: flex; }
.feed-fullscreen-pill__icon svg { width: 100%; height: 100%; }

/* 本轮新增:伪全屏播放层。很多内嵌浏览器/WebView(微信、QQ、部分国产手机自带浏览器等)
   要么完全不支持标准 Fullscreen API,要么禁止普通元素调用它,导致"点了全屏没反应"。
   这里改用一个铺满视口的固定定位容器,把 <video> 移进来做"假全屏",不依赖浏览器的
   全屏权限,兼容性好得多;--rotate 修饰类用于手机没有真正横过来时,靠 CSS 旋转
   模拟横屏画面(横拍视频在竖屏手机上也能撑满宽度观看)。 */
.video-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-fullscreen-overlay.hidden { display: none; }
.video-fullscreen-overlay video {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}
.video-fullscreen-overlay--rotate video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vh;
  height: 100vw;
  transform: translate(-50%, -50%) rotate(90deg);
}
.video-fullscreen-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.video-fullscreen-overlay--rotate .video-fullscreen-close {
  top: 14px;
  right: 14px;
  transform: rotate(90deg);
  transform-origin: center;
}

/* 双击点赞时,画面中央弹出的心形动画 */
.double-tap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -50%) scale(0.4);
  font-size: 96px;
  color: var(--magenta);
  text-shadow: 0 4px 16px rgba(0,0,0,0.35);
  pointer-events: none;
  animation: double-tap-heart-pop 0.7s ease-out forwards;
}
@keyframes double-tap-heart-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  45% { transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* 底部可拖动播放进度条 */
.feed-card__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 20px; /* 实际显示只有底部3px,多留出的高度是为了让手指更容易点中/拖动 */
  z-index: 4;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  touch-action: none; /* 拖动进度条时不要触发 Feed 的上下滑动切换视频 */
}
.feed-card__progress::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255,255,255,0.25);
}
.feed-card__progress-fill {
  position: relative;
  height: 3px;
  width: 0%;
  background: var(--gold);
  z-index: 1;
  pointer-events: none;
}

.comment-sheet__panel {
  max-height: 70vh;
  max-height: 70dvh; /* 同步基础弹层的动态视口修复,评论区始终能滚动到发送按钮 */
  max-height: calc(var(--app-vh, 70dvh) * 0.70); /* JS 计算的可视视口高度,兼容不支持 dvh 的浏览器内核 */
  overflow-y: hidden; /* 滚动交给内部 .comment-list,面板自身不再产生第二层滚动条 */
  display: flex;
  flex-direction: column;
}

.comment-list {
  flex: 1;
  min-height: 0; /* 关键修复:没有这一行,flex 子项默认不会收缩到小于内容高度,导致内部列表不产生滚动条,而是把发送框顶出可视区域 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* 本轮补上:之前这行只留在旧的外层 .tip-sheet__panel 上,
    min-height:0 修复把真正滚动的元素换成了这个内层 .comment-list,但这行没有跟着一起迁移过来,
    导致部分安卓 WebView(包括 Pi Browser 内嵌浏览器)上这里的滚动仍然发涩、不跟手 */
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comment-item__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #17130A;
  cursor: pointer;
  overflow: hidden;
}

/* 评论者有真实头像图时用的 <img>,铺满圆形头像容器,和占位首字母二选一显示 */
.comment-item__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment-item__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comment-item__user {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
}

.comment-item__time {
  font-size: 11px;
  color: var(--ink-text-faint);
}

.comment-item__content {
  font-size: 14px;
  color: var(--ink-text);
  line-height: 1.4;
}

/* 本轮新增:关注/粉丝名单里"互相关注"标签,复用 .comment-item 那一整套行样式,
   只是在昵称旁边多一个小标签。 */
.follow-mutual-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-950);
  background: var(--gold);
  border-radius: 999px;
  padding: 1px 7px;
  flex-shrink: 0;
}

/* 本轮新增:通知弹层里的每一条,复用 .comment-item 布局,未读的加一条左侧强调色竖线,
   系统公告用一个喇叭 emoji 当"头像"，关联视频有封面图的话在最右边露出一个小缩略图。 */
.notification-item.is-unread {
  border-left: 2px solid var(--gold);
  padding-left: 8px;
  margin-left: -10px;
}
.notification-item__system-avatar {
  background: var(--ink-800, #2A2118);
  font-size: 16px;
}
.notification-item__thumb {
  width: 40px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-item__like {
  background: none;
  border: none;
  color: var(--ink-text-faint);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
}
.comment-item__like.is-active {
  color: var(--magenta);
}

.comment-input-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.edit-profile-bio {
  resize: none;
  font-family: var(--font-body);
  margin-top: 10px;
}

/* ============================================
   编辑资料弹层:头像 / 背景图上传预览(本轮新增)
   ============================================ */
.edit-profile-bg-preview {
  position: relative;
  height: 100px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: linear-gradient(120deg, rgba(242,169,59,0.18), rgba(226,63,160,0.18));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.edit-profile-bg-preview__hint {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-text);
  background: rgba(10,21,18,0.45);
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.edit-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.edit-profile-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  background-size: cover;
  background-position: center;
  border: 2px solid var(--ink-800);
  cursor: pointer;
}
.edit-profile-avatar-hint {
  font-size: 12.5px;
  color: var(--ink-text-faint);
}

/* ============================================
   作品播放弹层(本轮改造:单条播放 → 上下滑动连续播放列表,
   结构和交互方式直接参照首页 .feed-list / .feed-card 的滚动吸附实现)
   ============================================ */
.work-viewer__panel {
  position: absolute;
  inset: 0;
  background: #000;
}
.work-viewer-list {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}
.work-viewer-item {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.work-viewer-item__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.work-viewer-item__delete {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(226,63,160,0.5);
  background: rgba(10,21,18,0.75);
  backdrop-filter: blur(6px);
  color: var(--magenta);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.work-viewer__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   账号绑定弹层(本轮新增:多身份绑定架构)
   ============================================ */
.bind-accounts-sheet__panel {
  max-height: 80vh;
  max-height: 80dvh;
  max-height: calc(var(--app-vh, 80dvh) * 0.80);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.bind-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.bind-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bind-row:last-child {
  border-bottom: none;
}
.bind-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bind-row__label {
  font-size: 14px;
  font-weight: 600;
}
.bind-row__status {
  font-size: 12.5px;
  color: var(--ink-text-faint);
  padding: 6px 10px;
}
.bind-row__status.is-bound {
  color: var(--gold);
  background: rgba(242,169,59,0.12);
  border-radius: 999px;
}
.bind-row__btn {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-text);
  cursor: pointer;
  flex-shrink: 0;
}
.bind-row__btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.bind-row__hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-text-faint);
}
.bind-row__inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.bind-row__inline.hidden {
  display: none;
}
.bind-row__input {
  flex: 1;
  min-width: 140px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ink-800, rgba(255,255,255,0.06));
  color: var(--ink-text);
  font-size: 13.5px;
}
.bind-row__code {
  width: 100px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ink-800, rgba(255,255,255,0.06));
  color: var(--ink-text);
  font-size: 13.5px;
}
.bind-row__send,
.bind-row__confirm {
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: #17130A;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.bind-row__send:disabled,
.bind-row__confirm:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ============================================
   表情选择面板(本轮新增,EmojiPicker 模块用)
   ============================================ */
.emoji-picker {
  position: fixed;
  width: 288px;
  max-height: 208px;
  overflow-y: auto;
  background: var(--ink-850, #1c1a14);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 999;
}
.emoji-picker__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.emoji-picker__item {
  background: none;
  border: none;
  font-size: 21px;
  line-height: 1;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
}
.emoji-picker__item:active { background: rgba(255,255,255,0.08); }

/* ============================================
   直播广场 / 直播间(本轮新增,直播功能 Phase 0/1)
   ============================================ */
.screen--live-square {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ink-950);
}
.live-start-btn {
  color: var(--gold);
  font-weight: 700;
}
.live-square-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}
.live-square-card {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--ink-800);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  padding-bottom: 56px; /* 给底部主播信息条留空间 */
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-square-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--magenta);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.live-square-card__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.live-square-card__viewers {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.5);
  color: var(--ink-text);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
}
.live-square-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #17130A;
  font-size: 19px;
  overflow: hidden;
}
.live-square-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.live-square-card__footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-square-empty {
  text-align: center;
  color: var(--ink-text-dim);
  font-size: 13.5px;
  padding: 40px 24px;
}

.screen--live-room {
  height: 100%;
  background: #000;
}
.live-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.live-stage-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.live-room-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
}
.live-room-host {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.live-room-host__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #17130A;
  font-size: 14px;
  overflow: hidden;
}
.live-room-host__avatar img { width: 100%; height: 100%; object-fit: cover; }
.live-room-host__meta { min-width: 0; }
.live-room-host__name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-room-viewer-count {
  font-size: 11px;
  color: var(--ink-text-dim);
}
.live-room-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.live-host-controls {
  position: absolute;
  right: 12px;
  bottom: 92px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.live-control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-control-btn.is-off { background: var(--magenta); }
/* 本轮改用自绘 SVG 图标(见 index.html/app.js)替换系统 emoji,这里统一控制图标尺寸 */
.live-control-btn svg,
.live-action-icon-btn svg,
.live-heart-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.live-control-btn--danger {
  width: auto;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--magenta);
}

.live-chat-log {
  position: absolute;
  left: 12px;
  right: 84px;
  bottom: 78px;
  max-height: 34%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%);
}
.live-chat-log__item {
  font-size: 12.5px;
  line-height: 1.35;
  background: rgba(0,0,0,0.35);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
  max-width: 100%;
  word-break: break-word;
}
.live-chat-log__item strong { color: var(--gold); font-weight: 700; margin-right: 4px; }
.live-chat-log__item--system {
  color: var(--ink-text-dim);
  background: none;
  font-style: italic;
}

.live-hearts-layer {
  position: absolute;
  right: 8px;
  bottom: 70px;
  width: 60px;
  height: 60%;
  pointer-events: none;
  overflow: visible;
}
.live-heart-particle {
  position: absolute;
  right: 6px;
  bottom: 0;
  width: 22px;
  height: 22px;
  color: var(--magenta); /* 本轮改用自绘 SVG 心形(见 app.js HEART_ICON_SVG),用 color 控制填色而不是依赖各手机 emoji 字体 */
  animation: live-heart-float 2.6s ease-out forwards;
}
.live-heart-particle svg { width: 100%; height: 100%; display: block; }
@keyframes live-heart-float {
  0% { transform: translateY(0) translateX(0) scale(0.6); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-220px) translateX(var(--heart-drift, 10px)) scale(1.1); opacity: 0; }
}

.live-room-bottombar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
}
.live-chat-input {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}
.live-chat-input::placeholder { color: rgba(255,255,255,0.55); }
.live-heart-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: var(--magenta);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-heart-btn:active { transform: scale(1.15); }

/* ============================================
   本轮新增:直播间打赏/送礼物图标按钮、礼物特效层、礼物聊天横幅
   ============================================ */
.live-action-icon-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-action-icon-btn:active { transform: scale(1.1); }

.live-gift-fx-layer {
  position: absolute;
  left: 0;
  right: 84px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  overflow: hidden;
}
.live-gift-fx-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226,63,160,0.85), rgba(226,63,160,0.15));
  animation: live-gift-fx-slide 3.2s ease-out forwards;
  max-width: 86%;
}
.live-gift-fx-banner__icon {
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.live-gift-fx-banner__text {
  font-size: 12.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes live-gift-fx-slide {
  0% { transform: translateX(-110%); opacity: 0; }
  12% { transform: translateX(0); opacity: 1; }
  78% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: 0; }
}

.live-chat-log__item--gift {
  background: rgba(226,63,160,0.28);
  color: #fff;
  font-weight: 600;
}

/* ============================================
   本轮新增:礼物面板(直播间点🎁打开)
   ============================================ */
.gift-panel__panel {
  max-height: 68vh;
  max-height: 68dvh;
  max-height: calc(var(--app-vh, 68dvh) * 0.68);
  display: flex;
  flex-direction: column;
}
.gift-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.gift-panel__header .tip-sheet__title { margin: 0; }
/* 本轮视觉优化:金币余额/充值按钮改成金色渐变实心胶囊(参照抖音"钻石余额+充值"
   角标的视觉分量),不再是和背景差不多的描边空心按钮,一眼就能看到"这是钱"。 */
.gift-panel__balance {
  border: none;
  background: linear-gradient(135deg, #f5d68c, var(--gold));
  color: #201203;
  font-size: 12.5px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(230,184,90,0.35);
}
.gift-panel__grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-bottom: 8px;
}
.gift-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.gift-card:active { border-color: var(--magenta); background: rgba(226,63,160,0.12); transform: scale(0.95); }
.gift-card__icon { font-size: 30px; line-height: 1; }
.gift-card__name { font-size: 11.5px; }
.gift-card__price { font-size: 11px; color: var(--gold); font-weight: 700; }

/* 按礼物档位(tier: small/medium/large,后端 gift_catalog 表自带这个字段)
   加一圈对应色的卡片边框,贵重礼物一眼就能看出来,不需要真的做分类标签
   切换那么大的改动。 */
.gift-card[data-tier="medium"] { border-color: var(--gold); background: rgba(230,184,90,0.08); }
.gift-card[data-tier="large"] {
  border-color: #7fd8ff;
  background: rgba(127,216,255,0.08);
}
.gift-card[data-tier="large"]::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7fd8ff;
  box-shadow: 0 0 6px rgba(127,216,255,0.9);
}

/* ============================================
   本轮新增:金币钱包充值弹层
   ============================================ */
.wallet-sheet__balance {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}
.wallet-sheet__rate {
  font-size: 12px;
  color: var(--ink-text-dim);
  margin: 0 0 16px;
}

/* ============================================
   本轮新增:背景音乐选择弹层(主播端)
   ============================================ */
.music-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.music-picker__header .tip-sheet__title { margin: 0 0 16px; }
.music-picker__rescan-btn {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text-dim);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 16px;
}
.music-picker__rescan-btn:disabled { opacity: 0.6; cursor: default; }
/* 本轮新增:背景音乐音量滑杆 */
.music-picker__volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.music-picker__volume-label {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--ink-text-dim);
}
.music-picker__volume-slider {
  flex: 1;
  accent-color: var(--magenta);
}
.music-picker__off-btn {
  width: 100%;
  padding: 11px 0;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.music-picker__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.music-picker__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  text-align: left;
  cursor: pointer;
}
.music-picker__item.is-active { border-color: var(--gold); background: rgba(230,184,90,0.12); color: var(--gold); }
.music-picker__item-title { font-size: 13.5px; font-weight: 600; }

/* =========================================================================
   登录成功开屏宣传页(本轮新增)—— 参照抖音冷启动开屏的排版:纯黑背景、
   文案居中偏上、品牌 logo 固定在底部,3-4 秒后自动淡出,点一下也能跳过。
   ========================================================================= */
.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #05060a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  text-align: center;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.intro-splash.hidden { display: none; }
.intro-splash.is-fading { opacity: 0; }
.intro-splash__tagline {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  max-width: 420px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
  animation: intro-splash-rise 0.6s ease both;
}
.intro-splash__brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(48px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}
.intro-splash__logo {
  width: 168px;
  height: auto;
  max-width: 55vw;
  object-fit: contain;
}
.intro-splash__logo-fallback {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.intro-splash__logo-fallback.hidden { display: none; }
@keyframes intro-splash-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.music-picker__item-artist { font-size: 11.5px; color: var(--ink-text-dim); }
