/* ==========================================================================
   视频新闻：列表页 demo/video-list.html + 内容页 demo/video.html
   V2 设计语言：去边框卡片、clamp() 流式字号、细线 #eef2f5、留白分层、accent 分组
   栅格沿用 .list-layout / .article-layout（700+280，≥1320 时 896+358）
   ========================================================================== */

/* ---- 列表页页头：与 V2 page-header 同节奏 ---- */
.video-page-head {
  padding: 12px 0 22px;
  border-bottom: 1px solid #eef2f5;
}
.video-page-head .eyebrow {
  display: block;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.video-page-head h1 {
  margin: 8px 0 0;
  font-size: clamp(28px, 2.6vw, 34px);
  line-height: 1.3;
  color: var(--color-heading);
}
.video-page-head p {
  margin: 10px 0 0;
  color: var(--color-muted);
  font-size: clamp(14px, 1.05vw, 15.5px);
}

/* ---- 视频卡片网格：桌面 3 列 ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 22px;
  margin-top: 26px;
}
.video-card {
  min-width: 0;
}
.video-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-soft);
}
.video-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}
.video-card:hover .video-card__media img {
  transform: scale(1.05);
}

/* 播放按钮：半透明圆 + 三角，hover 转主色 */
.video-card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.video-card__play::before {
  content: "";
  position: absolute;
  width: clamp(44px, 4vw, 54px);
  height: clamp(44px, 4vw, 54px);
  border-radius: 50%;
  background: rgba(16, 42, 58, 0.46);
  transition:
    background-color 0.22s ease,
    transform 0.22s ease;
}
.video-card__play::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
}
.video-card:hover .video-card__play::before {
  background: var(--color-primary);
  transform: scale(1.08);
}

.video-card__title {
  display: block;
  margin: 12px 0 0;
  font-size: clamp(15px, 1.15vw, 16.5px);
  line-height: 1.55;
  color: var(--color-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.18s ease;
}
.video-card:hover .video-card__title {
  color: var(--color-primary);
}
.video-card__date {
  display: block;
  margin-top: 6px;
  color: var(--color-muted);
  font-size: 13px;
}

/* ---- 内容页：标题区 ---- */
.video-article-head {
  padding: 24px 0 22px;
  border-bottom: 1px solid #eef2f5;
}
.video-article-head .article-kicker {
  color: var(--color-primary);
  font-size: clamp(13px, 1vw, 14px);
  font-weight: 700;
}
.video-article-head h1 {
  margin: 10px 0 0;
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.32;
  color: var(--color-heading);
}
.video-article-head .article-subtitle {
  margin: 8px 0 0;
  color: #8a94a3;
  font-size: clamp(19px, 2.1vw, 26px);
  font-weight: 600;
  line-height: 1.5;
}
.video-article-head .article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 14px;
  color: var(--color-muted);
  font-size: 14px;
}

/* ---- 内容页：播放器（16:9 响应式） ---- */
.video-player {
  position: relative;
  margin: 26px 0 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0b1a24;
}
.video-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-player__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  text-align: center;
}

/* ---- 内容页：简介 ---- */
.video-desc {
  padding: 24px 0 4px;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.95;
  color: var(--color-text);
}
.video-desc p {
  margin: 0 0 1.4em;
}
.video-desc p:last-child {
  margin-bottom: 0;
}
/* 兼容方案：若未配置 videourl 字段、播放 iframe 直接写在正文里，这里自动 16:9 响应式 */
.video-desc iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 0 1.4em;
  border: 0;
  border-radius: var(--radius-md);
  background: #0b1a24;
}

/* ---- 侧栏：相关视频（横向小卡片） ---- */
.sidebar-video-list {
  display: grid;
  gap: 14px;
}
.sidebar-video-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.sidebar-video-item .thumb {
  position: relative;
  isolation: isolate;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg-soft);
}
.sidebar-video-item .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.sidebar-video-item:hover .thumb img,
.sidebar-video-item:focus-visible .thumb img {
  transform: scale(1.06);
}
.sidebar-video-item .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 42, 58, 0.42);
  z-index: 1;
  pointer-events: none;
  transition: background-color 0.2s ease;
}
.sidebar-video-item .thumb::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
  transform: translate(-35%, -50%);
  z-index: 2;
  pointer-events: none;
}
.sidebar-video-item:hover .thumb::after,
.sidebar-video-item:focus-visible .thumb::after {
  background: var(--color-primary);
}
.sidebar-video-item__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-heading);
  transition: color 0.18s ease;
}
.sidebar-video-item:hover .sidebar-video-item__title,
.sidebar-video-item:focus-visible .sidebar-video-item__title {
  color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-video-item .thumb img {
    transition: none;
  }
  .sidebar-video-item:hover .thumb img,
  .sidebar-video-item:focus-visible .thumb img {
    transform: none;
  }
}

/* ---- 主内容容器 ---- */
.video-shell {
  width: 100%;
  min-width: 0;
}

/* ---- 分页（V2 语言：细线圆角、流式尺寸，与 list.css 同风格但自包含） ---- */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(6px, 0.7vw, 9px);
  padding: clamp(28px, 3vw, 40px) 0 0;
}
.pagination a,
.pagination span {
  display: grid;
  place-items: center;
  min-width: clamp(38px, 3.2vw, 46px);
  height: clamp(38px, 3.2vw, 46px);
  padding: 0 clamp(8px, 0.8vw, 12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease,
    color 0.18s ease;
}
.pagination a:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.pagination .current,
.pagination .current:hover,
/* Empire CMS [!--show.page--] 当前页输出为 <b>，此处一并兼容 */
.pagination b,
.pagination b:hover,
.pagination strong,
.pagination strong:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
.pagination .ellipsis,
.pagination .ellipsis:hover {
  border-color: transparent;
  background: transparent;
  color: var(--color-muted);
  cursor: default;
}
.pagination .disabled,
.pagination .disabled:hover {
  border-color: var(--color-border);
  background: var(--color-bg-soft);
  color: #b6bfc8;
  cursor: default;
}

/* ---- 分享区（与 article.css 同结构，宽度改为随主内容自适应） ---- */
.video-shell .article-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: clamp(16px, 1.6vw, 22px) 0;
  border-top: 1px solid #eef2f5;
}
.video-shell .article-share__label {
  color: var(--color-muted);
  font-size: clamp(13px, 1vw, 15px);
}

/* 微信弹层容器：必须是定位参照，否则弹层会飘到文档左上角 */
.video-shell .share-wechat {
  position: relative;
}
.video-shell .share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: clamp(36px, 2.9vw, 42px);
  padding: 7px clamp(14px, 1.2vw, 18px);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-text);
  font-size: clamp(13px, 1vw, 15px);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.video-shell .share-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.video-shell .share-btn--wechat:hover,
.video-shell .share-btn--wechat[aria-expanded="true"] {
  border-color: #07c160;
  color: #07c160;
}
.video-shell .share-btn--copy:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.video-shell .share-btn.is-copied {
  border-color: #07c160;
  color: #07c160;
}
.video-shell .share-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: 212px;
  padding: 16px 16px 14px;
  border: 1px solid #e8edf2;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.video-shell .share-pop::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid #e8edf2;
  border-bottom: 1px solid #e8edf2;
  background: #fff;
  transform: rotate(45deg);
}
.video-shell .share-pop [data-share-qr] {
  min-height: 118px;
  font-size: 13px;
  color: var(--color-muted);
}
.video-shell .share-pop [data-share-qr] canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  image-rendering: pixelated;
}
.video-shell .share-pop p {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.6;
  text-indent: 0;
}

/* ---- 正文为空时的兜底（数据迁移后常见） ---- */
.video-empty {
  text-align: center;
  padding: clamp(18px, 2vw, 30px) 0;
}
.video-empty__cover {
  margin: 0 0 16px;
  text-indent: 0;
}
.video-empty__cover img {
  display: block;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--color-bg-soft);
}
.video-empty__text {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(14px, 1.1vw, 16px);
  text-indent: 0;
}

/* ---- 上一篇 / 下一篇 ---- */
.video-shell .article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1vw, 16px);
  width: 100%;
  margin: 0;
  padding: clamp(16px, 1.6vw, 22px) 0 0;
  border-top: 1px solid #eef2f5;
}
.video-shell .article-nav a,
.video-shell .article-nav > div {
  display: block;
  padding: clamp(12px, 1.2vw, 16px);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  color: var(--color-text);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.6;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.video-shell .article-nav a:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.video-shell .article-nav .meta {
  color: var(--color-muted);
  font-size: 13px;
}

/* ---- 响应式 ---- */
@media (min-width: 1320px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 26px;
  }
}
@media (max-width: 1039px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 18px;
  }
}
@media (max-width: 767px) {
  .video-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 20px;
  }
  .video-page-head {
    padding: 8px 0 18px;
  }
  .video-article-head {
    padding: 18px 0 16px;
  }
  .video-player {
    margin-top: 18px;
  }
  .video-desc {
    padding-top: 18px;
  }
  .sidebar-video-item {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}

/* ---- 窄屏：分页与上下篇 ---- */
@media (max-width: 767px) {
  .pagination {
    gap: 6px;
    padding-top: 24px;
  }
  .pagination a,
  .pagination span {
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    font-size: 14px;
  }
  .video-shell .article-nav {
    grid-template-columns: minmax(0, 1fr);
  }
}
