/* static/css/videos.css */

/* 1. 定义根变量 */
:root {
  /* 响应式宽度变量，可根据您的全局设计调整 */
  --xl-main-width: 1200px;
  --xl-main-max-width: 100%;
  --md-main-width: 960px;
  --md-main-max-width: 100%;
  --topnav-margin-left: 20px; /* 移动端左右边距 */

  /* 颜色和字体 */
  --primary-text-color: #333;
  --secondary-text-color: #888;
  --link-color: #007bff;
  --border-color: #e0e0e0;
  --background-color: #fff;
}

/* 2. 粘贴您提供的响应式容器类 */
.content-width-container {
  width: var(--xl-main-width);
  max-width: var(--xl-main-max-width);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

@media (min-width: 992px) and (max-width: 1300px) {
  .content-width-container {
    width: var(--md-main-width);
    max-width: var(--md-main-max-width);
  }
}

@media (max-width: 991px) {
  .content-width-container {
    width: 100%;
    max-width: none;
    padding-left: var(--topnav-margin-left);
    padding-right: var(--topnav-margin-left);
  }
}

/* 3. 视频列表页专属样式 */
.video-list-page {
  padding: 2rem 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 面包屑导航 */
.breadcrumbs {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--secondary-text-color);
}
.breadcrumbs a {
  color: var(--secondary-text-color);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--link-color);
}

/* 页面头部 (标题和排序) */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.page-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  color: var(--primary-text-color);
}
.sort-options a {
  margin-left: 1rem;
  font-size: 0.9rem;
  color: var(--secondary-text-color);
  text-decoration: none;
}
.sort-options a:hover, .sort-options a.active {
  color: var(--link-color);
}


/* 分类筛选 */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  align-items: center;
}
.category-filters a {
  font-size: 1rem;
  color: var(--primary-text-color);
  text-decoration: none;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.category-filters a:hover {
  color: var(--link-color);
}
.category-filters a.active {
  color: var(--link-color);
  border-bottom-color: var(--link-color);
  font-weight: 600;
}

/* 视频列表 */
.video-item-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.video-item {
  border-bottom: 1px solid var(--border-color);
}
.video-item:last-child {
  border-bottom: none;
}
.video-item a {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  text-decoration: none;
  color: inherit;
}

.video-item .thumbnail {
  width: 160px;
  height: 90px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 4px;
}
.video-item .video-info {
    flex-grow: 1;
}
.video-item .video-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
  color: var(--primary-text-color);
  line-height: 1.4;
}
.video-item .video-date {
  font-size: 0.9rem;
  color: var(--secondary-text-color);
  margin: 0;
}

/* 移动端适配 */
@media (max-width: 767px) {
  .video-item a {
    gap: 1rem;
    padding: 1rem 0;
  }
  .video-item .thumbnail {
    width: 120px;
    height: 67.5px;
  }
  .video-item .video-title {
    font-size: 1rem;
  }
}

/* [NEW] 针对两级分类新增的样式 */
/* 父分类的样式（使其看起来更像标题） */
.category-parent {
    font-weight: bold;
    color: #555;
    border-bottom-color: transparent !important; /* 父分类没有下划线 */
}

/* 子分类默认隐藏 */
.category-child {
    display: none;
    font-size: 0.9rem; /* 子分类字体稍小 */
    margin-left: -0.5rem; /* 调整间距 */
}

/* 当父分类被激活时，显示其后的所有子分类 */
.category-parent.active-parent ~ .category-child {
    display: block;
}

/* [NEW] 为了让分组更清晰，可以为父分类加一个标记 */
.category-parent::before {
    content: "📁";
    margin-right: 0.3em;
    opacity: 0.7;
}

.category-filters a.category-all.active,
.category-parent.active,
.category-child.active {
    color: var(--link-color);
    border-bottom-color: var(--link-color);
    font-weight: 600;
}
