* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #0f172a;
  background: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #0f172a;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  color: #0f172a;
  background: #ffffff;
}

.chip:hover {
  background: #f8fafc;
}

.main {
  padding: 18px 0 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.card:hover {
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.cover {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #f1f5f9;
}

.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.muted {
  color: rgba(15, 23, 42, 0.6);
  font-size: 13px;
}

.title {
  font-weight: 650;
  letter-spacing: 0.2px;
}

[data-detail-title] {
  font-size: calc(1em + 13px);
}

.panel {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.panel-header {
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-right-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.panel-body {
  padding: 14px;
}

.episodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.episode {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.episode:hover {
  background: #f8fafc;
}

.episode.is-active {
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.1);
}

.btn {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #0f172a;
  color: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.btn:hover {
  background: #111c33;
}

.row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.player {
  position: relative;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  aspect-ratio: 16 / 9;
}

.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 10px 12px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  color: #fff;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.player-icon:hover {
  background: transparent;
  opacity: 0.9;
}

.player-icon:active {
  opacity: 0.75;
}

.player-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.player-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.player-icon svg.is-pause,
.player-volume svg.vol-off {
  display: none;
}

.player.is-playing .player-icon svg.is-play {
  display: none;
}

.player.is-playing .player-icon svg.is-pause {
  display: block;
}

.player.is-muted .player-volume svg.vol-on {
  display: none;
}

.player.is-muted .player-volume svg.vol-off {
  display: block;
}

.player-time {
  min-width: 96px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  opacity: 0.92;
}

.player-progress {
  flex: 1;
  width: 100%;
  min-width: 120px;
}

.player-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.player-rate {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.player-rate option {
  color: #0f172a;
}

.player-volume {
  position: relative;
}

.player-volume-pop {
  position: absolute;
  right: 0;
  bottom: 44px;
  width: 46px;
  height: 140px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  z-index: 20;
}

.player-volume-pop.show {
  display: flex;
}

.player-volume-value {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
  line-height: 1;
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

.player-volume-range {
  width: 120px;
  transform: rotate(-90deg);
  margin-top: 22px;
}

.player-fs-back {
  position: absolute;
  top: 10px;
  left: 10px;
  display: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  cursor: pointer;
}

.player-fs-back svg {
  width: 18px;
  height: 18px;
}

.player.show-fs-back .player-fs-back {
  display: inline-flex;
}

.player-episode-mask {
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.player-episode-mask.show {
  display: flex;
}

.player-episode-sheet {
  width: min(520px, 100%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.player-episode-sheet-hd {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.player-episode-sheet-bd {
  padding: 14px;
  max-height: 62vh;
  overflow: auto;
}

.range {
  width: 100%;
}

.time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  opacity: 0.92;
}

.spacer {
  flex: 1;
}

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.iconbtn {
  width: 44px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.iconbtn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-size: 13px;
  color: rgba(15, 23, 42, 0.6);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #0f172a;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  text-align: left;
}

.table th {
  font-size: 13px;
  color: rgba(15, 23, 42, 0.6);
}

.mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 1);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  z-index: 50;
}

.front-login-mask {
  z-index: 120;
}

.front-login-logo {
  width: 300px;
  height: 100px;
  object-fit: contain;
  background: transparent;
  display: block;
}

.front-login-footer {
  width: 150px;
  height: 50px;
  object-fit: contain;
  background: transparent;
  display: block;
}

.front-login-info-mask {
  z-index: 130;
}

.front-login-info-text {
  white-space: normal;
  line-height: 1.65;
  color: #0f172a;
  text-indent: 2em;
  text-align: justify;
  text-justify: inter-ideograph;
}

.mask.show {
  display: flex;
}

.modal {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  z-index: 2;
  top: -150px;
}

.login-logo {
  width: 250px;
  height: 250px;
  object-fit: contain;
  background: transparent;
  position: relative;
  z-index: 1;
  top: -50px;
  margin-bottom: 20px;
}

.modal-hd {
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-bd {
  padding: 14px;
}

.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row {
    grid-template-columns: 1fr;
  }

  .player [data-player-next],
  .player [data-player-episodes-btn],
  .player .player-rate {
    display: none;
  }

  .player-time {
    min-width: 78px;
  }
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .episodes {
    grid-template-columns: 1fr;
  }
  .topbar-inner {
    flex-wrap: wrap;
  }
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.brand-text {
  font-weight: 700;
}

body.theme-dark.page-home .topbar-inner {
  justify-content: center;
}

body.theme-dark.page-home .nav {
  display: none;
}

body.theme-dark.page-home .brand-logo {
  width: auto;
  height: 50px;
}

@media (min-width: 901px) {
  body.theme-dark.page-home {
    background: radial-gradient(
        ellipse at 50% 28%,
        rgba(255, 255, 255, 0.07),
        rgba(255, 255, 255, 0) 55%
      ),
      #050a12;
  }

  body.theme-dark.page-home .topbar {
    position: relative;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
  }

  body.theme-dark.page-home .topbar-inner {
    padding: 28px 0 14px;
  }

  body.theme-dark.page-home .brand-logo {
    width: auto;
    height: 80px;
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.6));
  }

  body.theme-dark.page-home .main {
    padding: 8px 0 22px;
  }
}

.banner-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.banner-thumb {
  position: relative;
}

.banner-preview img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
  display: block;
}

.banner-del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 0;
  background: #ef4444;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.banner-del-btn:hover {
  background: #dc2626;
}

.banner-add-tile {
  width: 100%;
  height: 64px;
  border-radius: 12px;
  border: 2px dashed rgba(148, 163, 184, 0.55);
  background: transparent;
  color: rgba(226, 232, 240, 0.92);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.banner-add-tile:hover {
  border-color: rgba(59, 130, 246, 0.8);
  color: rgba(59, 130, 246, 0.95);
  background: rgba(59, 130, 246, 0.08);
}

.banner-add-tile:active {
  transform: translateY(1px);
}

.banner-preview .muted {
  grid-column: 1 / -1;
}

.pc-top-carousel {
  display: none;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  margin: 6px 0 10px;
  background: rgba(15, 23, 42, 0.2);
}

.pc-top-carousel-track {
  position: relative;
  width: 100%;
  height: 220px;
}

.pc-top-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 500ms ease;
  display: block;
}

.pc-top-carousel-slide:first-child {
  opacity: 1;
}

.pc-top-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pc-top-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pc-top-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.pc-top-carousel-dot[data-active="1"] {
  background: rgba(255, 255, 255, 0.95);
}

@media (min-width: 901px) {
  .pc-top-carousel {
    display: block;
  }
}

body.theme-dark {
  color: rgba(226, 232, 240, 0.92);
  background: #050a12;
}

body.theme-dark .topbar {
  background: rgba(5, 10, 18, 0.86);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

body.theme-dark .brand {
  color: rgba(226, 232, 240, 0.92);
}

body.theme-dark .chip {
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.92);
  background: rgba(15, 23, 42, 0.55);
}

body.theme-dark .chip:hover {
  background: rgba(15, 23, 42, 0.75);
}

body.theme-dark .panel,
body.theme-dark .card,
body.theme-dark .episode {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

body.theme-dark .card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.38);
}

body.theme-dark .panel-header,
body.theme-dark .modal-hd {
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .muted,
body.theme-dark .label,
body.theme-dark .table th {
  color: rgba(226, 232, 240, 0.6);
}

body.theme-dark .cover {
  background: rgba(30, 41, 59, 0.55);
}

.home-divider {
  display: none;
  height: 1px;
  background: rgba(148, 163, 184, 0.55);
  box-shadow: none;
}

@media (min-width: 901px) {
  body.theme-dark.page-home .home-divider {
    display: block;
    width: 100%;
    margin: 0 0 10px;
  }
}
