/* ============================================================
   课文动画影院（video.html）专属样式
   封面网格 + 点击放大弹窗
   ============================================================ */

.cinema-page { max-width: 1180px; padding-bottom: 46px; }
body.no-scroll { overflow: hidden; }

/* ---------------- 顶部导航 ---------------- */
.cinema-top { margin-bottom: 20px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border-radius: 999px;
  background: #fff;
  color: #44518f;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease;
}
.back-link:hover { transform: translateX(-3px); color: var(--accent); box-shadow: var(--shadow-lg); }
.back-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.cinema-head { margin-top: 16px; }
.cinema-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: 1px;
  background: linear-gradient(100deg, #ff7a59, #ff5f8f 45%, #7a5bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cinema-sub { margin: 9px 0 0; font-size: 14px; color: var(--muted); }

/* ---------------- 标题栏 ---------------- */
.cinema-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 0 2px;
}
.cb-ttl { display: flex; align-items: baseline; gap: 9px; margin: 0; font-size: 17px; }
.cb-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.cb-back {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: #44518f;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, color .18s ease;
}
.cb-back:hover { transform: translateY(-2px); color: var(--accent); }
.cb-back:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------------- 封面网格 ---------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
  gap: 20px;
}

.video-card {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 24px;
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.video-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.video-card:active { transform: translateY(-1px) scale(.98); }
.video-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.vc-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(140deg, #dfe8ff, #eafcff);
}
.vc-thumb video {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none; /* 整卡点击，避免误触原生控件 */
}

/* 中央播放按钮 */
.vc-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  background: linear-gradient(140deg, #ff9a56, #ff5f6d);
  box-shadow: 0 12px 26px -8px rgba(255, 95, 109, .8);
  transition: transform .2s ease;
}
.video-card:hover .vc-play { transform: translate(-50%, -50%) scale(1.14); }

/* 时长 & 观看进度 */
.vc-dur {
  position: absolute;
  right: 9px; bottom: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(11, 16, 41, .74);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.vc-prog {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(11, 16, 41, .22);
}
.vc-prog[hidden] { display: none; }
.vc-prog i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffb057, #ff5f6d);
  border-radius: 0 4px 4px 0;
  transition: width .3s ease;
}

.vc-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px 15px;
}
.vc-no { font-size: 15px; font-weight: 800; letter-spacing: .4px; }
.vc-ch { font-size: 12.5px; color: var(--muted); }
.vc-watch {
  margin-top: 5px;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff3e6;
  color: #d9761f;
  font-size: 11.5px;
  font-weight: 700;
}
.vc-watch[hidden] { display: none; }

.cinema-empty {
  margin: 26px 0 0;
  padding: 40px 16px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
}
.cinema-empty a { color: var(--accent); font-weight: 800; }

/* ============================================================
   放大弹窗
   ============================================================ */
.vm {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.vm[hidden] { display: none; }

.vm-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 38, .78);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .22s ease;
}
.vm.show .vm-mask { opacity: 1; }

.vm-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1280px, 100%);
  max-height: 100%;
  padding: 12px 14px 12px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 34px 80px -22px rgba(6, 12, 36, .7);
  opacity: 0;
  transform: translateY(18px) scale(.97);
  transition: opacity .22s ease, transform .22s ease;
}
.vm.show .vm-box { opacity: 1; transform: none; }

.vm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 10px;
}
.vm-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vm-close {
  flex: 0 0 auto;
  padding: 9px 17px;
  border: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #44518f;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.vm-close:hover { background: #dfe7ff; color: var(--accent); }
.vm-close:active { transform: scale(.94); }
.vm-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 播放区：把可用空间尽量吃满，画面按比例居中 */
.vm-stage {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  overflow: hidden;
  background: #0b1029;
}
.vm-stage video {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 200px);
  background: #0b1029;
}

/* 大播放按钮（自动播放被拦截时出现） */
.vm-bigplay {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 84px; height: 84px;
  display: grid;
  place-items: center;
  padding-left: 6px;
  border: 0;
  border-radius: 50%;
  font-size: 30px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(140deg, #ff9a56, #ff5f6d);
  box-shadow: 0 16px 36px -12px rgba(255, 95, 109, .85);
  transition: transform .2s ease;
  animation: vmPulse 2.4s ease-in-out infinite;
}
.vm-bigplay:hover { transform: translate(-50%, -50%) scale(1.08); }
.vm-bigplay[hidden] { display: none; }
@keyframes vmPulse {
  0%, 100% { box-shadow: 0 16px 36px -12px rgba(255, 95, 109, .85), 0 0 0 0 rgba(255, 255, 255, .4); }
  60%      { box-shadow: 0 16px 36px -12px rgba(255, 95, 109, .85), 0 0 0 22px rgba(255, 255, 255, 0); }
}

/* 加载中 */
.vm-loading {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(11, 16, 41, .72);
}
.vm-loading[hidden] { display: none; }
.vm-loading i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: dotJump .9s ease-in-out infinite;
}
.vm-loading i:nth-child(2) { animation-delay: .15s; }
.vm-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes dotJump {
  0%, 100% { transform: translateY(0); opacity: .55; }
  45%      { transform: translateY(-7px); opacity: 1; }
}

/* 出错 */
.vm-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: rgba(11, 16, 41, .94);
}
.vm-error[hidden] { display: none; }
.vm-error p { margin: 0; font-size: 18px; font-weight: 800; }
.vm-error small { color: rgba(255, 255, 255, .75); font-size: 12.5px; max-width: 340px; line-height: 1.7; }
.vm-retry {
  margin-top: 4px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #3a53c9;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease;
}
.vm-retry:hover { transform: translateY(-2px); }
.vm-retry:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* 弹窗底部：切集 */
.vm-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px 0;
}
.vm-nav {
  flex: 0 0 auto;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #44518f;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.vm-nav:hover:not(:disabled) { background: #dfe7ff; color: var(--accent); }
.vm-nav:active:not(:disabled) { transform: scale(.95); }
.vm-nav:disabled { opacity: .38; cursor: not-allowed; }
.vm-nav:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.vm-hint {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---------------- 轻提示 ---------------- */
.cinema-tip {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 95;
  transform: translate(-50%, 14px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(29, 43, 83, .93);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
}
.cinema-tip.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 760px) {
  .cinema-page { padding-bottom: 34px; }
  .cinema-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .cb-back { text-align: center; }
  .video-grid { grid-template-columns: 1fr; gap: 14px; }
  .video-card { border-radius: 20px; }
  .vc-play { width: 54px; height: 54px; font-size: 21px; }

  .vm { padding: 8px; }
  .vm-box { padding: 9px 10px 9px; border-radius: 18px; }
  .vm-title { font-size: 13.5px; }
  .vm-close { padding: 8px 13px; font-size: 12px; }
  .vm-stage { border-radius: 12px; }
  .vm-stage video { max-height: calc(100vh - 176px); }
  .vm-foot { gap: 8px; padding-top: 9px; }
  .vm-nav { flex: 1; padding: 11px 8px; font-size: 13px; }
  .vm-hint { display: none; }
  .cinema-tip { bottom: 20px; font-size: 12px; padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .vm-bigplay, .vm-loading i { animation: none; }
  .cinema-tip, .video-card, .vm-box, .vm-mask, .back-link, .cb-back { transition: none; }
}

