/* 影院黑金 · Cinema Black Gold */

body.tpl-cinema,
body.cn-app {
  --cn-bg: #0a0a0b;
  --cn-panel: #121214;
  --cn-line: rgba(232, 197, 71, 0.14);
  --cn-gold: #e8c547;
  --cn-gold-2: #b8942e;
  --cn-text: #f3f1ea;
  --cn-muted: #9a9588;
  --cn-danger: #c45c5c;
  background: var(--cn-bg) !important;
  color: var(--cn-text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}

/* Google fonts may be slow in CN — graceful fallback already set; prefer local stacks */
@supports (font-variation-settings: normal) {
  body.tpl-cinema {
    font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  }
}

body.tpl-cinema.m-tabbar-on {
  padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}

/* Header */
body.tpl-cinema .cn-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(180deg, rgba(10, 10, 11, 0.96), rgba(10, 10, 11, 0.88));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
body.tpl-cinema .cn-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 8px;
  max-width: 1280px;
  margin: 0 auto;
}
body.tpl-cinema .cn-brand {
  flex: 0 0 auto;
  max-width: 160px;
}
body.tpl-cinema .cn-brand .logo,
body.tpl-cinema .cn-brand .logo-text,
body.tpl-cinema .cn-brand strong {
  color: var(--cn-gold) !important;
  font-weight: 700;
  letter-spacing: 0.04em;
}
body.tpl-cinema .cn-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  min-height: 38px;
}
body.tpl-cinema .cn-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--cn-text);
  padding: 8px 14px;
  outline: none;
  font-size: 14px;
}
body.tpl-cinema .cn-search input::placeholder {
  color: #6f6a60;
}
body.tpl-cinema .cn-search button {
  border: 0;
  background: transparent;
  color: var(--cn-gold);
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
  touch-action: manipulation;
}
body.tpl-cinema .cn-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.tpl-cinema .cn-tool-btn,
body.tpl-cinema .cn-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cn-line);
  background: rgba(232, 197, 71, 0.08);
  color: var(--cn-gold);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
body.tpl-cinema .cn-menu {
  position: relative;
}
body.tpl-cinema .cn-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  max-height: 70vh;
  overflow: auto;
  background: #161618;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 90;
}
body.tpl-cinema .cn-menu.is-open .cn-menu-panel,
body.tpl-cinema .cn-menu.is-open .qm-menu-panel {
  display: block;
  hidden: false;
}
body.tpl-cinema .cn-menu-panel a {
  display: block;
  padding: 10px 12px;
  color: var(--cn-text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
}
body.tpl-cinema .cn-menu-panel a:hover {
  background: rgba(232, 197, 71, 0.1);
  color: var(--cn-gold);
}

/* Categories */
body.tpl-cinema .cn-cats {
  padding: 0 16px 10px;
  max-width: 1280px;
  margin: 0 auto;
}
body.tpl-cinema .cn-cats-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
body.tpl-cinema .cn-cats-track::-webkit-scrollbar {
  display: none;
}
body.tpl-cinema .cn-cat {
  flex: 0 0 auto;
  padding: 6px 12px;
  color: var(--cn-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  touch-action: manipulation;
}
body.tpl-cinema .cn-cat.is-active {
  color: #0a0a0b;
  background: linear-gradient(135deg, #f0d56a, #c9a227);
}

/* Main */
body.tpl-cinema .cn-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 0 40px;
}

/* Hero */
body.tpl-cinema .cn-hero {
  position: relative;
  margin: 0 0 8px;
  min-height: clamp(280px, 52vw, 520px);
  overflow: hidden;
  background: #000;
}
body.tpl-cinema .cn-hero-slide {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}
body.tpl-cinema .cn-hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
body.tpl-cinema .cn-hero-media {
  position: absolute;
  inset: 0;
}
body.tpl-cinema .cn-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.02);
}
body.tpl-cinema .cn-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 11, 0.92) 0%, rgba(10, 10, 11, 0.55) 42%, rgba(10, 10, 11, 0.15) 70%, rgba(10, 10, 11, 0.35) 100%),
    linear-gradient(0deg, rgba(10, 10, 11, 0.95) 0%, rgba(10, 10, 11, 0.2) 45%, rgba(10, 10, 11, 0.35) 100%);
}
body.tpl-cinema .cn-hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: clamp(20px, 5vw, 48px) clamp(16px, 4vw, 40px) clamp(28px, 5vw, 44px);
  max-width: 640px;
}
body.tpl-cinema .cn-hero-kicker {
  margin: 0 0 8px;
  color: var(--cn-gold);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}
body.tpl-cinema .cn-hero-title {
  margin: 0 0 10px;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
body.tpl-cinema .cn-hero-meta {
  margin: 0 0 16px;
  color: var(--cn-muted);
  font-size: 14px;
}
body.tpl-cinema .cn-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f0d56a, #c9a227);
  color: #1a1406;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 28px rgba(201, 162, 39, 0.28);
}
body.tpl-cinema .cn-hero-dots {
  position: absolute;
  right: 16px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
body.tpl-cinema .cn-hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}
body.tpl-cinema .cn-hero-dot.is-active {
  background: var(--cn-gold);
  width: 18px;
  border-radius: 999px;
}

/* Rails */
body.tpl-cinema .cn-rail {
  margin: 18px 0 8px;
  padding: 0 16px;
}
body.tpl-cinema .cn-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
body.tpl-cinema .cn-rail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
body.tpl-cinema .cn-rail-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-right: 10px;
  vertical-align: -0.12em;
  border-radius: 2px;
  background: linear-gradient(180deg, #f0d56a, #c9a227);
}
body.tpl-cinema .cn-rail-more {
  color: var(--cn-muted);
  text-decoration: none;
  font-size: 13px;
  touch-action: manipulation;
}
body.tpl-cinema .cn-rail-more:hover {
  color: var(--cn-gold);
}
body.tpl-cinema .cn-rail-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 197, 71, 0.35) transparent;
  -webkit-overflow-scrolling: touch;
}
body.tpl-cinema .cn-card {
  flex: 0 0 auto;
  width: clamp(118px, 28vw, 168px);
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  touch-action: manipulation;
}
body.tpl-cinema .cn-card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a1c;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.tpl-cinema .cn-card:hover .cn-card-poster,
body.tpl-cinema .cn-card:focus-visible .cn-card-poster {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(232, 197, 71, 0.35);
}
body.tpl-cinema .cn-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.tpl-cinema .cn-card-badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 8px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.tpl-cinema .cn-card-title {
  margin: 8px 2px 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #ebe7dc;
}

/* Fallback grids on inner pages */
body.tpl-cinema .section {
  background: transparent !important;
  margin: 16px 0;
  padding: 0 16px;
}
body.tpl-cinema .section-head h2 {
  color: var(--cn-text) !important;
  font-size: 18px !important;
}
body.tpl-cinema .section-head .more {
  color: var(--cn-gold) !important;
}
body.tpl-cinema .video-grid {
  gap: 14px 12px !important;
}
body.tpl-cinema .video-card {
  background: transparent !important;
  border: 0 !important;
  color: var(--cn-text);
}
body.tpl-cinema .video-card .thumb {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
}
body.tpl-cinema .video-card .title {
  color: #ebe7dc !important;
}
body.tpl-cinema .video-card .meta {
  color: var(--cn-muted) !important;
}
body.tpl-cinema .empty,
body.tpl-cinema .muted {
  color: var(--cn-muted) !important;
}

/* Footer / tabbar */
body.tpl-cinema .cn-footer {
  padding: 24px 16px 32px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
body.tpl-cinema .cn-copy {
  margin: 4px 0;
  color: #6f6a60;
  font-size: 12px;
}
body.tpl-cinema .cn-vip-tip {
  color: rgba(232, 197, 71, 0.75) !important;
}
body.tpl-cinema .cn-friends {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin-bottom: 12px;
}
body.tpl-cinema .cn-friends a {
  color: var(--cn-muted);
  text-decoration: none;
  font-size: 12px;
}
body.tpl-cinema .cn-tabbar.mobile-tabbar {
  display: none;
  background: rgba(12, 12, 14, 0.96) !important;
  border-top: 1px solid rgba(232, 197, 71, 0.12) !important;
  backdrop-filter: none !important;
  z-index: 120 !important;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 720px) {
  body.tpl-cinema.m-tabbar-on .cn-tabbar.mobile-tabbar {
    display: flex !important;
  }
}
body.tpl-cinema .cn-tabbar .mobile-tab {
  color: #8a8578 !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}
body.tpl-cinema .cn-tabbar .mobile-tab.is-active {
  color: var(--cn-gold) !important;
}
body.tpl-cinema .cn-tabbar .mobile-tab:active {
  transform: scale(0.94);
}

/* Hide stock chrome that fights cinema */
body.tpl-cinema .site-header,
body.tpl-cinema .main-nav,
body.tpl-cinema .header-top-bar {
  display: none !important;
}
body.tpl-cinema .notice-marquee-bar,
body.tpl-cinema .site-notice,
body.tpl-cinema .popup-notice-bar {
  margin: 10px 16px !important;
  background: rgba(232, 197, 71, 0.08) !important;
  border: 1px solid rgba(232, 197, 71, 0.18) !important;
  color: #e8d9a0 !important;
  border-radius: 10px !important;
}
body.tpl-cinema .lot-float {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  filter: saturate(0.85);
}

/* Auth / mine pages on cinema */
body.tpl-cinema .mine-page,
body.tpl-cinema .mine-card,
body.tpl-cinema .rec-list,
body.tpl-cinema .apps-page {
  color: var(--cn-text);
}
body.tpl-cinema .mine-card {
  background: var(--cn-panel) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 14px !important;
}
body.tpl-cinema .mine-link {
  color: var(--cn-text) !important;
}

@media (min-width: 900px) {
  body.tpl-cinema .cn-hero {
    border-radius: 0 0 18px 18px;
    margin: 0 16px 12px;
  }
  body.tpl-cinema .cn-card {
    width: 176px;
  }
  body.tpl-cinema .mobile-tabbar.cn-tabbar {
    display: none !important;
  }
  body.tpl-cinema.m-tabbar-on {
    padding-bottom: 0;
  }
}


/* ==== mobile snappy v2 ==== */
@media (max-width: 720px) {
  body.tpl-cinema .cn-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(10, 10, 11, 0.98) !important;
  }
  body.tpl-cinema .cn-card:hover .cn-card-poster,
  body.tpl-cinema .cn-card:focus-visible .cn-card-poster {
    transform: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  }
  body.tpl-cinema .cn-hero-media img {
    transform: none;
  }
  body.tpl-cinema .video-card {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
body.tpl-cinema a,
body.tpl-cinema button,
body.tpl-cinema .mine-link,
body.tpl-cinema .cn-tool-btn,
body.tpl-cinema .cn-menu-btn,
body.tpl-cinema .cn-search button,
body.tpl-cinema .btn-load-more,
body.tpl-cinema .auth-btn {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
}
body.tpl-cinema .mine-link:active,
body.tpl-cinema .cn-cat:active,
body.tpl-cinema .cn-rail-more:active,
body.tpl-cinema .btn-load-more:active {
  opacity: 0.82;
}


/* ==== cinema ads v1 ==== */
body.tpl-cinema .cn-ad-slot,
body.tpl-cinema .home-banner-ads,
body.tpl-cinema .cn-ad-rail {
  margin: 12px 16px;
  max-width: 1280px;
}
body.tpl-cinema .home-banner-ads {
  display: grid;
  gap: 10px;
}
body.tpl-cinema .ad-banner,
body.tpl-cinema .ad-banner-img {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(232, 197, 71, 0.18);
  background: #121214;
  text-decoration: none;
  color: #e8c547;
  text-align: center;
  font-weight: 650;
  touch-action: manipulation;
}
body.tpl-cinema .ad-banner {
  padding: 16px 14px;
  font-size: 14px;
}
body.tpl-cinema .ad-banner-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  background: #0a0a0b;
}
body.tpl-cinema .cn-slide-wrap {
  margin: 8px 16px 4px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(232, 197, 71, 0.14);
  max-width: 1280px;
}
body.tpl-cinema .cn-slide-wrap .mayi-slide img,
body.tpl-cinema .cn-slide-wrap img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}
body.tpl-cinema .cn-ad-play-below {
  margin: 12px 0 4px;
}
body.tpl-cinema .cn-ad-play-below .ad-banner-img img {
  max-height: 120px;
}
body.tpl-cinema .mayi-preroll {
  border-radius: 0;
}
body.tpl-cinema .mayi-preroll-hit img {
  object-fit: contain;
  background: #000;
}
@media (min-width: 900px) {
  body.tpl-cinema .home-banner-ads,
  body.tpl-cinema .cn-slide-wrap,
  body.tpl-cinema .cn-ad-rail {
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
  }
  body.tpl-cinema .ad-banner-img img {
    max-height: 200px;
  }
  body.tpl-cinema .cn-slide-wrap .mayi-slide img {
    max-height: 260px;
  }
}
