/* ==========================================================================
   COZONE Web — Tab 4: 福利 (Edition R1 · 极简深灰)
   Restrained Apple TV / Linear video aggregator layout.
   Zero neon, zero glows, zero badge soup.
   ========================================================================== */

.wf-page {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text, #F4F4F6);
}

/* ---------- Optional PIN Gate ---------- */

.wf-pin-wrap {
  width: 100%;
  min-height: calc(100vh - var(--topbar-h, 56px) - var(--audiobar-h, 52px) - 108px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0;
}

.wf-pin-card {
  width: 340px;
  max-width: 100%;
  background: var(--surface, #1E1E22);
  border: 1px solid var(--border, #242429);
  border-radius: var(--radius-xl, 12px);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wf-pin-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.wf-pin-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-elevated, #19191D);
  border: 1px solid var(--border, #242429);
  color: var(--text-secondary, #8E8E93);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wf-pin-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  color: var(--text, #F4F4F6);
  letter-spacing: 0.01em;
}

.wf-pin-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--text-secondary, #8E8E93);
}

.wf-pin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-pin-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md, 8px);
  background: var(--bg, #141416);
  border: 1px solid var(--border-strong, #323238);
  color: var(--text, #F4F4F6);
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.16s ease;
}

.wf-pin-input::placeholder {
  color: var(--text-muted, #636368);
  letter-spacing: 0;
}

.wf-pin-input:focus {
  border-color: var(--text-secondary, #8E8E93);
}

.wf-pin-submit {
  width: 100%;
  height: 38px;
  border: none;
  border-radius: var(--radius-md, 8px);
  background: var(--cta-bg, #FFFFFF);
  color: var(--cta-fg, #141416);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.16s ease;
}

.wf-pin-submit:hover:not(:disabled) {
  opacity: 0.9;
}

.wf-pin-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.wf-pin-error {
  min-height: 17px;
  margin: 0;
  font-size: 12px;
  line-height: 17px;
  color: var(--text-secondary, #8E8E93);
  font-variant-numeric: tabular-nums;
}

.wf-pin-error.is-visible {
  color: var(--text, #F4F4F6);
}

/* ---------- Sub-Toolbar ---------- */

.wf-toolbar {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wf-source-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border, #242429);
}

.wf-source-bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.wf-source-tabs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0 28px 0 2px;
}

.wf-source-tabs::-webkit-scrollbar {
  display: none;
}

.wf-source-tabs.has-fade-right {
  padding-right: 40px;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 48px), transparent 100%);
}

.wf-source-tabs.has-fade-left {
  padding-left: 32px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 44px, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 44px, #000 100%);
}

.wf-source-tabs.has-fade-left.has-fade-right {
  padding-left: 32px;
  padding-right: 40px;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 44px,
    #000 calc(100% - 48px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 44px,
    #000 calc(100% - 48px),
    transparent 100%
  );
}

.wf-scroll-chevron {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: var(--radius-sm, 6px);
  background: var(--surface, #1E1E22);
  border: 1px solid var(--border-strong, #323238);
  color: var(--text-secondary, #8E8E93);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.92;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.wf-scroll-chevron.is-left {
  left: 0;
}

.wf-scroll-chevron.is-right {
  right: 0;
}

.wf-scroll-chevron:hover {
  background: var(--surface-hover, #26262B);
  color: var(--text, #F4F4F6);
  opacity: 1;
}

.wf-scroll-chevron[hidden] {
  display: none !important;
}

@media (hover: hover) and (min-width: 768px) {
  .wf-scroll-chevron {
    display: inline-flex;
  }
}

.wf-source-tab {
  position: relative;
  flex: 0 0 auto;
  height: 38px;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #8E8E93);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.wf-source-tab:hover {
  color: var(--text, #F4F4F6);
}

.wf-source-tab.is-active {
  color: var(--text, #F4F4F6);
  font-weight: 600;
}

.wf-source-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--text, #F4F4F6);
  border-radius: 1px;
}

.wf-source-tab.is-cooldown:not(.is-active) {
  opacity: 0.6;
}

.wf-source-tab.is-relay {
  color: var(--text-muted, #636368);
}

.wf-source-tab.is-relay:hover,
.wf-source-tab.is-relay.is-active {
  color: var(--text, #F4F4F6);
}

.wf-source-ms {
  font-family: var(--font-mono, "SF Mono", "Cascadia Mono", "Consolas", monospace);
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
  color: var(--text-muted, #636368);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.wf-source-tab.is-active .wf-source-ms {
  color: var(--text-secondary, #8E8E93);
}

.wf-source-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 14px;
  background: var(--border-strong, #323238);
}

/* Whisper-quiet 6px status dots (zero neon, zero glow) */
.wf-direct-dot,
.wf-health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--health-ok, var(--status-ok, #30D158));
  flex-shrink: 0;
}

.wf-health-dot.is-healthy {
  background: var(--health-ok, #30D158);
}

.wf-health-dot.is-degraded {
  background: var(--health-warn, #FFD60A);
}

.wf-health-dot.is-cooldown {
  background: var(--health-bad, #FF453A);
}

.wf-health-dot.is-untested {
  background: var(--health-idle, #636366);
}

.wf-source-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 4px;
}

.wf-quiet-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  border: 1px solid var(--border, #242429);
  color: var(--text-secondary, #8E8E93);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.wf-quiet-btn:hover:not(:disabled) {
  background: var(--surface, #1E1E22);
  border-color: var(--border-strong, #323238);
  color: var(--text, #F4F4F6);
}

.wf-quiet-btn.is-active {
  background: var(--surface, #1E1E22);
  border-color: var(--border-strong, #323238);
  color: var(--text, #F4F4F6);
}

.wf-quiet-btn.is-failed:not(.is-active) {
  opacity: 0.52;
  color: var(--text-muted, #636368);
}

.wf-quiet-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.wf-route-ms {
  font-family: var(--font-mono, "SF Mono", "Cascadia Mono", "Consolas", monospace);
  font-size: 10.5px;
  color: var(--text-muted, #636368);
  font-variant-numeric: tabular-nums;
}

.wf-probe-spin {
  animation: wf-spin 0.85s linear infinite;
}

/* ---------- Secondary Row: Categories + Search + Switches ---------- */

.wf-sub-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.wf-cat-strip {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-right: 12px;
}

.wf-cat-strip.has-fade-right {
  padding-right: 26px;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
}

.wf-cat-strip.has-fade-left {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 24px, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 24px, #000 100%);
}

.wf-cat-strip.has-fade-left.has-fade-right {
  padding-right: 26px;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 24px,
    #000 calc(100% - 28px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 24px,
    #000 calc(100% - 28px),
    transparent 100%
  );
}

.wf-cat-strip::-webkit-scrollbar {
  display: none;
}

.wf-cat-chip {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #8E8E93);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wf-cat-chip:hover {
  background: var(--surface, #1E1E22);
  color: var(--text, #F4F4F6);
}

.wf-cat-chip.is-active {
  background: var(--surface, #1E1E22);
  border-color: var(--border-strong, #323238);
  color: var(--text, #F4F4F6);
  font-weight: 500;
}

.wf-session-hint {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted, #636368);
  white-space: nowrap;
  padding-left: 6px;
}

.wf-controls-group {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.wf-search-form {
  position: relative;
  width: 216px;
  max-width: 100%;
  height: 32px;
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #1E1E22);
  border: 1px solid var(--border, #242429);
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  gap: 6px;
  transition: border-color 0.15s ease;
}

.wf-search-form:focus-within {
  border-color: var(--border-strong, #323238);
}

.wf-search-icon {
  flex-shrink: 0;
  color: var(--text-muted, #636368);
  display: inline-flex;
  align-items: center;
}

.wf-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text, #F4F4F6);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.wf-search-input::placeholder {
  color: var(--text-muted, #636368);
}

.wf-search-clear {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-hover, #26262B);
  color: var(--text-secondary, #8E8E93);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.wf-search-clear:hover {
  color: var(--text, #F4F4F6);
}

.wf-search-clear[hidden] {
  display: none;
}

/* Monochrome Switches */

.wf-switches {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.wf-switch {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary, #8E8E93);
  font-family: inherit;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.15s ease;
  user-select: none;
}

.wf-switch:hover {
  color: var(--text, #F4F4F6);
}

.wf-switch[aria-checked="true"] {
  color: var(--text, #F4F4F6);
}

.wf-switch-track {
  position: relative;
  width: 26px;
  height: 15px;
  border-radius: 999px;
  background: var(--border-strong, #323238);
  transition: background-color 0.16s ease;
  flex-shrink: 0;
}

.wf-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-secondary, #8E8E93);
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.wf-switch[aria-checked="true"] .wf-switch-track {
  background: var(--cta-bg, #FFFFFF);
}

.wf-switch[aria-checked="true"] .wf-switch-thumb {
  transform: translateX(11px);
  background: var(--cta-fg, #141416);
}

/* Optional quiet notice strip */
.wf-banner-note {
  padding: 8px 12px;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-elevated, #19191D);
  border: 1px solid var(--border, #242429);
  font-size: 12px;
  line-height: 17px;
  color: var(--text-secondary, #8E8E93);
}

.wf-banner-note[hidden] {
  display: none;
}

/* ---------- Workspace (Grid + Adaptive Split/Top Player) ---------- */

.wf-workspace {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wf-catalog-col {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Theater Player Container */

.wf-theater {
  width: 100%;
  min-width: 0;
  background: var(--bg-elevated, #19191D);
  border: 1px solid var(--border, #242429);
  border-radius: var(--radius-xl, 12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wf-theater[hidden] {
  display: none;
}

.wf-player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0C0C0E;
  overflow: hidden;
}

.wf-player-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wf-player-state {
  position: absolute;
  inset: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  background: #111114;
  color: var(--text-secondary, #8E8E93);
  z-index: 3;
}

.wf-player-state[hidden] {
  display: none;
}

.wf-player-state-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--text, #F4F4F6);
}

.wf-player-state-desc {
  margin: 0;
  max-width: 440px;
  font-size: 12.5px;
  line-height: 19px;
  color: var(--text-secondary, #8E8E93);
}

.wf-player-state-actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wf-cta-sm {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: var(--cta-bg, #FFFFFF);
  color: var(--cta-fg, #141416);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.wf-cta-sm:hover {
  opacity: 0.9;
}

.wf-link-sm {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm, 6px);
  background: var(--surface, #1E1E22);
  border: 1px solid var(--border-strong, #323238);
  color: var(--text, #F4F4F6);
  font-family: inherit;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.wf-link-sm:hover {
  background: var(--surface-hover, #26262B);
}

.wf-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong, #323238);
  border-top-color: var(--text, #F4F4F6);
  animation: wf-spin 0.8s linear infinite;
}

@keyframes wf-spin {
  to {
    transform: rotate(360deg);
  }
}

.wf-theater-bar {
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border, #242429);
}

.wf-theater-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wf-theater-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wf-theater-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 20px;
  color: var(--text, #F4F4F6);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wf-theater-sub {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary, #8E8E93);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wf-theater-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-sm, 6px);
  background: var(--surface, #1E1E22);
  border: 1px solid var(--border, #242429);
  color: var(--text-secondary, #8E8E93);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wf-theater-close:hover {
  background: var(--surface-hover, #26262B);
  color: var(--text, #F4F4F6);
}

.wf-theater-routes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wf-theater-routes[hidden] {
  display: none;
}

.wf-theater-notice {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg, #141416);
  border: 1px solid var(--border, #242429);
  font-size: 12px;
  line-height: 17px;
  color: var(--text-secondary, #8E8E93);
}

.wf-theater-notice[hidden] {
  display: none;
}

/* Desktop side-by-side split theater (>= 1080px) */
@media (min-width: 1080px) {
  .wf-workspace.has-player {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 348px;
    gap: 20px;
    align-items: start;
  }

  .wf-workspace.has-player .wf-theater {
    position: sticky;
    top: calc(var(--topbar-h, 56px) + 16px);
  }

  .wf-workspace.has-player .wf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }
}

@media (min-width: 1280px) {
  .wf-workspace.has-player {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 22px;
  }
}

/* ---------- Responsive 16:9 Card Grid ---------- */

.wf-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 16px;
}

@media (max-width: 1023px) {
  .wf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 12px;
  }
}

@media (max-width: 767px) {
  .wf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
}

.wf-card {
  min-width: 0;
  margin: 0;
}

.wf-card-btn {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  outline: none;
}

.wf-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: #1B1B1F;
  isolation: isolate;
}

.wf-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.065);
  pointer-events: none;
  z-index: 4;
  transition: box-shadow 0.16s ease;
}

.wf-card-btn:hover .wf-thumb::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.wf-card-btn:focus-visible .wf-thumb::after {
  box-shadow: inset 0 0 0 1.5px var(--text, #F4F4F6);
}

.wf-card.is-playing .wf-thumb::after {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.72);
}

.wf-thumb-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: filter 0.24s ease, transform 0.28s ease;
  will-change: transform, filter;
}

.wf-card-btn:hover .wf-thumb-media {
  transform: scale(1.025);
}

/* Muted monochrome placeholder when cover is absent or unavailable */
.wf-placeholder {
  position: absolute;
  inset: 0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  user-select: none;
}

.wf-placeholder::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.032);
  pointer-events: none;
}

.wf-ph-0 {
  background: radial-gradient(120% 95% at 22% 18%, #2B2C33 0%, #1B1C20 56%, #141417 100%);
}

.wf-ph-1 {
  background: radial-gradient(120% 95% at 78% 20%, #262930 0%, #191B1F 58%, #131417 100%);
}

.wf-ph-2 {
  background: radial-gradient(120% 95% at 30% 80%, #2C2A30 0%, #1C1B20 58%, #141417 100%);
}

.wf-ph-3 {
  background: radial-gradient(120% 95% at 72% 76%, #25282D 0%, #191A1E 56%, #131417 100%);
}

.wf-ph-4 {
  background: radial-gradient(120% 95% at 50% 15%, #2B2C31 0%, #1B1C20 60%, #141417 100%);
}

.wf-ph-5 {
  background: radial-gradient(120% 95% at 18% 68%, #282A30 0%, #1A1B1F 58%, #131416 100%);
}

.wf-ph-label {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 18px;
  color: rgba(244, 244, 246, 0.54);
  letter-spacing: 0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 88%;
}

.wf-ph-sub {
  font-family: var(--font-mono, "SF Mono", "Cascadia Mono", "Consolas", monospace);
  font-size: 10px;
  line-height: 14px;
  color: rgba(142, 142, 147, 0.56);
  letter-spacing: 0.09em;
  font-variant-numeric: tabular-nums;
}

.wf-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wf-cover-img.is-loaded {
  opacity: 1;
}

/* Single shared muted hover-preview video overlay */
.wf-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  pointer-events: none;
  background: #0C0C0E;
}

/* Cover Blur toggle (smooth 18px blur, revealed on hover/focus/tap) */
.wf-grid.wf-blur-active .wf-thumb-media {
  filter: blur(18px);
  transform: scale(1.12);
  transition: filter 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.wf-grid.wf-blur-active .wf-card-btn:hover .wf-thumb-media,
.wf-grid.wf-blur-active .wf-card-btn:focus-visible .wf-thumb-media,
.wf-grid.wf-blur-active .wf-card.is-unblurred .wf-thumb-media,
.wf-grid.wf-blur-active .wf-card.is-previewing .wf-thumb-media {
  filter: blur(0);
  transform: scale(1.01);
}

/* Strictly AT MOST ONE tiny dark bottom-right duration overlay */
.wf-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(14, 14, 16, 0.78);
  color: #F4F4F6;
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.wf-card-meta {
  margin-top: 7px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wf-card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: var(--text, #F4F4F6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-card-sub {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--text-secondary, #8E8E93);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Skeleton Loader (Restrained Neutral Shimmer) ---------- */

.wf-skel-thumb,
.wf-skel-line {
  background-color: var(--surface, #1E1E22);
  background-image: linear-gradient(
    102deg,
    var(--surface, #1E1E22) 28%,
    var(--surface-hover, #26262B) 50%,
    var(--surface, #1E1E22) 72%
  );
  background-size: 220% 100%;
  background-position: 100% 0;
  animation: wf-shimmer 1.55s ease-in-out infinite;
}

.wf-skel-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border, #242429);
}

.wf-skel-line {
  height: 13px;
  margin-top: 8px;
  width: 82%;
  border-radius: 4px;
}

.wf-skel-line.is-short {
  height: 11px;
  margin-top: 5px;
  width: 48%;
  opacity: 0.78;
}

@keyframes wf-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wf-skel-thumb,
  .wf-skel-line,
  .wf-spinner,
  .wf-probe-spin {
    animation: none;
  }

  .wf-source-tabs {
    scroll-behavior: auto;
  }
}

/* ---------- Empty / Error State ---------- */

.wf-empty {
  width: 100%;
  padding: 64px 20px;
  border-radius: var(--radius-xl, 12px);
  background: var(--bg-elevated, #19191D);
  border: 1px solid var(--border, #242429);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.wf-empty-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #F4F4F6);
}

.wf-empty-desc {
  margin: 0;
  max-width: 380px;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--text-secondary, #8E8E93);
}

.wf-empty-actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Quiet Pagination ---------- */

.wf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 0 8px;
}

.wf-pagination[hidden] {
  display: none;
}

.wf-page-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #1E1E22);
  border: 1px solid var(--border, #242429);
  color: var(--text, #F4F4F6);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wf-page-btn:hover:not(:disabled) {
  background: var(--surface-hover, #26262B);
  border-color: var(--border-strong, #323238);
}

.wf-page-btn:disabled {
  color: var(--text-muted, #636368);
  opacity: 0.5;
  cursor: not-allowed;
}

.wf-page-info {
  min-width: 72px;
  text-align: center;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary, #8E8E93);
  font-variant-numeric: tabular-nums;
}

/* ---------- Mobile PWA Adjustments (< 768px) ---------- */

@media (max-width: 767px) {
  .wf-page {
    gap: 12px;
  }

  .wf-toolbar {
    gap: 10px;
  }

  .wf-source-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-bottom: none;
  }

  .wf-source-bar {
    width: 100%;
    border-bottom: 1px solid var(--border, #242429);
  }

  .wf-source-tabs {
    gap: 15px;
    padding: 0 26px 0 2px;
  }

  .wf-source-tabs.has-fade-left,
  .wf-source-tabs.has-fade-left.has-fade-right {
    padding-left: 16px;
  }

  .wf-source-tabs.has-fade-right {
    padding-right: 30px;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 34px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 34px), transparent 100%);
  }

  .wf-source-tabs.has-fade-left.has-fade-right {
    padding-right: 30px;
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      #000 22px,
      #000 calc(100% - 34px),
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      #000 22px,
      #000 calc(100% - 34px),
      transparent 100%
    );
  }

  .wf-source-actions {
    width: 100%;
    padding-bottom: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .wf-source-tab {
    height: 34px;
    font-size: 12.5px;
  }

  .wf-source-ms {
    font-size: 10px;
  }

  .wf-quiet-btn {
    height: 26px;
    padding: 0 8px;
    font-size: 11.5px;
  }

  .wf-sub-row {
    gap: 9px;
  }

  .wf-cat-strip {
    flex: 1 1 100%;
  }

  .wf-controls-group {
    width: 100%;
    flex: 1 1 100%;
    gap: 10px;
  }

  .wf-search-form {
    width: 100%;
    height: 34px;
  }

  .wf-switches {
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .wf-switches::-webkit-scrollbar {
    display: none;
  }

  .wf-switch {
    font-size: 11.5px;
    gap: 5px;
  }

  .wf-card-meta {
    margin-top: 5px;
    gap: 1px;
  }

  .wf-card-title {
    font-size: 12.5px;
    line-height: 16px;
  }

  .wf-card-sub {
    font-size: 11px;
    line-height: 14px;
  }

  .wf-duration {
    right: 5px;
    bottom: 5px;
    padding: 1.5px 5px;
    font-size: 10px;
    line-height: 13px;
  }

  .wf-theater-bar {
    padding: 11px 12px;
  }

  .wf-theater-title {
    font-size: 13.5px;
    line-height: 19px;
  }

  .wf-empty {
    padding: 44px 16px;
  }

  .wf-pin-card {
    padding: 24px 20px 20px;
  }
}

/* ---------- Optional Light Theme Support ---------- */

[data-theme="light"] .wf-thumb {
  background: #E8E8EC;
}

[data-theme="light"] .wf-thumb::after {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .wf-card-btn:hover .wf-thumb::after {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .wf-card.is-playing .wf-thumb::after {
  box-shadow: inset 0 0 0 1.5px rgba(20, 20, 22, 0.72);
}

[data-theme="light"] .wf-ph-0,
[data-theme="light"] .wf-ph-1,
[data-theme="light"] .wf-ph-2,
[data-theme="light"] .wf-ph-3,
[data-theme="light"] .wf-ph-4,
[data-theme="light"] .wf-ph-5 {
  background: linear-gradient(145deg, #E5E5EA 0%, #D8D8DF 100%);
}

[data-theme="light"] .wf-ph-label {
  color: rgba(20, 20, 22, 0.56);
}

[data-theme="light"] .wf-ph-sub {
  color: rgba(20, 20, 22, 0.4);
}

[data-theme="light"] .wf-skel-thumb,
[data-theme="light"] .wf-skel-line {
  background-color: #E6E6EB;
  background-image: linear-gradient(
    102deg,
    #E6E6EB 28%,
    #F0F0F4 50%,
    #E6E6EB 72%
  );
}
