@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=Outfit:wght@600;700;800&display=swap');

:root {
  --w: 390px;
  --bg: #07080c;
  --panel: #12141c;
  --rose: #ff2d55;
  --rose-deep: #c9184a;
  --gold: #ffc857;
  --text: #f4f5f7;
  --muted: #9aa3b5;
  --tab-h: 56px;
  --top-h: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #2a1020 0%, transparent 55%),
    linear-gradient(180deg, #10131a 0%, #07080c 40%, #05060a 100%);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.phone-shell {
  width: min(100%, var(--w));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 20px 60px rgba(0,0,0,.45);
  overflow: hidden;
}

@media (min-width: 430px) {
  body { display: flex; align-items: stretch; justify-content: center; padding: 0; }
  .phone-shell {
    min-height: 100vh;
    max-height: 100vh;
  }
}

.topbar {
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(10,10,14,.92), rgba(10,10,14,.65));
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.logo {
  font-family: Outfit, "Noto Sans SC", sans-serif;
  font-weight: 800;
  letter-spacing: .02em;
  background: linear-gradient(90deg, #fff, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 17px;
}
.top-user { font-size: 12px; color: var(--muted); }
.link-btn {
  border: 0; background: rgba(255,45,85,.15); color: #ff8fa3;
  padding: 6px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--tab-h) + 10px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge 旧版 */
}
.page-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* Chrome / Safari / Edge */
}

.phone-shell,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.phone-shell::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(12,13,18,.94);
  border-top: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
}
.tabbar a i {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  display: block;
}
.tabbar a.on { color: #fff; }
.tabbar a.on i { background: linear-gradient(135deg, var(--rose), #ff6b35); box-shadow: 0 0 12px rgba(255,45,85,.45); }

/* List */
.banner {
  margin: 10px 12px 0;
  border-radius: 14px;
  overflow: hidden;
  min-height: 88px;
  background: linear-gradient(120deg, #3a1024, #1a1028 50%, #102033);
  position: relative;
}
.banner img { width: 100%; height: 100px; object-fit: cover; display: block; }
.banner-fallback {
  padding: 22px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.banner-fallback p { font-size: 14px; font-weight: 500; line-height: 1.4; }
.live-dot, .badge-live i, .live-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 0 rgba(255,45,85,.7);
  animation: pulse 1.6s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,45,85,.55); }
  70% { box-shadow: 0 0 0 8px rgba(255,45,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,45,85,0); }
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 14px 8px;
}
.section-head h1 { font-size: 16px; font-weight: 700; }
.live-count { font-size: 12px; color: var(--muted); }

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 20px;
}
.live-card {
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.04);
  transition: transform .2s ease;
}
.live-card:active { transform: scale(.98); }
.live-card .cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #1a1a22;
}
.live-card .cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.badge-live {
  position: absolute; left: 8px; top: 8px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
}
.online {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.5);
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 6px;
}
.meta { padding: 8px 9px 10px; }
.meta h2 {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stats {
  margin-top: 4px;
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted);
}
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

/* Member */
.member-page { padding: 20px 16px; }
.member-hero {
  display: flex; gap: 14px; align-items: center; margin-bottom: 18px;
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), #ff8a3d);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
}
.member-hero h1 { font-size: 18px; }
.member-hero p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.vip-card {
  background: linear-gradient(145deg, #2a1a12, #1a121c);
  border: 1px solid rgba(255,200,87,.25);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.vip-card.on {
  background: linear-gradient(145deg, #122a1a, #121a1c);
  border-color: rgba(52,211,153,.3);
  color: #86efac;
}
.vip-card .p {
  font-family: Outfit, sans-serif;
  font-size: 36px; font-weight: 800; color: var(--gold);
  margin: 8px 0 14px;
}
.logout {
  display: block; text-align: center; margin-top: 24px;
  color: var(--muted); font-size: 13px;
}

.btn-primary {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--rose-deep), var(--rose), #ff6b35);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255,45,85,.28);
}

/* Modal */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.62);
}
.modal-sheet {
  position: relative;
  width: min(100%, var(--w));
  background: #161822;
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: sheetUp .28s ease;
}
@keyframes sheetUp {
  from { transform: translateY(40px); opacity: .5; }
  to { transform: none; opacity: 1; }
}
.modal-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.modal-tabs button {
  flex: 1; border: 0; background: #0f1118; color: var(--muted);
  padding: 10px; border-radius: 10px; cursor: pointer;
}
.modal-tabs button.on { color: #fff; background: rgba(255,45,85,.2); }
.auth-form { display: none; gap: 10px; }
.auth-form.is-active { display: grid; }
.auth-form input {
  padding: 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08);
  background: #0c0e14; color: #fff;
}
.auth-form button {
  margin-top: 4px;
  border: 0; border-radius: 999px; padding: 12px;
  background: linear-gradient(90deg, var(--rose-deep), var(--rose));
  color: #fff; font-weight: 700; cursor: pointer;
}
.modal-tip { color: #f87171; font-size: 12px; margin-top: 10px; min-height: 16px; }
.cred-sheet h3 { text-align: center; margin-bottom: 8px; }
.cred-hint { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.cred-box {
  background: #0c0e14; border-radius: 12px; padding: 16px;
  margin-bottom: 14px; border: 1px dashed rgba(255,200,87,.35);
}
.cred-box div { font-size: 12px; color: var(--muted); margin-top: 8px; }
.cred-box strong {
  display: block; font-size: 22px; letter-spacing: .04em;
  font-family: Outfit, sans-serif; margin-top: 2px;
  user-select: all;
}
.pay-desc { text-align: center; color: var(--muted); font-size: 13px; }
.price {
  text-align: center;
  font-family: Outfit, sans-serif;
  font-size: 40px; font-weight: 800; color: var(--gold);
  margin: 12px 0 16px;
}

/* Play page */
.phone-shell.is-play .topbar { display: none; }
.play-page {
  position: absolute;
  inset: 0 0 var(--tab-h) 0;
  background: #000;
}
.player-wrap {
  position: relative;
  width: 100%; height: 100%;
  background: #000;
}
#liveVideo {
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
.player-overlay {
  pointer-events: none;
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 22%, transparent 55%, rgba(0,0,0,.55) 100%);
  display: flex; flex-direction: column;
}
.anchor-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 0;
}
.anchor-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35, var(--rose));
  border: 2px solid rgba(255,255,255,.5);
}
.anchor-info { flex: 1; min-width: 0; }
.anchor-info strong {
  display: block; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.anchor-info span { font-size: 11px; color: #ffb4c0; display: inline-flex; align-items: center; gap: 4px; }
.float-stats {
  background: rgba(0,0,0,.4);
  padding: 6px 10px; border-radius: 999px; font-size: 12px;
}
.side-stats {
  position: absolute; right: 10px; top: 64px;
  display: grid; gap: 8px; font-size: 11px; text-align: right;
}
.side-stats div {
  background: rgba(0,0,0,.35);
  padding: 6px 8px; border-radius: 8px;
}
.comment-rail {
  margin-top: auto;
  padding: 0 12px 16px;
  max-height: 42%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
.comment-item {
  align-self: flex-start;
  max-width: 82%;
  background: rgba(0,0,0,.38);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.35;
  animation: commentIn .35s ease;
}
.comment-item .n { color: #8ec8ff; margin-right: 4px; }
.comment-item.gift .n { color: var(--gold); }
.comment-item.like .n { color: #ff8fab; }
.comment-item.enter { opacity: .85; }
@keyframes commentIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.player-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.35);
  font-size: 14px; color: #ddd;
}
.player-loading[hidden] { display: none !important; }
