.ending-film-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: #f3eee5;
  color: #27251f;
}
.ending-film-stage {
  width: min(100%, 1040px);
  min-height: min-content;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vh, 22px);
}
.ending-film-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ending-film-top h1 {
  margin: 0;
  font: 600 clamp(25px, 4vw, 42px)/1.12 "Songti SC", SimSun, serif;
  letter-spacing: .035em;
}
.ending-film-top button {
  padding: 8px 15px;
  min-height: 42px;
  border: 1px solid #332f29;
  border-radius: 5px;
  background: #332f29;
  color: #fffaf0;
  white-space: nowrap;
}
.ending-film-top button:hover { background: #514436; }
.ending-film-top button span { margin-left: 5px; }
.ending-film-player, .ending-section.ending-film {
  overflow: hidden;
  min-width: 0;
  border-radius: 9px;
  background: #211f1b;
  color: #fffaf0;
}
.ending-film-player { box-shadow: 0 10px 30px #34291f24; }
.ending-section.ending-film { padding: 0; border: 0; }
.ending-section.ending-film h2 { margin: 0; padding: 12px 16px; font-size: 1rem; color: inherit; }
.ending-film-deck { background: #191713; }
.ending-film-picture {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  max-height: min(57dvh, 630px);
  min-height: 150px;
  overflow: hidden;
  background: #100f0d;
}
.ending-section .ending-film-picture { max-height: min(62dvh, 680px); }
.ending-film-picture video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.ending-film-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 12px;
  background: radial-gradient(ellipse at center, #17161577, #0d0c0b29);
  color: #fff8eb;
  text-align: center;
  pointer-events: none;
}
.ending-film-picture[data-phase="playing"] .ending-film-screen { display: none; }
.ending-film-spinner {
  display: none;
  width: 31px;
  height: 31px;
  border: 2px solid #ffecd85c;
  border-top-color: #ffe4bc;
  border-radius: 50%;
  animation: ending-video-spin .85s linear infinite;
}
.ending-film-picture[data-phase="loading"] .ending-film-spinner { display: block; }
@keyframes ending-video-spin { to { transform: rotate(360deg); } }
.ending-film-screen [data-film-screen] {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  padding: 8px 16px;
  border: 1px solid #ffe5ba;
  border-radius: 24px;
  background: #fff2db;
  color: #2a251d;
  font-weight: 700;
  pointer-events: auto;
}
.ending-film-screen [data-film-screen]:hover { background: #fffaf0; }
.ending-film-screen [data-film-screen][hidden] { display: none; }
.ending-film-state:not(:empty) {
  padding: 4px 9px;
  border-radius: 4px;
  background: #211a12d9;
  font-size: 14px;
}
.ending-film-controls { padding: 8px 16px 12px; }
.ending-film-scrubber,
.ending-film-tools,
.ending-film-volume { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ending-film-tools { margin-top: 3px; }
.ending-film-volume { margin-inline-start: auto; }
.ending-film-controls button {
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #a99a814f;
  border-radius: 5px;
  background: #2b251e;
  color: #f6eddf;
  white-space: nowrap;
}
.ending-film-controls button:hover { background: #493a2d; }
.ending-film-controls .ending-film-play { min-width: 58px; background: #eee0ca; color: #2b241a; }
.ending-film-controls .ending-film-play:hover { background: #fff2d9; }
.ending-film-controls :is(button, input):focus-visible,
.ending-film-screen button:focus-visible { outline: 2px solid #ffce8e; outline-offset: 2px; }
.ending-film-controls input { accent-color: #e1ba86; min-width: 0; min-height: 28px; margin: 0; cursor: pointer; }
.ending-film-controls [data-film-volume] { width: clamp(54px, 12vw, 105px); }
.ending-film-controls [data-film-seek] { flex: 1; width: 100%; appearance: none; background: transparent; }
.ending-film-controls [data-film-seek]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(90deg, #e5b674 var(--played, 0%), #8d806b var(--played, 0%) var(--buffered, 0%), #554b3c var(--buffered, 0%));
}
.ending-film-controls [data-film-seek]::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -4px;
  border-radius: 50%;
  background: #f6d09a;
}
.ending-film-controls [data-film-seek]::-moz-range-track { height: 5px; border-radius: 5px; background: #645a4c; }
.ending-film-controls [data-film-seek]::-moz-range-progress { height: 5px; background: #e1ba86; }
.ending-film-clock { flex: none; white-space: nowrap; color: #e4d9c9; font-size: .83rem; font-variant-numeric: tabular-nums; }
.ending-film-message { margin: 7px 0 0; color: #f6d09a; }
.ending-film-deck:fullscreen { display: flex; flex-direction: column; justify-content: center; }
.ending-film-deck:fullscreen .ending-film-picture { flex: 1; width: 100%; aspect-ratio: auto; max-height: none; }
@media (prefers-reduced-motion: reduce) {
  .ending-film-spinner { animation: none; }
}
.ending-film-timeline {
  --timeline-accent: #874d2a;
  --timeline-line: #ccbba7;
  min-width: 0;
  padding: 11px clamp(14px, 3vw, 32px) 8px;
  border-block: 1px solid var(--timeline-line);
  background: #faf6ee;
  color: #27251f;
}
.ending-page .ending-film-timeline { margin-top: 20px; background: #fffdf8; }
.ending-film-timeline header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 10px;
}
.ending-film-timeline h2 { margin: 0; font-size: clamp(16px, 2vw, 19px); }
.ending-timeline-toggle {
  padding: 5px 8px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--timeline-accent);
}
.ending-timeline-toggle:hover { border-color: var(--timeline-line); }
.ending-film-overlay .ending-timeline-track { max-height: clamp(108px, 20vh, 190px); overflow: hidden; }
.ending-film-overlay .ending-timeline-track.is-scrolled {
  mask-image: linear-gradient(transparent, #000 14px, #000);
}
.ending-film-timeline ol, .ending-film-timeline ul { list-style: none; margin: 0; padding: 0; }
.ending-film-timeline ol > li {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 0 0 20px 16px;
  border-left: 1px solid var(--timeline-line);
}
.ending-film-timeline ol > li::before {
  content: "";
  position: absolute;
  top: .55em;
  left: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--timeline-accent);
}
.ending-film-timeline time {
  color: var(--timeline-accent);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.ending-film-timeline ul { line-height: 1.55; overflow-wrap: anywhere; }
.ending-film-timeline ul li + li { margin-top: 9px; }
.ending-film-timeline ul strong { font-weight: 650; }
.ending-film-timeline ul span { display: block; color: #595043; }
@media (max-width: 560px) {
  .ending-film-overlay { padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .ending-film-top button { padding-inline: 10px; font-size: .85rem; }
  .ending-film-overlay .ending-timeline-track { max-height: clamp(120px, 25vh, 185px); }
  .ending-film-timeline ol > li { grid-template-columns: 1fr; gap: 4px; }
  .ending-film-overlay .ending-film-picture { max-height: 43dvh; }
  .ending-film-controls { padding-inline: 10px; }
  .ending-film-tools, .ending-film-volume { gap: 6px; }
}
