/**
 * 首页专用：头图带、轮播、导语卡、主内容区浅底（顶栏样式见 css/nav-feed-global.css）。
 * 需同时具有 body.page-home 与 body.has-nav-feed。
 */

body.page-home {
  --tj-feed-bg: #f4f4f4;
  --tj-feed-card: #ffffff;
  --tj-feed-text: #18191c;
  --tj-feed-muted: #9499a0;
}

/* —— 头图装饰带 —— */
body.page-home .tj-bili-header-banner {
  max-width: min(1760px, calc(100vw - 20px));
  margin: 6px auto 0;
  height: clamp(72px, 12vw, 120px);
  border-radius: 8px;
  background-image: url('../images/banner-bg.jpg'),
    linear-gradient(120deg, #2a2135 0%, #4a3048 40%, #1f2a38 100%);
  background-size: cover, cover;
  background-position: center, center;
  position: relative;
  overflow: hidden;
}

body.page-home .tj-bili-header-banner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: linear-gradient(to top, var(--tj-feed-bg), transparent);
  pointer-events: none;
}

/* —— 轮播 + 导语区 —— */
body.page-home .home-top-visual {
  max-width: min(1480px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 10px 12px 0;
}

body.page-home .home-carousel {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  /* 略高于旧版 42%，竖版封面 + contain 时仍有足够可视高度 */
  --tj-carousel-ratio: 54%;
}

body.page-home .home-carousel-viewport {
  position: relative;
  width: 100%;
  padding-bottom: var(--tj-carousel-ratio);
}

body.page-home .home-carousel-dots--bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 0 0;
  position: relative;
  z-index: 4;
}

body.page-home .home-intro-card .btn-primary--ghost {
  background: transparent !important;
  border: 2px solid var(--tj-nav-accent, #8b6914) !important;
  color: var(--tj-nav-accent, #8b6914) !important;
}

body.page-home .home-intro-card .btn-primary--ghost:hover {
  background: var(--tj-nav-highlight-bg, rgba(201, 162, 39, 0.14)) !important;
}

body.page-home .home-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

body.page-home .home-carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

body.page-home .home-carousel-slide a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  /* 底色 + 顶底浅金花边 + 暗角；底层极淡祥云纹平铺（images/patterns/xiangyun-faint.svg） */
  background-color: #141210;
  background-image:
    linear-gradient(180deg, rgba(196, 160, 96, 0.14) 0%, rgba(196, 160, 96, 0.03) 14px, transparent 36px),
    linear-gradient(0deg, rgba(196, 160, 96, 0.1) 0%, rgba(196, 160, 96, 0.02) 12px, transparent 32px),
    radial-gradient(ellipse 85% 70% at 50% 45%, rgba(35, 28, 22, 0.15) 0%, transparent 62%),
    url('../images/patterns/xiangyun-faint.svg');
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    184px 184px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-position: center, center, center, center;
  box-shadow: inset 0 0 0 1px rgba(196, 160, 96, 0.1);
}

/* 两侧柱形纹样（仿古立柱明暗条），填补 contain 左右留白 */
body.page-home .home-carousel-slide a::before,
body.page-home .home-carousel-slide a::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(72px, 10vw);
  z-index: 0;
  pointer-events: none;
  opacity: 0.92;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body.page-home .home-carousel-slide a::before {
  left: 0;
  border-right: 1px solid rgba(196, 160, 96, 0.18);
  background-image:
    linear-gradient(90deg, rgba(196, 160, 96, 0.22) 0%, rgba(196, 160, 96, 0.05) 3px, transparent 10px),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 11px,
      rgba(90, 68, 48, 0.28) 11px,
      rgba(90, 68, 48, 0.28) 12px
    ),
    linear-gradient(180deg, #2c241c 0%, #16110d 42%, #1a1410 58%, #2a2218 100%);
}

body.page-home .home-carousel-slide a::after {
  right: 0;
  border-left: 1px solid rgba(196, 160, 96, 0.18);
  background-image:
    linear-gradient(270deg, rgba(196, 160, 96, 0.22) 0%, rgba(196, 160, 96, 0.05) 3px, transparent 10px),
    repeating-linear-gradient(
      270deg,
      transparent 0,
      transparent 11px,
      rgba(90, 68, 48, 0.28) 11px,
      rgba(90, 68, 48, 0.28) 12px
    ),
    linear-gradient(180deg, #2c241c 0%, #16110d 42%, #1a1410 58%, #2a2218 100%);
}

/* 完整展示封面；层级压在柱纹之上 */
body.page-home .home-carousel-slide img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

body.page-home .home-carousel-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  padding: 28px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
}

body.page-home .home-carousel-title {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

body.page-home .home-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

body.page-home .home-carousel-dot.is-active {
  background: var(--tj-nav-accent-bright, #c9a227);
  width: 18px;
  border-radius: 6px;
}

body.page-home .home-carousel-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.page-home .home-carousel-arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  transform: translateY(-50%);
  pointer-events: none;
}

body.page-home .home-carousel-arrow {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

body.page-home .home-carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.5);
}

body.page-home .home-intro-card {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--tj-feed-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

body.page-home .home-intro-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  color: var(--tj-feed-text);
}

body.page-home .home-intro-card p {
  margin: 0 0 12px;
  line-height: 1.65;
  color: #61666d;
  font-size: 0.98rem;
}

/* —— 主内容区浅底 —— */
body.page-home .home-main-feed {
  background: var(--tj-feed-bg);
  padding: 18px 0 8px;
  margin-top: 8px;
}

body.page-home .home-main-feed .section-title {
  color: var(--tj-feed-text);
}

body.page-home .home-main-feed .sections {
  background: transparent;
}

body.page-home .home-main-feed .container {
  max-width: min(1760px, calc(100vw - 20px));
}

@media (max-width: 768px) {
  body.page-home .home-carousel-arrows {
    display: none;
  }

  /* 窄屏略增高轮播区，竖版封面更易完整显示 */
  body.page-home .home-carousel {
    --tj-carousel-ratio: 62%;
  }

  body.page-home .home-carousel-slide a::before,
  body.page-home .home-carousel-slide a::after {
    width: min(52px, 11vw);
    opacity: 0.88;
  }
}
