:root {
  --clr-bg:#ffffff;
  --clr-surface:#fafafa;
  --clr-border:#e0e0e0;
  --clr-text:#212121;
  --clr-muted:#757575;
  --clr-primary:#a21caf;
  --clr-accent:#d946ef;
  --radius-md:16px;
  --radius-sm:8px;
  --radius-pill:999px;
  --gap:clamp(1rem,2vw,1.5rem);
  --font-base:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.7;
  color: var(--clr-text);
  background: var(--clr-bg);
}

img {
  max-width: 100%;
  height: auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* ---------- header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--clr-bg);
  border-bottom: 1px solid var(--clr-border);
  height: 64px;
}

header.is-scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--clr-primary);
  text-decoration: none;
  letter-spacing: .3px;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-main {
  display: flex;
  gap: 24px;
}

.nav-main a {
  font-size: 15px;
  color: var(--clr-text);
  text-decoration: none;
  padding: 6px 0;
  transition: color .2s;
}

.nav-main a:hover {
  color: var(--clr-primary);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
  background: var(--clr-surface);
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  width: 140px;
  color: var(--clr-text);
  font-family: var(--font-base);
}

.search-count {
  font-size: 13px;
  color: var(--clr-muted);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: var(--clr-bg);
  color: var(--clr-text);
  cursor: pointer;
}

/* ---------- layout ---------- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.layout-three {
  display: grid;
  grid-template-columns: 200px 1fr 280px;
  gap: var(--gap);
  padding: var(--gap) 0;
  align-items: start;
}

.sidebar-left,
.sidebar-right {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.main-content {
  min-width: 0;
}

/* ---------- hero ---------- */

.hero-banner {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent) 100%);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: center;
  margin-bottom: var(--gap);
  overflow: hidden;
}

.hero-text h1 {
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 14px;
}

.hero-text p {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255, 255, 255, .86);
  margin: 0 0 24px;
  max-width: 52ch;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--clr-primary);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}

.btn-hero svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.hero-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* ---------- section title ---------- */

.section-title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.4;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 16px;
  margin-right: 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--clr-primary), var(--clr-accent));
  flex: 0 0 auto;
}

section {
  margin-bottom: 56px;
}

section:last-of-type {
  margin-bottom: 0;
}

/* ---------- video grid ---------- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.video-card {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  animation: fadeUp .45s ease both;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
}

.video-thumb {
  position: relative;
  display: block;
}

.video-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.duration-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .75);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.duration-badge svg {
  width: 12px;
  height: 12px;
}

.video-info {
  padding: 12px 14px 14px;
}

.video-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 2.9em;
  min-height: 2.9em;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 10px;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.uploader-avatar img {
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.uploader-info {
  min-width: 0;
}

.uploader-name {
  font-size: 13px;
  color: var(--clr-text);
  margin-bottom: 2px;
}

.video-stats {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--clr-muted);
}

.video-stats span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.video-stats svg {
  width: 12px;
  height: 12px;
}

/* ---------- live ---------- */

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
}

.live-card {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-bg);
  transition: transform .2s, box-shadow .2s;
}

.live-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
}

.live-thumb {
  position: relative;
  display: block;
}

.live-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--clr-primary);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
}

.live-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: livePulse 1.4s ease-in-out infinite;
}

.live-online {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
}

.live-info {
  padding: 10px 12px 12px;
}

.live-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 6px;
}

.live-host {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--clr-muted);
}

.live-host img {
  width: 28px;
  height: 28px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.live-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--clr-muted);
}

/* ---------- news ---------- */

.news-list {
  display: block;
}

.news-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--clr-border);
}

.news-item:first-child {
  padding-top: 0;
}

.news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-item time {
  font-size: 13px;
  color: var(--clr-muted);
  display: block;
  margin-bottom: 6px;
}

.news-item p {
  font-size: 15px;
  line-height: 1.75;
  margin: 0;
}

.news-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.5;
}

.news-excerpt {
  font-size: 14px;
  line-height: 1.75;
  color: var(--clr-muted);
  margin: 0;
}

/* ---------- faq ---------- */

.faq-list {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-bg);
}

.faq-item + .faq-item {
  border-top: 1px solid var(--clr-border);
}

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s;
}

.faq-q:hover {
  color: var(--clr-primary);
}

.faq-q::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--clr-muted);
  transition: transform .25s;
  flex: 0 0 auto;
}

.faq-item.open .faq-q::after {
  transform: rotate(45deg);
}

.faq-a {
  display: none;
  padding: 0 16px 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--clr-muted);
}

.faq-item.open .faq-a {
  display: block;
}

/* ---------- about ---------- */

#about p {
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 14px;
  max-width: 72ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tags a {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  font-size: 13px;
  color: var(--clr-muted);
  text-decoration: none;
  transition: color .2s, border-color .2s;
}

.tags a:hover {
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}

/* ---------- sidebar left ---------- */

.sidebar-card {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.sidebar-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.category-list {
  display: block;
}

.category-list a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--clr-text);
  text-decoration: none;
  transition: background .18s, color .18s;
}

.category-list a:hover {
  background: var(--clr-surface);
  color: var(--clr-primary);
}

/* ---------- sidebar right ---------- */

.sidebar-right h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 10px;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 13px;
  padding: 6px 10px;
  color: var(--clr-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-base);
  transition: color .2s, border-color .2s;
}

.tab-btn:hover {
  color: var(--clr-text);
}

.tab-btn.active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-primary);
}

.rank-list {
  display: block;
}

.rank-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  align-items: flex-start;
}

.rank-no {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--clr-surface);
  color: var(--clr-muted);
}

.rank-item:nth-child(-n+3) .rank-no {
  background: var(--clr-primary);
  color: #fff;
}

.rank-item a {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  color: var(--clr-text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}

.rank-item a:hover {
  color: var(--clr-primary);
}

.rank-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rank-value {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--clr-muted);
  white-space: nowrap;
}

.rank-meta {
  font-size: 12px;
  color: var(--clr-muted);
}

/* ---------- cat-scroll (mobile categories) ---------- */

.cat-scroll {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
}

.cat-scroll a {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  font-size: 13px;
  color: var(--clr-text);
  text-decoration: none;
  white-space: nowrap;
}

.cat-scroll a:hover {
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

/* ---------- footer ---------- */

footer {
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  margin-top: calc(var(--gap) * 2);
  padding-top: 2.5rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
}

.footer-col p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--clr-muted);
  margin: 0 0 8px;
}

.footer-col p:last-child {
  margin-bottom: 0;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col ul a {
  font-size: 13px;
  color: var(--clr-muted);
  text-decoration: none;
  transition: color .2s;
}

.footer-col ul a:hover {
  color: var(--clr-primary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 13px;
  color: var(--clr-muted);
  text-decoration: none;
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--clr-primary);
}

.footer-bottom {
  border-top: 1px solid var(--clr-border);
  margin-top: 2rem;
  padding: 16px 1rem;
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--clr-muted);
  line-height: 1.6;
  margin: 0;
}

.footer-bottom p + p {
  margin-top: 6px;
}

.footer-bottom a {
  color: var(--clr-muted);
  text-decoration: none;
  transition: color .2s;
}

.footer-bottom a:hover {
  color: var(--clr-primary);
}

.friend-links {
  padding: 14px 1rem 20px;
  font-size: 13px;
  line-height: 2;
  color: var(--clr-muted);
  text-align: center;
  border-top: 1px solid var(--clr-border);
  max-width: 1200px;
  margin: 0 auto;
}

.friend-links span {
  display: inline-block;
  font-weight: 600;
  color: var(--clr-text);
}

.friend-links a {
  color: var(--clr-muted);
  text-decoration: none;
  margin: 0 6px;
  transition: color .2s;
}

.friend-links a:hover {
  color: var(--clr-primary);
}

/* ---------- to-top ---------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 90;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ---------- animations ---------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: .35;
    transform: scale(.8);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
  .layout-three {
    grid-template-columns: 1fr 280px;
  }
  aside.sidebar-left {
    display: none;
  }
}

@media (max-width: 768px) {
  .layout-three {
    grid-template-columns: 1fr;
  }
  aside.sidebar-right {
    display: none;
  }
  .hero-banner {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem;
  }
  .hero-thumb {
    order: -1;
  }
  .hero-text h1 {
    font-size: 24px;
  }
  .hero-text p {
    font-size: 15px;
  }
  .nav-main {
    display: none;
  }
  .menu-btn {
    display: flex;
  }
  .search-box {
    display: none;
  }
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .video-title {
    font-size: 13px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .cat-scroll {
    display: flex;
  }
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
  .logo {
    max-width: 150px;
    font-size: 16px;
  }
  section {
    margin-bottom: 40px;
  }
  .container {
    padding: 0 16px;
  }
  .header-inner {
    padding: 0 16px;
  }
  .video-stats {
    flex-wrap: nowrap;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .live-grid {
    grid-template-columns: 1fr;
  }
  .footer-cols {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .video-card {
    animation: none;
  }
}