:root {
  --accent: #ff5a42;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.7);
  --panel: #111216;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #050506;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
}
button {
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hidden {
  display: none !important;
}
.page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050506;
}
.phone {
  position: relative;
  isolation: isolate;
  width: min(100%, 480px);
  height: 100dvh;
  max-height: 960px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 0 70px #000;
}
.phone video {
  position: absolute;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
.top-fade,
.bottom-fade {
  position: absolute;
  z-index: -2;
  left: 0;
  right: 0;
  pointer-events: none;
}
.top-fade {
  top: 0;
  height: 25%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.68), transparent);
}
.bottom-fade {
  bottom: 0;
  height: 54%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, 0.55) 30%,
    rgba(0, 0, 0, 0.96) 83%,
    #000
  );
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.control-layer {
  transition: opacity 0.2s ease;
}
.phone.controls-hidden .control-layer {
  opacity: 0;
  pointer-events: none;
}
.topbar {
  position: absolute;
  z-index: 12;
  top: 0;
  left: 0;
  right: 0;
  padding: max(19px, env(safe-area-inset-top)) 17px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-shadow: 0 1px 7px #000;
}
.episode-title,
.top-actions {
  display: flex;
  align-items: center;
}
.episode-title {
  gap: 4px;
  font-size: 17px;
  font-weight: 650;
}
.episode-title svg {
  width: 29px;
  height: 29px;
}
.top-actions {
  gap: 6px;
}
.top-button {
  height: 40px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 650;
}
.top-button svg {
  width: 23px;
  height: 23px;
}
.clean-button svg {
  width: 21px;
  height: 21px;
}
.more-button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
}
.speed-menu,
.more-menu {
  position: absolute;
  right: 17px;
  top: calc(max(19px, env(safe-area-inset-top)) + 47px);
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(16, 17, 20, 0.93);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}
.speed-menu {
  width: 110px;
  display: grid;
}
.more-menu {
  width: 150px;
  display: grid;
}
.speed-menu button,
.more-menu button {
  padding: 10px 11px;
  border-radius: 9px;
  text-align: left;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
}
.speed-menu button.on {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.center-play {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 16, 18, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(5px);
}
.center-play svg {
  width: 33px;
  height: 33px;
  fill: #fff;
  stroke: none;
}
.caption {
  position: absolute;
  z-index: 5;
  left: 52px;
  right: 52px;
  bottom: 35%;
  text-align: center;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow:
    0 2px 6px #000,
    0 0 2px #000;
}
.right-rail {
  position: absolute;
  z-index: 6;
  right: 10px;
  bottom: 202px;
  display: grid;
  gap: 19px;
}
.right-rail button {
  width: 54px;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
}
.action-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 5px #000);
}
.action-icon svg {
  width: 32px;
  height: 32px;
  fill: #fff;
  stroke: #fff;
}
.action-icon.layers svg {
  fill: none;
  stroke-width: 2.4;
}
.right-rail small {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 5px #000;
}
.right-rail button.active .action-icon svg {
  fill: var(--accent);
  stroke: var(--accent);
}
.drama-meta {
  position: absolute;
  z-index: 5;
  left: 18px;
  right: 72px;
  bottom: 104px;
  text-shadow: 0 2px 7px #000;
}
.title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.playing-line {
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
}
.playing-line span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 66, 0.17);
}
.drama-meta h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.18;
  font-weight: 760;
  letter-spacing: -0.02em;
}
.title-row > button {
  font-size: 27px;
  line-height: 1;
}
.intro-button {
  width: 100%;
  margin: 7px 0 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  text-align: left;
}
.intro {
  min-width: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.intro-more {
  flex: 0 0 auto;
  padding-bottom: 1px;
  color: #fff;
  font-size: 11px;
  font-weight: 720;
  text-shadow: 0 2px 7px #000;
}
.bottom-player {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 18px calc(13px + env(safe-area-inset-bottom));
  background: #000;
}
.progress-row {
  display: grid;
  grid-template-columns: 35px 1fr 35px;
  align-items: center;
  gap: 8px;
  height: 23px;
}
.progress-row span {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.55);
}
.progress-row span:last-child {
  text-align: right;
}
.progress-row input {
  --p: 0%;
  appearance: none;
  width: 100%;
  height: 16px;
  margin: 0;
  background: transparent;
}
.progress-row input::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    #fff var(--p),
    rgba(255, 255, 255, 0.27) var(--p)
  );
}
.progress-row input::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #fff;
}
.bottom-actions {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
}
.bottom-actions button {
  height: 40px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 650;
}
.bottom-actions svg {
  width: 21px;
  height: 21px;
}
.bottom-actions i {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
}
.bottom-actions button:disabled {
  opacity: 0.35;
}
.tap-hint {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 57%;
  transform: translate(-50%, -50%);
  padding: 7px 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.62);
  font-size: 11px;
}
.error-card {
  position: absolute;
  z-index: 20;
  left: 28px;
  right: 28px;
  top: 38%;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 17px;
  background: rgba(16, 17, 20, 0.9);
  text-align: center;
  backdrop-filter: blur(18px);
}
.error-card strong {
  display: block;
  font-size: 16px;
}
.error-card p {
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.55;
}
.error-card button {
  padding: 8px 17px;
  border-radius: 99px;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 700;
}
.scrim {
  position: absolute;
  z-index: 24;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
.scrim.show {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: absolute;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(62%, 570px);
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: rgba(18, 19, 23, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  transform: translateY(102%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -20px 55px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(24px);
}
.drawer.show {
  transform: none;
}
.intro-drawer {
  height: min(52%, 470px);
}
.intro-drawer .eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.full-intro {
  max-height: calc(100% - 76px);
  margin: 19px 0 0;
  padding: 0 5px 20px 0;
  overflow-y: auto;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.drawer-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.24);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-head h2 {
  margin: 0 0 4px;
  font-size: 21px;
}
.drawer-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}
.drawer-head > button {
  font-size: 30px;
  color: rgba(255, 255, 255, 0.65);
}
.episode-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  max-height: calc(100% - 75px);
  overflow-y: auto;
  padding-bottom: 8px;
}
.episode-grid button {
  aspect-ratio: 1.13;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  font-size: 14px;
  font-weight: 700;
}
.episode-grid button.current {
  background: #fff;
  color: #111;
}
.episode-grid button small {
  display: block;
  font-size: 7px;
  font-weight: 500;
}
.phone video::-webkit-media-controls {
  display: none !important;
}
@media (min-width: 520px) and (min-height: 760px) {
  .page {
    background: radial-gradient(
      circle at 50% 15%,
      #242529,
      #09090a 55%,
      #050506
    );
  }
  .phone {
    height: min(92dvh, 900px);
    border-radius: 24px;
  }
}
@media (max-height: 680px) {
  .right-rail {
    bottom: 177px;
  }
  .drama-meta {
    bottom: 92px;
  }
  .intro {
    -webkit-line-clamp: 1;
  }
  .caption {
    bottom: 32%;
  }
}

.clean-exit {
  position: absolute;
  z-index: 40;
  top: max(13px, env(safe-area-inset-top));
  right: 13px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.38);
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 650;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  transition: opacity 0.2s ease;
}
.clean-exit svg {
  width: 18px;
  height: 18px;
}
.clean-view .topbar,
.clean-view .top-fade,
.clean-view .bottom-fade,
.clean-view .center-play,
.clean-view .caption,
.clean-view .right-rail,
.clean-view .drama-meta,
.clean-view .bottom-player,
.clean-view .tap-hint,
.clean-view .toast {
  opacity: 0 !important;
  pointer-events: none !important;
}
.clean-view .clean-exit {
  opacity: 0.58;
}
.clean-view .clean-exit:hover,
.clean-view .clean-exit:focus-visible {
  opacity: 1;
}

/* Refined interaction and loading states */
.phone {
  touch-action: manipulation;
}
.episode-title {
  height: 40px;
  padding: 0;
  text-shadow: 0 1px 7px #000;
}
.video-loader {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px #000;
  transition: opacity 0.2s;
}
.video-loader > span {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.toast {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 164px;
  transform: translateX(-50%);
  max-width: 78%;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(10, 11, 13, 0.82);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}
.playing-line em {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.56);
  font-style: normal;
}
.playing-line em:not(:empty)::before {
  content: "·";
  padding: 0 5px;
}
.episode-grid button {
  padding: 4px;
}
.episode-grid button span {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.episode-grid button small {
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  opacity: 0.62;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 360px) {
  .right-rail {
    right: 5px;
  }
  .right-rail button {
    width: 49px;
  }
  .drama-meta {
    right: 60px;
  }
  .bottom-actions {
    gap: 9px;
  }
  .bottom-actions button {
    font-size: 11px;
  }
  .episode-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .video-loader > span {
    animation-duration: 1.8s;
  }
  .control-layer,
  .drawer,
  .scrim {
    transition-duration: 0.01ms !important;
  }
}
