/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 全局变量 */
:root {
  --main-color: #3366cc; /* 维基百科蓝 */
  --text-color: #222222; /* 更深的黑色文字 */
  --bg-color: #f8f9fa; /* 维基百科的背景色 */
  --card-bg: #ffffff;
  --header-bg: #ffffff; /* 白色头部 */
  --header-text: #000000; /* 黑色头部文字 */
  --footer-bg: #f6f6f6; /* 浅灰色底部 */
  --footer-text: #444444; /* 深灰色底部文字 */
  --border-color: #a7d7f9; /* 维基百科的边框色 */
  --hover-color: #0645ad; /* 维基百科链接悬停色 */
}

body {
  font-family: 'Liberation Serif', 'Linux Libertine', Georgia, Times, serif; /* 维基百科风格字体 */
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

a {
  color: var(--main-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--hover-color);
  text-decoration: underline; /* 维基百科风格下划线 */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 视频播放器适配样式 */
.video-wrapper {
  width: 100%;
  margin: 0 auto 15px auto;
  display: block;
  border: 1px solid var(--border-color); /* 增加边框 */
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 比例 */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  border-radius: 0; /* 移除圆角 */
  overflow: hidden;
  box-shadow: none; /* 移除阴影 */
}

.video-js {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
}

/* 增强播放控制体验 */
.video-js .vjs-control-bar {
  background-color: rgba(33, 33, 33, 0.8);
  border-radius: 0; /* 移除圆角 */
}

.video-js .vjs-play-progress {
  background-color: var(--main-color);
}

.video-js .vjs-slider-bar {
  background-color: rgba(255, 255, 255, 0.5);
}

.video-js .vjs-load-progress div {
  background-color: rgba(255, 255, 255, 0.2);
}

/* 触碰设备的特殊增强 */
@media (hover: none) and (pointer: coarse) {
  .video-js .vjs-big-play-button {
    font-size: 3em;
    border-radius: 50%;
    width: 2em;
    height: 2em;
    line-height: 2em;
    border: none;
    background-color: rgba(51, 102, 204, 0.8); /* 修改为主色 */
  }
}

/* 竖屏视频特殊样式 */
.portrait-mode .video-container {
  padding-bottom: 177.78%; /* 9:16比例，适合竖屏视频 */
  background-color: #000;
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.portrait-mode .video-wrapper {
  width: 65%; /* PC端调整为更合适的宽度 */
  margin: 0 auto;
  max-width: 500px; /* 限制最大宽度 */
}

/* 新增PC端竖屏视频容器样式 */
@media (min-width: 769px) {
  .portrait-video .video-container {
    padding-bottom: 0 !important; /* 覆盖默认padding-bottom */
    background-color: #000;
    overflow: visible;
    margin: 0 auto;
    transition: height 0.3s ease, width 0.3s ease;
  }
  
  .portrait-video .video-js {
    position: relative !important;
    object-fit: contain;
    transition: all 0.3s ease;
  }
  
  /* 确保控制栏在底部 */
  .portrait-video .video-js .vjs-control-bar {
    position: absolute !important;
    bottom: 0 !important;
    width: 100% !important;
  }
  
  /* 动态视频变化时的平滑过渡 */
  .video-container {
    transition: padding-bottom 0.3s ease, height 0.3s ease, width 0.3s ease;
  }
  
  .video-js,
  .video-js video {
    transition: width 0.3s ease, height 0.3s ease, object-fit 0.3s ease;
  }
}

/* 增强竖屏视频控制体验 */
.portrait-mode .video-js .vjs-big-play-button {
  transform: scale(1.2);
}

.portrait-mode .video-js .vjs-control-bar {
  height: 4em !important;
  padding: 0 8px;
}

.portrait-mode .video-js .vjs-button > .vjs-icon-placeholder:before {
  font-size: 2em;
  line-height: 2;
}

.portrait-mode .video-js .vjs-big-play-button {
  top: 45%; /* 中心稍上位置 */
}

/* 竖屏视频进度条增强 */
.portrait-mode .video-js .vjs-progress-control {
  min-width: 6em;
}

.portrait-mode .video-js .vjs-progress-holder {
  height: 0.5em;
}

.portrait-mode .video-js .vjs-progress-control:hover .vjs-progress-holder {
  font-size: 2em;
}

/* 响应式调整 */
@media (max-width: 1200px) and (min-width: 769px) {
  .portrait-video .video-container {
    max-width: 70vw;
  }
}

@media (max-width: 992px) and (min-width: 769px) {
  .portrait-video .video-container {
    max-width: 75vw;
  }
}

@media (max-width: 768px) {
  .portrait-mode .video-wrapper {
    width: 80%;
  }
  .portrait-mode .video-js .vjs-control-bar {
    height: 5em !important; /* 更大的控制条更易于触摸操作 */
  }
}

@media (max-width: 576px) {
  .portrait-mode .video-wrapper {
    width: 85%;
  }
}

@media (max-width: 480px) {
  .portrait-mode .video-wrapper {
    width: 98%;
    max-width: none; /* 移动端取消最大宽度限制 */
  }
  .portrait-mode .video-js .vjs-control-bar {
    height: 5.5em !important;
  }
}

/* 头部导航 - 维基百科风格 */
.site-header {
  background-color: var(--header-bg);
  box-shadow: none;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
}

.logo-container {
  font-size: 24px;
  font-weight: normal;
  margin-right: 20px;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
}

.logo-container a {
  color: var(--header-text);
}

.header-search {
  display: flex;
  align-items: center;
}

.main-navigation {
  flex: 2;
  margin-left: 15px;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  max-height: 76px; /* 限制为最多两行 */
  overflow: hidden;
}

.main-navigation li {
  margin: 5px 8px 5px 0;
}

.main-navigation a {
  color: var(--main-color);
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 0;
  white-space: nowrap;
  border: 1px solid transparent;
  font-family: sans-serif;
}

.main-navigation a.more-categories {
  background-color: transparent;
  color: var(--main-color);
  font-weight: normal;
}

.main-navigation a:hover {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  text-decoration: none;
}

.search-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 0;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.search-btn:hover {
  background: #eaecf0;
}

/* 汉堡菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-color);
  border-radius: 0;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* 搜索模态框 */
.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.search-modal.active {
  display: flex;
}

.search-form {
  width: 100%;
  max-width: 600px;
  padding: 20px;
}

.search-form input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 0;
}

.search-form input:focus {
  outline: none;
  border-color: var(--main-color);
}

.search-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  color: #fff;
  cursor: pointer;
}

/* 主内容区 */
.site-main {
  padding: 30px 0;
}

/* 视频卡片样式 - 类似维基百科的卡片 */
.entry-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

/* 相关视频专用：PC端每行4个 */
.related-videos .entry-cards {
  grid-template-columns: repeat(4, 1fr);
}

.entry-card {
  background-color: var(--card-bg);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: none;
  transition: all 0.2s ease;
}

.entry-card:hover {
  border-color: var(--main-color);
  transform: none;
  box-shadow: 0 0 5px rgba(51, 102, 204, 0.2);
}

.entry-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 比例 */
  background-color: #f8f9fa;
  overflow: hidden;
}

.entry-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.entry-card:hover .entry-thumb img {
  transform: scale(1.03);
}

.entry-title {
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-break: break-word;
  color: var(--text-color);
  height: 54px; /* PC端标题高度 */
}

.entry-title a {
  color: var(--main-color);
}

.entry-title a:hover {
  color: var(--hover-color);
}

/* 视频播放器 */
.video-player-container {
  margin: 20px 0 30px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.video-player {
  width: 100%;
  aspect-ratio: 16/9;
}

.video-info {
  padding: 20px;
}

.video-title {
  font-size: 24px;
  margin-bottom: 15px;
  font-weight: normal;
  line-height: 1.3;
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 5px;
}

.video-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
  font-family: sans-serif;
}

.video-meta .category {
  margin-right: 15px;
}

.video-meta a {
  color: var(--main-color);
}

.video-notes {
  padding: 10px;
  background-color: #f8f9fa;
  border: 1px solid #eaecf0;
  margin-top: 15px;
  font-size: 14px;
  font-family: sans-serif;
}

/* 相关视频 */
.related-videos {
  margin: 30px 0;
}

.section-title {
  font-size: 20px;
  margin-bottom: 20px;
  font-weight: normal;
  padding-bottom: 5px;
  border-bottom: 1px solid #a2a9b1;
  color: var(--text-color);
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
}

/* 分页导航 */
.ct-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
  flex-wrap: wrap;
  font-family: sans-serif;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  margin: 0 2px 5px;
  padding: 0 8px;
  background-color: var(--card-bg);
  color: var(--main-color);
  border: 1px solid var(--border-color);
  border-radius: 0;
  font-size: 14px;
  box-shadow: none;
  transition: all 0.2s ease;
}

.page-numbers.current {
  background-color: #f8f9fa;
  color: var(--text-color);
  font-weight: bold;
  border-color: #a2a9b1;
}

.page-numbers:hover:not(.current) {
  background-color: #eaecf0;
  text-decoration: none;
}

.page-numbers.dots {
  background: none;
  box-shadow: none;
  border: none;
}

/* 页脚 */
.site-footer {
  background-color: var(--footer-bg);
  padding: 30px 0;
  margin-top: 50px;
  color: var(--footer-text);
  text-align: center;
  border-top: 1px solid #a2a9b1;
  font-family: sans-serif;
}

.site-footer .container {
  max-width: 800px;
}

.site-info {
  font-size: 13px;
  line-height: 1.7;
}

.site-info p {
  margin-bottom: 5px;
}

/* 无结果 */
.no-results {
  text-align: center;
  padding: 30px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0;
  font-family: sans-serif;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .entry-cards {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }
  .related-videos .entry-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .video-title {
    font-size: 22px;
  }
}

@media (max-width: 768px) {
  .site-header .container {
    flex-direction: row;
    align-items: center;
  }
  
  .header-left {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .logo-container {
    margin-right: 0;
  }
  
  .main-navigation {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: var(--card-bg);
    padding: 80px 20px 20px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 9;
    overflow-y: auto;
    margin-left: 0;
    border-left: 1px solid var(--border-color);
  }
  
  .main-navigation.active {
    right: 0;
  }
  
  .main-navigation ul {
    flex-direction: column;
    align-items: flex-start;
    max-height: none;
  }
  
  .main-navigation li {
    margin: 5px 0;
    width: 100%;
  }
  
  .main-navigation a {
    display: block;
    width: 100%;
    padding: 8px 10px;
  }
  
  .main-navigation a.more-categories {
    background-color: transparent;
    margin-bottom: 0;
    font-weight: normal;
  }
  
  .menu-toggle {
    display: flex;
    margin-left: 15px;
  }
  
  .header-search {
    margin-right: 15px;
  }
  
  .search-btn {
    padding: 5px 10px;
    font-size: 14px;
  }
  
  .entry-cards {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  
  .entry-title {
    height: 46px; /* 移动端标题高度 */
    font-size: 14px;
    padding: 8px;
  }
  
  .video-title {
    font-size: 20px;
  }
  
  .refresh-btn {
    padding: 5px 10px;
    font-size: 14px;
    margin-left: 6px;
  }
}

@media (max-width: 576px) {
  .entry-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ct-pagination .ct-hidden-sm {
    display: none;
  }
}

/* 卡片分类标签 */
.card-category {
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: rgba(51, 102, 204, 0.8);
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  z-index: 5;
  font-family: sans-serif;
}

/* 移动端导航背景遮罩 */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 8;
}

.mobile-menu-overlay.active {
  display: block;
}

/* 分类列表 */
.categories-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  font-size: 14px;
  color: var(--main-color);
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: sans-serif;
}

.category-item:hover {
  background-color: #eaecf0;
  border-color: #a2a9b1;
  text-decoration: none;
}

.category-count {
  color: #666;
  font-size: 13px;
}

@media (max-width: 576px) {
  .categories-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .category-item {
    padding: 8px 10px;
    font-size: 13px;
  }
}

.refresh-btn {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 0;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
  font-family: sans-serif;
}

.refresh-btn:hover {
  background: #eaecf0;
}

.refresh-btn svg {
  display: block;
} 
