:root {
  --header-bg: #0a0a0a;
  --header-text: #f5f5f5;
  --header-muted: #a3a3a3;
  --brand-yellow: #facc15;
  --accent-pink: #ec4899;
  --sub-bg: #eceff3;
  --content-bg: #f3f4f6;
  --card-bg: #fff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --pill-bg: #fff;
  --pill-border: #e5e7eb;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sticky-header-h: 56px;
  --layout-break: 992px;
}

.layout-shell {
  display: flex;
  flex-direction: column;
}

* {
  box-sizing: border-box;
}

body.portal {
  margin: 0;
  font-family: var(--font);
  background: var(--content-bg);
  color: var(--text-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— 顶栏 —— */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  z-index: 42;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  order: 1;
}

/* 大屏：顶栏 → Banner → 栏目（与源站一致） */
@media (min-width: 992px) {
  .site-header {
    position: sticky;
    top: 0;
  }

  .hero-banner {
    order: 2;
  }

  .sub-bar-wrap {
    order: 3;
  }

  .content-wrap {
    order: 4;
  }
}

/* 小屏：第一行 logo+搜索，第二行主导航横滑（对齐源站） */
@media (max-width: 991px) {
  .site-header {
    position: sticky;
    top: 0;
  }

  .header-shell {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    max-width: 100%;
    padding: 8px 12px 0;
    gap: 0;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .header-tools {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    justify-self: end;
  }

  .main-nav-row {
    grid-column: 1 / -1;
    grid-row: 2;
    order: unset;
    margin: 8px -12px 0;
    padding: 8px 10px 10px;
    border-top: 1px solid #2a2a2a;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav-row::-webkit-scrollbar {
    display: none;
  }

  .main-nav {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
  }

  .main-nav button {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .sub-bar-wrap {
    order: 2;
    position: static;
  }

  .hero-banner {
    order: 3;
    min-height: 72px;
  }

  .hero-inner {
    padding: 16px;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .content-wrap {
    order: 4;
  }

  .sub-bar-inner {
    padding: 8px 12px;
  }

  .sub-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }

  .sub-nav button {
    flex-shrink: 0;
  }

  .brand-text strong {
    font-size: 1rem;
  }

  .brand-icon {
    font-size: 1.6rem;
  }
}

.header-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.main-nav-row {
  flex: 1;
  min-width: 0;
}

@media (min-width: 992px) {
  .main-nav-row {
    order: 0;
  }

  .header-tools {
    margin-left: auto;
    flex-shrink: 0;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 2rem;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 0.65rem;
  color: var(--brand-yellow);
  letter-spacing: 0.08em;
}

.main-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 4px 2px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.main-nav a,
.main-nav button {
  background: transparent;
  border: none;
  color: var(--header-text);
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0.92;
}

.main-nav a:hover,
.main-nav button:hover {
  color: var(--brand-yellow);
}

.main-nav .active {
  color: var(--brand-yellow);
  font-weight: 600;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.search-box {
  display: flex;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 999px;
  overflow: hidden;
  padding-right: 4px;
}

.search-box input {
  border: none;
  background: transparent;
  color: #fff;
  padding: 8px 12px;
  width: 140px;
  font-size: 0.85rem;
  outline: none;
}

.search-box button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.tool-link {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

/* —— Banner —— */
.hero-banner {
  background: linear-gradient(135deg, #1a0a12 0%, #0a0a0a 50%, #1a1020 100%);
  color: #fff;
  min-height: 120px;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 16px 32px;
}

.hero-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(90deg, #f472b6, #facc15);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 8px 0 0;
  color: #d4d4d4;
  font-size: 0.9rem;
}

/* —— 栏目 pill —— */
.sub-bar-wrap {
  background: var(--sub-bg);
  border-bottom: 1px solid #dde1e6;
}

.sub-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.sub-hot {
  font-size: 1.25rem;
  line-height: 32px;
  flex-shrink: 0;
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.sub-nav button {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-dark);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.sub-nav button:hover {
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

.sub-nav button.active {
  background: #fff;
  border-color: var(--accent-pink);
  color: var(--accent-pink);
  font-weight: 600;
}

/* —— 内容区 —— */
.content-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 18px;
}

.section-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-pink);
  color: #fff;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.section-en {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.section-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.xj-grid:not(.xj-video-grid) {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

@media (min-width: 992px) {
  .xj-grid:not(.xj-video-grid) {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

.home-portal .section-head {
  margin-top: 28px;
}

.home-portal .section-head:first-child {
  margin-top: 0;
}

.section-head-row {
  justify-content: space-between;
  align-items: center;
}

.section-head-row > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.btn-ghost {
  border: 1px solid var(--pill-border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

.home-lib-hint {
  margin-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.xj-card .xj-thumb {
  position: relative;
  aspect-ratio: 600 / 370;
}

.xj-card .thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  opacity: 0;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s;
  pointer-events: none;
}

.xj-card:hover .thumb-play {
  opacity: 1;
}

.vod-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  z-index: 2;
}

.vod-badge-free {
  background: #0284c7;
}

.vod-badge-vip {
  background: #dc2626;
}

.vod-badge-premium {
  background: #a16207;
  font-size: 11px;
}

.vod-badge-premium .gem {
  margin-left: 1px;
  font-size: 9px;
}

.xj-card .thumb-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent);
  z-index: 1;
}

.xj-card .thumb-views {
  white-space: nowrap;
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.card .thumb {
  aspect-ratio: 16 / 10;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow: hidden;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card .body {
  padding: 10px 12px 12px;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px;
}

/* —— 播放器 —— */
.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.player-overlay.open {
  display: flex;
}

.player-box {
  width: 100%;
  max-width: 920px;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  color: #eee;
}

.player-box header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #333;
}

.player-box header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.player-box header button {
  background: #222;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

#videoEl {
  width: 100%;
  max-height: 72vh;
  background: #000;
  display: block;
}

.player-hint {
  padding: 10px 14px 14px;
  font-size: 0.78rem;
  color: #999;
  white-space: pre-wrap;
}

@media (max-width: 991px) {
  .search-box input {
    width: 96px;
  }
}


/* 分类页 Logo 与首页统一尺寸 */
.site-header .brand-logo-full { width:180px; height:55px; object-fit:contain; object-position:left center; display:block; }




/* 分类文字与返回首页统一基线 */
.sub-bar-inner { align-items:center; }
.sub-nav { align-items:center; }
.sub-nav button { height:32px; line-height:20px; display:inline-flex; align-items:center; }

