:root {
  color-scheme: dark;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #fff7f3;
  background: #141014;
  --accent: #d82542;
  --soft: #d8c7c9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid #ff9ca9; outline-offset: 4px; }
.player {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  width: min(100%, 540px);
  margin: auto;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: #1b1118;
}
.backdrop {
  position: absolute;
  z-index: -1;
  inset: -28px;
  background: linear-gradient(170deg, #20121a85 0%, #23121c80 43%, #170d13 87%), var(--cover, none) center / cover;
  filter: blur(22px) saturate(.85);
}
.masthead {
  min-height: 72px;
  padding: calc(17px + env(safe-area-inset-top)) clamp(16px, 5vw, 28px) 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { border: 0; padding: 3px 0; background: none; }
.brand img { display: block; width: 104px; height: 35px; object-fit: contain; object-position: left; }
.open { padding: 8px 15px; border-radius: 6px; border: 1px solid #fff6; background: #321b2780; font-size: .875rem; }
.stage { position: relative; display: grid; place-items: center; min-width: 0; background: #0e090e; }
video { display: block; width: 100%; height: 100%; min-height: 220px; max-height: 66svh; object-fit: contain; }
.play-toggle { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: none; touch-action: manipulation; }
.play-glyph { display: grid; place-items: center; width: 60px; height: 60px; border: 1px solid #fff9; border-radius: 50%; background: #1c0d18c7; }
.play-glyph::before { content: ""; border-block: 10px solid transparent; border-left: 15px solid white; transform: translateX(2px); }
.stage[data-playing="true"] .play-glyph { opacity: 0; }
.stage[data-playing="true"] .play-toggle:focus-visible .play-glyph { opacity: 1; }
.stage[data-playing="true"] .play-glyph::before { width: 12px; height: 18px; border: none; border-inline: 4px solid white; transform: none; }
.status { position: absolute; bottom: 9px; left: 13px; right: 13px; margin: 0; text-align: center; background: #170d13e5; padding: 8px; border-radius: 6px; font-size: .875rem; pointer-events: none; }
.details { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 17px clamp(16px, 5vw, 28px) 9px; }
.episode-info { min-width: 0; display: grid; align-content: start; justify-items: start; gap: 7px; }
.episode-info button { background: none; border: 0; padding: 0; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title { font-size: clamp(1.25rem, 5vw, 1.65rem); font-weight: 750; letter-spacing: -.025em; }
.episode, .synopsis { color: var(--soft); font-size: .875rem; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags button { background: #573344; padding: 2px 7px; border-radius: 4px; color: #fae0dc; font-size: .8125rem; }
.actions { display: grid; align-content: start; gap: 5px; }
.actions button { border: 1px solid #fff3; border-radius: 6px; background: #241721; padding: 6px 10px; font-size: .875rem; }
.footer { display: grid; gap: 12px; padding: 4px clamp(16px, 5vw, 28px) 16px; }
.timeline { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font-size: .8125rem; color: var(--soft); font-variant-numeric: tabular-nums; }
progress { flex: 1; min-width: 0; height: 4px; border: 0; border-radius: 8px; overflow: hidden; appearance: none; background: #ffffff30; }
progress::-webkit-progress-bar { background: #ffffff30; }
progress::-webkit-progress-value { background: #ff5a70; }
progress::-moz-progress-bar { background: #ff5a70; }
.continue { border: 0; border-radius: 8px; background: var(--accent); color: white; min-height: 47px; font-size: 1rem; font-weight: 650; }
dialog { max-width: min(88vw, 388px); padding: 0; border: 1px solid #ff9bad45; border-radius: 16px; background: #2a1721; color: #fff7f3; box-shadow: 0 20px 70px #0007; }
dialog::backdrop { background: #09060ad9; }
dialog.fallback-dialog { position: fixed; inset: 0; z-index: 10; margin: auto; box-shadow: 0 0 0 100vmax #09060ad9; }
.app-dialog-content { padding: 22px; }
.app-dialog-content img { display: block; width: 37px; height: 37px; object-fit: contain; }
.app-dialog-content h2 { margin: 12px 0 7px; font-size: 1.25rem; }
.app-dialog-content p { margin: 0; color: #ebcfd3; line-height: 1.55; }
.dialog-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 19px; }
.dialog-buttons button { min-height: 44px; border: 1px solid #fff4; border-radius: 7px; background: #412a36; }
.dialog-buttons #confirm { background: var(--accent); border-color: transparent; }
#wechat-help { margin-top: 12px; font-size: .875rem; }
.app-landing { max-width: 480px; margin: 8vh auto; padding: 25px; }
.app-landing img { object-fit: contain; width: 130px; max-height: 56px; }
.app-landing p { color: var(--soft); line-height: 1.6; }
.app-landing a { display: inline-block; border-radius: 8px; padding: 13px 18px; background: var(--accent); color: white; text-decoration: none; }
@media (max-height: 600px) and (orientation: landscape) {
  .player { width: min(100%, 760px); }
  video { max-height: 62svh; }
}
