/*
 * 幻影TV / 魅影TV identity layer.
 * Loaded last so both fronts share interaction quality while keeping distinct visual systems.
 */

.portal {
  --motion-fast: 140ms;
  --motion-ui: 220ms;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --brand-gold: #d4ae62;
  --brand-cyan: #35b8e8;
  color-scheme: dark;
  background-image: radial-gradient(circle at 78% 9%, #18203c 0, transparent 24rem);
  background-attachment: fixed;
}

.portal .site-rail,
.portal .portal-topbar {
  border-color: #ffffff0b;
}

.portal .site-rail {
  border-right: 1px solid #ffffff09;
}

.portal .site-rail .brand {
  width: 136px;
  height: 42px;
  margin: 10px 0 16px 24px;
}

.portal .site-rail .brand img {
  width: 136px;
  height: 42px;
}

.portal .rail-tools > a,
.portal .rail-nav > a,
.portal .rail-bottom > a {
  padding-left: 34px;
  transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease;
}

.portal .rail-tools > a:hover,
.portal .rail-nav > a:hover,
.portal .rail-bottom > a:hover {
  background: linear-gradient(90deg, #ffffff08, transparent 84%);
}

.portal .portal-topbar {
  border-bottom: 1px solid #ffffff08;
}

.portal.feature-page .portal-topbar {
  border-bottom-color: transparent;
}

.portal .header-search {
  border: 1px solid #ffffff0c;
  box-shadow: inset 0 1px #ffffff08;
}

.portal .header-search:focus-within {
  border-color: #6bcdf05c;
  background: #1d253ccf;
}

.portal .cover-hero {
  height: 580px;
  background: #0b1020;
}

.portal .cover-image {
  filter: saturate(.88) contrast(1.04);
}

.portal .cover-shade {
  background:
    linear-gradient(0deg, #090b21 0, #090b21d8 8%, #090b210d 58%, #090b213d 100%),
    linear-gradient(90deg, #090b21e8 0, #090b218c 18%, transparent 52%, #090b2138 82%, #090b21b3 100%);
}

.portal .cover-copy {
  bottom: 30px;
  max-width: 610px;
}

.portal .cover-copy h1 {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: clamp(28px, 2.4vw, 40px);
  font-weight: 650;
  letter-spacing: .02em;
  text-shadow: 0 2px 18px #000a;
}

.cover-synopsis {
  max-width: 540px;
  margin: 0 0 18px;
  color: #d4d6df;
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-shadow: 0 1px 8px #000;
}

.portal .cover-copy .button-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.portal .button.play-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 21px;
  border: 1px solid #ffffff45;
  border-radius: var(--radius-sm);
  background: #f4f6fb;
  color: #111526;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 30px #0005;
}

.portal .button.play-primary svg {
  width: 20px;
  height: 20px;
}

.portal .button.play-primary:hover {
  background: #fff;
  color: #090b21;
}

.hero-detail-link {
  color: #f1f2f7;
  font-size: 14px;
  border-bottom: 1px solid #ffffff65;
  padding: 9px 1px 7px;
}

.hero-detail-link:hover {
  color: #fff;
  border-bottom-color: var(--accent);
}

.portal .hero-thumbnails > a {
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 25px #0005;
}

.portal .hero-thumbnails a.active {
  outline: 2px solid #fff;
  outline-offset: -2px;
  box-shadow: 0 8px 25px #0008;
}

.portal .home-content {
  padding-top: 1px;
}

.portal .channel-directory {
  margin: 18px 0 44px;
  border-bottom: 1px solid #ffffff0b;
  padding-bottom: 18px;
}

.portal .directory-links {
  gap: 8px;
}

.portal .directory-links > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 16px;
  border: 1px solid #373b5d;
  border-radius: var(--radius-sm);
  background: #15182f;
  color: #c7c9d8;
  transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease, background-color var(--motion-fast) ease;
}

.portal .directory-links > a:hover {
  border-color: #596184;
  background: #202442;
  color: #fff;
}

.portal .directory-links svg {
  width: 18px;
  height: 18px;
  color: #9ca9cf;
}

.portal .film-shelf {
  margin-bottom: 46px;
}

.portal .shelf-head {
  margin-bottom: 22px;
  min-height: 34px;
  border-bottom: 1px solid #ffffff09;
  padding-bottom: 13px;
}

.portal .shelf-head h2 i {
  width: 18px;
  height: 21px;
}

.portal .shelf-tabs a,
.portal .shelf-more {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.portal .shelf-more::after {
  content: "›";
  margin-left: 7px;
}

.portal .shelf-empty {
  margin: 0;
  min-height: 64px;
  padding: 20px 22px;
  align-items: center;
  border-left: 2px solid #444b74;
  background: linear-gradient(90deg, #15182d, transparent 70%);
}

.portal .cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 26px 12px;
}

.portal .film-card {
  min-width: 0;
}

.portal .poster {
  box-shadow: 0 8px 22px #0003;
}

.portal .poster::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px #ffffff10;
}

.portal .film-card h3 {
  margin-top: 9px;
  font-size: 15px;
}

.portal .film-card p {
  display: flex;
  gap: 0;
  min-width: 0;
}

.portal .film-card p span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal .film-card p span + span::before {
  content: "/";
  color: #565b78;
  margin: 0 7px;
}

.portal .poster-label {
  padding: 28px 8px 5px;
  font-size: 11px;
  letter-spacing: .02em;
}

.portal .catalog-page,
.portal .film-detail-page,
.portal .watch-page,
.portal .membership-page {
  max-width: 1520px;
}

.portal .catalog-heading {
  border-bottom: 1px solid #ffffff0c;
  padding-bottom: 18px;
}

.portal .catalog-filters {
  border: 0;
  border-bottom: 1px solid #ffffff0c;
  background: transparent;
  border-radius: 0;
  padding: 15px 0 18px;
}

.portal .filter-row {
  border-bottom: 0;
  min-height: 42px;
}

.portal .filter-row a {
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  padding: 7px 12px;
}

.portal .filter-row a:hover {
  background: #ffffff08;
}

.portal .filter-row a.selected {
  background: #263052;
  color: #fff;
}

.portal .catalog-results {
  border-bottom: 1px solid #ffffff0a;
  padding-bottom: 14px;
}

.portal .film-overview {
  border-bottom: 1px solid #ffffff0b;
}

.portal .film-cover {
  box-shadow: 0 18px 45px #0007;
}

.portal .film-tags a,
.portal .film-tags span {
  border-radius: var(--radius-xs);
}

.portal .content-tabs {
  border-bottom: 1px solid #ffffff0d;
}

.portal .member-banner {
  border-radius: 0;
  border: 1px solid #ffffff0d;
  background:
    linear-gradient(110deg, #262743, #191d35 56%, #241f31),
    #1b1e34;
  box-shadow: 0 22px 65px #0004;
}

.portal .member-navigation,
.portal .vip-tabs,
.portal .membership-plan,
.portal .membership-comparison table {
  border-radius: 0;
}

.portal .membership-plan {
  transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease;
}

.portal .membership-plan:hover {
  border-color: #c8a989;
  background: #ffffff05;
}

/* 魅影TV：独立横向导航、影厅式横幅、横版片库。 */
.portal.midnight {
  --bg: #0d0d0f;
  --panel: #17161a;
  --line: #2d2b31;
  --text: #f7f4f8;
  --muted: #9d98a3;
  --accent: #dca6ee;
  --accent-soft: #302336;
  background-image:
    radial-gradient(circle at 14% 0, #2c1c35 0, transparent 30rem),
    radial-gradient(circle at 92% 20%, #172237 0, transparent 28rem);
}

.midnight .portal-topbar {
  height: 64px;
  padding: 0 40px;
  border-bottom: 1px solid #ffffff0b;
  background: #101012f5;
}

.midnight .portal-topbar > .mobile-brand {
  display: block;
  position: static;
  flex-shrink: 0;
  width: 156px;
  margin-right: 54px;
}

.midnight .portal-topbar > .mobile-brand img {
  display: block;
  width: 156px;
  height: 44px;
}

.midnight .night-top-nav {
  width: auto;
  margin-right: 46px;
  gap: 30px;
}

.midnight .night-top-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.midnight-home {
  padding-top: 4px;
}

.night-feature {
  position: relative;
  height: 430px;
  overflow: hidden;
  background: #17171a;
}

.night-feature > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(.72) contrast(1.08);
}

.night-feature-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #0d0d0f 0, transparent 54%),
    linear-gradient(90deg, #0d0d0fd9 0, #0d0d0f75 30%, transparent 66%);
}

.night-feature-copy {
  position: absolute;
  left: 5%;
  bottom: 42px;
  max-width: 520px;
}

.night-feature-copy h1 {
  margin: 8px 0 7px;
  font-size: 34px;
  font-weight: 600;
}

.night-feature-copy > p {
  margin: 0 0 20px;
  color: #bbb5bf;
}

.night-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 35px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #b37bc4;
  border-radius: var(--radius-xs);
  color: #e7c6ef;
  font-size: 11px;
  letter-spacing: .04em;
}

.night-feature-copy .button-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.night-feature-copy .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  border-radius: var(--radius-sm);
  background: #e8d8ee;
  color: #251c29;
  border-color: #e8d8ee;
}

.night-feature-copy .button svg {
  width: 18px;
  height: 18px;
}

.night-feature-copy .button-row > a:last-child {
  color: #e3dee5;
  border-bottom: 1px solid #ffffff55;
  padding: 9px 0 7px;
}

.night-home-content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 0 38px 54px;
}

.night-quick-links {
  display: flex;
  gap: 26px;
  min-height: 64px;
  align-items: center;
  border-bottom: 1px solid #ffffff0b;
  margin-bottom: 34px;
}

.night-quick-links a {
  color: #aaa4ae;
  font-size: 13px;
}

.night-quick-links a:hover {
  color: #fff;
}

.night-latest {
  margin-top: 6px;
}

.midnight .night-section-heading {
  padding: 0 0 18px;
  border-bottom: 1px solid #ffffff0a;
  margin-bottom: 20px;
}

.midnight .night-section-heading h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 22px;
  margin: 0;
}

.night-mark {
  width: 19px;
  height: 19px;
  border-radius: 50% 50% 50% 8px;
  background: linear-gradient(135deg, #7ebaff, #b57ef0 55%, #ed91dc);
  transform: rotate(-28deg);
  box-shadow: 0 0 18px #b47fe765;
}

.midnight .cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 16px;
}

.midnight .poster {
  aspect-ratio: 16/9;
  border-radius: var(--radius-xs);
}

.midnight .film-card h3 {
  font-size: 15px;
  margin-top: 10px;
}

.midnight .film-card p {
  color: #8f8994;
}

.midnight .night-content-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #ffffff0b;
  margin-top: 42px;
  padding-top: 22px;
}

.midnight .night-content-notice > span {
  color: #d1aee0;
}

.midnight .catalog-filters,
.midnight .catalog-heading,
.midnight .catalog-results,
.midnight .content-tabs {
  border-color: #ffffff0d;
}

.midnight .filter-row a.selected {
  background: #35293a;
}

.midnight .member-banner {
  background: linear-gradient(112deg, #251f2b, #17151c 55%, #211927);
}

@media (max-width: 1250px) {
  .portal .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .midnight .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .midnight .portal-topbar > .mobile-brand { margin-right: 26px; }
  .midnight .night-top-nav { margin-right: 24px; gap: 22px; }
}

@media (max-width: 1000px) {
  .portal .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .midnight .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .midnight .portal-topbar { padding-inline: 24px; }
  .midnight .portal-topbar > .mobile-brand { width: 130px; margin-right: 14px; }
  .midnight .portal-topbar > .mobile-brand img { width: 130px; }
}

@media (max-width: 660px) {
  .portal .cover-hero { height: 335px; }
  .portal .cover-copy { max-width: calc(100% - 36px); }
  .cover-synopsis { display: none; }
  .portal .cover-copy .button-row { gap: 14px; }
  .portal .button.play-primary { min-height: 40px; font-size: 14px; padding: 7px 13px; }
  .hero-detail-link { font-size: 13px; }
  .portal .directory-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .portal .directory-links > a { min-height: 44px; flex-direction: column; gap: 4px; padding: 6px 2px; }
  .portal .directory-links svg { width: 16px; height: 16px; }
  .portal .shelf-head { align-items: center; }
  .portal .shelf-hint { display: none; }
  .portal .shelf-empty { flex-direction: column; align-items: flex-start; gap: 6px; }
  .portal .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; }
  .portal .film-card h3 { font-size: 13px; }
  .portal .film-card p { font-size: 11px; }
  .portal .film-card p span:nth-child(2) { display: none; }
  .midnight .portal-topbar { height: 58px; padding-inline: 15px; }
  .midnight .portal-topbar > .mobile-brand { width: 112px; margin-right: 0; }
  .midnight .portal-topbar > .mobile-brand img { width: 112px; height: 38px; }
  .night-feature { height: 310px; }
  .night-feature-copy { left: 18px; right: 18px; bottom: 28px; }
  .night-feature-copy h1 { font-size: 25px; }
  .night-home-content { padding: 0 16px 40px; }
  .night-quick-links { gap: 22px; overflow-x: auto; white-space: nowrap; min-height: 54px; margin-bottom: 28px; }
  .midnight .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 11px; }
  .midnight .night-content-notice { align-items: flex-start; flex-wrap: wrap; line-height: 1.8; }
}

@media (prefers-reduced-motion: reduce) {
  .portal *, .portal *::before, .portal *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
