:root {
  --bg: #070a12;
  --bg-soft: #0b101c;
  --panel: #101627;
  --panel-2: #151d33;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #eef2ff;
  --muted: #a6b0ca;
  --muted-2: #8b96b4;
  --mint: #7cf7d4;
  --violet: #7c5cff;
  --gold: #ffd166;
  --pink: #f72585;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --app-w: 480px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
[role="button"]:focus,
[data-action]:focus {
  outline: none;
}

html {
  overscroll-behavior: none;
  /* 关闭双击放大（WebView 不认 user-scalable=no），保留单指滚动与双指缩放 */
  touch-action: manipulation;
  /* 关掉 Android WebView 的字体放大（font boosting），避免文字被非整数倍缩放后发虚 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 460px at 12% -8%, rgba(124, 92, 255, .22), transparent 60%),
    radial-gradient(760px 420px at 92% 2%, rgba(124, 247, 212, .12), transparent 62%),
    radial-gradient(700px 500px at 50% 110%, rgba(247, 37, 133, .10), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

img { max-width: 100%; }

/* 图片加载中占位骨架：由 app.js 打标，加载完成或失败后自动移除（具体样式见文件末尾） */

@keyframes imgShimmer {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}

@media (prefers-reduced-motion: reduce) {
  img[data-img-loading="1"] { animation: none; }
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  padding: 0 16px;
  overflow-x: clip;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: linear-gradient(to bottom, rgba(7, 10, 18, .97), rgba(7, 10, 18, .82));
  border-bottom: 1px solid var(--line);
}

/* App（WebView）内顶部栏与页面底色区分开，用虚线做分隔 */
.webview-app .topbar {
  background: var(--bg-soft);
  border-bottom: 1px dashed rgba(255, 255, 255, .16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar-inner {
  max-width: var(--app-w);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 19px;
  color: #08111a;
  background: linear-gradient(135deg, var(--mint), #45c8ff);
  box-shadow: 0 6px 22px rgba(124, 247, 212, .28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text b { font-size: 18px; letter-spacing: .01em; }

.brand-text small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.top-nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-inline-start: 12px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
  transition: .18s ease;
}

.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

.nav-link.active {
  color: var(--mint);
  background: rgba(124, 247, 212, .10);
}

.top-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 209, 102, .28);
  background: rgba(255, 209, 102, .09);
  color: var(--gold);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}

.coin-pill:hover { background: rgba(255, 209, 102, .16); }

.coin-icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  vertical-align: -.125em;
}

.coin-pill .coin-refresh {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--gold);
  color: #2a1c00;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.lang-btn {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
  min-width: 44px;
}

.lang-btn:hover { border-color: var(--mint); color: var(--mint); }

.avatar-btn {
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(124, 92, 255, .35), rgba(124, 247, 212, .15));
  cursor: pointer;
  transition: .18s ease;
}

.avatar-btn:hover { transform: translateY(-1px); border-color: rgba(124, 247, 212, .4); }
.avatar-btn.has-avatar-img { border-radius: 50%; background: none; border-color: transparent; }

.signin-btn {
  border: 1px solid rgba(124, 247, 212, .45);
  color: var(--mint);
  background: rgba(124, 247, 212, .10);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  padding: 18px 0 0;
}

.page { min-height: 1px; }

.page-enter { animation: pageIn .18s cubic-bezier(.22, .8, .24, 1) both; }

@keyframes pageIn {
  from { opacity: 0; transform: translateX(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes pageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.keyboard-open .tabbar,
.keyboard-open .float-cta { display: none; }
.keyboard-open .footer { padding-bottom: 18px; }
.keyboard-open .page-enter,
.keyboard-open .cover-img,
.keyboard-open .float-cta,
.keyboard-open .skeleton { animation: none; }

@media (hover: none) {
  .btn:active,
  .back-btn:active,
  .sheet-close:active,
  .icon-btn:active,
  /* 按下即刻给视觉反馈，不必等页面重建完成，点按手感更接近原生 */
  .tab:active,
  .rail-item:active,
  .chip:active,
  .cat-btn:active,
  .small-card:active,
  .lobby-card:active,
  .game-card:active,
  .promo-card:active,
  .play-back:active,
  .coin-pill:active,
  .avatar-btn:active,
  .lang-btn:active,
  .chat-voice-bubble:active { opacity: .72; }

  /* 底部 Tab 按下立即染色，避免切换页面期间没有任何反馈 */
  .tab:active { color: var(--mint); }
}

@media (prefers-reduced-motion: reduce) {
  .page-enter { animation: pageFade .12s ease-out both; }
}

.play-enter { animation: playIn .26s ease both; }

@keyframes playIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.section { margin-top: 30px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .01em;
}

.section-head a,
.section-head button {
  color: var(--mint);
  font-size: 12.5px;
  font-weight: 700;
  background: none;
  border: 0;
  cursor: pointer;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(255, 209, 102, .08);
  border: 1px solid rgba(255, 209, 102, .24);
  border-radius: 999px;
  padding: 6px 12px;
}

/* ---------- Lobby banner ---------- */
.banner-wrap { margin-top: 6px; }

.banner-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 20px;
  direction: ltr;
}

.banner-track::-webkit-scrollbar { display: none; }

.banner-slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .16);
  overflow: hidden;
  display: block;
  background:
    linear-gradient(155deg, rgba(124, 92, 255, .18), rgba(124, 247, 212, .06)),
    var(--panel);
}

.banner-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 2.8 / 1;
  object-fit: cover;
  /* 图片尚未绘制时显示占位底色，避免出现空白框 */
  background: #131b2d;
}

.banner-dots { display: flex; gap: 5px; justify-content: center; margin-top: 8px; }

.banner-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
  cursor: pointer;
  transition: .2s ease;
}

.banner-dots button.active { width: 18px; background: var(--mint); }

/* ---------- Notice bar ---------- */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  font-size: 11.5px;
}

.notice-ico { flex-shrink: 0; font-size: 13px; }

.notice-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

.notice-more {
  flex-shrink: 0;
  border: 0;
  background: none;
  color: var(--mint);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

/* ---------- Lobby categories + grid ---------- */
.cat-row {
  display: flex;
  gap: 8px;
  margin: 16px -2px 0;
  padding: 2px 2px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.cat-row::-webkit-scrollbar { display: none; }

.cat-btn {
  position: relative;
  flex: 0 0 80px;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 13px 4px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(165deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .02));
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 5px 14px rgba(0, 0, 0, .16);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.cat-btn .ico {
  font-size: 27px;
  line-height: 1;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, .25));
  transition: transform .18s ease;
}

.cat-btn .ico img.cat-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.cat-btn b { font-weight: 700; white-space: nowrap; }

@media (hover: hover) {
  .cat-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
  }

  .cat-btn:hover .ico { transform: scale(1.06); }
}

.cat-btn.active {
  border-color: rgba(124, 247, 212, .52);
  background: linear-gradient(165deg, rgba(124, 247, 212, .2), rgba(124, 247, 212, .045));
  color: var(--mint);
  box-shadow: 0 10px 24px rgba(124, 247, 212, .14), inset 0 0 0 1px rgba(124, 247, 212, .08);
}

.cat-btn.active .ico { transform: scale(1.08); }

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  align-content: start;
  align-items: start;
}

.lobby-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease;
}

.lobby-card:hover { transform: translateY(-2px); border-color: rgba(124, 247, 212, .3); }

.lobby-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 72% 14%, rgba(255, 255, 255, .32), transparent 55%),
    linear-gradient(150deg, var(--c1), var(--c2));
  overflow: hidden;
}

.lobby-cover.has-image,
.game-cover.has-image {
  background: transparent;
}

.game-cover.has-image::after {
  display: none;
}

.lobby-emoji {
  font-size: clamp(30px, 9vw, 40px);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .35));
}

.lobby-cost {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  padding: 2px 6px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 800;
  color: #2a1c00;
  background: rgba(255, 209, 102, .92);
}

.lobby-name {
  padding: 7px 6px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-all { margin-top: 12px; }

/* ---------- Home bottom invite ---------- */
.home-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(124, 92, 255, .32);
  background:
    radial-gradient(240px 140px at 90% 0%, rgba(124, 92, 255, .35), transparent 70%),
    linear-gradient(145deg, #1d1840, #121026);
}

.home-cta-emoji { font-size: 30px; line-height: 1; }
.home-cta-body { flex: 1; min-width: 0; }
.home-cta-body b { display: block; font-size: 14px; }
.home-cta-body p { margin: 3px 0 0; font-size: 11px; line-height: 1.5; color: rgba(255, 255, 255, .65); }
.home-cta .btn { width: auto; flex-shrink: 0; padding: 9px 14px; font-size: 12px; }

.home-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 12px;
  padding: 0 2px;
  font-size: 10px;
  color: var(--muted-2);
}

/* ---------- Home floating CTA ---------- */
.float-cta {
  position: fixed;
  right: 16px;
  right: max(16px, calc(50% - 240px + 16px));
  left: auto;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 45;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 4px rgba(7, 10, 18, .55);
  animation: floatCta 3s ease-in-out infinite;
}

.float-cta img { display: block; width: 100%; height: 100%; object-fit: cover; }

@keyframes floatCta {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ---------- Mine ---------- */
.mine-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 12px;
}

.mine-head--balance { padding-bottom: 0; }
.mine-head--balance + .balance-card { margin-top: 4px; }

.mine-ava {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, #1a2233, #10141f);
  font-size: 34px;
  cursor: pointer;
}

.mine-ava.has-avatar-img { border-radius: 50%; background: none; border-color: transparent; }

.mine-ava-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--mint);
  color: #04121a;
  font-size: 11px;
}

.mine-id { flex: 1; min-width: 0; }

.mine-id .nickname-row { margin-bottom: 6px; }

.mine-id h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: -.01em;
}

.uid-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.uid-copy { color: var(--mint); }

.balance-card {
  padding: 20px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 209, 102, .3);
  background:
    radial-gradient(280px 160px at 90% 0%, rgba(255, 209, 102, .32), transparent 70%),
    linear-gradient(145deg, #3a2a10, #1b1610);
}

.balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.balance-refresh {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .75);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.balance-value {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #ffd166;
  font-size: 34px;
  font-weight: 900;
}

.balance-value b { font-size: 34px; }

.balance-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.balance-breakdown > div {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .16);
}

.balance-breakdown span {
  display: block;
  color: rgba(255, 255, 255, .65);
  font-size: 10.5px;
  font-weight: 700;
}

.balance-breakdown b {
  display: block;
  margin-top: 4px;
  color: var(--mint);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.balance-breakdown > div:last-child b { color: var(--gold); }

.balance-amount-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-amount-row b {
  flex: 1;
  min-width: 0;
}

.balance-rule-help {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .75);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.balance-rule-help:hover {
  border-color: var(--mint);
  color: var(--mint);
}

.vip-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 220, 132, .7);
  background: linear-gradient(135deg, #fff0aa, #e9ad38);
  color: #3b2600;
  box-shadow: 0 3px 12px rgba(233, 173, 56, .18);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
}

.mine-vip-button {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 209, 102, .3);
  background: linear-gradient(120deg, rgba(255, 209, 102, .14), rgba(255, 255, 255, .035));
  color: var(--text);
}

.mine-vip-mark,
.vip-hero-mark,
.vip-level-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 132, .55);
  background: linear-gradient(145deg, #ffe994, #c98b25);
  color: #3b2600;
  font-weight: 900;
  font-family: Georgia, serif;
}

.mine-vip-mark { width: 36px; height: 36px; }
.vip-badge.vip-logo-bare,
.mine-vip-mark.vip-logo-bare,
.vip-hero-mark.vip-logo-bare,
.vip-level-mark.vip-logo-bare {
  background: none;
  border-color: transparent;
  box-shadow: none;
}
.vip-logo { display: block; object-fit: contain; }

/* 「我的」页与 VIP 页的等级图标都是透明底 PNG，去掉外层金色底和描边，只留图标本身 */
.vip-badge,
.vip-hero-mark,
.mine-vip-mark {
  background: none;
  border-color: transparent;
  box-shadow: none;
}
.vip-badge .vip-logo { width: 40px; height: 18px; }
.mine-vip-mark .vip-logo { width: 30px; height: 30px; }
.vip-hero-mark .vip-logo { width: 46px; height: 46px; }
.vip-level-mark .vip-logo { width: 26px; height: 26px; }
.mine-vip-copy { flex: 1; min-width: 0; }
.mine-vip-copy b { display: block; color: var(--gold); font-size: 15px; letter-spacing: .08em; }
.mine-vip-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.mine-vip-button > strong { color: var(--gold); font-size: 12px; white-space: nowrap; }

.vip-page { max-width: 680px; margin: 0 auto; }
.vip-page .page-head { justify-content: space-between; }

.vip-hero {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 209, 102, .35);
  background:
    radial-gradient(260px 150px at 90% 0%, rgba(255, 224, 143, .24), transparent 75%),
    linear-gradient(145deg, #39280d, #17130d);
}

.vip-hero-top { display: flex; align-items: center; gap: 16px; }
.vip-hero-mark { width: 54px; height: 54px; font-size: 25px; }
.vip-hero-top > div > span { color: rgba(255, 255, 255, .6); font-size: 11px; }
.vip-hero-top h2 { margin: 3px 0 0; color: #ffe49a; font-size: 30px; letter-spacing: .04em; }
.vip-total { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; color: rgba(255, 255, 255, .65); font-size: 12px; }
.vip-total b { color: #ffe49a; font-size: 16px; }
.vip-progress-label { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; color: #ffe49a; font-size: 11px; font-weight: 800; }
.vip-progress { height: 9px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.vip-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c98b25, #ffe994); }
.vip-progress-note { margin: 10px 0 0; color: rgba(255, 255, 255, .62); font-size: 11px; line-height: 1.6; }

.vip-level-section { margin-top: 26px; }
.vip-level-section > h2 { margin: 0 0 12px; font-size: 17px; }
.vip-level-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
}

.vip-level-row.current { border-color: rgba(255, 209, 102, .45); background: rgba(255, 209, 102, .08); }
.vip-level-row.open { border-color: var(--gold); }
.vip-level-row:not(.current):not(.unlocked) { opacity: .55; }
.vip-level-mark {
  width: 32px;
  height: 32px;
  font-size: 13px;
  filter: grayscale(.7);
  /* 等级图标是自带透明底的 PNG，去掉外层金色圆底，避免出现双层圆 */
  background: none;
  border-color: transparent;
}
.vip-level-row.unlocked .vip-level-mark,
.vip-level-row.current .vip-level-mark { filter: none; }
.vip-level-row > .vip-level-copy { flex: 1; min-width: 0; }
.vip-level-copy b { display: block; font-size: 13px; }
.vip-level-copy span { display: block; margin-top: 6px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

.vip-weekly-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 209, 102, .3);
  background: linear-gradient(135deg, rgba(255, 209, 102, .1), rgba(255, 255, 255, .025));
}

.vip-weekly-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.vip-weekly-head > div > span { color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.vip-weekly-head h2 { margin: 4px 0 0; font-size: 18px; }
.vip-weekly-head > strong { display: flex; align-items: baseline; gap: 5px; color: var(--gold); font-size: 25px; white-space: nowrap; }
.vip-weekly-head > strong small { color: var(--muted); font-size: 10px; font-weight: 600; }
.vip-weekly-card > p { margin: 12px 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.vip-week-range { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 10.5px; }
.vip-week-range b { color: var(--text); font-weight: 700; text-align: end; }
.vip-section-desc { margin: -4px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.vip-level-row > .vip-level-side { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 10px; max-width: 46%; }
.vip-level-status { color: var(--muted); font-size: 10px; text-align: end; }
.vip-level-row.current .vip-level-status { color: var(--gold); }
.vip-claim-btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 209, 102, .5);
  border-radius: 9px;
  background: linear-gradient(135deg, #ffe58a, #f5b917);
  color: #2b1b00;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.vip-claim-btn:disabled { cursor: default; }
.vip-claim-btn.claimed { border-color: var(--line); background: rgba(255, 255, 255, .05); color: var(--muted); }
.vip-benefit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
}
.vip-level-row.open .vip-benefit-toggle { color: var(--gold); }
.vip-benefit-chev { color: var(--muted-2); font-style: normal; }
.vip-benefit-detail {
  flex: 0 0 100%;
  min-width: 0;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.vip-benefit-detail h3 { margin: 0 0 9px; color: var(--muted); font-size: 12px; }
.vip-benefit-detail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vip-benefit-detail li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(0, 0, 0, .22);
  color: var(--muted);
  font-size: 12px;
}
.vip-benefit-detail li b { color: var(--gold); white-space: nowrap; }
.vip-benefit-detail li.claimed { background: rgba(255, 255, 255, .025); color: var(--muted-2); }
.vip-benefit-detail li.claimed b { color: var(--muted-2); }
.vip-rules {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, .035);
  text-align: left;
}
.vip-rules ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.75; }
[dir="rtl"] .vip-benefit-detail,
[dir="rtl"] .vip-rules { text-align: right; }
[dir="rtl"] .vip-rules ul { padding-left: 0; padding-right: 18px; }

.mine-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.mine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: start;
}

.mine-item.static { cursor: default; }

.mine-item b { flex: 1; font-weight: 700; }
.mine-item-ico { font-size: 19px; }
.mine-item-tail { color: var(--muted); font-size: 11px; }

.mine-quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mine-quick-row .mine-item { min-width: 0; padding-inline: 14px; }
.mine-quick-row .mine-item b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-quick-row .mine-item-ico { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; }
.mine-quick-row .coin-icon { width: 24px; height: 24px; }
.card-icon { display: block; width: 23px; height: 23px; }
[dir="rtl"] .mine-quick-row .mine-item-tail { display: inline-block; transform: scaleX(-1); }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-option {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  font-size: 28px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.avatar-option.active {
  border-color: rgba(124, 247, 212, .5);
  background: rgba(124, 247, 212, .1);
}

.avatar-option:disabled,
.sheet-close:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-option-image { padding: 0; }
.avatar-option-image .avatar-img { border-radius: 50%; }

.custom-avatar-upload { margin-bottom: 14px; }
.custom-avatar-upload button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px;
  border: 1px dashed rgba(124, 247, 212, .4);
  border-radius: 14px;
  background: rgba(124, 247, 212, .055);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.custom-avatar-upload button:hover { background: rgba(124, 247, 212, .1); }
.custom-avatar-upload button:disabled { opacity: .55; cursor: wait; }
.custom-avatar-upload b { color: var(--mint); font-size: 13px; }
.custom-avatar-upload span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.vip-benefit-detail li.vip-benefit-feature b { color: var(--mint); }

.google-btn-slot {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

.modal-hint {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.nickname-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nickname-row h1 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nickname-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 247, 212, .5);
  background: rgba(124, 247, 212, .12);
  color: var(--mint);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: color .16s ease, border-color .16s ease;
}

.nickname-edit:hover { color: var(--text); border-color: var(--line-strong); }

.coin-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 54vh;
  overflow-y: auto;
}

.coin-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-group { display: flex; flex-direction: column; gap: 6px; }

.filter-group-label {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.coin-filters .chips { flex-wrap: wrap; overflow-x: visible; row-gap: 12px; }

.tx-list { display: flex; flex-direction: column; gap: 12px; }
.tx-load-more { display: block; width: 100%; min-height: 42px; padding: 14px 0 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-align: center; }

.tx-row {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.tx-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tx-type { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.tx-ico { font-size: 16px; }

.tx-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.tx-details {
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}

.tx-balance { flex-shrink: 0; font-size: 10px; color: var(--muted-2); }
.tx-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 10px; line-height: 1.5; color: var(--muted-2); }
.tx-remark { color: var(--muted); }

.coin-log {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.coin-log-ico { font-size: 20px; }
.coin-log-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.coin-log-info b { font-size: 12.5px; }
.coin-log-info small { font-size: 10px; color: var(--muted-2); }
.coin-log-amount { font-size: 13px; font-weight: 800; }
.coin-log-amount.plus { color: var(--mint); }
.coin-log-amount.minus { color: #ff8a9b; }
.log-loading { padding: 30px; text-align: center; color: var(--muted); font-size: 12px; }

.order-history-list { display: flex; flex-direction: column; gap: 12px; }

.order-history-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
}

.order-history-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-filters { margin-bottom: 14px; }
.orders-search { margin-bottom: 10px; }
.order-category-chips { padding-bottom: 3px; }

.order-history-game { min-width: 0; display: flex; align-items: center; gap: 10px; }
.order-history-game-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; line-height: 1.45; }
.order-history-game b { overflow-wrap: anywhere; font-size: 13px; }
.order-history-game small, .order-history-top time { font-size: 10px; color: var(--muted-2); }
.order-history-top time { flex-shrink: 0; white-space: nowrap; }

.order-game-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: 18px;
}

.order-game-icon img { width: 100%; height: 100%; object-fit: cover; }

.order-history-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.order-history-amounts > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-history-amounts span { font-size: 11px; color: var(--muted); }
.order-history-amounts b { font-size: 13px; }
.order-history-amounts .order-win.positive { color: var(--mint); }

/* ---------- Home rows ---------- */
.home-row { margin-top: 22px; }
.home-row .section-head { margin-bottom: 10px; }
.home-row .section-head h2 { font-size: 15px; }

/* ---------- Provider filter ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.filter-label { flex: 1; min-width: 0; font-size: 11px; font-weight: 700; color: var(--muted); }

.filter-select {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  max-width: 70%;
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.filter-select:active { border-color: rgba(124, 247, 212, .42); }
.filter-select .chev { font-size: 10px; color: var(--muted); }
.filter-select-ico {
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 16px;
  line-height: 1;
}
.filter-select b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-filter-logo { display: block; width: 22px; height: 22px; object-fit: contain; }

/* ---------- Games page provider rail ---------- */
.games-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
}

[dir="rtl"] .games-layout { flex-direction: row; }

.provider-rail {
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: sticky;
  top: 76px;
  align-self: flex-start;
  max-height: calc(100vh - 96px);
  padding-bottom: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}

.provider-rail::-webkit-scrollbar { display: none; }

.rail-head {
  text-align: center;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.rail-item.active {
  color: var(--mint);
  border-color: rgba(124, 247, 212, .45);
  background: rgba(124, 247, 212, .09);
}

.rail-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
}
.vendor-rail-logo { display: block; width: 26px; height: 26px; object-fit: contain; }
.rail-label { font-size: 10px; }

.games-layout .lobby-grid {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vendor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
}

.vendor-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.vendor-option.active {
  border-color: rgba(124, 247, 212, .45);
  background: rgba(124, 247, 212, .09);
  color: var(--mint);
}

.vendor-option-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vendor-option-ico {
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
}
.vendor-option-logo { display: block; width: 30px; height: 30px; object-fit: contain; }

.vendor-option .tick { opacity: 0; }
.vendor-option.active .tick { opacity: 1; }

/* ---------- Promotions ---------- */
.page-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

.promo-list { display: flex; flex-direction: column; }
/* 兼容 Chrome 83 WebView：不支持 flex gap，用 margin 拉开上下间距 */
.promo-list > * + * { margin-top: 14px; }
.webview-app .promo-list > * + * { margin-top: 18px; }

.promo-banner {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .32);
  transition: transform .16s ease, box-shadow .16s ease;
  /* 图片加载前的占位底色，避免先空白再突然出现 */
  background: linear-gradient(135deg, rgba(124, 92, 255, .22), rgba(124, 247, 212, .10));
}

.promo-banner img { display: block; width: 100%; aspect-ratio: 2.8 / 1; object-fit: cover; background: #131b2d; }

.promo-banner:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }

.promo-detail-hero {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .36);
  background: linear-gradient(135deg, rgba(124, 92, 255, .22), rgba(124, 247, 212, .10));
}

.promo-detail-hero img { display: block; width: 100%; aspect-ratio: 2.8 / 1; object-fit: cover; background: #131b2d; }

.promo-detail-body { padding-top: 20px; }
.promo-detail-body h1 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.01em; }

.promo-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 20px;
  padding: 0;
  list-style: none;
}

.promo-points li {
  position: relative;
  padding-inline-start: 26px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.promo-points li::before {
  content: '✓';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  color: var(--mint);
  font-weight: 800;
}

.promo-note { margin-top: 14px; font-size: 11px; color: var(--muted-2); text-align: center; }

/* ---------- Invite ---------- */
.invite-card {
  padding: 22px 18px;
  border-radius: 22px;
  text-align: center;
  border: 1px solid rgba(124, 92, 255, .35);
  background:
    radial-gradient(300px 180px at 85% 0%, rgba(124, 92, 255, .32), transparent 70%),
    linear-gradient(145deg, #211a44, #121026);
}

.invite-code {
  margin: 8px 0 16px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .16em;
  color: var(--mint);
}

.invite-actions { display: flex; gap: 10px; }
.invite-actions .btn { flex: 1; width: auto; }

.invite-steps { display: flex; flex-direction: column; gap: 12px; }

.invite-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
}

.invite-step b {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(124, 247, 212, .14);
  color: var(--mint);
  font-size: 12px;
}

.invite-step p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

.invite-empty {
  padding: 36px 20px;
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.invite-empty-ico { margin-bottom: 10px; font-size: 40px; }
.invite-empty h2 { margin: 0 0 6px; font-size: 18px; }
.invite-empty p { margin: 0 0 16px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.invite-empty .btn { width: auto; }

.invite-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  border: 1px dashed var(--line-strong);
}

.invite-link span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--muted-2);
  direction: ltr;
  text-align: left;
}

.invite-link button {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.team-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(124, 92, 255, .16), rgba(0, 210, 255, .06));
}

.team-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}

.team-total-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

.team-count { display: flex; flex-direction: column; align-items: center; }

.team-count b {
  font-size: 34px;
  line-height: 1.1;
  color: var(--mint);
}

.team-summary { display: flex; flex-direction: column; gap: 8px; text-align: start; }
.team-summary div { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.team-summary b { font-size: 12.5px; color: var(--gold); }
.team-summary b.up { color: #ff5c6c; }

.team-unit { font-size: 11px; color: var(--muted); }

.team-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.team-level {
  position: relative;
  min-width: 0;
  padding: 12px 6px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}

.team-level-new {
  position: absolute;
  top: 5px;
  inset-inline-end: 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: #ff5c6c;
}

.team-level b { display: block; font-size: 18px; }
.team-level span { font-size: 10.5px; color: var(--muted); }

.team-rate { margin: 14px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--muted-2); text-align: center; }

/* ---------- Agent stats ---------- */
.page-head-action { margin-inline-start: auto; }
.stats-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stats-range-text { margin-inline-start: auto; font-size: 10.5px; color: var(--muted-2); }
.stats-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stats-card { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.stats-card span { display: block; font-size: 10.5px; color: var(--muted); }
.stats-card b { display: block; margin-top: 5px; font-size: 17px; color: var(--mint); }
.stats-level { padding: 14px; margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.stats-level-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.stats-level-head b { font-size: 13px; color: var(--gold); }
.stats-level-head span { font-size: 10.5px; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats-cell { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .035); }
.stats-cell span { font-size: 9.5px; color: var(--muted-2); }
.stats-cell b { font-size: 13px; color: var(--text); }
.stats-commission-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
.stats-commission-row i { font-style: normal; font-size: 9.5px; color: var(--muted-2); }
.stats-commission-row b { color: var(--gold); }
.stats-empty { padding: 14px 0; text-align: center; font-size: 11px; color: var(--muted-2); }

/* ---------- Agent activity ---------- */
.activity-rule { margin: 0 0 12px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.activity-datebar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.activity-date-nav {
  flex: 0 0 26px; height: 26px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  color: var(--muted); font-size: 15px; line-height: 1;
}
.activity-date-nav:active { color: var(--mint); border-color: rgba(124, 247, 212, .4); }
.activity-dates {
  flex: 1; min-width: 0; display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}
.activity-date-gap { flex: 0 0 50%; pointer-events: none; }
.activity-dates::-webkit-scrollbar { display: none; }
.activity-dates button {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.activity-dates button.on {
  border-color: rgba(124, 247, 212, .4);
  background: rgba(124, 247, 212, .12);
  color: var(--mint);
}
.activity-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.activity-stats div {
  padding: 9px 6px; border-radius: 12px; text-align: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
}
.activity-stats span { display: block; font-size: 10px; color: var(--muted); }
.activity-stats b { font-size: 14px; }
.game-activity-stats { margin: 12px 0; }
.game-activity-claim span { display: block; margin-top: 3px; color: var(--muted); }
.activity-ratio { margin: 9px 0 13px; font-size: 11px; color: var(--muted); text-align: center; }
.activity-ratio.ok { color: var(--mint); }
.activity-tiers { display: grid; gap: 10px; }
.activity-tier {
  padding: 12px 13px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
}
.activity-tier.claimable {
  border-color: rgba(255, 209, 102, .45);
  background: rgba(255, 209, 102, .07);
}
.activity-tier.claimed { opacity: .62; }
.activity-more {
  width: 100%; padding: 10px; border-radius: 12px; cursor: pointer;
  border: 1px dashed var(--line); background: transparent;
  color: var(--muted); font-size: 11.5px;
}
.activity-more:active { color: var(--mint); border-color: rgba(124, 247, 212, .4); }
.activity-empty {
  padding: 18px; border-radius: 12px; text-align: center;
  border: 1px dashed var(--line); color: var(--muted); font-size: 11.5px;
}
.activity-tier-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.activity-tier-head b { display: block; font-size: 12px; line-height: 1.35; }
.activity-tier-head span { font-size: 11px; color: var(--gold); }
.activity-tier-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.activity-help {
  width: 22px; height: 22px; padding: 0; flex: 0 0 22px;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 209, 102, .35);
  background: rgba(255, 209, 102, .1);
  color: var(--gold); font-size: 12px; font-weight: 800; line-height: 1;
}
.activity-rule-list {
  margin: 0; padding-inline-start: 18px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px; line-height: 1.5; color: var(--muted);
}
.activity-rule-list li::marker { color: var(--gold); }
.activity-needs {
  margin: 8px 0 0; text-align: end;
  font-size: 10px; line-height: 1.4; color: var(--muted-2);
}
.activity-unmet {
  margin: 0 0 8px; padding: 6px 8px; border-radius: 8px;
  font-size: 10px; line-height: 1.45; color: #ffb38a;
  background: rgba(255, 122, 89, .1);
  border: 1px solid rgba(255, 122, 89, .25);
}
.activity-btn {
  min-width: 62px; padding: 7px 12px; border-radius: 10px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #FFD166, #F5B917);
  color: #2a1d00; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.activity-btn.locked, .activity-btn.done {
  background: rgba(255, 255, 255, .07); color: var(--muted); cursor: default;
}
.activity-progress {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; font-size: 9.5px; color: var(--muted);
}
.activity-progress > span { flex: 0 0 104px; }
.activity-progress > i {
  flex: 1; height: 5px; border-radius: 99px;
  background: rgba(255, 255, 255, .08); overflow: hidden;
}
.activity-progress > i > b {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #7C5CFF, #7CF7D4);
}
.activity-tier.claimable .activity-progress > i > b {
  background: linear-gradient(90deg, #FFD166, #F5B917);
}

/* ---------- Bet rebate ---------- */
.rebate-status {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.rebate-status div {
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
}
.rebate-status span { display: block; font-size: 10px; color: var(--muted); }
.rebate-status b { font-size: 12.5px; }
.rebate-list { display: grid; gap: 10px; }
.rebate-main { display: flex; align-items: center; gap: 10px; }
.rebate-ico, .rebate-ico-img {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(124, 92, 255, .16);
  border: 1px solid rgba(124, 92, 255, .35);
  font-size: 19px;
}
.rebate-ico-img { object-fit: cover; display: block; }
.rebate-info { flex: 1; min-width: 0; }
.rebate-info b {
  display: block; font-size: 12.5px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rebate-info small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.rebate-bonus { flex: 0 0 auto; text-align: end; }
.rebate-bonus span { display: block; font-size: 9.5px; color: var(--muted); }
.rebate-bonus b { font-size: 13px; color: var(--gold); }
.rebate-rule-scroll {
  overflow-x: auto; margin: 4px 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
}
.rebate-rule-table { width: 100%; border-collapse: collapse; min-width: 460px; }
.rebate-rule-table th, .rebate-rule-table td {
  padding: 8px 10px; font-size: 11px; text-align: center;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
.rebate-rule-table th:first-child, .rebate-rule-table td:first-child { text-align: start; }
.rebate-rule-table th {
  color: var(--muted); font-weight: 600;
  background: rgba(255, 255, 255, .03);
}
.rebate-rule-table th.on, .rebate-rule-table td.on {
  color: var(--gold); background: rgba(255, 209, 102, .1);
}
.rebate-rule-table tr:last-child td { border-bottom: 0; }
.rebate-rule-list { margin-top: 14px; }
.team-rate .rate-hl { color: var(--gold); font-weight: 700; }
.team-rate .rate-item { display: inline-block; white-space: nowrap; }
.team-total-head {
  position: relative; width: 100%; display: flex; align-items: center; justify-content: center;
}
.agent-level-badge {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 209, 102, .35);
  background: rgba(255, 209, 102, .12);
  color: var(--gold); font-size: 11px; font-weight: 700;
}
.agent-level-badge:hover { background: rgba(255, 209, 102, .2); }
.agent-level-scroll {
  overflow-x: auto; margin: 4px 0 12px;
  border: 1px solid var(--line); border-radius: 12px;
}
.agent-level-table { width: 100%; border-collapse: collapse; }
.agent-level-table th, .agent-level-table td {
  padding: 4px 6px; font-size: 10.5px; line-height: 1.2;
  text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line);
}
.agent-level-table th:first-child, .agent-level-table td:first-child { text-align: start; }
.agent-level-table th {
  color: var(--muted); font-weight: 600;
  background: rgba(255, 255, 255, .03);
}
.agent-level-table .on { color: var(--gold); background: rgba(255, 209, 102, .1); }
.agent-level-table tr:last-child td { border-bottom: 0; }
.rebate-rules-btn {
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 209, 102, .35);
  background: rgba(255, 209, 102, .1);
  color: var(--gold); font-size: 11.5px; font-weight: 700;
}
.rebate-rules-btn:hover { background: rgba(255, 209, 102, .18); }

/* ---------- Invite landing ---------- */
.join-hero {
  margin-top: 12px;
  padding: 28px 20px;
  border-radius: 24px;
  text-align: center;
  border: 1px solid rgba(124, 92, 255, .35);
  background:
    radial-gradient(320px 200px at 80% 0%, rgba(124, 92, 255, .32), transparent 70%),
    linear-gradient(150deg, #211a44, #121026);
}

.join-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  font-size: 36px;
  background: rgba(124, 247, 212, .1);
  border: 1px solid rgba(124, 247, 212, .3);
}

.join-hero h1 { margin: 8px 0; font-size: 22px; }
.join-hero p { margin: 0 auto 14px; max-width: 320px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

.join-code {
  display: inline-block;
  margin-bottom: 10px;
  padding: 8px 20px;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--mint);
  background: rgba(0, 0, 0, .3);
  border: 1px dashed rgba(124, 247, 212, .4);
}

.join-team { margin-bottom: 18px; font-size: 12px; color: var(--muted); }
.join-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Coin store ---------- */
.coin-store-btn { margin-inline-start: auto; padding: 8px 14px; font-size: 12px; }

.store-hero {
  margin-top: 12px;
  padding: 26px 20px;
  border-radius: 22px;
  text-align: center;
  border: 1px solid rgba(255, 209, 102, .32);
  background:
    radial-gradient(300px 170px at 15% 0%, rgba(255, 209, 102, .2), transparent 70%),
    linear-gradient(145deg, #221c2f, #121026);
}

.store-value { margin: 6px 0; font-size: 32px; font-weight: 900; color: var(--gold); }
.store-hero p { margin: 0; font-size: 12px; color: var(--muted); }

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.store-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: .16s ease;
}

.store-pack:hover { border-color: rgba(255, 209, 102, .45); transform: translateY(-1px); }
.store-pack.popular { border-color: rgba(124, 92, 255, .55); }
.store-pack.best { border-color: rgba(255, 209, 102, .55); }
.store-pack-ico { font-size: 22px; }
.store-pack b { font-size: 20px; }
.store-pack-sub { font-size: 10.5px; color: var(--muted); }

.store-pack-price {
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(255, 209, 102, .1);
}

.store-pack-tag {
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #47c9ff);
}

.topup-order {
  margin-bottom: 4px;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.topup-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
}

.topup-row:last-child { border-bottom: none; }
.topup-row b { color: var(--text); }
.topup-row.total b { font-size: 14px; color: var(--gold); }
.topup-row .mint { color: var(--mint); }

/* ---------- Deposit form ---------- */
.deposit-section { margin-top: 18px; }

.deposit-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.pay-method-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 60px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}

.pay-method.active {
  border-color: rgba(124, 92, 255, .75);
  background: rgba(124, 92, 255, .12);
}

.pay-logo {
  display: grid;
  place-items: center;
  min-width: 60px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2px;
}

.pay-logo.has-img {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
}
.pay-method .pay-logo { margin-inline-end: 10px; flex-shrink: 0; }
.pay-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pay-method.easypaisa .pay-logo { background: #e9fbef; color: #0a8f3c; }
.pay-method.jazzcash .pay-logo { background: #ffecec; color: #c1121f; font-size: 10px; }

.pay-name { min-width: 0; font-size: 12px; font-weight: 700; line-height: 1.45; text-align: start; }

/* ---------- Saved cards ---------- */
.cards-head { margin-bottom: 18px; }
.cards-head h1 { flex: 1; min-width: 0; }
.card-add-btn { flex-shrink: 0; min-height: 44px; margin-inline-start: auto; padding: 10px 14px; font-size: 12px; }
.card-channel-field { margin-bottom: 16px; }
.card-number-field { margin: 16px 0 18px; }
.card-select-hint { margin: 14px 0 18px; }
#card-submit { min-height: 46px; margin-top: 18px; }
.saved-card-list { display: grid; gap: 12px; }
.cards-balance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}
.cards-balance div { display: grid; gap: 6px; min-width: 0; }
.cards-balance span { color: var(--muted); font-size: 12px; font-weight: 700; }
.cards-balance b { font-size: 18px; font-weight: 800; }
.cards-toggle { width: 100%; margin-top: 12px; }
.cards-toggle-chev { margin-inline-start: 6px; font-style: normal; }
.saved-card[data-action] { cursor: pointer; }
.saved-card.active { border-color: var(--accent, #5ee7c4); box-shadow: 0 0 0 1px var(--accent, #5ee7c4) inset; }
.card-order-panel { margin-top: 18px; display: grid; gap: 10px; }
.card-order-panel h2 { margin: 0; font-size: 16px; font-weight: 800; }
.card-order-history { margin-top: 16px; display: grid; gap: 10px; }
.card-order-history h3 { margin: 0; font-size: 14px; font-weight: 800; }
.card-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}
.card-order-info { display: grid; gap: 4px; min-width: 0; }
.card-order-info b { font-size: 14px; }
.card-order-info span { font-size: 13px; color: var(--muted); }
.card-order-info time { font-size: 11px; color: var(--muted); }
.card-order-meta { display: grid; gap: 3px; justify-items: end; }
.card-order-amount { font-size: 12px; color: var(--muted); }
.card-order-fee { font-size: 12px; color: var(--muted); }
.card-order-net { font-size: 14px; font-weight: 800; }
.card-order-status {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, .1);
  color: var(--muted);
}
.card-order-status.pending { background: rgba(255, 196, 0, .16); color: #ffc400; }
.card-order-status.completed { background: rgba(94, 231, 196, .16); color: #5ee7c4; }
.card-order-status.rejected { background: rgba(255, 92, 92, .16); color: #ff5c5c; }
.saved-card {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(124, 92, 255, .12), rgba(255, 255, 255, .025));
  box-shadow: var(--shadow);
}
.saved-card-main { display: flex; align-items: center; min-width: 0; }
/* 老版 WebView 不支持 flex gap，卡片 logo 与文字间距用 margin 保证 */
.saved-card-main .card-logo { margin-inline-end: 14px; }
.saved-card-copy { display: grid; gap: 6px; min-width: 0; }
.saved-card-copy span { color: var(--muted); font-size: 12px; font-weight: 700; }
.saved-card-copy b {
  font-size: clamp(14px, 4vw, 20px);
  line-height: 1.4;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}
.saved-card time {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--muted-2);
  font-size: 11px;
  text-align: end;
}
.saved-card.easypaisa .pay-logo { background: #e9fbef; color: #0a8f3c; }
.saved-card.jazzcash .pay-logo { background: #ffecec; color: #c1121f; font-size: 10px; }
.card-logo { flex-shrink: 0; }
.card-logo img { pointer-events: none; }
.cards-empty .card-icon { width: 42px; height: 42px; margin: 0 auto; }
.guest-emoji .card-icon { width: 48px; height: 48px; margin: 0 auto; }
.card-channel-field { margin-bottom: 16px; }
.card-channel-option { min-width: 0; height: 58px; padding-inline: 8px; gap: 7px; }
.card-channel-option .pay-logo.has-img { min-width: 32px; width: 32px; height: 32px; }
.card-channel-option .pay-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.card-channel-option:disabled { opacity: .65; cursor: not-allowed; }
.card-select-hint { margin: 0 0 14px; }
.card-number-field { margin-top: 14px; }

.pay-channel-row { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.pay-channel {
  position: relative;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}

.pay-channel.active {
  border-color: rgba(124, 247, 212, .6);
  background: rgba(124, 247, 212, .1);
  color: var(--mint);
}

.channel-bonus-badge,
.deposit-quick-bonus,
.deposit-input-bonus {
  position: absolute;
  z-index: 2;
  top: -8px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
}

.channel-bonus-badge {
  background: linear-gradient(135deg, #ffe58a, #ffb703);
  color: #2b1b00;
  box-shadow: 0 0 12px rgba(255, 209, 102, .4);
}

.deposit-quick-bonus,
.deposit-input-bonus {
  background: #7cf7d4;
  color: #06372d;
  box-shadow: 0 0 12px rgba(124, 247, 212, .42);
}

.deposit-quick-bonus { right: 3px; }
.deposit-input-bonus { right: 10px; font-size: 10px; }

.deposit-input-wrap { position: relative; margin-top: 4px; }

.deposit-input-extra {
  position: absolute;
  top: 50%;
  right: 14px;
  max-width: 42%;
  overflow: hidden;
  transform: translateY(-50%);
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.deposit-input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}

.deposit-input:focus { border-color: rgba(124, 92, 255, .7); }
.deposit-input.has-bonus { padding-right: 180px; }

.deposit-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 16px;
}

.deposit-quick {
  position: relative;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}

.deposit-quick.has-bonus {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  padding: 8px 3px 4px;
}

.deposit-quick-value { line-height: 1.1; }
.deposit-quick-extra { color: var(--mint); font-size: 9px; font-weight: 900; line-height: 1.1; white-space: nowrap; }

.deposit-quick.active {
  border-color: rgba(124, 92, 255, .75);
  background: rgba(124, 92, 255, .16);
  color: #fff;
}

.deposit-submit { height: 50px; font-size: 14px; }

.deposit-rewards {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}
.deposit-reward-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deposit-reward-head h3 { margin: 0; font-size: 13px; }
.deposit-reward-status { color: var(--mint); font-size: 10px; font-weight: 800; text-align: end; }
.deposit-reward-summary { margin-top: 8px; color: var(--muted); font-size: 11px; }
.deposit-reward-track { height: 6px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.deposit-reward-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--mint)); transition: width .2s ease; }
.deposit-reward-steps {
  display: grid;
  grid-auto-rows: 46px;
  align-content: start;
  gap: 8px;
  height: 208px;
  margin-top: 12px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 247, 212, .35) transparent;
}
.deposit-reward-steps::-webkit-scrollbar { width: 4px; }
.deposit-reward-steps::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(124, 247, 212, .35); }
.deposit-reward-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, .03);
  transition: .18s ease;
}
.deposit-reward-marker {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.deposit-reward-threshold { display: flex; flex-direction: column; gap: 2px; }
.deposit-reward-threshold b { font-size: 12px; }
.deposit-reward-threshold small { color: var(--muted); font-size: 9px; }
.deposit-reward-amount { color: var(--mint); font-size: 13px; white-space: nowrap; }
.deposit-reward-step.claimed { opacity: .62; }
.deposit-reward-step.claimed .deposit-reward-marker { background: rgba(124, 247, 212, .16); color: var(--mint); }
.deposit-reward-step.reached {
  border-color: rgba(255, 209, 102, .55);
  background: rgba(255, 209, 102, .08);
}
.deposit-reward-step.reached .deposit-reward-marker { background: var(--gold); color: #2b1b00; box-shadow: 0 0 14px rgba(255, 209, 102, .36); }
.deposit-reward-step.reached .deposit-reward-threshold small { color: var(--gold); }
.deposit-reward-step.reached .deposit-reward-amount {
  padding: 5px 9px;
  border-radius: 99px;
  background: linear-gradient(135deg, #ffe58a, #ffb703);
  color: #2b1b00;
  box-shadow: 0 0 16px rgba(255, 209, 102, .38);
}

.deposit-note {
  margin: 18px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

.recent-deposits { margin-top: 24px; }

.recent-deposits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.recent-deposits-head .deposit-label { margin: 0; }
.recent-deposits-more { flex: none; padding: 6px 12px; font-size: 11px; }

.deposit-records { display: flex; flex-direction: column; gap: 12px; }

.deposit-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.deposit-record-main { display: flex; flex-direction: column; gap: 4px; }
.deposit-record-main b { font-size: 13px; }
.deposit-record-main .time { font-size: 11px; color: var(--muted); }

.deposit-record-amount { font-size: 15px; font-weight: 800; color: var(--text); }
.deposit-record-amount.success { color: var(--mint); }
.deposit-record-amount.failed { color: var(--red); }
.deposit-record-amount.pending { color: var(--gold); }

.deposit-empty {
  margin: 0;
  padding: 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ---------- Notice sheet ---------- */
.notice-list { display: flex; flex-direction: column; gap: 10px; }

.notice-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}

.notice-item-ico { flex-shrink: 0; font-size: 20px; }
.notice-item b { display: block; font-size: 13px; margin-bottom: 3px; }
.notice-item p { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 26px 22px;
  background:
    radial-gradient(420px 240px at 100% 0%, rgba(124, 247, 212, .18), transparent 70%),
    radial-gradient(420px 260px at 0% 100%, rgba(124, 92, 255, .26), transparent 70%),
    linear-gradient(155deg, #131a2d, #0b1020);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset-inline-end: -40px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 247, 212, .16), transparent 65%);
  pointer-events: none;
}

.hero-copy h1 {
  margin: 16px 0 10px;
  font-size: clamp(26px, 4.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -.01em;
}

.hero-copy h1 span {
  background: linear-gradient(90deg, var(--mint), #58c8ff 60%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
  max-width: 440px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

.hero-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.promo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  padding: 16px 15px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.promo:hover { transform: translateY(-2px); }

.promo h3 { margin: 0; font-size: 14px; }
.promo p { margin: 0; font-size: 11.5px; color: rgba(255, 255, 255, .72); line-height: 1.5; }
.promo .promo-icon { font-size: 22px; }
.promo .promo-cta { font-size: 11.5px; font-weight: 800; color: #fff; opacity: .92; }

.promo-gold {
  background:
    radial-gradient(220px 140px at 90% 0%, rgba(255, 209, 102, .35), transparent 70%),
    linear-gradient(150deg, #3a2a10, #1b1610);
  border-color: rgba(255, 209, 102, .28);
}

.promo-violet {
  background:
    radial-gradient(220px 140px at 90% 0%, rgba(124, 92, 255, .5), transparent 70%),
    linear-gradient(150deg, #211a44, #121026);
  border-color: rgba(124, 92, 255, .35);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--mint), #47c9ff);
  color: #06141a;
  box-shadow: 0 10px 30px rgba(124, 247, 212, .22);
}

.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-violet {
  background: linear-gradient(135deg, #9b7bff, var(--violet));
  color: #fff;
  box-shadow: 0 10px 30px rgba(124, 92, 255, .25);
}

.btn-ghost {
  background: rgba(255, 255, 255, .05);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover { border-color: rgba(124, 247, 212, .4); color: var(--mint); }

.btn-danger {
  background: rgba(247, 37, 133, .12);
  border-color: rgba(247, 37, 133, .35);
  color: #ff9cc4;
}

.btn-block { width: 100%; }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Game cards ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  text-align: start;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 247, 212, .28);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .38);
}

.game-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--c1, #6c5ce7), var(--c2, #00d2ff));
  overflow: hidden;
}

.game-cover::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, .32), transparent 55%);
  mix-blend-mode: overlay;
}

.cover-img {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* 禁用 Chrome 图片悬停下载按钮：展示图不接收指针事件，点击穿透到父容器 */
.cover-img,
.banner-slide img,
.float-cta img,
.promo-banner img,
.promo-detail-hero img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}


.game-cost,
.game-badge,
.lobby-cost { z-index: 2; }

.game-emoji {
  font-size: clamp(38px, 9vw, 52px);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
  transform: translateY(2px);
}

.game-cost {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  color: #2a1c00;
  background: rgba(255, 209, 102, .92);
  backdrop-filter: blur(4px);
}

.game-badge {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #fff;
  background: rgba(7, 10, 18, .55);
  border: 1px solid rgba(255, 255, 255, .22);
}

.game-body { padding: 11px 12px 12px; }

.game-body h3 {
  margin: 0 0 3px;
  font-size: 13.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-body p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-foot {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted-2);
}

.game-play { color: var(--mint); font-weight: 800; }

/* ---------- Chips / tabs ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }

.chip.active {
  color: #06141a;
  background: linear-gradient(135deg, var(--mint), #4ecbff);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 247, 212, .2);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.tab-chip {
  flex: 1;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.tab-chip.active {
  background: rgba(124, 247, 212, .12);
  color: var(--mint);
}

/* ---------- Page head / search ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 6px 0 16px;
}

.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }

.page-head.games-head {
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  margin: 6px 0 12px;
}

.page-head.games-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 36px;
}

.games-search.search { width: 100%; margin: 0 0 12px; }

.search {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  flex: 0 1 320px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  border-radius: 12px;
  padding: 0 14px;
  height: 42px;
}

.search span { color: var(--muted-2); font-size: 14px; }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
}

.search input::placeholder { color: var(--muted-2); }

/* ---------- Detail ---------- */
/* 老版 WebView 不支持 flex gap，二级页面返回按钮与标题之间补间距 */
.page-head > .back-btn { margin-inline-end: 10px; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin: 4px 0 16px;
  transition: background .16s ease, border-color .16s ease;
}

.back-btn.icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 11px;
  color: var(--text);
  font-size: 16px;
}

.back-btn:active { border-color: rgba(124, 247, 212, .42); }

html[dir="rtl"] .back-btn .arrow { transform: scaleX(-1); display: inline-block; }

.detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.detail-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: clamp(64px, 14vw, 96px);
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, .34), transparent 55%),
    linear-gradient(140deg, var(--c1, #6c5ce7), var(--c2, #00d2ff));
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  overflow: hidden;
}

/* 分享落地页用紧凑的 16:10 区域完整居中显示封面，不裁切也不按原图撑高。 */
.detail-cover .cover-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: contain;
}

.detail-cover .cover-img + span { display: none; }

.detail-info .tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mint);
  background: rgba(124, 247, 212, .1);
  border: 1px solid rgba(124, 247, 212, .25);
  border-radius: 999px;
  padding: 5px 10px;
}

.detail-info h1 { margin: 12px 0 4px; font-size: clamp(26px, 4.5vw, 36px); line-height: 1.15; }

.detail-sub { margin: 0 0 14px; color: var(--gold); font-size: 13.5px; font-weight: 600; }

.detail-desc { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.75; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stat {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  border-radius: 14px;
  padding: 10px 12px;
}

.stat span { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 4px; }

.stat b { font-size: 15px; }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.detail-actions .btn-primary { flex: 1 1 200px; }

/* ---------- Rank list ---------- */
.rank-list {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child { border-bottom: 0; }

.rank-row.is-you { background: rgba(124, 247, 212, .06); }

.rank-no {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted-2);
}

.rank-row:nth-child(1) .rank-no { color: var(--gold); }
.rank-row:nth-child(2) .rank-no { color: #cfd8ea; }
.rank-row:nth-child(3) .rank-no { color: #e0a075; }

.rank-ava {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.rank-info { flex: 1; min-width: 0; }

.rank-info b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-info span { font-size: 10.5px; color: var(--muted-2); }

.rank-score {
  font-size: 14px;
  color: var(--gold);
  font-weight: 900;
  white-space: nowrap;
}

.rank-score small { font-size: 10px; color: var(--muted-2); font-weight: 600; margin-inline-start: 3px; }

.rank-tabs {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rank-tabs::-webkit-scrollbar { display: none; }

.rank-tabs .tab-chip {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.order-rank-previous,
.order-rank-current {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)), var(--panel);
}

.order-rank-previous { margin-bottom: 12px; }

.order-rank-previous.claimable {
  border-color: rgba(255, 209, 102, .42);
  background: linear-gradient(145deg, rgba(255, 209, 102, .10), rgba(255, 255, 255, .02)), var(--panel);
}

.order-rank-card-head,
.order-rank-current-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-rank-card-head h2 { margin: 0; font-size: 14px; }

.order-rank-card-head > span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: end;
}

.order-rank-current-head > div > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.order-rank-current-head > div > b { display: block; font-size: 16px; }

.order-rank-current-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.order-rank-current-head > strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(124, 247, 212, .22);
  border-radius: 999px;
  background: rgba(124, 247, 212, .08);
  color: var(--mint);
  font-size: 10px;
  white-space: nowrap;
}

.order-rank-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.order-rank-stat {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.order-rank-stat span {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-rank-stat b {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-rank-stat:last-child b { color: var(--gold); }

.order-rank-login p,
.order-rank-empty,
.order-rank-me-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.order-rank-login .btn { margin-top: 12px; }

.order-rank-me {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(124, 92, 255, .22);
  border-radius: 14px;
  background: rgba(124, 92, 255, .07);
}

.order-rank-me .order-rank-stats { margin-top: 0; }

.order-rank-columns,
.order-rank-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(64px, auto) minmax(54px, auto);
  align-items: center;
  gap: 8px;
}

.order-rank-columns {
  padding: 0 12px 7px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
}

.order-rank-columns span:nth-child(n+3) { text-align: end; }

.order-rank-list { border-radius: 14px; }

.order-rank-row { padding: 11px 12px; }

.order-rank-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-rank-player .rank-ava {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 15px;
}

.order-rank-player .rank-info { min-width: 0; }

.order-rank-you { color: var(--mint) !important; font-size: 9px; }

.order-rank-value { min-width: 0; text-align: end; }

.order-rank-value b {
  display: block;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-rank-value.bonus b { color: var(--mint); }

.order-rank-claim {
  display: block;
  margin: 12px 0 0;
  margin-inline-start: auto;
}

@media (max-width: 420px) {
  .order-rank-previous,
  .order-rank-current { padding: 12px; }
  .order-rank-columns,
  .order-rank-row {
    grid-template-columns: 26px minmax(0, 1fr) minmax(58px, auto) minmax(48px, auto);
    gap: 6px;
  }
  .order-rank-row { padding: 10px 9px; }
  .order-rank-player { gap: 6px; }
  .order-rank-player .rank-ava { width: 26px; height: 26px; font-size: 13px; }
  .order-rank-value b { font-size: 11px; }
  .order-rank-stat { padding: 8px; }
  .order-rank-stat b { font-size: 13px; }
}

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .015);
}

.empty .empty-ico { display: block; font-size: 30px; margin-bottom: 8px; opacity: .8; }

/* ---------- Profile ---------- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(360px 200px at 100% 0%, rgba(124, 92, 255, .3), transparent 70%),
    linear-gradient(150deg, #131a2d, #0b1020);
  box-shadow: var(--shadow);
}

.profile-ava {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: linear-gradient(150deg, rgba(124, 247, 212, .28), rgba(124, 92, 255, .28));
  border: 1px solid rgba(255, 255, 255, .16);
}

.profile-id { flex: 1; min-width: 140px; }
.profile-id h1 { margin: 0 0 3px; font-size: 20px; }
.profile-id p { margin: 0; font-size: 11.5px; color: var(--muted-2); }

.profile-coins {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 900;
  color: var(--gold);
  background: rgba(255, 209, 102, .08);
  border: 1px solid rgba(255, 209, 102, .25);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
}

.stat-card span { display: block; font-size: 11px; color: var(--muted-2); margin-bottom: 6px; }
.stat-card b { font-size: 20px; }
.stat-card small { font-size: 11px; color: var(--muted-2); font-weight: 500; margin-inline-start: 4px; }

.checkin-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 209, 102, .24);
  background:
    radial-gradient(320px 180px at 100% 0%, rgba(255, 209, 102, .16), transparent 70%),
    linear-gradient(150deg, #1a160d, #100f0b);
}

.checkin-card h2 { margin: 0 0 4px; font-size: 16px; }
.checkin-card p { margin: 0 0 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.streak-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.streak-day {
  border-radius: 10px;
  padding: 7px 2px 6px;
  text-align: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}

.streak-day span { display: block; font-size: 9px; color: var(--muted-2); margin: 3px 0; }
.streak-day b { font-size: 11px; color: var(--muted); }
.streak-day .streak-reward { display: block; color: var(--gold); font-size: 10px; white-space: nowrap; }
.streak-day i { display: block; color: var(--muted); font-size: 11px; font-style: normal; }

.streak-day.done {
  background: rgba(255, 209, 102, .16);
  border-color: rgba(255, 209, 102, .38);
}

.streak-day.done span, .streak-day.done b, .streak-day.done i { color: var(--gold); }

.streak-day.today { box-shadow: 0 0 0 2px rgba(255, 209, 102, .28) inset; }

.guest-card {
  text-align: center;
  padding: 40px 22px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(360px 220px at 50% 0%, rgba(124, 92, 255, .22), transparent 70%),
    var(--panel);
}

.guest-emoji { font-size: 46px; margin-bottom: 10px; }
.guest-card h1 { margin: 0 0 8px; font-size: 22px; }
.guest-card p { margin: 0 auto 20px; max-width: 380px; color: var(--muted); font-size: 13px; line-height: 1.65; }

.small-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.small-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: .16s ease;
}

.small-card:hover { border-color: rgba(124, 247, 212, .3); transform: translateY(-2px); }

.small-cover {
  height: 62px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
}

.small-body { padding: 8px 10px 9px; }
.small-body b { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small-body span { font-size: 10px; color: var(--muted-2); }

/* ---------- Play screen ---------- */
.play-shell {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #070a12;
}

.play-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 24, .96);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 2;
  flex: none;
}

.play-back {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

html[dir="rtl"] .play-back span { transform: scaleX(-1); display: inline-block; }

.play-open {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .05);
  color: var(--muted-2);
  display: grid;
  place-items: center;
  font-size: 13px;
  text-decoration: none;
  flex: none;
}
.play-open:hover { color: var(--text); border-color: var(--accent); }

.play-title { flex: 1; min-width: 0; }
.play-title b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-title span { font-size: 10.5px; color: var(--muted-2); }

.play-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  background: #070a12;
  display: block;
}

/* 进入游戏后先盖住 iframe，等游戏文档加载完成再淡出，避免看到白屏 */
.play-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  background: #070a12;
}

.play-frame-wrap .play-frame {
  flex: 1;
  width: 100%;
  height: 100%;
}

.play-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: #070a12;
  transition: opacity .24s ease;
}

.play-loading.is-done {
  opacity: 0;
  pointer-events: none;
}

.play-loading-spin {
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 2.5px solid rgba(124, 247, 212, .18);
  border-top-color: var(--mint);
  animation: playSpin .8s linear infinite;
}

@keyframes playSpin {
  to { transform: rotate(360deg); }
}

.play-loading b {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.play-loading small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Bottom tabs ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  width: 100%;
  max-width: var(--app-w);
  z-index: 40;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: #090d17;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 7px 4px;
  border-radius: 12px;
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 700;
  transition: background-color .16s ease, color .16s ease;
}

.tab-ico { font-size: 19px; line-height: 1; opacity: .85; }
.tab-icon-image { display: block; object-fit: contain; }
.tab-ico .tab-icon-image { width: 22px; height: 22px; }

.tab.active { color: var(--mint); background: rgba(124, 247, 212, .08); }
.tab.active .tab-ico { opacity: 1; }
.tab:active { background: rgba(124, 247, 212, .12); }

/* 中间悬浮凸出的 Chat 按钮 */
.tab-float {
  position: relative;
  z-index: 2;
  overflow: visible;
  justify-content: flex-start;
  padding-top: 0;
}

.tab-float.active { background: none; }

.tab-float-circle {
  width: 54px;
  height: 54px;
  margin-top: -32px;
  margin-bottom: 3px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  background: linear-gradient(135deg, #7cf7d4 0%, #34d399 100%);
  border: 4px solid #090d17;
  box-shadow: 0 6px 18px rgba(124, 247, 212, .35), 0 0 0 1px rgba(124, 247, 212, .15);
  filter: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

/* 按下时暂停球体动画，让按压缩放生效（底色渐变图片仍在，只是停下流动） */
.tab-float:active .tab-float-circle { animation: none; transform: scale(.94); }
.tab-float-circle .tab-icon-image { width: 30px; height: 30px; border-radius: 50%; }

.tab-float.active .tab-float-circle {
  box-shadow: 0 8px 22px rgba(124, 247, 212, .5), 0 0 0 1px rgba(124, 247, 212, .3);
}

/* 中间按钮：三色液态渐变 + 呼吸光环 + 💬↔🎬 3D 翻转 + 落定抖动 */
.tab-float-circle {
  position: relative;
  background-image: linear-gradient(120deg, #7cf7d4 0%, #45c8ff 30%, #7c5cff 55%, #45c8ff 78%, #7cf7d4 100%);
  background-size: 220% 220%;
  animation: tfcLiquid 5s ease-in-out infinite;
}

.tab-float-circle::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid rgba(124, 247, 212, .55);
  animation: tfcHalo 2s ease-out infinite;
  pointer-events: none;
}

@keyframes tfcLiquid {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes tfcHalo {
  0% { transform: scale(.9); opacity: .7; }
  70%, 100% { transform: scale(1.38); opacity: 0; }
}

.tfc-flip {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  animation: tfcTurn 9s ease-in-out infinite;
}

/* 9s 一轮：💬 3s → 翻转 1.5s → 🎬 3s → 翻回 1.5s */
@keyframes tfcTurn {
  0%, 33.33% { transform: rotateY(0deg); }
  50%, 83.33% { transform: rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}

/* 图标内层：落定时 emoji 自己快速抖一下，球体保持不动 */
.tfc-inner {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  animation: tfcShake 9s linear infinite;
}

@keyframes tfcShake {
  0% { transform: rotate(-24deg) translateX(-2px) scale(.9); }
  2% { transform: rotate(22deg) translateX(2px) scale(1.08); }
  4% { transform: rotate(-17deg) translateX(-2px) scale(.95); }
  6% { transform: rotate(14deg) translateX(2px) scale(1.04); }
  8% { transform: rotate(-10deg) translateX(-1px); }
  10% { transform: rotate(6deg); }
  12% { transform: rotate(-3deg); }
  14%, 50% { transform: none; }
  52% { transform: rotate(-24deg) translateX(-2px) scale(.9); }
  54% { transform: rotate(22deg) translateX(2px) scale(1.08); }
  56% { transform: rotate(-17deg) translateX(-2px) scale(.95); }
  58% { transform: rotate(14deg) translateX(2px) scale(1.04); }
  60% { transform: rotate(-10deg) translateX(-1px); }
  62% { transform: rotate(6deg); }
  64% { transform: rotate(-3deg); }
  66%, 100% { transform: none; }
}

/* 点击 Say&See 顶部切换按钮时图标轻抖一下（幅度收敛，避免小图标抖动过大） */
.chat-circle-ico {
  display: block;
  line-height: 1;
}

.chat-circle-ico.is-shaking {
  animation: tfcShakeOnce .6s linear both;
}

@keyframes tfcShakeOnce {
  0% { transform: rotate(-12deg) scale(.96); }
  8% { transform: rotate(10deg) scale(1.03); }
  18% { transform: rotate(-7deg); }
  28% { transform: rotate(5deg); }
  38% { transform: rotate(-2deg); }
  50%, 100% { transform: none; }
}

.tfc-face {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.tfc-video { transform: rotateY(180deg); }

.tfc-custom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .tab-float-circle {
    animation: none;
    background-image: linear-gradient(135deg, #7cf7d4 0%, #34d399 100%);
    background-size: auto;
  }
  .tab-float-circle::before { display: none; }
  .tfc-flip { animation: none; transform: none; }
  .tfc-inner { animation: none; transform: none; }
  .chat-circle-ico { animation: none; transform: none; }
  .tfc-video { display: none; }
}

.tab-float-label { font-size: 11.5px; font-weight: 700; }

/* ---------- Footer ---------- */
.footer {
  display: block;
  border-top: 1px solid var(--line);
  padding: 18px 0 96px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

/* 二级页面没有底部 Tab，页脚不用再留出 Tab 的高度 */
.shell.no-tabbar .footer { padding-bottom: 28px; }

/* ---------- Home popup ---------- */
.home-popup-backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 36px;
  background: rgba(4, 6, 12, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease;
}

.home-popup {
  position: relative;
  width: min(100%, 420px);
  animation: modalIn .22s ease;
}

.home-popup-link {
  display: block;
  overflow: hidden;
  border-radius: 22px;
  background: #101627;
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

.home-popup-link img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.home-popup-not-today {
  display: block;
  min-height: 36px;
  margin: 14px auto 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(22, 29, 49, .9);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.home-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: #161d31;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 480px) {
  .home-popup-backdrop { padding: 28px; }
  .home-popup-close { right: 8px; }
}

/* ---------- Modal / sheet ---------- */
.modal-backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 12, .7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease;
}

/* 手机软键盘输入时避免登录弹窗整层模糊反复重绘造成闪动。 */
@media (max-width: 560px) {
  #modal-root[data-modal="login"] .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 430px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 20px;
  border-radius: 24px;
  background: linear-gradient(170deg, #161d31, #0d1220);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  animation: modalIn .22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-head h2 { margin: 0 0 4px; font-size: 19px; }
.sheet-head p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.sheet-head > :first-child { flex: 1; min-width: 0; }
.sheet-head > .sheet-close { flex: 0 0 32px; align-self: flex-start; margin-inline-start: auto; }

#modal-root[data-modal="invite-share"] .modal-backdrop {
  padding: 12px 16px;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
}
.share-sheet {
  max-height: 100%;
  padding: 16px;
  overscroll-behavior: contain;
}
.share-sheet .sheet-head { margin-bottom: 10px; }
.share-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}
.share-thumbs::-webkit-scrollbar { display: none; }
.share-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
}
.share-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.share-thumb.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 185, 23, .22); }
.share-note { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.share-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #070a12;
}
/* 预览图保持 4:5，按当前浏览器可见高度等比缩放，给底部操作按钮留出空间。 */
.share-preview canvas {
  display: block;
  width: min(100%, 25.6vh);
  width: min(100%, 25.6dvh);
  height: auto;
  max-height: 32vh;
  max-height: 32dvh;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}
.share-channels { display: flex; align-items: flex-start; gap: 10px; margin: 0; }
.invite-link + .share-channels { margin: 12px 0 0; }
.share-channel {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.share-channel-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.share-channel-icon svg { width: 23px; height: 23px; fill: currentColor; }
.share-channel-whatsapp .share-channel-icon { background: #25d366; }
.share-channel-telegram .share-channel-icon { background: #229ed9; }
.share-channel-facebook .share-channel-icon { background: #1877f2; }
.share-channel-x .share-channel-icon { background: #050505; border: 1px solid rgba(255, 255, 255, .16); }
.share-channel:active .share-channel-icon { transform: scale(.94); }
.share-loading { margin-bottom: 14px; }
.share-error { padding: 18px 0 8px; text-align: center; }
.share-error p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.share-actions { display: flex; gap: 10px; margin-top: 12px; }
.share-actions .btn { flex: 1; min-width: 0; min-height: 44px; margin: 0; }
.share-sheet .btn-block { margin-top: 4px; }

.app-confirm-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 12, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.app-confirm {
  width: 100%;
  max-width: 360px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(170deg, #161d31, #0d1220);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  animation: modalIn .22s ease;
}
.app-confirm p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.65; white-space: pre-line; }
.app-confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.app-confirm-actions .btn { flex: 1; min-width: 0; min-height: 42px; }

/* 视频分享弹窗：主操作独占一行，其余按钮三等分，避免小屏挤压溢出 */
.video-share-dialog .app-confirm-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.video-share-dialog .app-confirm-actions .btn {
  width: 100%;
  min-height: 38px;
  padding: 8px 4px;
  font-size: 13px;
  white-space: nowrap;
}
.video-share-dialog .app-confirm-actions .btn[data-share="chat"] {
  grid-column: 1 / -1;
  min-height: 44px;
  font-size: 15px;
}

.sheet-close {
  margin-inline-start: auto;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.field { margin-bottom: 12px; }

.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .03em;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: .16s ease;
}

.field input::placeholder { color: var(--muted-2); }
.field input:focus { border-color: rgba(124, 247, 212, .55); box-shadow: 0 0 0 3px rgba(124, 247, 212, .10); }

/* 密码框：右侧显示/隐藏密码小眼睛 */
.field-eye { position: relative; }
.field-eye input { padding-inline-end: 46px; }

.password-eye {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.password-eye svg { width: 19px; height: 19px; }

.password-eye .eye-slash { display: none; }
.password-eye.is-on { color: var(--mint); }
.password-eye.is-on .eye-slash { display: inline; }

.code-row { display: flex; gap: 8px; margin: 2px 0 18px; }
.code-row .field { flex: 1; margin-bottom: 0; }

.mini-btn {
  flex-shrink: 0;
  height: 46px;
  margin-top: 17px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 247, 212, .4);
  background: rgba(124, 247, 212, .09);
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.mini-btn:disabled { opacity: .45; cursor: not-allowed; }

.login-hint {
  margin: 10px 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(124, 247, 212, .07);
  border: 1px dashed rgba(124, 247, 212, .3);
  font-size: 11.5px;
  color: var(--mint);
  text-align: center;
}

.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }

.play-confirm-actions .btn { flex: 1; }

.play-loading-sheet {
  max-width: 340px;
  padding: 30px 24px;
  text-align: center;
}

.play-loading-sheet h2 { margin: 0 0 8px; font-size: 20px; }
.play-loading-sheet p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}

.auth-tab {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: .16s ease;
}

.auth-tab.active {
  background: linear-gradient(135deg, rgba(124, 247, 212, .18), rgba(0, 210, 255, .12));
  color: var(--mint);
  box-shadow: inset 0 0 0 1px rgba(124, 247, 212, .3);
}

.auth-seg {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.auth-seg-btn {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.auth-seg-btn.active {
  border-color: rgba(124, 247, 212, .45);
  background: rgba(124, 247, 212, .08);
  color: var(--mint);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted-2);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-google {
  background: #fff;
  color: #1f2430;
  border-color: rgba(255, 255, 255, .75);
}

.btn-google svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.btn-google:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.auth-demo-hint {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--muted-2);
  text-align: center;
}

.checkin-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 209, 102, .07);
  border: 1px solid rgba(255, 209, 102, .22);
  margin-bottom: 14px;
}

.checkin-preview .big { font-size: 30px; }
.checkin-preview b { display: block; font-size: 20px; color: var(--gold); }
.checkin-preview span { font-size: 11.5px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 16px);
  z-index: 120;
  max-width: min(88vw, 420px);
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(16, 22, 39, .96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: rgba(124, 247, 212, .45); }
.toast.bad { border-color: rgba(247, 37, 133, .45); }

/* ---------- Skeleton ---------- */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 12px; }

.skeleton {
  height: 190px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255, 255, 255, .045) 30%, rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, .045) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.25s infinite;
}

.skeleton-list { padding: 4px 0; }

.skeleton-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.skeleton-list-row:last-child { border-bottom: 0; }

.skeleton.skeleton-list-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
}

.skeleton-list-copy { display: block; flex: 1; min-width: 0; }

.skeleton.skeleton-line {
  display: block;
  width: 62%;
  height: 10px;
  border-radius: 99px;
}

.skeleton.skeleton-line.short { width: 38%; margin-top: 8px; }

.skeleton.skeleton-list-amount {
  width: 52px;
  height: 12px;
  flex: 0 0 52px;
  border-radius: 99px;
}

.skeleton-pay-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.skeleton-pay-methods .skeleton { height: 66px; }
.skeleton-channel-row { display: flex; gap: 8px; }
.skeleton-channel-row .skeleton { height: 38px; flex: 1; }
.skeleton.skeleton-deposit-input { height: 48px; }
.skeleton-quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.skeleton-quick-grid .skeleton { height: 34px; }
.skeleton.skeleton-deposit-submit { height: 46px; }

.game-loading-skeleton { margin-bottom: 18px; }
.skeleton.game-skeleton-cover { height: 120px; margin-bottom: 14px; }
.game-loading-skeleton .skeleton-line { margin-left: auto; margin-right: auto; }
.skeleton.game-skeleton-button { height: 40px; margin-top: 16px; }

.skeleton.skeleton-play-title { width: 150px; height: 14px; border-radius: 99px; }
.play-frame-loading { overflow: auto; }
.game-route-skeleton { width: min(100%, 420px); margin: 36px auto; padding: 0 20px; }
.skeleton.game-route-cover { height: 220px; margin-bottom: 18px; }
.skeleton.game-route-button { height: 44px; margin-top: 20px; }

@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }

/* ---------- Launch splash ---------- */
.splash {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(520px 380px at 50% 38%, rgba(124, 92, 255, .22), transparent 65%),
    radial-gradient(420px 320px at 50% 100%, rgba(247, 37, 133, .12), transparent 70%),
    #070a12;
  transition: opacity .45s ease, visibility .45s ease;
}

.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-glow {
  position: absolute;
  width: min(120vw, 560px);
  height: min(120vw, 560px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 247, 212, .17), transparent 62%);
  animation: splashBreathe 2.8s ease-in-out infinite;
  pointer-events: none;
}

.splash-inner {
  position: relative;
  width: min(88vw, 440px);
  padding: 24px;
  text-align: center;
}

.splash-mark {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 46px;
  font-weight: 900;
  color: #06141a;
  background: linear-gradient(135deg, #7cf7d4, #45c8ff);
  box-shadow: 0 18px 60px rgba(124, 247, 212, .35);
  animation: splashPop .75s cubic-bezier(.2, .9, .3, 1.35) both;
}

.splash-brand {
  font-size: clamp(32px, 9vw, 40px);
  font-weight: 900;
  letter-spacing: .005em;
}

.splash-brand span {
  font-size: 20px;
  font-weight: 700;
  color: var(--mint);
  margin-inline-start: 8px;
}

.splash-tag {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

.splash-urdu {
  margin-top: 5px;
  font-size: 14px;
  color: #b9a7d6;
}

.splash-loading {
  width: min(56vw, 220px);
  height: 4px;
  margin: 26px auto 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.splash-loading i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--mint), var(--violet));
  animation: splashLoad 1.15s ease-in-out infinite;
}

.splash-note { font-size: 11px; color: var(--muted-2); }

.splash-skip {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes splashPop {
  from { transform: scale(.68); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes splashBreathe {
  0%, 100% { transform: scale(.92); opacity: .65; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes splashLoad {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(350%); }
}

/* ---------- Fixed-width H5 frame ---------- */
@media (min-width: 560px) {
  .shell {
    background: rgba(7, 10, 18, .62);
    border-inline: 1px solid var(--line);
    box-shadow: 0 0 90px rgba(0, 0, 0, .55);
  }

  .tabbar { border-inline: 1px solid var(--line); }
  .play-shell { border-inline: 1px solid var(--line); }
}

@media (max-width: 420px) {
  .brand-text small { display: none; }
  .coin-pill { padding: 6px 9px; font-size: 12px; }
  .lang-btn { padding: 6px 8px; }
  .topbar-inner { gap: 8px; }
  .top-actions { gap: 6px; }
  .main { padding-top: 14px; }
  .games-layout { gap: 8px; }
  .provider-rail { flex-basis: 68px; }
  .games-layout .lobby-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Chat & Video ---------- */
.chat-switch {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin: 16px 0 18px;
}

.chat-circle {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: .16s ease;
}

.chat-circle .tab-icon-image { width: 22px; height: 22px; }

.chat-circle.on {
  color: #04120f;
  background: var(--mint);
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(122, 242, 211, .12);
}

.chat-circle.locked {
  opacity: .6;
  filter: grayscale(.4);
}
.chat-circle.locked.on { background: rgba(255, 255, 255, .08); color: var(--muted); box-shadow: none; }
.chat-lock {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1a2230;
  border: 1px solid var(--line);
  font-size: 9px;
  line-height: 1;
}

.chat-circle:active { transform: scale(.94); }

.video-cats {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.video-cats::-webkit-scrollbar { display: none; }

.video-cat {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}

.video-cat.on {
  color: #04120f;
  background: var(--mint);
  border-color: transparent;
}

.chat-empty {
  padding: 54px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .02);
}

.chat-empty-ico { font-size: 36px; margin-bottom: 10px; }
.chat-empty b { display: block; font-size: 15px; }
.chat-empty p { margin: 8px 0 16px; color: var(--muted); font-size: 12px; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
}

.video-card {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: start;
  cursor: pointer;
}

.video-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  background: #0b1220;
}

.video-cover img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.video-play {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}

.video-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

[dir="rtl"] .video-duration { right: auto; left: 6px; }

.video-title {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 该行只有 All / Purchased / My videos，取消横向滚动，才能让 My videos 真正贴住最右侧 */
/* 强制 LTR 排列：乌尔都语整页是 RTL，RTL 下 My videos 会被排到最左边 */
.video-scopes { margin-bottom: 14px; overflow: visible; flex-wrap: wrap; align-items: center; gap: 0; direction: ltr; }
.video-scopes .video-cat + .video-cat { margin-inline-start: 8px; }
/* 提高一层选择器权重：老版 WebView 的 .video-cats > * + * 规则会给按钮补 8px 左间距，覆盖掉 auto */
.video-scopes .video-publish-btn {
  margin-inline-start: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(255, 196, 0, .08);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: .16s ease;
}
.video-publish-btn:active { transform: scale(.96); }
/* 老版 WebView 不支持 flex gap，图标与文字的间距用 margin */
.video-publish-ico { font-size: 13px; line-height: 1; margin-inline-end: 5px; }
.video-detail { padding-bottom: 20px; }
.video-detail-back { margin: 0 0 12px; }
.video-detail-title { margin: 20px 0 10px; font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
.video-detail-meta { display: flex; align-items: center; gap: 12px; }
.video-detail-price { color: var(--gold); font-size: 16px; font-weight: 800; }
.video-detail-price.free,
.video-detail-unlocked { color: var(--mint); }
.video-detail-unlocked { font-size: 11px; font-weight: 700; }
.video-detail-preview { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.video-detail-copy { margin-top: 24px; }
.video-detail-copy h2 { margin: 0 0 8px; font-size: 16px; }
.video-detail-desc { color: var(--muted); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.video-no-preview { padding: 24px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.video-recommendations { margin-top: 30px; }
.video-recommendations:empty { display: none; }
.video-player-stage {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
}
.video-player { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-animated-poster {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}
.video-player-status {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(0, 0, 0, .38);
  color: #fff;
  text-align: center;
  pointer-events: none;
}
.video-player-status[hidden],
.video-player-spinner[hidden],
.video-player-status-actions [hidden],
.video-player-tool[hidden] { display: none; }
.video-player-status b { font-size: 13px; line-height: 1.5; text-shadow: 0 1px 5px #000; }
.video-player-status-actions { display: flex; align-items: center; justify-content: center; margin-top: 12px; pointer-events: auto; }
.video-player-status-actions .btn { min-height: 44px; }
.video-player-status-actions .btn + .btn { margin-inline-start: 8px; }
.video-player-spinner {
  /* 转圈永远落在播放器正中心；文案与按钮排在圆心下方 */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(255, 255, 255, .28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: videoPlayerSpin .8s linear infinite;
}
.video-player-spinner:not([hidden]) ~ b { margin-top: 54px; }
/* 自绘播放条：替代浏览器原生 controls，保证控件文案跟随 App 语言 */
.video-player-controls {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  color: #fff;
}
.video-control-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.video-control-btn:active { background: rgba(255, 255, 255, .3); }
.video-control-btn.video-rate-btn {
  width: auto;
  min-width: 44px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.video-control-btn.video-rate-btn.is-changed { background: #ffd95a; color: #1a1205; }
.video-control-time {
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: .92;
}
.video-control-seek {
  flex: 1 1 auto;
  min-width: 0;
  height: 20px;
  margin: 0;
  accent-color: #ffd95a;
  cursor: pointer;
}
.video-player-tools {
  position: absolute;
  z-index: 3;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  max-width: calc(100% - 16px);
}
[dir="rtl"] .video-player-tools { right: auto; left: max(8px, env(safe-area-inset-left)); }
.video-player-tool {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  touch-action: manipulation;
}
.video-player-stage:fullscreen,
.video-player-stage:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  background: #000;
}
.video-player-stage:fullscreen .video-player,
.video-player-stage:-webkit-full-screen .video-player { width: 100%; height: 100%; }
.video-player-wrap[hidden],
.video-preview-ended[hidden] { display: none; }
@keyframes videoPlayerSpin { to { transform: rotate(360deg); } }
@supports not (aspect-ratio: 16 / 9) {
  .video-player { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
}
@media (max-width: 420px) {
  .video-grid { gap: 12px 8px; }
  .video-detail-title { margin-top: 16px; font-size: 19px; }
  .video-player-status { padding: 50px 12px; }
  .video-player-status b { font-size: 12px; }
  .video-sound-btn span { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.video-price-badge,
.video-unlocked-badge,
.video-preview-badge {
  position: absolute;
  z-index: 2;
  max-width: 72%;
  padding: 3px 7px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-price-badge { inset-block-start: 6px; inset-inline-start: 6px; color: var(--gold); }
.video-price-badge.free { color: var(--mint); }
.video-unlocked-badge { inset-block-start: 6px; inset-inline-end: 6px; color: var(--mint); }
.video-preview-badge { inset-block-end: 6px; inset-inline-start: 6px; color: #dcd5ff; }

.video-skeleton { aspect-ratio: 16 / 10; border-radius: 12px; }
.video-inline-state { padding: 8px 0 12px; color: var(--muted); font-size: 12px; text-align: center; }
.video-state { margin-top: 10px; padding: 30px 18px; }
.video-state .btn { margin-top: 16px; }

.video-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(124, 92, 255, .12);
  color: #dcd5ff;
  font-size: 12px;
}

.video-preview-bar b { color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.video-preview-ended {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 209, 102, .25);
  border-radius: 10px;
  background: rgba(255, 209, 102, .08);
  color: var(--gold);
  font-size: 12px;
  line-height: 1.5;
  text-align: start;
}

.video-purchase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.video-purchase-price { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: start; }
.video-purchase-price span { color: var(--muted); font-size: 11px; }
.video-purchase-price b { color: var(--gold); font-size: 16px; }
.video-purchase .btn { flex-shrink: 0; margin: 0; }

.video-purchase-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  text-align: start;
}

.video-purchase-summary b { font-size: 14px; }
.video-purchase-summary span { color: var(--gold); font-size: 13px; font-weight: 800; }
.video-purchase-permanent { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.video-purchase-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.video-purchase-balance b { color: var(--text); font-size: 14px; }
.video-purchase-error { margin: 8px 0 0; color: #ff8b9d; font-size: 12px; line-height: 1.5; }
div.video-purchase-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.video-purchase-sheet .sheet-actions .btn { flex: 1; min-width: 0; }

[dir="rtl"] .video-preview-bar,
[dir="rtl"] .video-purchase,
[dir="rtl"] .video-purchase-balance { direction: rtl; }

/* ---------- Private chat ---------- */
.tab-float-circle { position: relative; }

.tab-unread {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(247, 37, 133, .45);
}

[dir="rtl"] .tab-unread { right: auto; left: -5px; }

.chat-page { display: flex; flex-direction: column; gap: 8px; }

.chat-section-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
}

.chat-section-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chat-section-tab.on {
  background: rgba(124, 247, 212, .12);
  color: var(--mint);
}

.chat-tab-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.chat-list { display: flex; flex-direction: column; gap: 6px; }

.chat-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  color: inherit;
  text-align: start;
  cursor: pointer;
  transition: .16s ease;
}

.chat-row:hover { background: rgba(255, 255, 255, .06); }
.chat-row:active { transform: scale(.995); }

/* 点击区域扩大到整行：按钮伪元素铺满整行，连头像一起响应 */
.chat-row .chat-row-open::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 14px;
}

.chat-avatar {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: visible;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 92, 255, .55), rgba(124, 247, 212, .3));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.chat-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-avatar .tab-icon-image { width: 100%; height: 100%; object-fit: cover; }

.chat-presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid #111625;
  border-radius: 50%;
  background: #737b8c;
  pointer-events: none;
}

.chat-presence-dot.online { background: #32d583; }

.chat-row-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-row-main b {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-main small {
  color: var(--muted-2);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10px;
}

.chat-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.chat-row-action {
  flex: 0 0 auto;
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
}

.chat-avatar-button { padding: 0; border: 0; cursor: pointer; font: inherit; }
.chat-row-open {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.chat-swipe-content,
.chat-friend-row { cursor: default; }
.chat-pinned { color: var(--mint); font-size: 9px; font-weight: 800; }

.chat-swipe-row { position: relative; width: 100%; overflow: hidden; border-radius: 14px; contain: layout paint; }
.chat-swipe-actions {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 168px;
  display: flex;
  align-items: stretch;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform .18s ease, visibility 0s linear .18s;
}
.chat-swipe-row.single-action .chat-swipe-actions { width: 84px; }
.chat-swipe-row.open .chat-swipe-actions,
.chat-swipe-row.swiping .chat-swipe-actions {
  visibility: visible;
  transition-delay: 0s, 0s;
}
.chat-swipe-row.open .chat-swipe-actions {
  pointer-events: auto;
  transform: translateX(0);
}
.chat-swipe-row.swiping .chat-swipe-actions { transition: none; }
[dir="rtl"] .chat-swipe-actions { transform: translateX(-100%); }
[dir="rtl"] .chat-swipe-row.open .chat-swipe-actions { transform: translateX(0); }
.chat-swipe-actions button {
  flex: 1;
  min-width: 0;
  padding: 6px;
  border: 0;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
}
.chat-swipe-actions button:disabled { opacity: .55; cursor: wait; }
.chat-swipe-pin { background: #6654d9; }
.chat-swipe-delete { background: #d94765; }
.chat-swipe-content {
  position: relative;
  z-index: 1;
  width: 100%;
  background-color: var(--bg-soft);
  touch-action: pan-y;
  transition: transform .18s ease, background .16s ease;
}
.chat-swipe-row.swiping .chat-swipe-content { transition: background .16s ease; }
.chat-swipe-row.open .chat-swipe-content,
.chat-swipe-row.open .chat-swipe-actions,
.chat-swipe-row.swiping .chat-swipe-content,
.chat-swipe-row.swiping .chat-swipe-actions { will-change: transform; }
.chat-swipe-row.open .chat-swipe-content { transform: translateX(-168px); }
.chat-swipe-row.single-action.open .chat-swipe-content { transform: translateX(-84px); }
[dir="rtl"] .chat-swipe-row.open .chat-swipe-content { transform: translateX(168px); }
[dir="rtl"] .chat-swipe-row.single-action.open .chat-swipe-content { transform: translateX(84px); }

.chat-friend-search { margin: 0 0 12px; }
.chat-friend-search input {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
}
.chat-friend-search input:focus { border-color: rgba(124, 247, 212, .55); }
.chat-search-status { padding: 22px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.chat-search-status.error { color: #ff9fb5; }

.chat-user-sheet { max-width: 360px; }
.chat-user-profile { display: flex; flex-direction: column; align-items: center; padding: 10px 0 6px; text-align: center; }
.chat-user-profile .chat-user-avatar { flex: 0 0 88px; width: 88px; height: 88px; font-size: 34px; }
.chat-user-profile h3 { margin: 14px 0 10px; font-size: 19px; }
.chat-user-uid {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 12px;
}
.chat-user-uid b { color: var(--text); font-size: 13px; }
.chat-profile-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chat-profile-vip,
.chat-profile-presence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
/* 老版 WebView 不支持 flex gap，两个徽章之间补间距 */
.chat-profile-badges > * + * { margin-inline-start: 8px; }
.chat-profile-vip { display: inline-flex; align-items: center; justify-content: center; color: var(--gold); border-color: rgba(245, 185, 23, .25); }
.chat-profile-vip-logo { display: block; width: 40px; height: 16px; object-fit: contain; }
.chat-profile-vip.vip-logo-bare { background: none; border-color: transparent; }
.chat-profile-presence.online { color: var(--mint); }

.chat-msg-avatar-button { padding: 0; border: 0; cursor: pointer; font-family: inherit; }
.chat-msg-avatar-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.group-link-avatar { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 14px; font-size: 19px; }
.group-link-avatar .avatar-img { border-radius: 14px; }
.group-link-messages { justify-content: center; padding: 24px 18px; }
.group-link-message { width: 100%; max-width: 330px; margin: auto; text-align: center; color: var(--muted); }
.group-link-message-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(255, 255, 255, .045);
  color: var(--mint);
  font-size: 30px;
  font-weight: 800;
}
.group-link-message h2 { margin: 0 0 12px; color: var(--text); font-size: 20px; line-height: 1.4; }
.group-link-message p { margin: 0; font-size: 13px; line-height: 1.7; }
.group-link-message .group-link-error { margin-bottom: 16px; color: #ff9fb5; }
.group-link-compose { display: block; padding: 12px; }
.group-link-compose .btn { width: 100%; min-height: 48px; }

.chat-group-share { margin: 4px 0 12px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.chat-group-share .chat-group-pick-title { margin-top: 0; }
.chat-group-share-link {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  direction: ltr;
  text-overflow: ellipsis;
}
.chat-group-share .toggle-field { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.chat-group-share-actions { display: flex; gap: 10px; }
.chat-group-share-actions .btn { flex: 1; min-width: 0; min-height: 40px; }
.chat-group-share-delete { color: #ff9fb5; }

.chat-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 2px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.chat-section-title span {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 9px;
}

.chat-add {
  display: flex;
  gap: 8px;
  margin: 2px 0 8px;
}

.chat-add input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.chat-add input:focus { border-color: rgba(124, 247, 212, .55); }

.chat-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  margin-bottom: 8px;
  border: 1px solid rgba(124, 247, 212, .25);
  border-radius: 14px;
  background: rgba(124, 247, 212, .06);
}

.chat-search-error {
  margin: 4px 2px 8px;
  color: #ff9fb5;
  font-size: 11px;
}

.chat-small-btn { padding: 8px 12px; font-size: 11px; }

.chat-request-row { align-items: flex-start; }

.chat-request-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-friend-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-friend-tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid rgba(124, 247, 212, .22);
  border-radius: 13px;
  background: rgba(124, 247, 212, .07);
  color: var(--mint);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.chat-friend-tools button:hover { background: rgba(124, 247, 212, .13); }
.chat-friend-tools svg { width: 20px; height: 20px; fill: currentColor; }

.friend-qr-sheet { max-width: 380px; text-align: center; }
.friend-qr-loading .skeleton { width: 240px; height: 240px; margin: 16px auto; border-radius: 20px; }
.friend-qr-error { padding: 24px 0; }
.friend-qr-profile { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 12px; }
.friend-qr-profile .chat-avatar { flex: 0 0 40px; width: 40px; height: 40px; }

.friend-qr-code {
  position: relative;
  width: min(68vw, 280px);
  aspect-ratio: 1;
  margin: 0 auto 16px;
  padding: 10px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(0, 0, 0, .25);
}

.friend-qr-image { display: block; width: 100%; height: 100%; }

.friend-qr-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 4px solid #fff;
  border-radius: 50%;
  background: #171b2a;
  color: #fff;
  font-size: 23px;
}

.friend-qr-center .avatar-img { width: 100%; height: 100%; object-fit: cover; }
.friend-qr-download { min-height: 44px; margin-top: 4px; }
.friend-qr-download:disabled { opacity: .6; cursor: wait; }

.friend-scan-sheet { max-width: 430px; }

.friend-native-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.friend-native-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 12px;
  border: 1px solid rgba(124, 247, 212, .24);
  border-radius: 15px;
  background: rgba(124, 247, 212, .07);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

.friend-native-options button:hover { background: rgba(124, 247, 212, .13); }
.friend-native-options button:disabled { opacity: .5; cursor: wait; }
.friend-native-options b { color: var(--mint); font-size: 13px; }
.friend-native-options span { color: var(--muted); font-size: 10px; line-height: 1.5; }

.friend-qr-upload {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  border: 1px dashed rgba(124, 247, 212, .45);
  border-radius: 16px;
  background: rgba(124, 247, 212, .05);
  cursor: pointer;
}

.friend-qr-upload:hover { background: rgba(124, 247, 212, .1); }
.friend-qr-upload.disabled { opacity: .55; pointer-events: none; }
.friend-qr-upload b { color: var(--mint); font-size: 14px; }
.friend-qr-upload span { color: var(--muted); font-size: 11px; }
.friend-qr-file-input { display: none; }

.friend-qr-preview {
  display: flex;
  justify-content: center;
  max-height: 190px;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}

.friend-qr-preview img { max-width: 100%; max-height: 190px; object-fit: contain; }

.friend-scan-status { margin: 12px 2px; color: var(--muted); font-size: 12px; text-align: center; }
.friend-scan-status.error { color: #ff9fb5; }

body.chat-conversation-open { overflow: hidden; }

.chat-conversation-stage {
  position: fixed;
  animation: chatConversationIn .18s ease-out;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  /* 键盘弹起时 WebView 以不均匀步长收缩布局，输入框会一顿一顿上跳；
     用 height 过渡把这些离散的 resize 事件插值成连续的缓动上移，观感更顺。 */
  transition: height .26s cubic-bezier(.22, .8, .24, 1);
  overflow: hidden;
  background: var(--bg);
}

.chat-window {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
  overflow: hidden;
}

.chat-conversation-stage .chat-window {
  width: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: #070a12;
}

.chat-window-background {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #070a12;
}

.chat-window-background img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
}

.chat-window-background.has-image img { opacity: 1; visibility: visible; }

.chat-window-background::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(7, 10, 18, .36);
}

.chat-window-head,
.chat-pinned-bar,
.chat-messages { position: relative; z-index: 1; }

.chat-conversation-stage .chat-window-head {
  flex: 0 0 auto;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: #090d17;
}

.chat-conversation-stage .chat-messages {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.chat-conversation-stage .chat-compose {
  flex: 0 0 auto;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: #090d17;
}

.chat-window-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 24, .55);
}

.chat-window-head .back-btn {
  flex: 0 0 auto;
  /* 老版 WebView 不支持 flex gap，返回按钮与标题间距用 margin 兜底 */
  margin-inline-end: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}

.chat-window-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-window-title b {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-window-title small {
  min-height: 14px;
  color: var(--muted);
  font-size: 10px;
}

.chat-window-title small.online,
.chat-window-title small.typing { color: var(--mint); }

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-messages::-webkit-scrollbar { width: 0; height: 0; display: none; }
.chat-messages > * + * { margin-top: 8px; }
.chat-messages > .chat-msg-row.chat-group-middle,
.chat-messages > .chat-msg-row.chat-group-last { margin-top: 2px; }

.chat-day {
  align-self: center;
  margin: 4px 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(9, 13, 23, .68);
  color: #c2cbe0;
  font-size: 10px;
  font-weight: 700;
}

.chat-msg-row { display: flex; justify-content: flex-start; align-items: flex-end; gap: 8px; touch-action: pan-y; }
.chat-msg-row.mine { justify-content: flex-end; }

.chat-msg-row.chat-msg-system {
  justify-content: center;
  padding: 2px 16px;
  text-align: center;
}

.chat-msg-system-text {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-msg-stack {
  min-width: 0;
  max-width: 82%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.chat-msg-row.mine .chat-msg-stack { align-items: flex-end; }
.chat-msg-stack .chat-bubble { max-width: 100%; }

.chat-msg-avatar {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-top: 0;
  display: grid;
  visibility: hidden;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(124, 92, 255, .55), rgba(124, 247, 212, .3));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.chat-msg-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-msg-row.chat-group-single .chat-msg-avatar,
.chat-msg-row.chat-group-last .chat-msg-avatar { visibility: visible; }

.chat-bubble {
  max-width: 100%;
  padding: 7px 11px 5px;
  border-radius: 18px 18px 18px 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .12);
  overflow-wrap: anywhere;
}

.chat-msg-row.mine .chat-bubble {
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, var(--violet), #5b3df5);
}

.chat-msg-row.chat-group-first:not(.mine) .chat-bubble { border-bottom-left-radius: 8px; }
.chat-msg-row.chat-group-middle:not(.mine) .chat-bubble {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.chat-msg-row.chat-group-last:not(.mine) .chat-bubble { border-top-left-radius: 8px; }
.chat-msg-row.chat-group-first.mine .chat-bubble { border-bottom-right-radius: 8px; }
.chat-msg-row.chat-group-middle.mine .chat-bubble {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.chat-msg-row.chat-group-last.mine .chat-bubble { border-top-right-radius: 8px; }

[dir="rtl"] .chat-bubble { border-radius: 18px 18px 6px 18px; }
[dir="rtl"] .chat-msg-row.mine .chat-bubble { border-radius: 18px 18px 18px 6px; }
[dir="rtl"] .chat-msg-row.chat-group-first:not(.mine) .chat-bubble { border-bottom-right-radius: 8px; }
[dir="rtl"] .chat-msg-row.chat-group-middle:not(.mine) .chat-bubble {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
[dir="rtl"] .chat-msg-row.chat-group-last:not(.mine) .chat-bubble { border-top-right-radius: 8px; }
[dir="rtl"] .chat-msg-row.chat-group-first.mine .chat-bubble { border-bottom-left-radius: 8px; }
[dir="rtl"] .chat-msg-row.chat-group-middle.mine .chat-bubble {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
[dir="rtl"] .chat-msg-row.chat-group-last.mine .chat-bubble { border-top-left-radius: 8px; }

.chat-msg-text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* 引用回复：气泡内的被引用消息 */
.chat-quote {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 5px 8px;
  border: 0;
  border-inline-start: 3px solid rgba(124, 247, 212, .85);
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  text-align: start;
  font-family: inherit;
  cursor: pointer;
}

.chat-quote b {
  display: block;
  margin-bottom: 1px;
  font-size: 11px;
  font-weight: 800;
  color: var(--mint);
}

.chat-quote span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg-row.mine .chat-quote {
  border-inline-start-color: rgba(255, 255, 255, .9);
  background: rgba(0, 0, 0, .18);
}

.chat-msg-row.mine .chat-quote b { color: #fff; }

.chat-msg-row.mine .chat-quote span { color: rgba(255, 255, 255, .82); }

.chat-msg-flash .chat-bubble { animation: chatMsgFlash 1.1s ease; }

@keyframes chatMsgFlash {
  0%, 100% { box-shadow: none; }
  30%, 70% { box-shadow: 0 0 0 2px rgba(124, 247, 212, .85); }
}

/* 置顶消息横幅 */
.chat-pinned-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(124, 92, 255, .16), rgba(124, 247, 212, .08));
  border-bottom: 1px solid var(--line);
}

.chat-pinned-ico {
  flex: 0 0 auto;
  font-size: 14px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3));
}

.chat-pinned-track {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-pinned-track::-webkit-scrollbar { display: none; }

.chat-pinned-item {
  flex: 0 0 auto;
  max-width: 62%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 5px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  text-align: start;
  font-family: inherit;
  cursor: pointer;
  transition: background .16s ease;
}

.chat-pinned-item:hover { background: rgba(255, 255, 255, .14); }

.chat-pinned-who {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--mint);
}

.chat-pinned-preview {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 气泡上的置顶徽标 */
.chat-msg-pin-badge {
  font-size: 10px;
  margin: 0 1px;
  line-height: 1;
}

.chat-msg-quoted-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 5px;
  padding: 2px 6px;
  border: 1px solid rgba(124, 247, 212, .22);
  border-radius: 999px;
  background: rgba(124, 247, 212, .08);
  color: var(--mint);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.chat-msg-row.mine .chat-msg-quoted-badge {
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.chat-msg-edited { font-style: italic; opacity: .85; }

/* 长按操作悬浮在消息上方，透明层接住任意外部点击，避免误触底层控件。 */
.chat-msg-actions-layer {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
}

.chat-msg-actions-dismiss {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  touch-action: none;
}

.chat-msg-inline-actions {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 0;
  height: 0;
}

@keyframes chatConversationIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes chatActionsIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-enter .chat-page { animation: chatListIn .18s ease-out; }

@keyframes chatListIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.chat-msg-inline-actions::-webkit-scrollbar { display: none; }

.chat-msg-action {
  flex: 0 0 auto;
  min-width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.chat-msg-action:hover,
.chat-msg-action.active { background: rgba(255, 255, 255, .08); }
.chat-msg-like-action { color: #ff9fbd; background: rgba(247, 37, 133, .1); }
.chat-msg-like-action.active { color: #ff8fb3; background: rgba(247, 37, 133, .2); }
.chat-msg-action.danger { color: #ff9fb5; }
.chat-msg-action.danger:hover { background: rgba(247, 37, 133, .12); }

.chat-msg-action-ico {
  font-size: 17px;
  line-height: 1;
  text-align: center;
}

/* 点赞头像预览及完整列表 */
.chat-like-summary {
  direction: ltr;
  min-height: 26px;
  display: flex;
  align-items: center;
  margin: 0 4px;
  padding: 1px 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chat-like-summary:hover { background: rgba(255, 255, 255, .05); }

.chat-like-avatar {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #090d17;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 92, 255, .65), rgba(124, 247, 212, .35));
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.chat-like-avatar + .chat-like-avatar { margin-left: -8px; }
.chat-like-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 消息表情反应条（气泡上方） */
.chat-reaction-bar {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: linear-gradient(170deg, #1a2238, #101627);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  animation: chatActionsIn .14s ease-out;
}
.chat-reaction-emoji {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.chat-reaction-emoji:hover { background: rgba(255, 255, 255, .1); }
.chat-reaction-emoji:active { transform: scale(.9); }
.chat-reaction-emoji.active {
  background: rgba(247, 37, 133, .22);
  box-shadow: inset 0 0 0 1px rgba(247, 37, 133, .5);
}

/* 消息操作菜单（气泡下方，行式：左标签右图标） */
.chat-msg-action-menu {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(170deg, #1a2238, #101627);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  animation: chatActionsIn .14s ease-out;
}
.chat-msg-action-menu .chat-msg-action {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  gap: 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
}
.chat-msg-action-menu .chat-msg-action:last-child { border-bottom: 0; }
.chat-msg-action-menu .chat-msg-action-ico {
  order: 2;
  margin-inline-start: auto;
  font-size: 16px;
}

/* 气泡下方的反应汇总 pill */
.chat-reactions-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 4px 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
}
.chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font-size: 11px;
  color: var(--muted);
}
.chat-reaction-pill.active { background: rgba(124, 92, 255, .22); color: var(--text); }
.chat-reaction-pill-emoji { font-size: 14px; line-height: 1; }
.chat-reaction-pill-count { font-weight: 700; }

/* 前台在线时的站内消息通知横幅 */
.chat-in-app-notice {
  position: fixed;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2000;
  transform: translateY(-120%);
  transition: transform .25s ease;
  pointer-events: none;
}
.chat-in-app-notice.show { transform: translateY(0); pointer-events: auto; }
.chat-in-app-notice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(170deg, #1a2238, #101627);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.chat-in-app-notice-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  font-size: 18px;
}
.chat-in-app-notice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-in-app-notice-text b { font-size: 13px; }
.chat-in-app-notice-text span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-background-entry {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.chat-background-entry:hover { border-color: rgba(124, 247, 212, .35); }
.chat-background-entry > span:last-child { color: var(--mint); font-size: 20px; line-height: 1; }
[dir="rtl"] .chat-background-entry > span:last-child { transform: scaleX(-1); }

.chat-background-sheet { max-width: 420px; }
.chat-background-preview {
  position: relative;
  height: 180px;
  margin: 4px 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(240px 130px at 15% 0%, rgba(124, 92, 255, .2), transparent 70%),
    #070a12;
}
.chat-background-preview img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
}
.chat-background-preview.has-image img { opacity: 1; visibility: visible; }
.chat-background-preview::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(7, 10, 18, .3);
}
.chat-background-preview > span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(7, 10, 18, .72);
  color: #d7deef;
  font-size: 11px;
}
[dir="rtl"] .chat-background-preview > span { left: auto; right: 12px; }
.chat-background-current { margin-bottom: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.chat-background-actions { display: flex; flex-direction: column; }
.chat-background-actions .btn { width: 100%; margin: 0; }
.chat-background-actions .btn + .btn { margin-top: 16px; }
.chat-background-hint { margin: 10px 0 0; color: var(--muted-2); font-size: 11px; text-align: center; }
.chat-background-status { margin: 10px 0 0; font-size: 12px; text-align: center; }
.chat-background-status.error { color: #ff9fb5; }
.chat-background-status.success { color: var(--mint); }

/* 资料页 / 群信息页的免打扰开关 */
.chat-mute-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}
.chat-mute-label { font-size: 14px; font-weight: 600; color: var(--text); }
.chat-mute-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  cursor: pointer;
  transition: background .18s ease;
}
.chat-mute-switch.on { background: var(--mint); }
.chat-mute-switch:disabled { opacity: .6; cursor: default; }
.chat-mute-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .18s ease;
}
.chat-mute-switch.on .chat-mute-switch-knob { transform: translateX(18px); }

.chat-like-more {
  flex: 0 0 auto;
  margin-left: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chat-like-list-sheet { max-width: 360px; }
.chat-like-list { max-height: min(420px, 60vh); overflow-y: auto; }

.chat-like-list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.chat-like-list-row:last-child { border-bottom: 0; }
.chat-like-list-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.chat-like-list-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 92, 255, .55), rgba(124, 247, 212, .3));
  font-size: 17px;
}

.chat-like-list-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-like-list-status { padding: 30px 0 20px; color: var(--muted); font-size: 13px; text-align: center; }
.chat-edit-strip { border-inline-start-color: var(--violet); }

.chat-msg-image-btn {
  display: block;
  width: min(230px, 60vw);
  max-width: 100%;
  max-height: 300px;
  aspect-ratio: var(--chat-image-ratio, 4 / 3);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  cursor: zoom-in;
}

.chat-msg-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 12px;
  object-fit: cover;
  transition: opacity .18s ease;
}

/* 图片消息加载中：骨架流光 + 中心转圈，加载完成后淡入原图 */
.chat-msg-image-btn.is-loading {
  position: relative;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, .06) 30%, rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, .06) 70%);
  background-size: 200% 100%;
  animation: chatImgShimmer 1.2s linear infinite;
}

.chat-msg-image-btn.is-loading .chat-msg-img { opacity: 0; }

.chat-msg-image-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--mint);
  animation: chatImgSpin .8s linear infinite;
}

@keyframes chatImgSpin { to { transform: rotate(360deg); } }

@keyframes chatImgShimmer {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

#modal-root[data-modal="chat-image-preview"] .modal-backdrop {
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, .94);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.chat-image-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.chat-image-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.chat-image-preview-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(10, 14, 24, .82);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.chat-msg-meta {
  display: inline;
  float: right;
  margin-inline-start: 8px;
  margin-top: 4px;
  color: rgba(255, 255, 255, .55);
  font-size: 9px;
  white-space: nowrap;
}

/* 文字消息的时间跟在最后一行末尾并向下微移，空间不足时整体换行。 */
.chat-msg-body-text .chat-msg-meta {
  display: inline-block;
  position: relative;
  top: 2px;
  float: none;
  margin-top: 0;
  vertical-align: bottom;
}

.chat-msg-row.failed .chat-bubble { opacity: .65; }
.chat-msg-row.failed .chat-msg-meta span { color: #ff9fb5; }
.chat-msg-meta [data-chat-msg-state][data-read] {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
}
.chat-msg-meta [data-chat-msg-state][data-read="1"] { color: var(--mint); }
.chat-msg-meta [data-chat-msg-state][data-read="0"] { color: rgba(255, 255, 255, .72); }

.chat-compose {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: rgba(10, 14, 24, .6);
}

.chat-compose input[type="text"],
.chat-compose input:not([type]) {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.chat-compose input:focus { border-color: rgba(124, 247, 212, .55); }

/* 引用回复：输入框上方的引用条 */
.chat-compose.has-reply { flex-wrap: wrap; row-gap: 6px; }

.chat-reply-strip {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border-inline-start: 3px solid var(--mint);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
}

.chat-reply-strip-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-reply-strip-body b {
  font-size: 11px;
  color: var(--mint);
  font-weight: 800;
}

.chat-reply-strip-body span {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-reply-strip-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.chat-icon-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  font-size: 16px;
  cursor: pointer;
}

.chat-icon-btn:disabled { opacity: .5; cursor: default; }

.chat-voice-start svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-record-status {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-record-status b { color: #ff9fb5; font-size: 12px; }
.chat-record-status span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.chat-record-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6685;
  box-shadow: 0 0 0 5px rgba(255, 102, 133, .12);
  animation: chat-record-pulse 1.2s ease-in-out infinite;
}

/* 录音条按钮不被压缩，避免 Stop 按钮被挤出可视区 */
.chat-voice-recording .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@keyframes chat-record-pulse {
  50% { opacity: .45; box-shadow: 0 0 0 8px rgba(255, 102, 133, .04); }
}

.chat-voice-draft {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-voice-draft-bubble {
  width: auto;
  min-width: 118px;
  max-width: 220px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
}

/* 语音消息：微信式气泡，宽度随时长变化 */
.chat-bubble.voice { width: auto; max-width: 82%; }
.chat-msg-stack .chat-bubble.voice { max-width: 100%; }

.chat-voice-bubble {
  display: flex;
  align-items: center;
  width: 120px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.chat-voice-icon {
  flex: 0 0 21px;
  display: block;
  width: 21px;
  height: 21px;
}

.chat-voice-icon svg { display: block; width: 100%; height: 100%; }

.chat-voice-dur {
  flex: 1 1 auto;
  padding-inline-start: 10px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: end;
  opacity: 1;
}

.chat-msg-row.mine .chat-voice-bubble { flex-direction: row-reverse; }
.chat-msg-row.mine .chat-voice-icon svg { transform: scaleX(-1); }
.chat-msg-row.mine .chat-voice-dur {
  padding-inline-start: 0;
  padding-inline-end: 10px;
  text-align: start;
  color: #fff;
}

.chat-voice-wave .w1,
.chat-voice-wave .w2 { opacity: .55; }
.chat-voice-bubble.is-playing .chat-voice-wave .w1 { animation: chatVoiceWave .9s ease-in-out infinite; }
.chat-voice-bubble.is-playing .chat-voice-wave .w2 { animation: chatVoiceWave .9s ease-in-out .18s infinite; }

@keyframes chatVoiceWave {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

.chat-voice-error { padding: 2px 0; color: var(--muted); font-size: 11px; }

.chat-msg-row.mine .chat-voice-error { color: #fff; }

.chat-load-earlier {
  align-self: center;
  margin: 2px 0 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.chat-empty-small { padding: 28px 16px; }
.chat-empty-small .chat-empty-ico { font-size: 26px; margin-bottom: 4px; }

@media (max-width: 420px) {
  .chat-msg-image-btn { width: min(200px, 58vw); }
  .chat-voice-draft-compose { flex-wrap: wrap; }
  .chat-voice-draft-compose .chat-voice-draft { flex-basis: 100%; order: -1; }
  .chat-voice-draft-compose > .btn { flex: 1; }
}

/* 旧版 Android WebView（Chrome 83 及以下）不支持 aspect-ratio 和 inset 简写。 */
@supports not (aspect-ratio: 16 / 10) {
  /* 旧内核把 gap 用于 Grid，但不支持 Flex gap；移除后用 margin 还原。 */
  .topbar-inner,
  .brand,
  .top-actions,
  .coin-pill,
  .cat-row,
  .cat-btn,
  .chips,
  .tabs,
  .filter-bar,
  .filter-select,
  .games-layout,
  .provider-rail,
  .vendor-list,
  .sheet-head,
  .sheet-actions,
  .auth-tabs,
  .code-row,
  .share-thumbs,
  .invite-actions,
  .banner-dots,
  .btn {
    gap: 0;
  }

  .topbar-inner > .brand { margin-inline-end: 16px; }
  .brand > * + * { margin-inline-start: 10px; }
  .top-actions > * + * { margin-inline-start: 8px; }
  .coin-pill > * + * { margin-inline-start: 7px; }
  .cat-row > * + *,
  .chips > * + * { margin-inline-start: 8px; }
  .cat-btn > * + * { margin-top: 6px; }
  .tabs > * + *,
  .auth-tabs > * + * { margin-inline-start: 6px; }
  .filter-bar > * + * { margin-inline-start: 10px; }
  .filter-select > * + *,
  .btn > * + * { margin-inline-start: 8px; }
  .games-layout > .provider-rail { margin-inline-end: 14px; }
  .provider-rail > * + *,
  .vendor-list > * + * { margin-top: 8px; }
  .sheet-head > * + * { margin-inline-start: 12px; }
  .sheet-actions > * + *,
  .share-thumbs > * + *,
  .invite-actions > * + * { margin-inline-start: 10px; }
  .code-row > * + * { margin-inline-start: 8px; }
  .banner-dots > * + * { margin-inline-start: 5px; }

  @media (max-width: 420px) {
    .topbar-inner > .brand { margin-inline-end: 8px; }
    .top-actions > * + * { margin-inline-start: 6px; }
    .games-layout > .provider-rail { margin-inline-end: 8px; }
  }

  .banner-slide {
    display: block;
    padding-top: 35.714286%;
  }

  .banner-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  /* Promo 图：旧内核没有 aspect-ratio，用 padding-top 撑出固定比例，避免高度塌陷后跳动 */
  .promo-banner,
  .promo-detail-hero {
    position: relative;
    display: block;
    padding-top: 35.714286%;
  }

  .promo-banner img,
  .promo-detail-hero img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .game-cover,
  .video-cover,
  .detail-cover {
    display: block;
    padding-top: 62.5%;
  }

  .lobby-cover {
    display: block;
    padding-top: 133.333333%;
  }

  .cover-img,
  .game-cover::after,
  .video-play {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  .game-emoji,
  .lobby-emoji,
  .detail-cover > span {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .video-cover img {
    position: absolute;
    top: 0;
    left: 0;
  }
}

/* 群组聊天 */
.chat-section-create {
  flex: 0 0 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(124, 247, 212, .08);
  color: var(--mint);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.chat-group-avatar {
  display: grid;
  place-items: center;
  background: rgba(124, 247, 212, .14);
  color: var(--mint);
  font-size: 18px;
  border-radius: 14px;
}

.chat-group-avatar .avatar-img { border-radius: 14px; }

.chat-group-avatar-edit {
  padding: 0;
  border: 0;
  cursor: pointer;
}

.chat-group-avatar-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: #04211a;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.chat-group-count {
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.chat-window-info {
  margin-left: auto;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.chat-msg-sender {
  display: none;
  margin-bottom: 3px;
  color: #8dd8ff;
  font-size: 10px;
  font-weight: 700;
}
.chat-msg-row.chat-group-single .chat-msg-sender,
.chat-msg-row.chat-group-first .chat-msg-sender { display: block; }

.chat-group-sheet { max-width: 420px; max-height: 82vh; overflow-y: auto; }
.chat-group-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}
.chat-group-summary .chat-group-avatar { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; font-size: 24px; }
.chat-group-summary .chat-group-avatar .avatar-img { border-radius: 16px; }
.chat-group-summary b { display: block; font-size: 16px; }
.chat-group-summary small { color: var(--muted); font-size: 12px; }

.chat-group-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.chat-group-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.chat-group-form input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: inherit;
  font-size: 14px;
}
.chat-group-form .toggle-field { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.chat-group-hint { margin: -4px 0 4px; font-size: 11px; line-height: 1.5; }
.chat-group-error { margin: 0; color: var(--pink); font-size: 12px; font-weight: 700; }

.chat-group-pick-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chat-group-pick-title span { color: var(--mint); }

.chat-group-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 36vh; overflow-y: auto; }
.chat-group-pick-list.compact { max-height: 30vh; }

.chat-group-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.chat-group-pick.on { border-color: var(--mint); background: rgba(124, 247, 212, .08); }
.chat-group-pick-name { flex: 1; text-align: left; font-size: 13px; font-weight: 700; }
[dir="rtl"] .chat-group-pick-name { text-align: right; }
.chat-group-pick-check { color: var(--mint); font-size: 14px; font-weight: 800; }

.chat-group-member { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.chat-group-member-name { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.chat-group-owner-tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(124, 247, 212, .14);
  color: var(--mint);
  font-size: 9px;
  font-weight: 800;
}
.chat-group-remove,
.chat-group-add {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.chat-group-add { color: var(--mint); border-color: rgba(124, 247, 212, .35); }
.chat-group-footer { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.chat-group-footer .chat-group-invite,
.chat-group-footer .chat-group-leave,
.chat-group-footer .chat-group-dissolve { display: flex; width: 100%; margin: 0; }

.chat-group-invite { margin-bottom: 10px; }

.chat-group-leave { margin-top: 12px; }
.chat-group-dissolve { justify-content: center; color: var(--pink); border-color: rgba(217, 71, 101, .45); }
.chat-group-empty { margin: 4px 0 10px; font-size: 12px; }

/* WebView 83：完整补齐后追加模块的 Flex 间距，并降低滚动重绘成本。 */
@supports not (aspect-ratio: 16 / 10) {
  .games-layout > .provider-rail { margin: 0; margin-inline-end: 10px; }

  .mine-head,
  .uid-row,
  .balance-top,
  .balance-value,
  .balance-amount-row,
  .mine-vip-button,
  .mine-menu,
  .mine-item,
  .nickname-row,
  .checkin-preview,
  .chat-switch,
  .video-cats,
  .video-detail-meta,
  .video-preview-bar,
  .video-purchase,
  .video-purchase-price,
  .video-purchase-summary,
  .video-purchase-balance,
  div.video-purchase-error,
  .chat-page,
  .chat-section-tabs,
  .chat-section-tab,
  .chat-list,
  .chat-row,
  .chat-row-main,
  .chat-row-meta,
  .chat-row-open,
  .chat-add,
  .chat-search-result,
  .chat-request-actions,
  .chat-friend-tools button,
  .chat-user-uid,
  .chat-section-title,
  .chat-window-head,
  .chat-window-title,
  .chat-messages,
  .chat-msg-row,
  .chat-msg-stack,
  .chat-pinned-bar,
  .chat-pinned-track,
  .chat-pinned-item,
  .chat-msg-inline-actions,
  .chat-reaction-bar,
  .chat-reactions-summary,
  .chat-reaction-pill,
  .chat-in-app-notice-btn,
  .chat-in-app-notice-text,
  .chat-mute-row,
  .chat-msg-action,
  .chat-like-list-row,
  .chat-msg-meta,
  .chat-compose,
  .chat-reply-strip,
  .chat-record-status,
  .chat-voice-draft,
  .chat-voice-title,
  .chat-group-summary,
  .chat-group-form,
  .chat-group-form label,
  .chat-group-form .toggle-field,
  .chat-group-pick-list,
  .chat-group-pick,
  .chat-group-member,
  .chat-group-member-name,
  .chat-group-footer,
  .invite-steps,
  .invite-step,
  .invite-link,
  .team-total,
  .team-total-main,
  .team-summary,
  .team-summary div,
  .stats-range,
  .stats-level-head,
  .stats-cell,
  .stats-commission-row,
  .friend-qr-profile,
  .friend-native-options button,
  .friend-qr-upload {
    gap: 0;
  }

  .mine-head > * + * { margin-inline-start: 14px; }
  .uid-row > * + *,
  .balance-value > * + *,
  .nickname-row > * + *,
  .chat-add > * + *,
  .chat-section-title > * + *,
  .chat-compose > * + *,
  .chat-reply-strip > * + *,
  .chat-voice-draft > * + *,
  .chat-pinned-bar > * + *,
  .chat-pinned-track > * + *,
  .video-cats > * + * { margin-inline-start: 8px; }
  .balance-top > * + *,
  .video-purchase-balance > * + *,
  div.video-purchase-error > * + *,
  .chat-search-result > * + *,
  .chat-window-head > * + * { margin-inline-start: 10px; }
  .balance-amount-row > * + *,
  .chat-section-tab > * + *,
  .chat-msg-meta > * + * { margin-inline-start: 6px; }
  .mine-vip-button > * + *,
  .mine-item > * + *,
  .chat-voice-title > * + *,
  .video-preview-bar > * + *,
  .chat-group-summary > * + * { margin-inline-start: 12px; }
  .mine-quick-row .mine-item > * + * { margin-inline-start: 8px; }
  .chat-switch > * + * { margin-inline-start: 12px; }
  .chat-section-tabs > * + * { margin-inline-start: 8px; }
  .chat-row > * + *,
  .chat-row-open > * + *,
  .chat-like-list-row > * + * { margin-inline-start: 11px; }
  .chat-friend-tools button > * + * { margin-inline-start: 8px; }
  .chat-user-uid > * + * { margin-inline-start: 9px; }
  .chat-msg-row > * + *,
  .chat-group-pick > * + *,
  .chat-group-member > * + *,
  .chat-group-member-name > * + *,
  .friend-qr-profile > * + * { margin-inline-start: 10px; }
  .chat-msg-inline-actions > * + * { margin-inline-start: 0; }
  .chat-reaction-bar > * + * { margin-inline-start: 2px; }
  .chat-reactions-summary > * + * { margin-inline-start: 4px; }
  .chat-reaction-pill > * + * { margin-inline-start: 3px; }
  .chat-in-app-notice-btn > * + * { margin-inline-start: 10px; }
  .chat-in-app-notice-text > * + * { margin-top: 2px; }
  .chat-mute-row > * + * { margin-inline-start: 12px; }
  .chat-msg-action-menu .chat-msg-action > * + * { margin-inline-start: 10px; }
  .invite-step > * + * { margin-inline-start: 12px; }
  .invite-link > * + *,
  .stats-range > * + *,
  .stats-level-head > * + * { margin-inline-start: 8px; }
  .team-total-main > * + * { margin-inline-start: 24px; }
  .team-summary div > * + * { margin-inline-start: 6px; }
  .stats-commission-row > * + * { margin-inline-start: 10px; }
  .stats-range > .stats-range-text { margin-inline-start: auto; }
  .video-detail-meta > * + *,
  .video-purchase > * + *,
  .checkin-preview > * + * { margin-inline-start: 14px; }

  .mine-menu > * + * { margin-top: 12px; }
  .chat-page > * + *,
  .chat-messages > * + * { margin-top: 8px; }
  .chat-list > * + * { margin-top: 6px; }
  .chat-row-main > * + * { margin-top: 3px; }
  .chat-msg-stack > * + * { margin-top: 2px; }
  .invite-steps > * + *,
  .chat-group-footer > * + * { margin-top: 12px; }
  .chat-group-footer > .chat-group-invite { margin-top: 0; }
  .chat-group-footer > * + .chat-group-leave { margin-top: 12px; }
  .team-total > * + * { margin-top: 6px; }
  .team-summary > * + * { margin-top: 8px; }
  .stats-cell > * + * { margin-top: 4px; }
  .chat-row-meta > * + * { margin-top: 5px; }
  .chat-window-title > * + * { margin-top: 2px; }
  .chat-request-actions > * + * { margin-top: 6px; }
  .chat-record-status > * + *,
  .chat-pinned-item > * + *,
  .chat-msg-action > * + *,
  .video-purchase-price > * + * { margin-top: 3px; }
  .video-purchase-summary > * + *,
  .chat-group-form > * + *,
  .chat-group-form label > * + * { margin-top: 6px; }
  .chat-group-pick-list > * + * { margin-top: 6px; }
  .friend-native-options button > * + *,
  .friend-qr-upload > * + * { margin-top: 6px; }

  .chat-group-form .toggle-field > * + * {
    margin-top: 0;
    margin-inline-start: 8px;
  }
  .chat-compose > .chat-reply-strip {
    margin-inline-start: 0;
    margin-bottom: 6px;
  }
  .chat-window-head > .chat-window-info,
  .sheet-head > .sheet-close { margin-inline-start: auto; }

  .vip-hero-top,
  .vip-total,
  .vip-progress-label,
  .vip-level-row,
  .vip-level-row > .vip-level-side,
  .tx-list,
  .tx-top,
  .tx-type,
  .tx-mid,
  .tx-meta,
  .order-history-list,
  .order-history-top,
  .order-history-game,
  .order-history-game-copy,
  .order-history-amounts > div,
  .share-actions,
  .cards-head,
  .tab { gap: 0; }

  .vip-hero-top > * + * { margin-inline-start: 16px; }
  .vip-total > * + *,
  .vip-progress-label > * + * { margin-inline-start: 12px; }
  .vip-level-row > .vip-level-mark { margin-inline-end: 12px; }
  .vip-level-row > .vip-level-side { margin-inline-start: auto; }
  .vip-level-row > .vip-level-side > * + * { margin-top: 10px; }
  .tx-list > * + *,
  .order-history-list > * + * { margin-top: 12px; }
  .tx-top > * + *,
  .tx-mid > * + *,
  .order-history-top > * + * { margin-inline-start: 10px; }
  .tx-type > * + *,
  .order-history-game > * + * { margin-inline-start: 8px; }
  .tx-meta > * { margin-top: 6px; margin-inline-end: 12px; }
  .order-history-game-copy > * + * { margin-top: 5px; }
  .order-history-amounts > div > * + * { margin-inline-start: 8px; }
  .share-actions > .btn + .btn { margin-inline-start: 10px; }
  .cards-head > * + * { margin-inline-start: 12px; }
  .cards-head > .card-add-btn { margin-inline-start: auto; }
  .tab > * + * { margin-top: 3px; }

  .topbar,
  .tabbar,
  .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .topbar { background: rgba(7, 10, 18, .98); }
  .tabbar { background: #090d17; }
  .page-enter { animation: pageFade .12s ease-out both; }
  .page-enter .chat-page,
  .chat-conversation-stage,
  .chat-msg-inline-actions,
  .cover-img,
  .skeleton { animation: none; }
  .cat-btn,
  .chat-row,
  .chat-circle,
  .chat-swipe-content { transition: none; }
  .cat-btn .ico,
  .chat-pinned-ico { filter: none; }
}

/* ---------- UGC: publish & my videos ---------- */
.btn-sm { padding: 6px 12px; font-size: 13px; }
.publish-page, .myvideos-page { padding-bottom: 40px; }
.publish-hint { color: var(--muted); font-size: 13px; margin: 0 14px 18px; line-height: 1.6; }
/* 老版 Android WebView(Chrome 83) 不支持 flex 的 gap，间距一律用 margin，避免字段贴在一起 */
.publish-form { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; margin: 0 14px; display: block; }
.publish-form > * + * { margin-top: 20px; }
.publish-field { display: block; }
.publish-field > span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.publish-field input[type="text"], .publish-field input[type="number"], .publish-field textarea {
  width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px 12px; font-size: 14px; outline: none;
}
.publish-field textarea { resize: vertical; line-height: 1.6; }
.publish-field small.muted { display: block; margin-top: 8px; font-size: 12px; line-height: 1.5; }
/* 自研深色分类选择器，替代 WebView 里会弹白色系统列表的原生 select */
.cat-picker { position: relative; margin-top: 8px; }
.cat-picker-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; box-sizing: border-box;
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px; font-size: 14px; text-align: start;
  cursor: pointer; outline: none;
}
.cat-picker-btn.is-empty .cat-picker-text { color: var(--muted-2); }
.cat-picker-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-picker-arrow { flex: 0 0 auto; margin-inline-start: 10px; font-size: 11px; color: var(--muted); transition: transform .18s ease; }
.cat-picker.open .cat-picker-arrow { transform: rotate(180deg); }
.cat-picker-list {
  display: none; position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 240px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px;
}
.cat-picker.open .cat-picker-list { display: block; }
.cat-picker-opt {
  display: block; width: 100%; box-sizing: border-box;
  border: 0; background: transparent; color: var(--text);
  padding: 10px; border-radius: 8px; font-size: 14px; text-align: start; cursor: pointer;
}
.cat-picker-opt + .cat-picker-opt { margin-top: 2px; }
.cat-picker-opt.on { background: rgba(124, 247, 212, .12); color: var(--mint); }
.cat-picker-opt:active { background: rgba(255, 255, 255, .06); }
.publish-upload-row { display: block; }
.publish-upload-row > * + * { margin-top: 10px; }
.publish-upload-label { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.publish-upload-label .publish-pick-btn { margin-inline-start: 10px; }
.publish-cover-preview { display: block; width: 120px; height: 68px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.publish-progress { width: 100%; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.publish-progress-bar { height: 100%; background: var(--mint); transition: width .2s ease; }
.publish-file-done { display: inline-block; color: #22c55e; font-size: 13px; font-weight: 600; }
.publish-field-error { color: #ef4444; font-size: 12px; }
.publish-preview-row { display: flex; align-items: center; flex-wrap: wrap; }
.publish-preview-row > * + * { margin-inline-start: 12px; }
.publish-inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.publish-inline-field input { width: 90px; margin-inline-start: 8px; }
.publish-actions { display: flex; justify-content: flex-end; }
.publish-actions > * + * { margin-inline-start: 10px; }
.myvideos-add { margin-inline-start: auto; }
.myvideos-page .page-head { display: flex; align-items: center; gap: 10px; }
.myvideo-row { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0 14px 12px; }
.myvideo-cover { width: 120px; height: 68px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex-shrink: 0; background: var(--bg); }
.myvideo-no-cover { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px; }
.myvideo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.myvideo-title { font-weight: 700; color: var(--text); font-size: 15px; text-decoration: none; }
.myvideo-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.myvideo-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.myvideo-actions { display: flex; gap: 8px; margin-top: 4px; }
.audit-pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.audit-pending { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.audit-approved { background: rgba(34, 197, 94, .15); color: #22c55e; }
.audit-rejected { background: rgba(239, 68, 68, .15); color: #ef4444; }
.video-card-author { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.video-detail-author { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.video-detail-author-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
[dir="rtl"] .myvideos-add, [lang="ur"] .myvideos-add { margin-inline-start: auto; margin-inline-end: 0; }


.publish-video-preview { display: block; width: 100%; max-height: 240px; margin-top: 10px; background: #000; border-radius: 12px; }

.confirm-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1200; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 24px; }
.confirm-dialog { width: 100%; max-width: 340px; background: #16202f; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; padding: 22px 20px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.confirm-message { margin: 0 0 18px; color: #e8edf5; font-size: 15px; line-height: 1.65; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

.audit-offline { background: rgba(255,255,255,.12); color: #9aa4b2; }

.video-mine-badge { position: absolute; z-index: 2; inset-block-start: 6px; inset-inline-end: 6px; padding: 3px 7px; border-radius: 6px; background: var(--gold); color: #14100a; font-size: 10px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.video-views { position: absolute; z-index: 2; inset-block-end: 6px; inset-inline-end: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; line-height: 1.3; }
.video-own-badge { padding: 2px 9px; border-radius: 999px; background: var(--gold); color: #14100a; font-size: 11px; font-weight: 700; }
.video-detail-views { color: var(--muted); font-size: 12px; }
.myvideo-actions { flex-wrap: wrap; }
.myvideo-actions .btn { white-space: nowrap; }
@media (max-width: 420px) {
  .myvideo-cover { width: 92px; height: 56px; }
  .myvideo-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* 我的投稿卡片布局优化：封面固定高度 + 价格徽章左下 + 状态标签标题行右侧 + 按钮沉底 */
.myvideo-row { align-items: stretch; }
.myvideo-cover-wrap { position: relative; width: 132px; height: 116px; flex-shrink: 0; display: flex; cursor: pointer; text-decoration: none; }
.myvideo-cover { width: 100%; height: 100%; min-height: 0; }
.myvideo-price-badge { position: absolute; inset-inline-start: 6px; inset-block-end: 6px; background: rgba(0,0,0,.8); color: var(--gold); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; line-height: 1.3; }
.myvideo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.myvideo-head .myvideo-title { flex: 1; min-width: 0; }
.myvideo-head .audit-pill { flex-shrink: 0; margin-top: 2px; }
.myvideo-actions { margin-top: auto; padding-top: 6px; }
@media (max-width: 420px) {
  .myvideo-cover-wrap { width: 96px; }
  .myvideo-actions .btn { flex: 0 1 auto; }
}

/* 视频卡片：作者头像 + 标题超宽慢速无缝滚动 */
.video-card-author { display: inline-flex; align-items: center; gap: 4px; }
.video-card-author-avatar { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.video-card-author-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: var(--line); }
.video-card-author-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.video-title-text { display: inline-block; white-space: nowrap; }
.video-title.marquee .video-title-text { padding-inline-end: 48px; animation: videoTitleScroll var(--marquee-duration, 10s) linear infinite; }
@keyframes videoTitleScroll { 0%, 5% { transform: translateX(0); } 95%, 100% { transform: translateX(-50%); } }

/* 视频详情头部分享 + 作者主页 */
.video-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.video-detail-head .video-back { margin-bottom: 0; }
.video-share-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; font-size: 17px; cursor: pointer; flex-shrink: 0; position: relative; z-index: 2; touch-action: manipulation; }
.video-share-btn:active { transform: scale(.94); }
a.video-detail-author { text-decoration: none; color: inherit; }
.video-author-enter { color: #8a93b8; margin-left: 2px; }
.video-share-dialog { text-align: left; }
.video-share-title { margin: 0 0 12px; font-size: 16px; }
.video-share-invite { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #b9c0d8; margin-bottom: 10px; cursor: pointer; }
.video-share-link { width: 100%; font-size: 12px; color: #9aa3c7; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; box-sizing: border-box; cursor: pointer; -webkit-user-select: text; user-select: text; }
.video-share-link:active { border-color: var(--mint); color: var(--mint); }
.author-page { padding-bottom: 24px; }
.author-header { display: flex; align-items: center; padding: 22px 0; }
.author-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid rgba(255,255,255,.12); margin-inline-end: 18px; }
.author-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 30px; background: rgba(255,255,255,.07); }
.author-info { flex: 1; min-width: 0; }
.author-info h1 { margin: 0 0 8px; font-size: 18px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author-followers { display: block; font-size: 12px; color: #8a93b8; line-height: 1.5; }
.author-header > .btn, .author-header > .author-self-badge { margin-inline-start: 12px; flex-shrink: 0; }
.author-self-badge { font-size: 12px; color: #8a93b8; border: 1px solid rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.author-videos-title { font-size: 15px; margin: 8px 0 12px; }

/* -------------------- 分享到聊天 -------------------- */
.share-chat-dialog { max-width: 360px; }
.share-chat-title { margin: 0 0 16px; font-size: 17px; }
.share-chat-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px; background: rgba(255,255,255,.04); border-radius: 10px; }
.share-chat-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.share-chat-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-chat-search { margin-bottom: 12px; }
.share-chat-search .input { width: 100%; padding: 10px 14px; font-size: 14px; }
.share-chat-list { max-height: 320px; overflow-y: auto; margin-bottom: 16px; }
.share-chat-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: none; background: none; cursor: pointer; border-radius: 10px; text-align: start; transition: background .15s; }
.share-chat-item:hover { background: rgba(255,255,255,.06); }
.share-chat-item:active { background: rgba(255,255,255,.1); }
.share-chat-item.sending { opacity: .5; pointer-events: none; }
.share-chat-item-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); font-size: 20px; }
.share-chat-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.share-chat-item-info { flex: 1; min-width: 0; }
.share-chat-item-info b { display: block; font-size: 14px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-chat-item-info span { font-size: 12px; color: #8a93b8; }

/* -------------------- 游戏分享面板 -------------------- */
.game-share-sheet { max-width: 340px; }
.game-share-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.game-share-action { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: #e8ecf4; font-size: 15px; cursor: pointer; border-radius: 12px; text-align: start; transition: background .15s; }
.game-share-action:hover { background: rgba(255,255,255,.08); }
.game-share-action:active { background: rgba(255,255,255,.12); }
.game-share-icon { font-size: 22px; flex-shrink: 0; }

/* -------------------- 聊天分享卡片 -------------------- */
.chat-share-card { display: flex; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); cursor: pointer; transition: background .15s; max-width: 280px; }
.chat-share-card:hover { background: rgba(255,255,255,.08); }
.chat-share-card:active { background: rgba(255,255,255,.1); }
.chat-share-cover { width: 100px; min-height: 75px; margin-inline-end: 12px; align-self: stretch; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: rgba(255,255,255,.06); }
.chat-share-cover img { width: 100%; height: 100%; object-fit: cover; }
.chat-share-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.chat-share-title { font-size: 13px; font-weight: 600; line-height: 1.45; color: #eef1ff; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-share-action { margin-top: 5px; }
.chat-share-author { font-size: 11px; color: #9aa3c7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-share-meta { display: flex; gap: 8px; align-items: center; }
.chat-share-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.chat-share-badge.free { background: rgba(46,204,113,.2); color: #2ecc71; }
.chat-share-badge.paid { background: rgba(241,196,15,.2); color: #f1c40f; }
.chat-share-badge.chat-share-loading { background: rgba(255,255,255,.08); color: #8a93b8; }
.chat-share-views { font-size: 11px; color: #8a93b8; }
.chat-share-action { font-size: 12px; color: #5b9cf6; font-weight: 600; }

/* 视频转发卡片文案行距：Chrome 83 WebView 不支持 flex gap，用 margin 拉开 */
.chat-video-card .chat-share-author { margin-top: 4px; }
.chat-video-card .chat-share-meta { margin-top: 7px; }
.chat-video-card .chat-share-action { margin-top: 9px; }
.chat-share-badge + .chat-share-badge { margin-inline-start: 6px; }
.webview-app .chat-share-title { line-height: 1.55; }
.webview-app .chat-share-author { line-height: 1.5; }
.webview-app .chat-video-card .chat-share-author { margin-top: 6px; }
.webview-app .chat-video-card .chat-share-meta { margin-top: 10px; }
.webview-app .chat-video-card .chat-share-action { margin-top: 12px; }

/* 游戏分享卡片：游戏名做主标题，竖版封面完整显示不裁切 */
.chat-game-card { padding: 8px; max-width: 262px; }
.chat-game-card .chat-share-cover { width: 78px; min-height: 78px; margin-inline-end: 10px; background: #0d1220; }
.chat-game-card .chat-share-cover img { object-fit: contain; }
.chat-game-title { font-size: 14px; font-weight: 700; line-height: 1.4; color: #f2f5ff; }
.chat-game-title:empty { display: none; }
.chat-game-card .chat-share-action {
  display: inline-flex;
  align-items: center;
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
}
.chat-game-card .chat-share-play { margin-inline-end: 4px; }
.chat-share-play { font-size: 8px; line-height: 1; }

/* 长按反馈 */
.game-card.pressing, .lobby-card.pressing, .small-card.pressing { transform: scale(.95); opacity: .8; transition: transform .15s, opacity .15s; }

/* ---------- 老内核 WebView（Chrome 83）兼容补丁 ---------- */

/* 图片加载骨架放到最后，并用 !important 防止被各组件自己的 background 简写覆盖 */
img[data-img-loading="1"] {
  background-image: linear-gradient(100deg, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .16) 45%, rgba(255, 255, 255, .05) 65%) !important;
  background-size: 220% 100% !important;
  background-repeat: no-repeat !important;
  animation: imgShimmer 1.2s linear infinite;
  color: transparent;
}

/* Chrome 83 不支持 inset-block / inset-inline，补物理定位，避免视频价格、播放量、角标被裁掉 */
@supports not (inset-block-start: 0px) {
  .video-price-badge { top: 6px; left: 6px; }
  .video-unlocked-badge { top: 6px; right: 6px; }
  .video-preview-badge { bottom: 6px; left: 6px; }
  .video-views { bottom: 6px; right: 6px; }
  .video-mine-badge { top: 6px; right: 6px; }
  .myvideo-price-badge { left: 6px; bottom: 6px; }
}

/* 视频卡片发布者头像与昵称之间留出间距（flex gap 在旧 WebView 无效） */
.video-card-author-avatar { margin-inline-end: 5px; }

/* ---------- 头像裁剪 ---------- */
.avatar-crop-sheet { max-width: 380px; }
.avatar-crop-view {
  position: relative;
  width: 100%;
  max-width: 260px;
  height: 260px;
  margin: 4px auto 16px;
  overflow: hidden;
  border-radius: 24px;
  background: #05070d;
  border: 1px solid var(--line-strong);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.avatar-crop-view img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.avatar-crop-ring {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(5, 7, 13, .55);
  pointer-events: none;
}
.avatar-crop-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.avatar-crop-zoom { display: block; width: 100%; margin: 0 0 16px; }

/* ---------- 分享落地页 / 相关游戏 ---------- */
/* 有封面图时去掉底板渐变色，只展示图片本身 */
.detail-cover.has-image {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
/* 相关游戏封面高度与首页保持一致（3:4） */
.related-grid .game-cover { aspect-ratio: 3 / 4; }
@supports not (aspect-ratio: 3 / 4) {
  .related-grid .game-cover { padding-top: 133.3333%; }
}

/* ---------- 我的视频：收益规则入口 ---------- */
.myvideos-title {
  display: flex;
  align-items: center;
}
.myvideos-title h1 { margin: 0; }
.myvideos-help {
  width: 22px;
  height: 22px;
  margin-inline-start: 6px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.myvideos-help:active { color: var(--mint); border-color: rgba(124, 247, 212, .5); }
.video-rules-sheet { max-width: 420px; }
.video-rules-body { margin: 0 0 16px; max-height: 52vh; overflow-y: auto; }
.video-rule-line {
  margin: 0 0 9px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.video-rule-line:last-child { margin-bottom: 0; }

/* ---------- 后台可配置的品牌 Logo ---------- */
.brand-mark img,
.splash-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  max-width: none;
}
.brand-mark.has-logo,
.splash-mark.has-logo {
  background: transparent;
  box-shadow: none;
  color: transparent;
}

/* ---------- 金币定期存放生息 ---------- */
.chat-circle.deposit-entry {
  color: var(--gold);
  border-color: rgba(255, 209, 102, .45);
  background: rgba(255, 209, 102, .12);
}
.chat-circle.deposit-entry.on {
  color: #1b1400;
  border-color: transparent;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, .12);
}

.deposit-page { padding-bottom: 34px; }

.deposit-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.deposit-summary-cell {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.deposit-summary-cell span {
  display: block;
  font-size: 12px;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.deposit-summary-cell b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px;
}
.deposit-summary-cell b.warn { color: var(--gold); }
.deposit-summary-cell b.good { color: var(--mint); }

.deposit-section { margin-bottom: 18px; }
.deposit-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.deposit-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.deposit-section-head > span {
  font-size: 12px;
  color: var(--muted-2);
}

.deposit-plan-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.deposit-card {
  flex: 0 0 118px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 11px 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}
.deposit-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: #41d3ff;
}
.deposit-card.is-weekly::before { background: var(--violet); }
.deposit-card.is-half::before { background: #4c8dff; }
.deposit-card.is-monthly::before { background: var(--gold); }
.deposit-card[data-action] { cursor: pointer; }
.deposit-card.disabled { opacity: .55; filter: grayscale(.25); }

.deposit-card-name {
  font-size: 13px;
  font-weight: 600;
}
.deposit-card-term {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}
.deposit-card-lock,
.deposit-card-rate,
.deposit-card-min {
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.35;
}
.deposit-card-btn {
  margin-top: 6px;
  width: 100%;
  padding: 7px 0;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 209, 102, .16);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.deposit-card-blocked {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.3;
}

/* 兼容 Chrome 83 WebView：flex gap 不生效时用 margin 保留标题和卡片间距 */
.webview-app .deposit-section-head { gap: 0; }
.webview-app .deposit-section-head h2 { min-width: 0; line-height: 1.4; }
.webview-app .deposit-section-head > span {
  flex: 0 0 auto;
  margin-inline-start: 10px;
  white-space: nowrap;
}
.webview-app .deposit-plan-grid { gap: 0; }
.webview-app .deposit-plan-grid > .deposit-card + .deposit-card { margin-inline-start: 10px; }
.webview-app .deposit-card { gap: 0; }
.webview-app .deposit-card > * + * { margin-top: 4px; }
.webview-app .deposit-card > .deposit-card-btn,
.webview-app .deposit-card > .deposit-card-blocked { margin-top: 6px; }

.deposit-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted-2);
}

.deposit-chart-card {
  padding: 14px 12px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.deposit-range {
  display: flex;
  gap: 6px;
}
.deposit-range-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.deposit-range-btn.on {
  color: #1b1400;
  background: var(--gold);
  border-color: transparent;
  font-weight: 600;
}
.deposit-chart-wrap { margin: 4px -2px 0; }
.deposit-chart-svg { width: 100%; height: auto; display: block; }
.deposit-grid-line { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.deposit-axis-label { fill: var(--muted-2); font-size: 9px; }
.deposit-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.deposit-dot { fill: var(--gold); stroke: #1b1400; stroke-width: 1; }
.deposit-chart-empty { fill: var(--muted-2); font-size: 11px; }
.deposit-chart-foot {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-2);
}

.deposit-list { display: flex; flex-direction: column; gap: 10px; }
.deposit-row {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.deposit-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.deposit-row-top b { font-size: 14px; }
.deposit-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, .06);
}
.deposit-status.on {
  color: var(--mint);
  background: rgba(124, 247, 212, .12);
}
.deposit-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-2);
}
.deposit-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--gold);
}
.deposit-settle-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, .4);
  background: transparent;
  color: var(--gold);
  font-size: 11px;
  cursor: pointer;
}
.deposit-empty {
  margin: 4px 0;
  padding: 22px 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
}
.deposit-empty-card {
  padding: 28px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
}
.deposit-empty-card p { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

.deposit-plan-head h2 { margin-inline-end: auto; }
.deposit-rules-btn {
  flex: 0 0 auto;
  margin-inline-start: 10px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--mint);
  font-size: 11px;
  cursor: pointer;
}
.deposit-rules-sheet { max-width: 430px; }
.deposit-rules-plan {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}
.deposit-rules-plan + .deposit-rules-plan { margin-top: 8px; }
.deposit-rules-plan > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.deposit-rules-plan b { font-size: 13px; }
.deposit-rules-plan span {
  margin-inline-start: 10px;
  color: var(--gold);
  font-size: 12px;
}
.deposit-rules-plan p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.deposit-rules-list {
  margin: 14px 0 0;
  padding-inline-start: 20px;
}
.deposit-rules-list li {
  padding-inline-start: 3px;
  font-size: 12px;
  line-height: 1.65;
}
.deposit-rules-list li + li { margin-top: 8px; }

/* 参与弹层 */
.deposit-sheet-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 96;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 7, 14, .66);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.deposit-sheet {
  width: 100%;
  max-width: var(--app-w);
  max-height: 86vh;
  overflow-y: auto;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--line-strong);
  animation: depositSheetUp .18s ease;
}
@keyframes depositSheetUp {
  from { transform: translateY(18px); opacity: .4; }
  to { transform: translateY(0); opacity: 1; }
}
.deposit-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.deposit-sheet-head b { font-size: 16px; }
.deposit-sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.deposit-sheet-sub {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted-2);
}
.deposit-amount-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted-2);
}
.deposit-amount-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}
.deposit-amount-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font);
  -webkit-user-select: text;
  user-select: text;
}
.deposit-amount-wrap span { font-size: 12px; color: var(--muted-2); }
.deposit-quick {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
}
.deposit-quick button {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.deposit-preview {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 209, 102, .08);
  border: 1px solid rgba(255, 209, 102, .2);
}
.deposit-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0;
}
.deposit-preview-row b { color: var(--gold); font-size: 14px; }
.deposit-preview-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-2);
}
.deposit-preview-invalid {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--pink);
}
.deposit-sheet-actions {
  display: flex;
  gap: 10px;
}
.deposit-sheet-actions .btn { flex: 1; }

@media (min-width: 420px) {
  .deposit-card { flex-basis: 132px; }
}

