/* ==========================================================
   影院 / 音乐馆 页面美化
   作用页面：source/movies/index.md、source/music/index.md
   引入位置：_config.butterfly.yml → inject.head → /css/cinema.css
   新增视频的写法见两个页面文件顶部的 HTML 注释
   主色沿用站点 #49b1f5 / #39c5bb
   ========================================================== */

/* ---------- 影院：顶部放映厅横幅 ---------- */
.cinema-hero {
  position: relative;
  overflow: hidden;
  margin: 6px 0 24px;
  padding: 26px 24px 20px;
  border: 1px solid rgba(120, 160, 255, .22);
  border-radius: 16px;
  background: linear-gradient(120deg, #16233f 0%, #22345c 52%, #101a31 100%);
  box-shadow: 0 12px 32px rgba(20, 34, 66, .18);
}

/* 放映机光束 */
.cinema-hero::before {
  content: "";
  position: absolute;
  top: -120%;
  left: -10%;
  width: 120%;
  height: 220%;
  background: radial-gradient(ellipse at 50% 0%, rgba(130, 185, 255, .26), transparent 62%);
  pointer-events: none;
}

.cinema-hero__badge {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border: 1px solid rgba(150, 190, 255, .3);
  border-radius: 999px;
  background: rgba(120, 170, 255, .16);
  color: #d5e6ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}

.cinema-hero h2 {
  position: relative;
  margin: 0;
  color: #eaf3ff;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
  text-shadow: 0 2px 14px rgba(90, 150, 255, .4);
}

/* 一排影厅地灯，几个 <i> 就代表几个厅 */
.cinema-hero__lights {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 18px;
}

.cinema-hero__lights i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8fc4ff;
  box-shadow: 0 0 10px 2px rgba(120, 180, 255, .65);
  opacity: .8;
}

/* ---------- 影院：预告提示卡 ---------- */
.cinema-hero ~ .tip.home,
.cinema-hero ~ .tip.bell {
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(49, 140, 220, .12);
}

/* ---------- 影院：影厅折叠面板与分厅 Tab ---------- */
.cinema-hero ~ .folding-tag {
  margin-bottom: 18px;
  border: 1px solid rgba(73, 177, 245, .16);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(31, 45, 80, .06);
}

.cinema-hero ~ .folding-tag > summary {
  padding: 12px 16px;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(73, 177, 245, .09), rgba(57, 197, 187, .06));
}

.cinema-hero ~ .folding-tag .nav-tabs .tab {
  border-radius: 999px;
  transition: background .25s ease, color .25s ease;
}

.cinema-hero ~ .folding-tag .nav-tabs .tab.active {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #49b1f5, #39c5bb);
  color: #fff;
}

/* 片名做成一条居中「场次条」 */
.cinema-hero ~ .folding-tag .tab-item-content h2 {
  margin: 16px 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(73, 177, 245, .08), rgba(57, 197, 187, .08));
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}

/* ---------- 影院：幕布外框 + 16:9 播放器 ---------- */
.cinema-screen {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(120, 160, 255, .14);
  border-radius: 14px;
  background: linear-gradient(160deg, #101728, #0a0f1c 60%, #131c30);
  box-shadow: 0 12px 30px rgba(10, 18, 36, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* 幕布顶部一道高光 */
.cinema-screen::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(130, 185, 255, .7), transparent);
}

/* ---------- 音乐馆：分组标题 ---------- */
.music-section > h2 {
  position: relative;
  margin: 26px 0 14px;
  padding-left: 14px;
  font-size: 20px;
  font-weight: 600;
}

.music-section > h2::before {
  content: "";
  position: absolute;
  top: .35em;
  left: 0;
  width: 5px;
  height: 1em;
  border-radius: 3px;
  background: linear-gradient(180deg, #49b1f5, #39c5bb);
}

/* ---------- 音乐馆：作品墙 ---------- */
.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin: 0 0 12px;
  counter-reset: music;
}

.music-item {
  position: relative;
  counter-increment: music;
  padding: 10px;
  border: 1px solid rgba(73, 177, 245, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 22px rgba(31, 45, 80, .09);
  transition: transform .25s ease, box-shadow .25s ease;
}

.music-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(31, 45, 80, .16);
}

/* 编号由 CSS 自动累加，新增作品不用手写序号；data-title 可填作品名 */
.music-item::before {
  content: "No." counter(music, decimal-leading-zero) "  " attr(data-title);
  display: block;
  overflow: hidden;
  padding: 0 4px 9px;
  color: #3a6fa8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 两页共用：把原来的 4:3 + 86% 高度改成 16:9 满高，去掉上下黑边 */
.cinema-screen .aspect-ratio,
.music-item .aspect-ratio {
  width: 100%;
  margin: 0;
  padding-bottom: 56.25%;
  border-radius: 9px;
  overflow: hidden;
  background: #0b1020;
}

.cinema-screen .aspect-ratio iframe,
.music-item .aspect-ratio iframe {
  display: block;
  height: 100%;
}

/* ---------- 深色模式 ---------- */
[data-theme="dark"] .music-item {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

[data-theme="dark"] .music-item::before { color: #9dc9f5; }

[data-theme="dark"] .cinema-hero ~ .folding-tag { border-color: rgba(255, 255, 255, .12); }

[data-theme="dark"] .cinema-hero ~ .folding-tag .tab-item-content h2 {
  background: rgba(255, 255, 255, .05);
}

/* ---------- 窄屏 ---------- */
@media screen and (max-width: 768px) {
  .cinema-hero { padding: 20px 14px 16px; margin-bottom: 18px; }
  .cinema-hero h2 { font-size: 16px; }
  .cinema-hero__lights { gap: 16px; }
  .cinema-screen { padding: 6px; }
  .music-grid { grid-template-columns: 1fr; gap: 14px; }
  .music-section > h2 { font-size: 18px; }
}

/* ---------- 低性能模式：去掉位移与投影 ---------- */
html.low-perf .music-item { transition: none; box-shadow: none; }
html.low-perf .music-item:hover { transform: none; }
html.low-perf .cinema-screen { box-shadow: none; }
