/* 刷视频 · 沉浸式竖向视频流 */
:root {
  --vf-bg: #0B0B0D;
  --vf-fg: #F5F4F1;
  --vf-dim: rgba(245, 244, 241, 0.66);
  --vf-veil: rgba(11, 11, 13, 0.55);
  --vf-line: rgba(245, 244, 241, 0.16);
  --vf-accent: #B5854F;
  --vf-topbar-h: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body.vf-page {
  background: var(--vf-bg);
  color: var(--vf-fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ── 顶栏 / 悬浮控件 ── */
.vf-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: calc(var(--vf-topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.72), rgba(11, 11, 13, 0));
  pointer-events: none;
}

.vf-topbar > * { pointer-events: auto; }

.vf-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 244, 241, 0.1);
  color: var(--vf-fg);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.vf-icon-btn:hover { background: rgba(245, 244, 241, 0.2); }
.vf-icon-btn:focus-visible { outline: 1px solid var(--vf-accent); outline-offset: 2px; }

.vf-brand {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--vf-fg);
}

.vf-source {
  margin-left: auto;
  max-width: 42vw;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(245, 244, 241, 0.1);
  color: var(--vf-fg);
  font-size: 12px;
  cursor: pointer;
}

.vf-source option { color: #1C1B19; }

.vf-sound { position: fixed; right: 14px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 20; }

.vf-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--vf-dim);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.vf-hint.hidden { display: block !important; opacity: 0; }

.vf-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  max-width: 78vw;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.78);
  color: var(--vf-fg);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

/* ── 视频流 ── */
.vf-feed {
  height: 100dvh;
  height: 100vh;
  overflow-y: scroll;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vf-feed::-webkit-scrollbar { width: 0; height: 0; }

.vf-item {
  position: relative;
  height: 100dvh;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--vf-bg);
  overflow: hidden;
}

.vf-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.vf-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 72%, rgba(0, 0, 0, 0.42) 100%);
}

.vf-badge {
  position: absolute;
  left: 14px;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  max-width: 60vw;
  padding: 4px 10px;
  border: 1px solid var(--vf-line);
  border-radius: 999px;
  background: var(--vf-veil);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--vf-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf-badge:empty { display: none; }

.vf-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(245, 244, 241, 0.14);
}

.vf-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--vf-fg);
  transition: width 0.2s linear;
}

.vf-item:not(.vf-item-active) .vf-progress { opacity: 0; }

.vf-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 76vw;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--vf-veil);
  font-size: 13px;
  color: var(--vf-fg);
  text-align: center;
  line-height: 1.5;
}

.vf-retry {
  position: absolute;
  left: 50%;
  top: calc(50% + 46px);
  transform: translateX(-50%);
  padding: 8px 22px;
  border: 1px solid var(--vf-line);
  border-radius: 999px;
  background: rgba(245, 244, 241, 0.12);
  color: var(--vf-fg);
  font-size: 13px;
  cursor: pointer;
}

.vf-retry:hover { background: rgba(245, 244, 241, 0.22); }

.vf-paused .vf-video { opacity: 0.72; }

.vf-pause-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  display: none;
}

.vf-paused .vf-pause-mark { display: block; }

.vf-pause-mark::before,
.vf-pause-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 3px;
  height: 20px;
  margin-top: -10px;
  background: var(--vf-fg);
}

.vf-pause-mark::before { left: 21px; }
.vf-pause-mark::after { left: 33px; }

@media (prefers-reduced-motion: reduce) {
  .vf-progress i, .vf-hint { transition: none; }
}

/* ── 访问密码门禁 ── */
.vf-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0B0B0D;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vf-gate.hidden { display: none; }

.vf-gate-card {
  width: min(320px, 100%);
  text-align: center;
  color: #EDEBE6;
}

.vf-gate-icon { color: #B5854F; }

.vf-gate-title {
  font-size: 17px;
  font-weight: 600;
  margin: 14px 0 6px;
}

.vf-gate-sub {
  font-size: 12px;
  color: rgba(238, 238, 238, 0.55);
  margin: 0 0 22px;
}

.vf-gate-input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.vf-gate-input:focus { border-color: #B5854F; }

.vf-gate-btn {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  border: none;
  border-radius: 10px;
  background: #B5854F;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.vf-gate-btn:disabled { opacity: 0.6; cursor: default; }

.vf-gate-error {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 12px;
  color: #FF8A80;
}
