:root {
  --bg: #0b0b0d;
  --bg-soft: #151519;
  --card: #17171c;
  --card-hover: #202027;
  --surface: #1a1a20;
  --line: #26262d;
  --line-soft: #1e1e24;
  --text: #f2f3f5;
  --muted: #8c8f98;
  --muted-2: #6b6e77;
  --accent: #00be06;
  --accent-hover: #1ad424;
  --accent-2: #ffc93c;
  --hot: #ff5a3c;
  --radius: 10px;
  --sidebar-w: 176px;
  --topbar-h: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  width: 100%;
}

button {
  font-family: inherit;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== Shared page header (doc pages) ==================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 13, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
  color: var(--accent);
  flex-shrink: 0;
}

.logo__mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #04140a;
  font-size: 13px;
}

/* ==================== Shell / layout ==================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 12px 28px;
  background: linear-gradient(180deg, #101015, #0b0b0e);
  border-right: 1px solid var(--line-soft);
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #04140a;
  flex-shrink: 0;
}

.brand__mark svg {
  width: 15px;
  height: 15px;
}

.brand__name {
  color: var(--accent);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: none;
  background: none;
  border-radius: 9px;
  color: var(--muted);
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.side-nav__item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.side-nav__item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav__item:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.side-nav__item.is-active {
  color: var(--accent);
  background: rgba(0, 190, 6, 0.1);
}

.side-nav__item .pill {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 190, 6, 0.16);
  color: var(--accent);
}

/* ---------- Main column ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 26px;
  background: rgba(11, 11, 13, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.2px;
  color: var(--accent);
}

.topbar__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #04140a;
  flex-shrink: 0;
}

.topbar__mark svg {
  width: 13px;
  height: 13px;
}

.search {
  position: relative;
  flex: 1;
  max-width: 620px;
  display: flex;
  align-items: center;
}

.search input {
  width: 100%;
  height: 42px;
  padding: 0 18px 0 42px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: border 0.15s, background 0.15s;
}

.search input::placeholder {
  color: var(--muted-2);
}

.search input:focus {
  border-color: var(--accent);
  background: #101014;
}

.search__icon {
  position: absolute;
  left: 15px;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.btn-fav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-fav svg {
  width: 17px;
  height: 17px;
}

.btn-fav:hover {
  color: var(--text);
  border-color: #3a3f47;
}

.btn-fav.is-on {
  background: rgba(0, 190, 6, 0.12);
  border-color: var(--accent);
  color: #fff;
}

.btn-fav.is-on svg {
  color: var(--accent);
}

.btn-fav__count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #04140a;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

/* ---------- Content ---------- */
.content {
  padding: 22px 26px 0;
  flex: 1;
}

/* ==================== Hero banner ==================== */
.banner {
  margin-bottom: 28px;
}

.banner__link {
  position: relative;
  display: block;
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}

.banner__link img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.banner__link:hover img {
  transform: scale(1.03);
}

.banner__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
      90deg,
      rgba(8, 8, 10, 0.94) 0%,
      rgba(8, 8, 10, 0.72) 36%,
      rgba(8, 8, 10, 0.14) 68%,
      rgba(8, 8, 10, 0) 100%
    ),
    linear-gradient(0deg, rgba(8, 8, 10, 0.82), rgba(8, 8, 10, 0) 52%);
}

.banner__content {
  position: relative;
  z-index: 2;
  min-height: 420px;
  max-width: 640px;
  padding: 44px 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 13px;
}

.banner__rank {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
}

.banner__rank svg {
  width: 15px;
  height: 15px;
}

.banner__title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.16;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.banner__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.banner__list li {
  position: relative;
  padding-left: 15px;
  color: #d4d6db;
  font-size: 13.5px;
}

.banner__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.banner__cta {
  align-self: flex-start;
  margin-top: 4px;
  height: 42px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #04140a;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.2px;
  transition: background 0.15s, transform 0.15s;
}

.banner__link:hover .banner__cta {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.banner__desc {
  max-width: 520px;
  color: #b9bcc4;
  font-size: 13.5px;
  line-height: 1.55;
}

/* ==================== Blocks / sections ==================== */
.block {
  margin-bottom: 34px;
}

.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.block__head h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.block__more {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 1.4s infinite;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 190, 6, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(0, 190, 6, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 190, 6, 0);
  }
}

/* ---------- Horizontal poster row ---------- */
.row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.row::-webkit-scrollbar {
  display: none;
}

.row .card {
  flex: 0 0 268px;
  scroll-snap-align: start;
}

/* ==================== Category tabs ==================== */
.cats {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 22px;
  scroll-margin-top: 84px;
  scrollbar-width: none;
}

.cats::-webkit-scrollbar {
  display: none;
}

.chip {
  position: relative;
  flex-shrink: 0;
  padding: 8px 2px 13px;
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
}

.chip:hover {
  color: var(--text);
}

.chip.is-active {
  color: var(--text);
}

.chip.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ==================== Video cards ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 24px 16px;
}

.grid-loader {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 80px 0;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: tipSpin 0.8s linear infinite;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 15px;
}

.card {
  display: block;
  color: inherit;
}

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--cover-opacity, 1);
  transition: transform 0.35s ease, opacity 1s linear;
}

body.is-loading {
  --cover-opacity: 0;
}

.card:hover .card__thumb img {
  transform: scale(1.06);
}

.card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover .card__thumb::after {
  opacity: 1;
}

.card__censor {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 74%;
  transform: translate(-50%, -50%);
  z-index: 2;
  border-radius: 6px;
  background: rgba(9, 9, 12, 0.16);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  pointer-events: none;
}

.card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.card__badge--hot {
  background: var(--hot);
  color: #fff;
}

.card__badge--vip {
  background: linear-gradient(180deg, #ffe08a, #f5b301);
  color: #3a2600;
}

.card__play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover .card__play {
  opacity: 1;
}

.card__play svg {
  width: 46px;
  height: 46px;
  color: #fff;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

.card__duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.card__fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.15s, background 0.15s, transform 0.15s;
}

.card:hover .card__fav {
  opacity: 1;
}

.card__fav:hover {
  transform: scale(1.12);
  background: rgba(0, 0, 0, 0.75);
}

.card__fav svg {
  width: 16px;
  height: 16px;
}

.card__fav.is-on {
  opacity: 1;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.6);
}

.card__info {
  padding: 10px 2px 0;
}

.card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}

.card:hover .card__title {
  color: var(--accent);
}

.card__meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ==================== Pagination ==================== */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 38px 0 56px;
  flex-wrap: wrap;
}

.pager button {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.pager button:hover:not(:disabled) {
  color: var(--text);
  border-color: #3a3f47;
}

.pager button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #04140a;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==================== Footer ==================== */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 28px 26px;
  color: var(--muted);
  font-size: 13px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  max-width: 720px;
}

/* ==================== Bottom tab bar (mobile) ==================== */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(11, 11, 13, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.tabbar__item svg {
  width: 20px;
  height: 20px;
}

.tabbar__item.is-active {
  color: var(--accent);
}

/* ==================== Loading tip ==================== */
.loading-tip {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(600px, calc(100% - 32px));
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #17191f, #111318);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: tipIn 0.4s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.loading-tip.is-hidden {
  opacity: 0;
  transform: translate(-50%, -14px);
  pointer-events: none;
}

.loading-tip.is-warn {
  border-color: var(--accent);
  background: linear-gradient(135deg, #0f2410, #0b170c);
  box-shadow: 0 18px 60px rgba(0, 190, 6, 0.42);
  animation: tipWarn 0.5s ease;
}

.loading-tip.is-warn .loading-tip__title {
  color: var(--accent-hover);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.loading-tip.is-warn .loading-tip__count b {
  color: var(--accent-hover);
}

@keyframes tipWarn {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  20% {
    transform: translate(calc(-50% - 7px), 0);
  }
  40% {
    transform: translate(calc(-50% + 7px), 0);
  }
  60% {
    transform: translate(calc(-50% - 5px), 0);
  }
  80% {
    transform: translate(calc(-50% + 5px), 0);
  }
}

.loading-tip__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.loading-tip__title {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}

.loading-tip__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}

.loading-tip__count b {
  color: var(--accent-2);
  font-size: 15px;
}

.loading-tip__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: tipSpin 0.8s linear infinite;
}

.loading-tip__text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@keyframes tipSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tipIn {
  from {
    opacity: 0;
    transform: translate(-50%, -14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ==================== Responsive ==================== */
@media (max-width: 1180px) {
  :root {
    --sidebar-w: 156px;
  }
  .banner__link,
  .banner__content {
    min-height: 380px;
  }
  .banner__title {
    font-size: 30px;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .tabbar {
    display: flex;
  }
  .content {
    padding: 18px 16px 0;
  }
  .topbar {
    padding: 0 16px;
  }
  .footer {
    padding: 24px 16px calc(80px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 760px) {
  .banner__link,
  .banner__content {
    min-height: 340px;
  }
  .banner__content {
    padding: 24px 20px;
    gap: 10px;
  }
  .banner__title {
    font-size: 21px;
  }
  .banner__list li {
    font-size: 12.5px;
  }
  .banner__desc {
    font-size: 12.5px;
  }
  .block__head h2 {
    font-size: 18px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 18px 12px;
  }
  .row .card {
    flex-basis: 220px;
  }
  .btn-fav__label {
    display: none;
  }
  .block__more {
    display: none;
  }
  .loading-tip {
    top: 16px;
  }
}

@media (max-width: 560px) {
  .topbar__name {
    display: none;
  }
}
