/* 跨境资讯页面样式 */

:root {
  --cbn-accent: #f97316;
  --cbn-accent-soft: rgba(249, 115, 22, 0.15);
}

/* 跨境资讯轮播组件覆盖样式 */
.cbn-section-home {
  padding: 20px 0 48px;
  background: var(--bg-color, #0b0e14);
}

.cbn-section-home .container {
  max-width: 1660px; /* 加宽容器，让一行 4 个卡片更宽 */
  padding: 0 40px;
}

.cbn-section-home .section-title {
  margin-bottom: 24px;
}

.cbn-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.cbn-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  background: none;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
}

.cbn-more-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.cbn-more-btn:hover {
  color: #3b82f6;
}

.cbn-more-btn:hover svg {
  transform: translateX(4px);
}

.cbn-swiper-shell {
  position: relative;
  padding: 0 64px;
}

.cbn-swiper {
  width: 100%;
  overflow: hidden;
  padding: 20px 10px; /* 为阴影留出空间 */
  position: relative; /* 必须加相对定位，以约束内部元素 */
}

.cbn-swiper .swiper-wrapper {
  display: flex; /* Ensure it is a flex container */
  align-items: stretch;
}

.cbn-swiper .swiper-slide {
  height: auto; /* 让卡片自适应高度 */
  display: flex;
}

.cbn-swiper .cbn-card {
  width: 100%;
}

.cbn-swiper-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--border-light, rgba(255, 255, 255, 0.12));
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

.cbn-swiper-prev {
  left: 0;
}

.cbn-swiper-next {
  right: 0;
}

.cbn-swiper-nav svg {
  width: 20px;
  height: 20px;
}

.cbn-swiper-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.cbn-swiper-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.cbn-swiper-nav.swiper-button-disabled,
.cbn-swiper-nav.swiper-button-lock {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 767px) {
  .cbn-section-home .container {
    padding: 0 16px;
  }

  .cbn-swiper-shell {
    padding: 0;
  }

  .cbn-swiper-nav {
    top: 120px;
    width: 50px;
    height: 50px;
  }

  .cbn-swiper-prev {
    left: 12px;
  }

  .cbn-swiper-next {
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cbn-swiper-nav {
    transition: none;
  }
}

.cbn-banner {
  height: 330px;
  min-height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 10%, rgba(249, 115, 22, 0.18) 0%, transparent 55%),
    url("../images/alshou.png") center center no-repeat;
  background-size: cover, cover;
  position: relative;
  overflow: hidden;
}

.cbn-banner .header-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 20, 0.75);
  z-index: 1;
}

.cbn-banner .container {
  position: relative;
  z-index: 2;
}

.cbn-banner h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -1.8px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ef4444 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cbn-banner p {
  font-size: 18px;
  color: var(--text-secondary, #94a3b8);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 列表区域 */
.cbn-section {
  padding: 80px 0 100px;
  background:
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
    var(--bg-color, #0b0e14);
}

.cbn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* 卡片 */
.cbn-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  color: white;
}

.cbn-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cbn-card-cover {
  width: 100%;
  height: 200px; /* 固定高度，避免 slide 宽度异常时图片被撑爆 */
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.cbn-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease, opacity 0.3s ease;
}

/* Swiper lazy：未加载前透明，加载完成后显示 */
.cbn-card-cover img.swiper-lazy:not(.swiper-lazy-loaded) {
  opacity: 0;
}

.cbn-card-cover img.swiper-lazy-loaded {
  opacity: 1;
}

.cbn-card:hover .cbn-card-cover img {
  transform: scale(1.05);
}

.cbn-card-body {
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cbn-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: white;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.cbn-card:hover .cbn-card-title {
  color: #3b82f6; /* 品牌蓝 */
}

.cbn-card-summary {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #94a3b8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cbn-card-summary:empty {
  display: none;
  margin: 0;
}

.cbn-card-date {
  font-size: 13px;
  color: #94a3b8; /* text-secondary */
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 首页轮播专用：不改行业资讯列表页卡片 */
.cbn-card--home .cbn-card-body {
  padding: 16px 16px 14px;
}

.cbn-card--home .cbn-card-title {
  min-height: 3em;
  margin-bottom: 4px;
}

.cbn-card--home .cbn-card-body > .cbn-card-date {
  margin: 0;
}

.cbn-card--home .cbn-card-footer {
  margin-top: 12px;
  padding-top: 12px;
}

.cbn-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cbn-card-footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.cbn-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cbn-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}

.cbn-tag-muted {
  color: #64748b;
}

.cbn-card-arrow {
  --cbn-arrow-travel: 28px;
  position: relative;
  overflow: hidden;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* 背景只变色，不位移 */
  transition: background 0.25s ease;
}

.cbn-card-arrow svg {
  display: block;
  width: 18px;
  height: 18px;
  color: #fff;
  flex-shrink: 0;
}

/* 静止层：未悬停居中；失焦时从右侧滑入 */
.cbn-arrow-idle {
  position: relative;
  z-index: 1;
  opacity: 0.75;
  transform: translateX(0);
}

/* 滑动层：悬停时从左侧滑入，失焦时往左退出 */
.cbn-arrow-slide {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  margin: -9px 0 0 -9px;
  opacity: 0;
  transform: translateX(calc(var(--cbn-arrow-travel) * -1));
  pointer-events: none;
}

.cbn-card:hover .cbn-card-arrow,
.cbn-card:focus-visible .cbn-card-arrow {
  background: #3b82f6;
}

/* 空状态 & 加载 */
.cbn-empty,
.cbn-detail-loading,
.cbn-detail-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary, #94a3b8);
}

.cbn-detail-error h2 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 24px;
}

/* 分页 */
.cbn-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
}

.cbn-page-btn {
  padding: 10px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.cbn-page-btn:hover:not(:disabled) {
  background: var(--cbn-accent);
  border-color: var(--cbn-accent);
}

.cbn-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cbn-pagination-info {
  color: var(--text-secondary, #94a3b8);
  font-size: 14px;
}

/* 详情页 */
.cbn-detail-section {
  padding: 60px 0 100px;
  background: var(--bg-color, #0b0e14);
}

.cbn-detail {
  max-width: 860px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
}

.cbn-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary, #94a3b8);
  font-size: 14px;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.cbn-back-link svg {
  width: 18px;
  height: 18px;
}

.cbn-back-link:hover {
  color: var(--cbn-accent);
}

.cbn-detail-header h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  margin-bottom: 16px;
}

.cbn-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.cbn-detail-meta time {
  font-size: 14px;
  color: var(--text-secondary, #94a3b8);
}

.cbn-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cbn-detail-tags .cbn-tag {
  border-color: rgba(249, 115, 22, 0.3);
  color: #fb923c;
  background: var(--cbn-accent-soft);
}

.cbn-detail-cover {
  margin-bottom: 32px;
  border-radius: 16px;
  overflow: hidden;
}

.cbn-detail-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.cbn-detail-content {
  background: transparent;
  border-radius: 16px;
  padding: 0;
  color: #d1d5db; /* 调整正文文字颜色以适应深色背景 */
  line-height: 1.8;
  word-break: break-word;
}

.cbn-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.cbn-detail-content p {
  margin-bottom: 1.5em;
  color: #cbd5e1;
}

.cbn-detail-content h1,
.cbn-detail-content h2,
.cbn-detail-content h3,
.cbn-detail-content h4 {
  color: #fff;
  margin: 1.5em 0 0.8em;
}


/* 响应式 */
@media (max-width: 1200px) {
  .cbn-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .cbn-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .cbn-banner h1 {
    font-size: 42px;
  }
}

@media (max-width: 600px) {
  .cbn-grid {
    grid-template-columns: 1fr;
  }

  .cbn-banner h1 {
    font-size: 32px;
  }

  .cbn-detail-header h1 {
    font-size: 26px;
  }

  .cbn-detail-content {
    padding: 20px;
  }
}
