/* x18 / xtok 共用 — 抖音式竖向视频流 + iOS 锁屏密码门（xtok 未设密码不出现）
   移动端全屏；桌面端居中固定手机框模拟移动尺寸。 */

:root {
  --red: #fe2c55;
  --cyan: #25f4ee;
  --bg: #000;
  --panel: #16171d;
  --line: rgba(255, 255, 255, 0.08);
  --txt: #fff;
  --txt2: rgba(255, 255, 255, 0.64);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* 底部导航栏总高（含 iOS 手势条区），刻意用 env() 而非 --safe-bottom：#home 内后者被置 0 */
  --bbar-h: calc(50px + env(safe-area-inset-bottom, 0px));
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #000;
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "MiSans", "HarmonyOS Sans SC",
    "Noto Sans SC", "Helvetica Neue", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; }
.hidden { display: none !important; }
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* ---------- 手机框 ---------- */

#phone {
  position: relative;
  width: 100vw;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

@media (min-width: 700px) and (min-height: 560px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(52% 40% at 18% 12%, rgba(37, 244, 238, 0.07), transparent 70%),
      radial-gradient(56% 44% at 84% 88%, rgba(254, 44, 85, 0.08), transparent 70%),
      #070709;
  }
  #phone {
    width: 400px;
    height: min(864px, 94vh);
    border-radius: 34px;
    outline: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      0 0 0 10px #101013,
      0 0 0 11px rgba(255, 255, 255, 0.06),
      0 40px 90px rgba(0, 0, 0, 0.8);
  }
}

.screen { position: absolute; inset: 0; }

/* ---------- iOS 锁屏密码 ---------- */

.lock {
  position: absolute;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(110% 80% at 16% 8%, #232a44 0%, transparent 62%),
    radial-gradient(95% 75% at 88% 90%, #3a1f34 0%, transparent 62%),
    #0a0b10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.lock.away { opacity: 0; transform: scale(1.06); pointer-events: none; }

.lock-glow {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 110, 190, 0.16), transparent 65%);
  filter: blur(30px);
  animation: drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate(-26%, -30%); }
  to { transform: translate(30%, 24%); }
}

.lock-inner {
  position: relative;
  text-align: center;
  padding-bottom: 4vh;
  user-select: none;
  -webkit-user-select: none;
}
.lock-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #fff;
  text-shadow: -1.6px 0 var(--cyan), 1.6px 0 var(--red);
  margin-bottom: 5vh;
  opacity: 0.95;
}
.lock-title { font-size: 21px; font-weight: 300; letter-spacing: 0.08em; }

.lock-dots {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 26px 0 5vh;
}
.lock-dots i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.2px solid rgba(255, 255, 255, 0.92);
  transition: background 0.12s ease;
}
.lock-dots i.on { background: #fff; }
.lock-dots.error { animation: shake 0.45s ease; }
.lock-dots.error i { border-color: var(--red); }
.lock-dots.error i.on { background: var(--red); }
@keyframes shake {
  20% { transform: translateX(-13px); }
  40% { transform: translateX(11px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(4px); }
}

.lock-pad {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 16px 24px;
  justify-content: center;
  align-items: center;
}
.lock-pad button[data-d] {
  width: clamp(64px, 20vw, 76px);
  height: clamp(64px, 20vw, 76px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  touch-action: manipulation;
}
.lock-pad button[data-d]:active { background: rgba(255, 255, 255, 0.34); transition: none; }
.lock-pad b { font-size: 30px; font-weight: 400; line-height: 1.05; }
.lock-pad span { font-size: 9.5px; letter-spacing: 0.18em; text-indent: 0.18em; opacity: 0.72; margin-top: 1px; }
.pad-del { font-size: 15px; font-weight: 400; opacity: 0.9; padding: 14px; touch-action: manipulation; }
.pad-del:active { opacity: 0.5; }
.lock.busy .lock-pad { pointer-events: none; opacity: 0.55; transition: opacity 0.2s; }

/* ---------- 顶栏 tabs ---------- */

#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding-top: max(10px, var(--safe-top));
  height: calc(48px + max(10px, var(--safe-top)));
  background: linear-gradient(rgba(0, 0, 0, 0.48), transparent);
  display: flex;
  align-items: center;
}
.tabs {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  max-width: calc(100% - 104px);
  margin: 0 auto;
  padding: 4px 8px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.tab {
  flex: 0 0 auto;
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.62);
  text-shadow: var(--shadow);
  position: relative;
  padding-bottom: 7px;
  max-width: 9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab.active { color: #fff; font-weight: 700; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
}
.topbtn {
  position: absolute;
  right: 10px;
  top: max(10px, var(--safe-top));
  width: 44px;
  height: 42px;
  display: grid;
  place-items: center;
}
.topbtn svg { width: 23px; height: 23px; fill: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }

/* ---------- 视频流 ---------- */

.feed {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
}
.page {
  position: relative;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
  container-type: size;
}

.strip {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
.slot {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}
.slot-bg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(38px) brightness(0.42) saturate(1.25);
}
.slot .poster,
.slot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.slot.cover .poster,
.slot.cover video { object-fit: cover; }
.slot video { z-index: 2; background: transparent; }

.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.slot.paused .play-badge { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
.play-badge svg { width: 62px; height: 62px; fill: rgba(255, 255, 255, 0.85); filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5)); }

.slot-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.2s 0.3s;
  pointer-events: none;
}
.slot.buffering .slot-spin { opacity: 1; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.m-count {
  position: absolute;
  top: calc(56px + max(10px, var(--safe-top)));
  right: 12px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.m-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 88px;
  z-index: 5;
  display: flex;
  gap: 5px;
}
.m-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  transition: background 0.15s;
}
.m-dots i.on { background: #fff; }

.shade-top,
.shade-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: none;
}
.shade-top { top: 0; height: 100px; background: linear-gradient(rgba(0, 0, 0, 0.42), transparent); }
.shade-bottom { bottom: 0; height: 170px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }

.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.page.cap-open::after { opacity: 1; }

/* 纯文本帖（无媒体兜底） */
.text-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 48px 28px 140px;
  background:
    radial-gradient(90% 70% at 20% 15%, #1d2030 0%, transparent 65%),
    radial-gradient(80% 65% at 85% 85%, #2c1a28 0%, transparent 65%),
    #0a0a0e;
  font-size: 19px;
  line-height: 1.75;
  overflow: hidden;
}

/* ---------- 右侧操作栏 ---------- */

.rail {
  position: absolute;
  right: 6px;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.r-avatar {
  position: relative;
  width: 47px;
  height: 47px;
  margin-bottom: 6px;
}
.r-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid #fff;
  object-fit: cover;
  background: #26262c;
}
.r-plus {
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--red);
  display: grid;
  place-items: center;
  transition: background 0.25s, opacity 0.3s 0.5s, transform 0.25s;
}
.r-plus svg { width: 13px; height: 13px; fill: #fff; transition: fill 0.25s; }
.r-avatar.followed .r-plus { background: #fff; opacity: 0; transform: translateX(-50%) scale(0.6); }
.r-avatar.followed .r-plus svg { fill: var(--red); }

.r-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 48px;
}
.r-btn svg { width: 31px; height: 31px; fill: #fff; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.r-btn span { font-size: 12px; font-weight: 600; text-shadow: var(--shadow); }
.r-btn.liked svg { fill: var(--red); animation: pop 0.35s ease; }
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.r-disc {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-top: 2px;
  background:
    radial-gradient(circle at center, #3a3a40 0 22%, #17171b 23% 60%, #2b2b31 61% 100%);
  border: 6px solid #101014;
  display: grid;
  place-items: center;
  animation: rotate 6s linear infinite;
  animation-play-state: paused;
}
.r-disc svg { width: 14px; height: 14px; fill: rgba(255, 255, 255, 0.85); }
.page.playing .r-disc:not(.muted) { animation-play-state: running; }
.r-disc.muted svg { fill: rgba(255, 255, 255, 0.55); }
@keyframes rotate { to { transform: rotate(360deg); } }

.burst {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  transform: translate(-50%, -60%);
}
.burst svg { width: 84px; height: 84px; fill: var(--red); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.burst { animation: burst 0.75s ease forwards; }
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(0.4) rotate(-14deg); }
  22% { opacity: 1; transform: translate(-50%, -60%) scale(1.15) rotate(4deg); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(1); }
}

.sound-pill {
  position: absolute;
  left: 12px;
  bottom: calc(158px + var(--safe-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
}
.sound-pill svg { width: 15px; height: 15px; fill: #fff; }

/* ---------- 文案区 ---------- */

.caption {
  position: absolute;
  left: 0;
  right: 72px;
  bottom: 0;
  z-index: 4;
  padding: 0 14px calc(16px + var(--safe-bottom) + 6px);
}
.cap-name {
  font-size: 17px;
  font-weight: 700;
  text-shadow: var(--shadow);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cap-name .cap-date { font-size: 12px; font-weight: 400; opacity: 0.7; }
.cap-text {
  margin-top: 7px;
  font-size: 14.5px;
  line-height: 1.5;
  text-shadow: var(--shadow);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cap-text a { color: #9fd8ff; text-decoration: none; }
.cap-text .htag { font-weight: 600; }
.cap-text.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.caption.open .cap-text {
  max-height: 44cqh;
  overflow-y: auto;
  padding-right: 4px;
}
.cap-quote {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cap-more {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: var(--shadow);
}
/* ---------- 进度条 ---------- */

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  touch-action: none;
}
.progress .bar {
  width: 100%;
  height: 2.5px;
  margin-bottom: max(var(--safe-bottom), 0px);
  background: rgba(255, 255, 255, 0.22);
  transition: height 0.15s;
}
.progress .bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 0 2px 2px 0;
}
.progress.scrub .bar { height: 6px; }
.progress.scrub .bar i { background: linear-gradient(90deg, var(--cyan), #fff 30%); }

/* ---------- 长按倍速 ---------- */

/* 长按不选中文字/不弹 iOS 图片长按气泡 */
.slot,
.slot img,
.text-stage {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.speed-tip {
  position: absolute;
  top: calc(64px + max(10px, var(--safe-top)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
}
.page.speeding .speed-tip { display: flex; }
.speed-tip svg {
  width: 14px;
  height: 14px;
  fill: #fff;
  animation: ff-pulse 0.6s ease-in-out infinite alternate;
}
@keyframes ff-pulse { from { opacity: 0.45; } to { opacity: 1; } }

/* ---------- 底部导航栏（抖音式，仅首页） ---------- */

/* 首页 feed 在栏顶结束，safe-bottom 由栏自己消化，页内偏移不再叠加 */
#home { --safe-bottom: 0px; }
#home .feed,
#home .feed-empty { bottom: var(--bbar-h); }
#home .more-spin { bottom: calc(var(--bbar-h) + 14px); }
#home .sound-pill { bottom: calc(var(--bbar-h) + 108px); }

.bbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bbar-h);
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 0 6px env(safe-area-inset-bottom, 0px);
  background: #000;
  border-top: 0.5px solid rgba(255, 255, 255, 0.09);
}
.bb-item {
  flex: 1;
  height: 100%;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.bb-item.active { color: #fff; font-weight: 700; }
/* 已登录：「我」前挂 Google 头像 */
.bb-avatar {
  display: inline-block;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  vertical-align: -3px;
  margin-right: 5px;
}
.bb-plus {
  position: relative;
  flex: 1;
  height: 100%;
}
.bb-plus::before,
.bb-plus::after,
.bb-plus span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 27px;
  border-radius: 8px;
}
.bb-plus::before { content: ""; background: var(--cyan); transform: translate(calc(-50% - 3.5px), -50%); }
.bb-plus::after { content: ""; background: var(--red); transform: translate(calc(-50% + 3.5px), -50%); }
.bb-plus span {
  background: #fff;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  z-index: 1; /* ::after（红）按绘制顺序会盖住 span，白底必须提上来 */
}
.bb-plus svg { width: 19px; height: 19px; fill: #0a0a0a; }
.bb-plus:active span { transform: translate(-50%, -50%) scale(0.92); }

/* ---------- 面板（个人主页 / 子级流 / 搜索） ---------- */

.panel {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #000;
  animation: slide-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.panel.out { animation: slide-out 0.24s ease forwards; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slide-out { from { transform: translateX(0); } to { transform: translateX(100%); } }

.pn-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  height: calc(48px + max(8px, var(--safe-top)));
  padding-top: max(8px, var(--safe-top));
  display: flex;
  align-items: center;
}
.pn-head.solid { background: rgba(0, 0, 0, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pn-head.float { background: linear-gradient(rgba(0, 0, 0, 0.45), transparent); }
.pn-back {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.pn-back svg { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.pn-title {
  position: absolute;
  left: 60px;
  right: 60px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: var(--shadow);
  pointer-events: none;
}

/* ---------- 个人主页 ---------- */

.pf-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding-top: calc(52px + max(8px, var(--safe-top)));
  overscroll-behavior: contain;
}
.pf-hero { text-align: center; padding: 14px 16px 2px; }
.pf-ava {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: #222;
}
.pf-name { margin-top: 12px; font-size: 19px; font-weight: 700; }
.pf-handle { margin-top: 3px; font-size: 13px; color: var(--txt2); }
.pf-follow {
  margin-top: 14px;
  width: 168px;
  height: 42px;
  border-radius: 6px;
  background: var(--red);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.12s, background 0.2s, color 0.2s;
}
.pf-follow:active { transform: scale(0.96); }
.pf-follow.on { background: #1e1f24; color: var(--txt2); box-shadow: inset 0 0 0 1px var(--line); }
.pf-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 16px;
}
.pf-stats b { display: block; font-size: 17px; }
.pf-stats span { font-size: 12px; color: var(--txt2); }

.pf-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.pf-tab {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  font-size: 14px;
  color: var(--txt2);
  position: relative;
}
.pf-tab.active { color: #fff; font-weight: 600; }
.pf-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2.5px;
  border-radius: 2px;
  background: #fff;
}
.pf-tab svg { width: 13px; height: 13px; fill: currentColor; vertical-align: -1.5px; margin-right: 3px; }

.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  padding-bottom: calc(24px + var(--safe-bottom));
}
.pf-cell {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #17181d;
  overflow: hidden;
  padding: 0;
}
.pf-cell img { width: 100%; height: 100%; object-fit: cover; }
.pf-views {
  position: absolute;
  left: 6px;
  bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-shadow: var(--shadow);
}
.pf-views svg { width: 12px; height: 12px; fill: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.pf-multi {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  padding: 2px 6px;
}
.pf-note {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--txt2);
  font-size: 13px;
  padding: 28px 0;
}

/* ---------- 搜索 ---------- */

.sr-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 10px 2px;
  padding-top: calc(max(8px, var(--safe-top)) + 6px);
  background: #000;
  border-bottom: 1px solid var(--line);
}
.sr-head input {
  flex: 1;
  height: 38px;
  border: none;
  outline: none;
  border-radius: 8px;
  background: #1e1f24;
  color: #fff;
  font-size: 15px;
  padding: 0 13px;
}
.sr-head input::placeholder { color: rgba(255, 255, 255, 0.38); }
.sr-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
}
.sr-progress i {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--cyan), var(--red));
  animation: slide 1s ease-in-out infinite;
}
@keyframes slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(280%); }
}
.sr-body {
  position: absolute;
  top: calc(56px + max(8px, var(--safe-top)));
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: auto;
  padding: 10px;
  overscroll-behavior: contain;
}
.sr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
.sr-card {
  background: #131318;
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  display: block;
  width: 100%;
}
.sr-thumb { position: relative; aspect-ratio: 3 / 4; background: #1b1c22; }
.sr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-thumb .sr-play {
  position: absolute;
  right: 6px;
  bottom: 6px;
}
.sr-thumb .sr-play svg { width: 18px; height: 18px; fill: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }
.sr-text {
  font-size: 13px;
  line-height: 1.45;
  color: #eee;
  /* line-clamp 会把溢出行漏进 padding-bottom，间距只能用 margin 给 */
  padding: 8px 9px 0;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.4em;
}
.sr-auth {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 9px;
  font-size: 11.5px;
  color: var(--txt2);
}
.sr-auth img { width: 16px; height: 16px; border-radius: 50%; background: #26262c; }
.sr-auth .sr-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-hint { text-align: center; color: var(--txt2); font-size: 13.5px; padding: 52px 30px; line-height: 1.8; }

/* ---------- 评论占位弹层 ---------- */

.sheet-mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.42);
  animation: fade 0.25s ease;
}
.sheet-mask.out { animation: fade 0.2s ease reverse forwards; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 66%;
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  animation: up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-mask.out .sheet { animation: up 0.22s ease reverse forwards; }
@keyframes up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sh-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  margin: 8px auto 0;
}
.sh-head {
  position: relative;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 0 10px;
}
.sh-close {
  position: absolute;
  right: 8px;
  top: 2px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.sh-close svg { width: 20px; height: 20px; fill: var(--txt2); }
.sh-body {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--txt2);
}
.sh-empty { text-align: center; padding-bottom: 24px; }
.sh-empty svg { width: 46px; height: 46px; fill: rgba(255, 255, 255, 0.16); }
.sh-empty p { font-size: 14.5px; margin-top: 12px; color: rgba(255, 255, 255, 0.75); }
.sh-empty small { display: block; font-size: 12px; margin-top: 5px; color: var(--txt2); }
.sh-input {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + var(--safe-bottom));
}
.fake-input {
  flex: 1;
  height: 38px;
  border-radius: 999px;
  background: #23242b;
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.35);
}
.sh-emoji { font-size: 19px; opacity: 0.45; }

/* ---------- 真实评论 ---------- */

.sh-list { display: flex; flex-direction: column; gap: 16px; }
.sh-note { text-align: center; padding: 18px 0 24px; font-size: 13px; color: var(--txt2); }
.cm-row { display: flex; gap: 10px; align-items: flex-start; }
.cm-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #23242b;
  flex: 0 0 auto;
}
.cm-ava-ph { display: grid; place-items: center; }
.cm-ava-ph svg { width: 16px; height: 16px; fill: rgba(255, 255, 255, 0.3); }
.cm-main { flex: 1; min-width: 0; }
.cm-name { font-size: 12.5px; color: var(--txt2); }
.cm-date { margin-left: 8px; font-size: 11.5px; opacity: 0.7; }
.cm-text { margin-top: 2px; font-size: 14.5px; line-height: 1.45; word-break: break-word; }
.cm-del { flex: 0 0 auto; font-size: 12px; color: var(--txt2); padding: 2px 4px; }
.sh-field {
  flex: 1;
  height: 38px;
  border-radius: 999px;
  background: #23242b;
  border: none;
  outline: none;
  color: var(--txt);
  padding: 0 15px;
  font-size: 14px;
  font-family: inherit;
}
.sh-send { font-size: 14px; font-weight: 600; color: var(--red); padding: 4px 6px; }
.sh-loginhint { gap: 8px; color: rgba(255, 255, 255, 0.6); }
.sh-loginhint svg { width: 16px; height: 16px; }

/* ---------- 我 页面 ---------- */

.me-hero { padding-bottom: 12px; }
.me-gicon { display: grid; place-items: center; padding-top: 10px; }
.me-gicon svg { width: 64px; height: 64px; opacity: 0.9; }
.me-hint { margin-top: 10px; font-size: 12.5px; line-height: 1.6; color: var(--txt2); }
.me-login {
  margin-top: 16px;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fff;
  color: #1f1f1f;
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.12s;
}
.me-login:active { transform: scale(0.96); }
.me-login svg { width: 18px; height: 18px; }
.me-logout {
  margin-top: 14px;
  padding: 8px 18px;
  border-radius: 6px;
  background: #1e1f24;
  color: var(--txt2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13.5px;
}

/* ---------- 强制登录墙 ---------- */

.loginwall {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 32px;
  background:
    radial-gradient(110% 80% at 16% 8%, #232a44 0%, transparent 62%),
    radial-gradient(95% 75% at 88% 90%, #3a1f34 0%, transparent 62%),
    #0a0b10;
}
.lw-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-shadow: -1.6px 0 var(--cyan), 1.6px 0 var(--red);
  opacity: 0.95;
  margin-bottom: 40px;
}
.lw-title { font-size: 22px; font-weight: 600; }
.lw-sub { margin-top: 12px; font-size: 13.5px; line-height: 1.6; color: var(--txt2); }
.lw-btn {
  margin-top: 30px;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  background: #fff;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.12s;
}
.lw-btn:active { transform: scale(0.96); }
.lw-btn svg { width: 19px; height: 19px; }

/* ---------- 杂项 ---------- */

.boot-spin,
.more-spin {
  position: absolute;
  z-index: 60;
  left: 50%;
  transform: translateX(-50%);
}
.boot-spin { top: 50%; transform: translate(-50%, -50%); }
.more-spin { bottom: calc(64px + var(--safe-bottom)); }
.boot-spin i,
.more-spin i {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.more-spin i { width: 22px; height: 22px; border-width: 2.5px; }

.feed-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--txt2);
  font-size: 14px;
  line-height: 2;
  padding: 0 36px;
}

.cap-user { font: inherit; color: inherit; text-shadow: inherit; padding: 0; }
.cap-text .htag,
.text-stage .htag { font: inherit; font-weight: 600; color: #fff; padding: 0; text-shadow: inherit; }
.text-stage a { color: #9fd8ff; text-decoration: none; }
.caption:not(.open) .cap-quote {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.r-avatar img[data-act] { cursor: pointer; }
.pf-multi { display: inline-flex; align-items: center; gap: 3px; }
.pf-multi svg { width: 11px; height: 11px; fill: #fff; }
.pf-tab b { font-weight: 600; font-size: 12.5px; }
/* iOS：输入框字号 <16px 聚焦会触发页面缩放 */
.sr-head input { font-size: 16px; }

.toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(110px + var(--safe-bottom));
  z-index: 99;
  background: rgba(24, 24, 30, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  max-width: 78%;
  text-align: center;
  animation: fade 0.2s ease;
}
