/* ==========================================================================
   抖音网页版 · 推荐流 / 播放器 / 评论区
   ========================================================================== */
.feed-page { height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; overflow: hidden; }
.feed-toolbar {
  flex: 0 0 auto; height: 56px; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 0 24px; position: relative; z-index: 12;
  background: linear-gradient(180deg, var(--bg-body) 20%, transparent);
}
.feed-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-soft); }
.feed-tab {
  position: relative; height: 34px; padding: 0 20px; border-radius: 999px; color: var(--text-2);
  font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s var(--ease);
}
.feed-tab:hover { color: var(--text); }
.feed-tab.active { color: #fff; background: var(--brand); box-shadow: 0 4px 14px rgba(254, 44, 85, .3); }
.feed-tab .icon { width: 16px; height: 16px; }
.feed-tools { position: absolute; right: 26px; display: flex; align-items: center; gap: 6px; }
.feed-tools .icon-btn { width: 34px; height: 34px; }
.feed-status { font-size: 11px; color: var(--text-4); margin-left: 6px; }

.feed-list {
  flex: 1; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory;
  scrollbar-width: none; padding: 0 0 8px; overscroll-behavior: contain;
}
.feed-list::-webkit-scrollbar { display: none; }
.feed-item {
  min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; padding: 4px 28px 20px;
}
.feed-stage {
  width: min(1160px, 100%); height: min(calc(100vh - var(--topbar-h) - 86px), 900px);
  display: grid; grid-template-columns: minmax(0, 1fr) 386px; gap: 20px; align-items: stretch;
}
.video-column {
  position: relative; height: 100%; border-radius: 20px; overflow: hidden; background: #050507;
  box-shadow: var(--shadow-lg); isolation: isolate;
}
.video-ambient {
  position: absolute; inset: -60px; background-size: cover; background-position: center;
  filter: blur(46px) saturate(1.25) brightness(.34); transform: scale(1.12); z-index: 0;
  opacity: .9;
}
.video-ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, transparent 20%, rgba(0,0,0,.55) 78%); }
.video-shell {
  position: relative; height: 100%; aspect-ratio: 9 / 16; margin: 0 auto; background: #000;
  z-index: 1; overflow: hidden;
}
.feed-video { width: 100%; height: 100%; object-fit: cover; background: #000; cursor: pointer; }
.video-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.22) 0%, transparent 18%, transparent 55%, rgba(0,0,0,.68) 100%);
}
.video-topline {
  position: absolute; top: 16px; left: 16px; right: 16px; display: flex; align-items: center;
  justify-content: space-between; z-index: 5; pointer-events: none;
}
.video-flag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 7px;
  background: rgba(10, 10, 14, .42); border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.86);
  font-size: 11px; backdrop-filter: blur(10px); letter-spacing: .2px;
}
.video-flag .icon { width: 13px; height: 13px; color: var(--cyan); }
.video-index { font-size: 11px; color: rgba(255,255,255,.62); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- action rail */
.video-actions {
  position: absolute; right: 12px; bottom: 108px; z-index: 8; display: flex; flex-direction: column;
  align-items: center; gap: 17px;
}
.action-avatar-wrap { position: relative; margin-bottom: 4px; }
.action-avatar-wrap .avatar { width: 48px; height: 48px; border: 2px solid rgba(255,255,255,.92); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.action-follow {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); width: 20px; height: 20px;
  border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
  border: 2px solid #fff; transition: transform .2s var(--ease), background .2s var(--ease);
}
.action-follow:hover { transform: translateX(-50%) scale(1.1); }
.action-follow.following { background: var(--bg-soft); color: var(--text); border-color: rgba(255,255,255,.6); }
.action-follow .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); transition: transform .18s var(--ease);
}
.action-btn:hover { transform: scale(1.08); }
.action-btn:active { transform: scale(.94); }
.action-btn .action-icon-wrap {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12, 12, 16, .34); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px); transition: background .18s var(--ease);
}
.action-btn:hover .action-icon-wrap { background: rgba(12, 12, 16, .55); }
.action-btn .icon { width: 25px; height: 25px; stroke-width: 1.7; }
.action-btn.liked { color: var(--brand); }
.action-btn.liked .icon { fill: var(--brand); stroke: var(--brand); }
.action-btn.collected { color: var(--gold); }
.action-btn.collected .icon { fill: var(--gold); stroke: var(--gold); }
.action-btn .action-count { font-size: 11.5px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.6); font-variant-numeric: tabular-nums; }
.action-btn.like-pop .action-icon-wrap { animation: like-pop .35s var(--ease); }
@keyframes like-pop { 40% { transform: scale(1.22); } }

/* ------------------------------------------------------------- meta overlay */
.video-meta {
  position: absolute; left: 16px; right: 74px; bottom: 92px; z-index: 6; color: #fff;
  text-shadow: 0 1px 5px rgba(0,0,0,.5); pointer-events: none;
}
.video-meta > * { pointer-events: auto; }
.video-author { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.video-author .name { font-size: 15px; font-weight: 700; letter-spacing: .1px; }
.video-author .verified { color: #fff; filter: drop-shadow(0 0 2px rgba(37,244,238,.6)); }
.video-caption { font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,.94); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.video-tags { margin-top: 4px; font-size: 12.5px; color: var(--cyan); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.video-tags .tag { color: var(--cyan); }
.video-music { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: rgba(255,255,255,.86); cursor: pointer; width: fit-content; }
.video-music .icon { width: 14px; height: 14px; }
.video-music .music-title { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-marquee { overflow: hidden; max-width: 220px; }
.music-marquee span { display: inline-block; white-space: nowrap; animation: marquee 9s linear infinite; }
@keyframes marquee { 0%, 12% { transform: translateX(0); } 100% { transform: translateX(-55%); } }

/* ------------------------------------------------------------- controls */
.play-center {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none;
}
.play-center button {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12,12,16,.42); border: 1px solid rgba(255,255,255,.2); color: #fff;
  backdrop-filter: blur(8px); opacity: 0; transform: scale(.9); transition: opacity .2s var(--ease), transform .2s var(--ease);
  pointer-events: auto;
}
.play-center button .icon { width: 30px; height: 30px; margin-left: 3px; }
.video-shell.paused .play-center button, .video-shell:hover .play-center button { opacity: 1; transform: scale(1); }
.video-shell:hover .play-center button:hover { background: rgba(12,12,16,.62); }
.video-controls {
  position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 10; display: flex;
  align-items: center; gap: 8px; color: #fff; opacity: 0; transform: translateY(4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.video-shell:hover .video-controls, .video-shell.paused .video-controls, .video-shell.controls-open .video-controls { opacity: 1; transform: translateY(0); }
.control-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: rgba(255,255,255,.92);
  background: rgba(12,12,16,.3); backdrop-filter: blur(6px); transition: background .18s var(--ease);
}
.control-btn:hover { background: rgba(12,12,16,.56); }
.control-btn .icon { width: 18px; height: 18px; }
.control-btn.active { color: var(--cyan); }
.volume-wrap { display: flex; align-items: center; gap: 5px; }
.volume-slider {
  width: 74px; height: 3px; appearance: none; background: rgba(255,255,255,.28); border-radius: 99px; cursor: pointer;
}
.volume-slider::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #fff; }
.control-spacer { flex: 1; }
.control-label { font-size: 11px; color: rgba(255,255,255,.82); min-width: 30px; text-align: center; }
.video-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 11; cursor: pointer;
  background: rgba(255,255,255,.18); transition: height .15s var(--ease);
}
.video-progress:hover { height: 5px; }
.video-progress-fill { height: 100%; width: 0; background: var(--brand); position: relative; }
.video-progress-fill::after { content: ""; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .15s; }
.video-progress:hover .video-progress-fill::after { opacity: 1; }
.video-time { font-size: 10.5px; color: rgba(255,255,255,.74); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- danmaku */
.danmaku-layer { position: absolute; inset: 0 0 92px 0; z-index: 3; pointer-events: none; overflow: hidden; }
.danmaku-item {
  position: absolute; left: 100%; white-space: nowrap; font-size: 15px; font-weight: 600;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.85); will-change: transform;
  animation: danmaku-move linear forwards;
}
.danmaku-item.self { color: var(--cyan); border: 1px solid rgba(37,244,238,.6); border-radius: 999px; padding: 1px 9px; }
@keyframes danmaku-move {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100vw - 100%)); }
}
.heart-burst { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.burst-heart { position: absolute; color: var(--brand); animation: heart-float .9s var(--ease) forwards; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.burst-heart .icon { width: 26px; height: 26px; fill: var(--brand); stroke: none; }
@keyframes heart-float {
  0% { opacity: 0; transform: translateY(0) scale(.4) rotate(-12deg); }
  25% { opacity: 1; transform: translateY(-28px) scale(1.15) rotate(4deg); }
  100% { opacity: 0; transform: translateY(-150px) scale(.9) rotate(18deg); }
}

/* ------------------------------------------------------------- comment panel */
.feed-panel {
  height: 100%; display: flex; flex-direction: column; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-md);
}
.panel-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.panel-title .count { font-weight: 400; }
.panel-head .select { width: auto; height: 30px; padding: 0 30px 0 10px; font-size: 12px; background-color: transparent; border-color: transparent; color: var(--text-2); }
.panel-head .select:hover { background-color: var(--bg-soft); }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 18px 10px; overscroll-behavior: contain; }
.panel-empty { padding: 44px 12px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.panel-empty .icon { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--text-4); }
.comment-item { display: flex; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-top { display: flex; align-items: center; gap: 6px; }
.comment-name { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.comment-name:hover { color: var(--text); }
.comment-badge { font-size: 9px; color: var(--brand); border: 1px solid rgba(254,44,85,.35); border-radius: 4px; padding: 0 4px; line-height: 14px; }
.comment-text { font-size: 13px; line-height: 1.6; margin-top: 3px; color: var(--text); word-break: break-word; white-space: pre-wrap; }
.comment-text .tag { color: var(--cyan); }
.comment-text .mention { color: var(--cyan); }
.comment-meta { display: flex; align-items: center; gap: 14px; margin-top: 5px; font-size: 11px; color: var(--text-3); }
.comment-meta button { color: var(--text-3); font-size: 11px; }
.comment-meta button:hover { color: var(--text); }
.comment-like { margin-left: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-3); min-width: 28px; }
.comment-like .icon { width: 16px; height: 16px; }
.comment-like:hover { color: var(--text); }
.comment-like.liked { color: var(--brand); }
.comment-like.liked .icon { fill: var(--brand); stroke: var(--brand); }
.comment-like span { font-size: 10px; }
.comment-replies { margin-top: 10px; padding: 2px 0 0 0; display: flex; flex-direction: column; gap: 9px; }
.comment-reply { display: flex; gap: 8px; }
.comment-reply .avatar { width: 24px; height: 24px; }
.comment-reply .comment-text { font-size: 12.5px; margin-top: 0; }
.comment-reply .comment-name { font-size: 11.5px; }
.reply-toggle { font-size: 11px; color: var(--text-3); margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.reply-toggle:hover { color: var(--cyan); }
.reply-toggle::before { content: ""; width: 16px; height: 1px; background: var(--line-strong); }
.comment-more { text-align: center; padding: 10px 0 2px; }
.comment-more button { font-size: 12px; color: var(--text-3); }
.comment-more button:hover { color: var(--cyan); }

.composer { flex: 0 0 auto; padding: 12px 14px 14px; border-top: 1px solid var(--line); background: var(--bg-card); }
.composer-reply-hint { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-bottom: 6px; padding: 0 4px; }
.composer-reply-hint button { color: var(--text-3); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-input-wrap { flex: 1; min-width: 0; background: var(--bg-input); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; transition: border-color .18s var(--ease); }
.composer-input-wrap:focus-within { border-color: var(--line-strong); }
.composer-input { width: 100%; min-height: 22px; max-height: 96px; border: 0; outline: 0; resize: none; background: transparent; font-size: 13px; line-height: 1.5; padding: 0; }
.composer-tools { display: flex; align-items: center; gap: 2px; margin-top: 3px; }
.composer-tools .icon-btn { width: 26px; height: 26px; }
.composer-tools .icon { width: 17px; height: 17px; }
.composer-send { height: 34px; padding: 0 14px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 600; }
.composer-send[disabled] { opacity: .4; }
.composer-login { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--text-3); font-size: 12.5px; cursor: pointer; }
.composer-login:hover { background: var(--bg-soft); color: var(--text); }

/* ------------------------------------------------------------- comment sheet (mobile) */
.comment-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 191; height: 72vh; display: flex; flex-direction: column; background: var(--bg-card); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line-strong); box-shadow: 0 -20px 60px rgba(0,0,0,.5); animation: sheet-up .24s var(--ease); }
.comment-sheet .panel-head { border-radius: 22px 22px 0 0; }
.comment-sheet .panel-body { flex: 1; }
.comment-sheet .composer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------- video grid / cards */
.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.video-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.video-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.video-card { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg-soft); aspect-ratio: 9 / 16; cursor: pointer; isolation: isolate; }
.video-card img, .video-card video { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.video-card:hover img, .video-card:hover video { transform: scale(1.045); }
.video-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.72) 100%); pointer-events: none; }
.video-card-info { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 2; color: #fff; }
.video-card-caption { font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 4px rgba(0,0,0,.55); }
.video-card-meta { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 10.5px; color: rgba(255,255,255,.78); }
.video-card-meta .icon { width: 12px; height: 12px; }
.video-card-play { position: absolute; left: 10px; top: 10px; z-index: 2; display: flex; align-items: center; gap: 4px; color: #fff; font-size: 10.5px; background: rgba(0,0,0,.34); padding: 2px 7px; border-radius: 6px; backdrop-filter: blur(6px); }
.video-card-play .icon { width: 11px; height: 11px; }
.video-card .hover-play { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .2s var(--ease); pointer-events: none; }
.video-card:hover .hover-play { opacity: 1; }
.video-card .hover-play video { width: 100%; height: 100%; object-fit: cover; }
.video-card-add { position: absolute; right: 10px; top: 10px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.4); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.video-card-add .icon { width: 15px; height: 15px; }

/* ------------------------------------------------------------- feed banner / detail */
.feed-banner {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin: 0 28px 8px;
  padding: 9px 14px; border-radius: 10px; background: var(--brand-soft);
  border: 1px solid rgba(254, 44, 85, .2); color: var(--text-2); font-size: 12.5px;
}
.feed-banner .icon { width: 16px; height: 16px; color: var(--brand); }
.feed-banner a { margin-left: auto; color: var(--cyan); font-weight: 600; white-space: nowrap; }
.video-detail-page { padding-top: 18px; }
.video-detail-inner { max-width: 1160px; margin: 0 auto; padding: 0 28px 72px; }
.video-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.video-detail-stage { height: min(calc(100vh - 170px), 880px); margin: 0 auto 26px; }
.video-detail-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 100px 0; color: var(--text-3); }
.video-detail-page .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.video-shell:fullscreen { width: 100vw; height: 100vh; background: #000; aspect-ratio: auto; }
.video-shell:fullscreen .feed-video { object-fit: contain; }
.video-shell:fullscreen .video-meta, .video-shell:fullscreen .video-actions { z-index: 20; }
.video-fullscreen .topbar, .video-fullscreen .sidebar, .video-fullscreen .mobile-nav { display: none; }
@media (max-width: 900px) {
  .feed-banner { margin: 6px 10px; }
  .video-detail-page { padding-top: 0; }
  .video-detail-inner { padding: 12px 0 80px; }
  .video-detail-stage { height: calc(100vh - var(--topbar-h) - var(--mobile-nav-h) - 48px); margin-bottom: 18px; display: block; }
  .video-detail-page .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 0 8px; }
  .video-detail-page .section-head { padding: 0 12px; }
}

/* ------------------------------------------------------------- feed skeleton */
.feed-skeleton { display: flex; align-items: center; justify-content: center; height: 100%; padding: 10px 28px 20px; }
.feed-skeleton .stage { width: min(1160px, 100%); height: min(calc(100vh - var(--topbar-h) - 86px), 900px); display: grid; grid-template-columns: minmax(0, 1fr) 386px; gap: 20px; }
.feed-skeleton .v { border-radius: 20px; }
.feed-skeleton .p { border-radius: 20px; }
.feed-skeleton .v::before { content: ""; position: absolute; }
.loading-dots { display: inline-flex; gap: 3px; }
.loading-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); animation: dot-bounce .9s infinite; }
.loading-dots i:nth-child(2) { animation-delay: .12s; }
.loading-dots i:nth-child(3) { animation-delay: .24s; }
@keyframes dot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
