/* xw overlays — player, play page, mobile polish, ABABSEO */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body,
#root,
.app-shell {
  width: 100%;
  max-width: 100%;
}

body {
  overflow-x: clip;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell > main {
  flex: 1;
  width: 100%;
  min-width: 0;
}

.nav-link.is-active {
  color: var(--primary);
}

/* —— 本机封面展示 —— */
.film-card {
  background: linear-gradient(160deg, #ffffff 0%, #fff8f0 100%);
  isolation: isolate;
}

.film-card a {
  display: block;
  color: inherit;
}

.cover-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background:
    linear-gradient(145deg, rgba(255, 107, 53, 0.12), transparent 45%),
    #efe6dc;
}

.cover-frame .film-poster,
.cover-frame img[loading='lazy'] {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.01);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.35s ease;
  opacity: 1 !important;
}

.cover-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(20, 16, 14, 0.78) 0%, rgba(20, 16, 14, 0.2) 42%, transparent 68%),
    linear-gradient(120deg, rgba(255, 107, 53, 0.08), transparent 50%);
  opacity: 0.85;
  transition: opacity 0.35s ease;
  z-index: 2;
  pointer-events: none;
}

.cover-score {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff6b35, #ff8a5b);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

.cover-genre {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  max-width: calc(100% - 3.6rem);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #2d3142;
  background: rgba(255, 248, 240, 0.92);
  border: 1px solid rgba(255, 107, 53, 0.22);
  backdrop-filter: blur(6px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-meta {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #fff;
  font-size: 0.7rem;
  opacity: 0.95;
  pointer-events: none;
}

.cover-meta strong {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cover-meta em {
  font-style: normal;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.film-card .play-icon {
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 10px 28px rgba(255, 107, 53, 0.45);
}

.cover-caption {
  padding: 0.75rem 0.85rem 0.9rem;
}

.film-card:hover .cover-frame .film-poster,
.film-card:focus-within .cover-frame .film-poster {
  transform: scale(1.08);
  filter: saturate(1.08) contrast(1.04);
}

.film-card:hover .cover-shade,
.film-card:focus-within .cover-shade {
  opacity: 1;
}

/* 覆盖目标站默认 poster 规则，改由 cover-frame 控制 */
.film-card .film-poster {
  aspect-ratio: auto;
}

.film-card::before {
  display: none;
}

@media (hover: none) {
  .film-card .play-icon {
    transform: translate(-50%, -50%) scale(0.72);
    opacity: 0.88;
  }

  .cover-shade {
    opacity: 0.95;
  }
}

@media (max-width: 768px) {
  .cover-score {
    min-width: 1.85rem;
    height: 1.85rem;
    font-size: 0.7rem;
    top: 8px;
    right: 8px;
  }

  .cover-genre {
    top: 8px;
    left: 8px;
    font-size: 0.62rem;
  }

  .cover-caption {
    padding: 0.65rem 0.7rem 0.8rem;
  }
}

/* —— 播放页 —— */
.play-page .breadcrumb span {
  color: var(--text-primary);
}

.play-stage {
  margin-bottom: 1.25rem;
}

.player-shell {
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  border: 1px solid rgba(255, 107, 53, 0.18);
  background: linear-gradient(180deg, #1f2430 0%, #111827 100%);
  box-shadow: 0 18px 40px rgba(45, 49, 66, 0.14);
}

.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, rgba(255, 107, 53, 0.22), transparent 55%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.player-toolbar__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: #fff;
}

.player-toolbar__title strong {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-toolbar__title em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  color: #ffe8dc;
  background: rgba(255, 107, 53, 0.28);
  border: 1px solid rgba(255, 138, 91, 0.35);
}

.player-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b35;
  box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.55);
  animation: player-pulse 1.8s ease-out infinite;
}

@keyframes player-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 107, 53, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
  }
}

.player-play-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.player-box {
  position: relative;
  background: #020617;
}

.player-box video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #020617;
}

.player-loading,
.player-error {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
}

.player-loading {
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
}

.player-error {
  color: #fff7ed;
  background: rgba(185, 28, 28, 0.85);
}

.play-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .play-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }

  .play-side {
    position: sticky;
    top: 88px;
  }
}

.play-info,
.side-card,
.content-card {
  background: linear-gradient(135deg, #fff 0%, #fff8f0 100%);
  border: 1px solid rgba(255, 107, 53, 0.12);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.play-info h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0.35rem 0 0.65rem;
  line-height: 1.25;
}

.play-lead {
  color: var(--text-secondary);
  margin: 0;
}

.play-hero-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.25rem;
}

.play-poster-mini {
  width: 120px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(45, 49, 66, 0.16);
}

.play-poster-mini img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1 !important;
}

.play-poster-mini .cover-score {
  top: 8px;
  right: 8px;
  min-width: 1.7rem;
  height: 1.7rem;
  font-size: 0.68rem;
}

.play-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.play-tags span {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-main);
  border: 1px solid rgba(255, 107, 53, 0.18);
}

.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.play-actions .primary-btn {
  margin-top: 0;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 53, 0.28);
  background: #fff;
  color: var(--text-primary);
  font-weight: 600;
  transition: var(--transition);
}

.ghost-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.meta-line {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1.15rem;
  font-size: 0.875rem;
}

.info-grid span {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 248, 240, 0.9);
  border: 1px solid rgba(255, 107, 53, 0.1);
}

.info-grid em {
  font-style: normal;
  color: var(--text-secondary);
  min-width: 3.2em;
}

.info-grid a {
  color: var(--primary);
  font-weight: 600;
}

.play-synopsis {
  color: var(--text-primary);
  line-height: 1.75;
}

.play-note {
  margin-top: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.side-list {
  display: grid;
  gap: 0.75rem;
}

.side-list a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: var(--bg-main);
  transition: var(--transition);
}

.side-list a:hover {
  background: rgba(255, 107, 53, 0.12);
}

.side-list--thumbs {
  gap: 0.65rem;
}

.side-thumb-item {
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem !important;
}

.side-thumb-item img {
  width: 52px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  opacity: 1 !important;
  background: #efe6dc;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-more {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

@media (max-width: 480px) {
  .play-hero-row {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .play-poster-mini {
    width: 88px;
  }

  .player-toolbar {
    flex-wrap: wrap;
  }

  .player-toolbar__title {
    width: 100%;
  }
}

.search-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 1rem;
  font-weight: 600;
}

.wide-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.wide-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 107, 53, 0.25);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  background: #fff;
  color: var(--text-primary);
}

.wide-search button {
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.footer-bottom-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  margin-top: 12px;
}

/* ABABSEO */
.ababseo-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
  user-select: none;
}

.ababseo-mark__sky {
  position: relative;
  width: 2rem;
  height: 1.35rem;
}

.ababseo-mark__plane {
  position: absolute;
  left: 0;
  top: 50%;
  color: #ff8a5b;
  animation: ababseo-fly 4.2s ease-in-out infinite;
}

.ababseo-mark__trail {
  position: absolute;
  right: calc(100% + 2px);
  top: 52%;
  width: 18px;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(to left, rgba(255, 138, 91, 0.9), transparent);
}

.ababseo-mark__spark {
  position: absolute;
  right: calc(100% + 16px);
  top: 40%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffd7c2;
}

.ababseo-mark__text {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  background: linear-gradient(100deg, #2d3142, #ff6b35, #6b7280);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ababseo-shimmer 5s linear infinite;
}

@keyframes ababseo-fly {
  0% {
    transform: translate(-2px, 3px) rotate(8deg);
  }
  50% {
    transform: translate(10px, -3px) rotate(-6deg);
  }
  100% {
    transform: translate(-2px, 3px) rotate(8deg);
  }
}

@keyframes ababseo-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@media (max-width: 768px) {
  .wide-search {
    flex-direction: column;
  }

  .wide-search button,
  .primary-btn,
  .ghost-btn,
  .play-actions {
    width: 100%;
  }

  .play-actions .primary-btn,
  .play-actions .ghost-btn {
    width: 100%;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom-extra {
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ababseo-mark__plane,
  .ababseo-mark__text,
  .film-card {
    animation: none;
    transition: none;
  }
}
