*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
img, video, iframe, embed, object { max-width: 100%; height: auto; display: block; }
img { object-fit: cover; }
table { max-width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-word; overflow: auto; max-width: 100%; }
a, p, h1, h2, h3, li, span { overflow-wrap: anywhere; word-break: break-word; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main, section, article, aside { position: relative; }

:root {
  --purple: #5b21b6;
  --purple-deep: #3b1478;
  --purple-soft: #ede7fb;
  --gold: #c49a2c;
  --gold-light: #f1dd9a;
  --bg: #f7f5fc;
  --card: #ffffff;
  --ink: #241a3d;
  --muted: #7d759a;
  --line: #e5def4;
  --header-bg: #1d1136;
  --radius: 4px;
}

html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold); }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; line-height: 1.35; }

/* ===== 头部（深色） ===== */
.site-header {
  background: linear-gradient(120deg, var(--header-bg), #2a1655 70%, #34196b);
  position: sticky;
  top: 0;
  z-index: 900;
  border-bottom: 2px solid var(--gold);
}
.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
  color: #fff;
}
.site-logo:hover { color: var(--gold-light); }
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #e6c869);
  color: var(--purple-deep);
  font-size: 14px;
  border-radius: var(--radius);
}
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: 1px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.site-nav a {
  position: relative;
  color: #d8cff0;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 10px;
  white-space: nowrap;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.site-nav a:hover, .site-nav a.current { color: #fff; }
.site-nav a:hover::after, .site-nav a.current::after { transform: scaleX(1); }

.header-search {
  display: flex;
  flex-shrink: 0;
  min-width: 0;
  margin-left: auto;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  overflow: hidden;
}
.header-search input {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 8px 12px;
  font-size: 16px;
  width: 180px;
  min-width: 0;
  outline: none;
}
.header-search input::placeholder { color: #b3a7d6; }
.header-search button {
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #e6c869);
  color: var(--purple-deep);
  font-weight: 700;
  padding: 8px 16px;
  font-size: 14px;
}
.header-search button:hover { filter: brightness(1.08); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--gold-light);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 主体布局 ===== */
.site-main { min-height: 60vh; }
.page-wrap { padding-top: 32px; padding-bottom: 48px; }
.home-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 28px;
  padding-left: 14px;
  border-left: 5px solid var(--gold);
  color: var(--purple-deep);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 340px);
  gap: 32px;
  align-items: start;
}
.layout-main, .layout-side { min-width: 0; }

/* ===== 通用模块 ===== */
.sec { margin-bottom: 44px; background: var(--card); padding: 24px; border-radius: var(--radius); }
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sec-head h1, .sec-head h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--purple-deep);
  position: relative;
  padding-left: 14px;
}
.sec-head h1::before, .sec-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 1.1em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--purple), var(--gold));
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 18px;
}
.card-grid > * { min-width: 0; }
.v-card { display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.v-card:hover .v-title { color: var(--purple); }
.v-title {
  font-size: 15px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.v-meta { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 图片容器 */
.thumb-box, .poster-box {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(110deg, #ece6f8 30%, #f6f2ff 50%, #ece6f8 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  display: block;
}
@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -80% 0; }
}
.ratio-23 { aspect-ratio: 2 / 3; }
.ratio-169 { aspect-ratio: 16 / 9; }
.thumb-box img, .poster-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, opacity .5s ease;
}
a:hover .thumb-box img { transform: scale(1.05); }
.js-on .thumb-box img, .js-on .poster-box img { opacity: 0; }
.js-on .thumb-box img.is-loaded, .js-on .poster-box img.is-loaded { opacity: 1; }

/* 角标 */
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius);
  color: #fff;
}
.badge-hot { background: linear-gradient(135deg, #d63a3a, #ef7a3c); }
.badge-new { background: linear-gradient(135deg, var(--purple), #8b5cf6); }
.badge-du { background: linear-gradient(135deg, var(--gold), #a37d17); color: #fff; }

/* 焦点区：左大右小 */
.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.focus-grid > * { min-width: 0; }
.focus-item { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.focus-item:first-child { grid-column: 1; grid-row: 1 / 4; }
.focus-item:first-child .thumb-box { height: 100%; aspect-ratio: auto; min-height: 260px; }
.focus-item:first-child .v-title { font-size: 18px; }
.focus-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* 排行榜 */
.rank-list { counter-reset: rank; }
.rank-list li {
  counter-increment: rank;
  border-bottom: 1px solid var(--line);
}
.rank-list li:last-child { border-bottom: 0; }
.rank-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  color: var(--ink);
  min-width: 0;
}
.rank-list li a::before {
  content: counter(rank);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  border-radius: var(--radius);
  background: var(--purple-soft);
  color: var(--purple);
}
.rank-list li:nth-child(1) a::before,
.rank-list li:nth-child(2) a::before,
.rank-list li:nth-child(3) a::before {
  background: linear-gradient(135deg, var(--gold), #e6c869);
  color: var(--purple-deep);
}
.rank-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 14px;
}
.rank-cat { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.rank-list li a:hover .rank-title { color: var(--purple); }
.rank-wide li a { padding: 12px 6px; }

/* 细描边极简列表 */
.line-list { display: flex; flex-direction: column; }
.line-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.line-item:first-child { padding-top: 4px; }
.line-item:last-child { border-bottom: 0; }
.line-link { display: flex; gap: 18px; align-items: flex-start; color: var(--ink); min-width: 0; }
.line-thumb { flex: 0 0 220px; max-width: 220px; }
.line-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.line-body .v-title a { color: var(--ink); }
.line-body .v-title a:hover { color: var(--purple); }
.line-intro {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-body .v-meta { margin: 0; white-space: normal; }
.cat-link { color: var(--gold); font-weight: 600; }
.tag-links { margin: 0; font-size: 12px; color: var(--muted); }
.tag-links a { margin-right: 8px; color: var(--purple); }

/* 侧栏 */
.side-box {
  background: var(--card);
  padding: 20px;
  margin-bottom: 28px;
  border-radius: var(--radius);
}
.side-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--purple-deep);
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--gold);
}
.type-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.type-cloud a {
  border: 1px solid var(--line);
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--bg);
}
.type-cloud a:hover { border-color: var(--gold); color: var(--purple); }
.side-search { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
  background: var(--bg);
  color: var(--ink);
}
.side-search button {
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
}
.side-search button:hover { filter: brightness(1.1); }

/* 面包屑 */
.breadcrumb { margin-bottom: 22px; font-size: 13px; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.breadcrumb li { display: flex; align-items: center; min-width: 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--purple); }
.bc-current {
  color: var(--ink);
  max-width: 40vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: bottom;
}

/* 分页（极简） */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.pagination a {
  min-width: 40px;
  padding: 8px 16px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  background: var(--card);
}
.pagination a:hover {
  border-color: var(--gold);
  color: var(--purple);
  background: var(--purple-soft);
}

/* ===== 视频详情 ===== */
.video-detail { background: var(--card); padding: 24px; margin-bottom: 44px; border-radius: var(--radius); }
.video-h1 { font-size: 26px; font-weight: 800; color: var(--purple-deep); margin-bottom: 18px; }
.player-module { margin-bottom: 26px; }
.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #120a24;
  border-radius: var(--radius);
}
.hls-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.video-info { margin-bottom: 26px; }
.info-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.info-grid > * { min-width: 0; }
.poster-box { aspect-ratio: 2 / 3; }
.info-list { margin: 0; display: flex; flex-direction: column; gap: 0; }
.info-row {
  display: flex;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.info-row:last-child { border-bottom: 0; }
.info-row dt { flex: 0 0 72px; color: var(--muted); font-size: 14px; }
.info-row dd { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 14px; }
.score-num { color: var(--gold); font-size: 20px; font-weight: 800; }
.video-text-sec { margin-bottom: 26px; }
.video-text-sec h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--purple-deep);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--gold);
}
.video-intro-text { margin: 0; color: var(--ink); font-size: 15px; }
.rich-content { font-size: 15px; line-height: 1.8; }
.rich-content img { margin: 12px auto; border-radius: var(--radius); }
.rich-content table { display: block; overflow-x: auto; border-collapse: collapse; }
.rich-content p { margin: 0 0 12px; }

/* ===== 关于我们 ===== */
.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  margin: 26px 0;
}
.stat-box {
  background: linear-gradient(135deg, var(--purple-soft), #fdf6dd);
  padding: 22px;
  text-align: center;
  border-radius: var(--radius);
}
.stat-num { display: block; font-size: 30px; font-weight: 800; color: var(--purple); }
.stat-label { font-size: 13px; color: var(--muted); }
.about-contact h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--purple-deep);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--gold);
}
.about-contact p { margin: 6px 0; }

/* ===== 搜索无结果 ===== */
.no-result { display: none; text-align: center; padding: 48px 16px; }
.no-result-icon { font-size: 46px; color: var(--gold); margin: 0 0 12px; }
.no-result-text { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.no-result-tip { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: #fff;
  font-weight: 700;
  padding: 10px 28px;
  border-radius: var(--radius);
}
.btn-primary:hover { color: #fff; filter: brightness(1.1); }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--header-bg);
  color: #cfc4ea;
  margin-top: 40px;
  border-top: 3px solid var(--gold);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  padding-top: 36px;
  padding-bottom: 28px;
}
.footer-grid > * { min-width: 0; }
.footer-logo { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 10px; }
.footer-desc { font-size: 13px; margin: 0; color: #a99cd0; }
.footer-title { font-size: 15px; font-weight: 700; color: var(--gold-light); margin: 0 0 10px; }
.footer-col p { margin: 6px 0; font-size: 13px; }
.footer-col a { color: #cfc4ea; }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 0; }
.footer-bottom p { margin: 0; font-size: 12px; color: #9a8dc2; text-align: center; }
.footer-bottom a { color: var(--gold-light); }

/* ===== 404 ===== */
.page-404 {
  background: linear-gradient(135deg, #1d1136, #34196b);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.err-wrap { width: 100%; max-width: 480px; }
.err-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  border-top: 4px solid var(--gold);
}
.err-code {
  font-size: 72px;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, var(--purple), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.err-title { font-size: 22px; margin: 8px 0 10px; color: var(--purple-deep); }
.err-desc { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.err-search { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.err-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 11px 12px;
  font-size: 16px;
  outline: none;
  background: var(--bg);
}
.err-search button {
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #e6c869);
  color: var(--purple-deep);
  font-weight: 700;
  padding: 11px 18px;
}

/* ===== 淡入动效 ===== */
.js-on .fade-item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s ease;
}
.js-on .fade-item.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-on .fade-item { opacity: 1; transform: none; transition: none; }
  .thumb-box, .poster-box { animation: none; }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout-side { order: 2; }
  .focus-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .focus-item:first-child { grid-column: 1 / -1; grid-row: auto; }
  .focus-item:first-child .thumb-box { aspect-ratio: 16 / 9; min-height: 0; height: auto; }
}

@media (max-width: 768px) {
  .header-inner { gap: 10px; }
  .site-logo { order: 1; }
  .nav-toggle { display: flex; order: 2; margin-left: auto; }
  .header-search { order: 3; width: 100%; margin-left: 0; }
  .header-search input { flex: 1 1 auto; width: auto; }
  .site-nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 12px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { width: 100%; padding: 12px 8px; border-bottom: 1px solid rgba(255,255,255,.08); white-space: normal; }
  .site-nav a::after { display: none; }
  .page-wrap { padding-top: 20px; }
  .sec, .video-detail { padding: 16px; margin-bottom: 28px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px 12px; }
  .focus-grid { grid-template-columns: minmax(0, 1fr); }
  .line-link { flex-direction: column; }
  .line-thumb { flex: 0 0 auto; max-width: 100%; width: 100%; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .poster-box { max-width: 220px; margin: 0 auto; }
  .video-h1 { font-size: 21px; }
  .home-title { font-size: 18px; margin-bottom: 20px; }
  .bc-current { max-width: 55vw; }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-text { font-size: 17px; }
  .sec-head h1, .sec-head h2 { font-size: 17px; }
  .rank-cat { display: none; }
}
