/**
 * 使用视频页样式
 *
 * 结构：分区（软件 / 机器）→ 分组折叠面板 → 语言分组 → 视频卡片网格
 * 配色沿用站点的中性色与品牌紫，仅在此页加载。
 */

/* ============ 页面骨架 ============ */
.imt-vd-page {
  background: #f8fafc;
}

.imt-vd-body {
  padding: 28px 0 56px;
}

/* 顶部工具条：总数 + 全部展开/收起 */
.imt-vd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.imt-vd-total {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.3;
  font-size: 13px;
  color: var(--neutral-500, #64748b);
}

.imt-vd-total .bi-en {
  font-size: 11px;
  opacity: 0.7;
}

.imt-vd-toolbar-actions {
  display: inline-flex;
  gap: 8px;
}

.imt-vd-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 14px;
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: 999px;
  background: #fff;
  color: var(--neutral-600, #475569);
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.imt-vd-toggle em {
  font-style: normal;
  font-size: 10px;
  opacity: 0.62;
}

.imt-vd-toggle:hover {
  border-color: var(--color-brand-500, #7c3aed);
  color: var(--color-brand-500, #7c3aed);
  background: rgba(124, 58, 237, 0.04);
}

/* ============ 分区 ============ */
.imt-vd-kind {
  margin-bottom: 34px;
}

.imt-vd-kind:last-of-type {
  margin-bottom: 18px;
}

.imt-vd-groups {
  display: grid;
  gap: 12px;
}

/* ============ 分组折叠面板 ============ */
.imt-vd-group {
  background: #fff;
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.imt-vd-group[open] {
  box-shadow: 0 14px 34px -22px rgba(15, 23, 42, 0.32);
}

.imt-vd-group summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.imt-vd-group summary::-webkit-details-marker {
  display: none;
}

.imt-vd-group summary:hover {
  background: #fafbff;
}

.imt-vd-group-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--neutral-900, #0f172a);
}

.imt-vd-group-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--neutral-400, #94a3b8);
}

.imt-vd-group-count .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* 箭头：默认朝下，展开后朝上 */
.imt-vd-chev {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--neutral-300, #cbd5e1);
  border-bottom: 2px solid var(--neutral-300, #cbd5e1);
  transform: rotate(45deg);
  transition: transform 0.25s ease, border-color 0.25s ease;
  flex: none;
}

.imt-vd-group[open] .imt-vd-chev {
  transform: rotate(-135deg);
  border-color: var(--color-brand-500, #7c3aed);
}

.imt-vd-group-body {
  padding: 2px 20px 20px;
  border-top: 1px solid var(--neutral-100, #f1f5f9);
}

/* ============ 语言页签（各 50% 宽） ============ */
.imt-vd-tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0 18px;
  padding: 4px;
  background: var(--neutral-100, #f1f5f9);
  border-radius: 12px;
}

.imt-vd-tab {
  flex: 1 1 50%;
  width: 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--neutral-500, #64748b);
  font: inherit;
  font-size: clamp(11px, 2.6vw, 13px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  word-break: break-word;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.imt-vd-tab:hover {
  color: var(--color-brand-500, #7c3aed);
}

.imt-vd-tab.is-on {
  background: #fff;
  color: var(--color-brand-600, #6d28d9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 6px 16px -10px rgba(15, 23, 42, 0.28);
}

.imt-vd-tab.is-empty {
  color: var(--neutral-400, #94a3b8);
}

.imt-vd-tab.is-empty.is-on {
  color: var(--neutral-500, #64748b);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* 页签对应的内容面板：只显示选中的那一侧 */
.imt-vd-pane {
  display: none;
}

.imt-vd-pane.is-on {
  display: block;
}

.imt-vd-lang-missing {
  margin: 4px 0 0;
  padding: 22px 0;
  font-size: 12px;
  text-align: center;
  color: var(--neutral-400, #94a3b8);
}

/* ============ 视频卡片 ============ */
.imt-vd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 16px;
}

.imt-vd-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* 缩略图：16:9，无封面时用深色渐变占位 */
.imt-vd-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background-color: #0b1220;
  background-image: linear-gradient(135deg, #14203c 0%, #241a45 52%, #0b1220 100%);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--neutral-200, #e2e8f0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 图片上的暗色蒙版，保证白色图标与徽章始终可读 */
.imt-vd-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.06) 0%, rgba(8, 12, 24, 0.42) 100%);
}

.imt-vd-card:hover .imt-vd-thumb {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -18px rgba(15, 23, 42, 0.5);
}

.imt-vd-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s ease, background 0.25s ease;
}

.imt-vd-card:hover .imt-vd-play {
  transform: scale(1.08);
  background: #fff;
}

.imt-vd-play svg {
  width: 20px;
  height: 20px;
  fill: #0b1220;
}

/* 播放三角在视觉上偏左，稍微右移一点看起来才居中 */
.imt-vd-card:not(.is-external) .imt-vd-play svg {
  margin-left: 2px;
}

.imt-vd-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.62);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.imt-vd-langtag {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
  color: #0b1220;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

/* 时长为采集时从公众号带来的信息，放在左下角 */
.imt-vd-dur {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(8, 12, 24, 0.62);
  color: rgba(255, 255, 255, 0.94);
  font-size: 10px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.imt-vd-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.imt-vd-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--neutral-900, #0f172a);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.imt-vd-card:hover .imt-vd-title {
  color: var(--color-brand-500, #7c3aed);
}

.imt-vd-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--neutral-400, #94a3b8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ 播放弹层 ============ */
body.imt-vd-lock {
  overflow: hidden;
}

.imt-vd-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.imt-vd-modal[hidden] {
  display: none;
}

.imt-vd-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 18, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.imt-vd-modal-box {
  position: relative;
  width: min(1000px, 92vw);
  background: #0b1220;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
}

.imt-vd-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.86);
}

.imt-vd-modal-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.imt-vd-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s ease;
  flex: none;
}

.imt-vd-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.imt-vd-modal-close svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.imt-vd-modal-body {
  aspect-ratio: 16 / 9;
  background: #000;
}

.imt-vd-modal-body iframe,
.imt-vd-modal-body video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 微信源：不允许站外播放，弹层里给封面 + 明确去处 */
.imt-vd-wx {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
  overflow: hidden;
}

.imt-vd-wx-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(14px) brightness(0.42);
  transform: scale(1.08);
}

.imt-vd-wx-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  padding: 26px 30px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

.imt-vd-wx-inner strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.imt-vd-wx-inner p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.72);
}

.imt-vd-wx-btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--color-brand-500, #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.2s ease;
}

.imt-vd-wx-btn:hover {
  filter: brightness(1.1);
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .imt-vd-body {
    padding: 20px 0 42px;
  }

  .imt-vd-group summary {
    padding: 14px 16px;
  }

  .imt-vd-group-body {
    padding: 2px 16px 16px;
  }

  .imt-vd-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }

  .imt-vd-group-name {
    font-size: 15px;
  }

  .imt-vd-tabs {
    margin: 14px 0 16px;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
  }

  .imt-vd-tab {
    padding: 9px 8px;
    border-radius: 8px;
    line-height: 1.25;
  }
}

@media (max-width: 560px) {
  .imt-vd-toolbar {
    margin-bottom: 14px;
  }

  .imt-vd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .imt-vd-play {
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
  }

  .imt-vd-play svg {
    width: 16px;
    height: 16px;
  }

  .imt-vd-title {
    font-size: 13px;
  }

  .imt-vd-note {
    display: none;
  }

  .imt-vd-group-count {
    font-size: 11px;
  }

  .imt-vd-tabs {
    margin: 12px 0 14px;
    padding: 3px;
  }

  .imt-vd-tab {
    padding: 8px 6px;
    font-size: 11.5px;
  }

  .imt-vd-lang-missing {
    padding: 16px 0;
  }

  .imt-vd-modal {
    padding: 10px;
  }

  .imt-vd-modal-box {
    width: 100%;
  }
}
