/* 短视频 feed (pilot 2026-10-27). Theme via --sv-accent on :root. */
:root { --sv-accent: #ff6b2c; --sv-bg: #000; --sv-fg: #fff; --sv-dim: rgba(255,255,255,.72); color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--sv-bg); color: var(--sv-fg); overflow: hidden;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
a { color: inherit; }
.sv-top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; }
.sv-top > * { pointer-events: auto; }
.sv-home { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 22px; text-decoration: none; font-weight: 600; background: rgba(0,0,0,.35); }
.sv-home img { height: 26px; width: auto; display: block; }
.sv-top h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .5px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.sv-mute { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; color: #fff; background: rgba(0,0,0,.45); font: inherit; font-size: 13px; cursor: pointer; }
.sv-mute .sv-wave { display: none; } .sv-mute.on .sv-wave { display: inline; } .sv-mute.on .sv-x { display: none; }
#sv-feed { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#sv-feed::-webkit-scrollbar { display: none; }
.sv-card { position: relative; height: 100vh; height: 100dvh; width: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; }
.sv-bg { position: absolute; inset: -40px; background: center/cover no-repeat; filter: blur(28px) brightness(.45); transform: scale(1.1); }
.sv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.sv-tap { position: absolute; inset: 0; z-index: 2; border: 0; background: transparent; cursor: pointer; padding: 0; color: #fff; }
.sv-playicon { display: none; opacity: .85; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.sv-paused .sv-playicon { display: inline-block; }
.sv-spin { position: absolute; z-index: 3; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: sv-rot .8s linear infinite; display: none; pointer-events: none; }
.sv-loading .sv-spin { display: block; }
.sv-paused .sv-spin { display: none; }
@keyframes sv-rot { to { transform: rotate(360deg); } }
.sv-side { position: absolute; z-index: 4; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 150px); display: flex; flex-direction: column; gap: 14px; }
.sv-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; min-height: 52px; border: 0; background: none; color: #fff; font: inherit; font-size: 12px; cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.sv-btn svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.sv-like svg path { fill: rgba(255,255,255,.92); }
.sv-like.on svg path { fill: #ff3b5c; }
.sv-info { position: absolute; z-index: 4; left: 0; right: 72px; bottom: 0; padding: 40px 14px calc(env(safe-area-inset-bottom) + 22px); background: linear-gradient(transparent, rgba(0,0,0,.75)); pointer-events: none; }
.sv-info > * { pointer-events: auto; }
.sv-title { margin: 0 0 2px; font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.sv-ep { margin: 0 0 4px; color: var(--sv-dim); font-size: 13px; }
.sv-tags { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--sv-dim); }
.sv-full { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 20px; border-radius: 22px; background: var(--sv-accent); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.sv-prog { position: absolute; z-index: 5; left: 0; right: 0; bottom: env(safe-area-inset-bottom); height: 3px; background: rgba(255,255,255,.18); }
.sv-prog i { display: block; height: 100%; background: var(--sv-accent); transform-origin: left; transform: scaleX(0); }
.sv-dead .sv-tap, .sv-dead .sv-side { display: none; }
.sv-dead .sv-info::before { content: "该片段暂时无法播放，已跳过"; display: block; margin-bottom: 8px; color: #ffd27a; font-size: 13px; }
.sv-ad .sv-adlink { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 80px 20px; text-decoration: none; }
.sv-ad img { max-width: min(92%, 420px); max-height: 62vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.5); object-fit: contain; }
.sv-adtitle { font-size: 17px; font-weight: 700; text-align: center; }
.sv-adcta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 22px; background: var(--sv-accent); font-weight: 700; }
.sv-adlabel { position: absolute; z-index: 3; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 10px); padding: 2px 8px; border-radius: 4px; font-size: 12px; background: rgba(0,0,0,.55); color: rgba(255,255,255,.8); }
.sv-empty { padding: 40vh 20px 0; text-align: center; color: var(--sv-dim); }
.sv-nav { display: none; }
#sv-toast { position: fixed; z-index: 30; left: 50%; top: 45%; transform: translate(-50%,-50%); padding: 10px 18px; border-radius: 8px; background: rgba(0,0,0,.8); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
#sv-toast.on { opacity: 1; }
.sv-backdrop { display: none; }
/* desktop: centered 9:16 column with blurred backdrop */
@media (min-width: 768px) {
  .sv-backdrop { display: block; position: fixed; inset: 0; background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.08), transparent 60%), #0b0b0d; }
  #sv-feed { left: 50%; right: auto; width: min(calc(100vh * 9 / 16), 100vw); transform: translateX(-50%); box-shadow: 0 0 80px rgba(0,0,0,.8); }
  .sv-card { border-left: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(255,255,255,.06); }
  .sv-top { padding-left: 24px; padding-right: 24px; }
  .sv-nav { display: flex; flex-direction: column; gap: 12px; position: fixed; z-index: 20; top: 50%; right: max(24px, calc(50% - 100vh * 9 / 32 - 84px)); transform: translateY(-50%); }
  .sv-nav button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; cursor: pointer; }
  .sv-nav button:hover { background: rgba(255,255,255,.22); }
}
@media (prefers-reduced-motion: reduce) {
  #sv-feed { scroll-behavior: auto; }
  .sv-spin { animation: none; border-top-color: rgba(255,255,255,.25); }
  #sv-toast { transition: none; }
}
.sv-seo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* rollout r1 (2026-10-27): tag links, 不显示 button, Next.js host page (html zoom reset) */
html:has(.sv-page) { zoom: 1 !important; }
.sv-page { position: fixed; inset: 0; z-index: 100; background: var(--sv-bg); }
.sv-tags a.sv-tag { color: var(--sv-dim); text-decoration: none; min-height: 24px; display: inline-flex; align-items: center; }
.sv-tags a.sv-tag:hover { color: #fff; text-decoration: underline; }
.sv-hide span { font-size: 11px; }
.sv-hidden .sv-tap, .sv-hidden .sv-side, .sv-hidden video { display: none; }
.sv-hidden .sv-info::before { content: "已隐藏这个视频"; display: block; margin-bottom: 8px; color: #ffd27a; font-size: 13px; }
/* v2 (2026-10-27): site accent, stable card height, layout that never overlaps on 375 px, end overlay, chips, share sheet, hint, heart */
.sv-page { --sv-accent: var(--action-strong, var(--action, #ff6b2c)); --sv-on-accent: #fff; }
:root { --sv-on-accent: #fff; }
.sv-full, .sv-adcta, .sv-end-full { color: var(--sv-on-accent); }
.sv-prog i { background: var(--sv-accent); }
.sv-card { height: 100%; }                         /* = #sv-feed height: no jump when the mobile URL bar collapses */
.sv-top { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.sv-top h1 { display: flex; align-items: baseline; gap: 8px; }
.sv-count { font-size: 12px; font-weight: 500; color: var(--sv-dim); font-variant-numeric: tabular-nums; }
.sv-count:empty { display: none; }
/* side rail sits in its own column; the info block never runs under it */
.sv-side { right: max(6px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 28px); gap: 10px; }
.sv-btn { min-width: 52px; min-height: 52px; }
.sv-info { left: 0; right: calc(64px + env(safe-area-inset-right)); padding-left: max(14px, env(safe-area-inset-left)); padding-bottom: calc(env(safe-area-inset-bottom) + 20px); }
.sv-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sv-ep { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-tags { max-height: 52px; overflow: hidden; }
.sv-chips { display: flex; gap: 6px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.sv-chips::-webkit-scrollbar { display: none; }
.sv-chip { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 22px; background: rgba(255,255,255,.14); color: #fff; font-size: 13px; text-decoration: none; white-space: nowrap; }
.sv-chip.on { background: #fff; color: #111; font-weight: 700; }
.sv-chip.sv-next-ep { background: var(--sv-accent); color: var(--sv-on-accent); font-weight: 700; }
.sv-full { max-width: 100%; }
.sv-prog { height: 3px; bottom: 0; }
.sv-prog i { transition: transform .25s linear; }
/* pause icon only while paused by the user, never during the end overlay */
.sv-ended .sv-playicon, .sv-loading .sv-playicon { display: none; }
.sv-end { position: absolute; z-index: 6; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: rgba(0,0,0,.62); text-align: center; }
.sv-ended .sv-end { display: flex; }
.sv-end-t { margin: 0 0 4px; font-size: 18px; font-weight: 700; max-width: 90%; }
.sv-end-full, .sv-end-next, .sv-end-replay { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; min-width: 200px; padding: 0 22px; border-radius: 24px; border: 0; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.sv-end-full { background: var(--sv-accent); }
.sv-end-next { background: #fff; color: #111; }
.sv-end-replay { min-width: 0; min-height: 44px; background: transparent; color: var(--sv-dim); font-weight: 500; }
.sv-end-n { font-variant-numeric: tabular-nums; font-weight: 500; }
.sv-ended .sv-side, .sv-ended .sv-info { visibility: hidden; }
/* double-tap heart */
.sv-burst { position: absolute; z-index: 7; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none; color: #ff3b5c; animation: sv-pop .9s ease-out forwards; }
.sv-burst svg { width: 96px; height: 96px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
.sv-burst svg path { fill: #ff3b5c; }
@keyframes sv-pop { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 15% { transform: scale(1.15) rotate(-6deg); opacity: 1; } 30% { transform: scale(.95); } 70% { transform: scale(1) translateY(0); opacity: 1; } 100% { transform: scale(1.1) translateY(-60px); opacity: 0; } }
.sv-like.on svg { animation: sv-beat .35s ease-out; }
@keyframes sv-beat { 50% { transform: scale(1.25); } }
/* share sheet */
.sv-sheet { position: fixed; z-index: 40; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.5); }
.sv-sheet[hidden] { display: none; }
.sv-sheet-box { width: min(100%, 480px); margin: 0; padding: 18px max(16px, env(safe-area-inset-left)) calc(env(safe-area-inset-bottom) + 18px); border-radius: 16px 16px 0 0; background: #1b1c20; color: #fff; }
.sv-sheet-t { margin: 0 0 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-sheet-u { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: #0f1013; color: #fff; font: inherit; font-size: 14px; }
.sv-sheet-b { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sv-sheet-b button { flex: 1 1 120px; min-height: 44px; border: 0; border-radius: 22px; font: inherit; font-weight: 700; cursor: pointer; background: rgba(255,255,255,.12); color: #fff; }
.sv-sheet-b .sv-sheet-copy { background: var(--sv-accent); color: var(--sv-on-accent); }
/* first-visit swipe hint */
.sv-hint { position: fixed; z-index: 35; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 22px; border-radius: 16px; background: rgba(0,0,0,.66); color: #fff; font-weight: 700; text-align: center; transition: opacity .3s; }
.sv-hint small { font-weight: 400; color: var(--sv-dim); }
.sv-hint-arrow { font-size: 30px; line-height: 1; animation: sv-nudge 1.1s ease-in-out infinite; }
.sv-hint.off { opacity: 0; }
@keyframes sv-nudge { 50% { transform: translateY(-10px); } }
:focus-visible { outline: 2px solid var(--sv-accent); outline-offset: 2px; }
/* short phones (iPhone SE 375×667) */
@media (max-height: 700px) {
  .sv-title { font-size: 16px; -webkit-line-clamp: 1; }
  .sv-tags { max-height: 26px; margin-bottom: 8px; }
  .sv-chips { margin-bottom: 8px; }
  .sv-side { gap: 4px; }
  .sv-btn span { font-size: 11px; }
}
@media (min-width: 768px) {
  .sv-burst { width: 120px; height: 120px; margin: -60px 0 0 -60px; }
}
@media (prefers-reduced-motion: reduce) {
  .sv-burst { animation: none; opacity: .9; }
  .sv-like.on svg, .sv-hint-arrow { animation: none; }
  .sv-prog i, .sv-hint { transition: none; }
}
