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

/* Pornhub风格配色变量 */
:root {
  --ph-orange: #ff9900; /* Pornhub橙色 */
  --ph-orange-hover: #ff8800;
  --ph-black: #000000; /* 纯黑色背景 */
  --ph-dark-gray: #1a1a1a; /* 深灰色 */
  --ph-gray: #333333; /* 中灰色 */
  --ph-light-gray: #666666; /* 浅灰色 */
  --ph-white: #fff; /* 纯白色文字 */
  --ph-yellow: #ffcc00; /* 黄色强调 */
  --ph-yellow-hover: #ffdd33;
  --ph-card-bg: #1a1a1a; /* 卡片背景 */
  --ph-border: #333333; /* 边框色 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: var(--ph-black);
  color: var(--ph-white);
  line-height: 1.6;
}

.container {
  width: 98%; /* 减少两边距离 */
  max-width: 1400px; /* 增加最大宽度 */
  margin: 0 auto;
  padding: 0 10px; /* 减少左右padding */
}

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

a:hover {
  color: var(--ph-orange-hover);
}

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

/* 视频播放器适配样式 */
.video-wrapper {
  width: 100%;
  margin: 0 auto 15px auto;
  display: block;
}

.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;
  outline: none !important;
  border: none !important;
}

/* 去除video-js播放器的focus边框 */
.video-js:focus,
.video-js video:focus,
.video-js .vjs-tech:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* 去除所有video-js相关元素的focus边框 */
.video-js *:focus {
  outline: none !important;
  border-color: transparent !important;
}

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

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

.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(255, 153, 0, 0.8);
  }
}

/* 竖屏视频特殊样式 */
.portrait-mode .video-container {
  padding-bottom: 177.78%; /* 9:16比例，适合竖屏视频 */
  background-color: #000;
  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;
    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;
  }
}

/* 头部导航 - Pornhub风格 */
.site-header {
  background-color: var(--ph-black);
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  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: 28px;
  font-weight: bold;
  margin-right: 30px;
  font-family: 'Arial Black', Arial, sans-serif;
}

.logo-container a {
  color: var(--ph-orange);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.logo-container a:hover {
  color: var(--ph-yellow);
}

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

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

.main-navigation ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  max-height: 76px;
  overflow: hidden;
}

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

.main-navigation a {
  color: var(--ph-white);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 20px;
  white-space: nowrap;
  background-color: var(--ph-dark-gray);
  border: 1px solid var(--ph-gray);
  transition: all 0.3s ease;
}

.main-navigation a.more-categories {
  background-color: var(--ph-gray);
  color: var(--ph-white);
  font-weight: bold;
}

.main-navigation a:hover {
  background-color: var(--ph-orange);
  color: var(--ph-black);
  border-color: var(--ph-orange);
  transform: translateY(-1px);
}

.search-btn {
  background: var(--ph-orange);
  border: 2px solid var(--ph-orange);
  color: var(--ph-black);
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  padding: 8px 20px;
  border-radius: 25px;
  white-space: nowrap;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.search-btn:hover {
  background: var(--ph-yellow);
  border-color: var(--ph-yellow);
  transform: scale(1.05);
}

/* 汉堡菜单 */
.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(--ph-orange);
  border-radius: 2px;
  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.9);
  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: 15px 20px;
  font-size: 18px;
  background-color: var(--ph-dark-gray);
  border: 2px solid var(--ph-orange);
  color: var(--ph-white);
  border-radius: 30px;
}

.search-form input:focus {
  outline: none;
  border-color: var(--ph-yellow);
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.3);
}

.search-form input::placeholder {
  color: var(--ph-light-gray);
}

.search-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 40px;
  color: var(--ph-orange);
  cursor: pointer;
  transition: color 0.3s ease;
}

.search-close:hover {
  color: var(--ph-yellow);
}

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

/* 视频卡片样式 - Pornhub风格 */
.entry-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* PC端固定5列 */
  gap: 15px; /* 减少间隙 */
  margin: 20px 0;
  padding: 0 5px; /* 减少左右内边距 */
}

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

.entry-card {
  background-color: var(--ph-black);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ph-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.entry-card:hover {
  border-color: var(--ph-orange);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(255, 153, 0, 0.2);
}

.entry-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 比例 */
  background-color: var(--ph-black);
  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.08);
}

.entry-title {
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-break: break-word;
  color: var(--ph-white);
  height: 54px;
  background-color: var(--ph-black);
}

.entry-title a {
  color: var(--ph-orange); /* 默认橙色 */
}

.entry-title a:hover {
  color: var(--ph-white); /* 悬停白色 */
}

/* 视频播放器 */
.video-player-container {
  margin: 20px 0 30px;
  background-color: var(--ph-card-bg);
  border: 2px solid var(--ph-orange);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

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

.video-info {
  padding: 25px;
  background: linear-gradient(180deg, var(--ph-card-bg) 0%, var(--ph-black) 100%);
}

.video-title {
  font-size: 28px;
  margin-bottom: 15px;
  font-weight: bold;
  line-height: 1.3;
  color: var(--ph-white);
}

.video-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  color: var(--ph-light-gray);
  font-size: 14px;
  margin-bottom: 15px;
}

.video-meta .category {
  margin-right: 20px;
  background-color: var(--ph-orange);
  color: var(--ph-black);
  padding: 4px 12px;
  border-radius: 15px;
  font-weight: bold;
  text-transform: uppercase;
}

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

.video-notes {
  padding: 15px 20px;
  background-color: var(--ph-dark-gray);
  border: 1px solid var(--ph-orange);
  border-radius: 8px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--ph-yellow);
}

/* 相关视频 */
.related-videos {
  margin: 30px 0;
  background-color: var(--ph-black);
  padding: 30px 0;
}

.section-title {
  font-size: 24px;
  margin-bottom: 20px;
  font-weight: bold;
  color: #cfc3c3;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  margin: 0 5px 5px;
  padding: 0 15px;
  background-color: var(--ph-dark-gray);
  color: var(--ph-white);
  border: 2px solid var(--ph-gray);
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.page-numbers.current {
  background-color: var(--ph-orange);
  color: var(--ph-black);
  border-color: var(--ph-orange);
}

.page-numbers:hover:not(.current) {
  background-color: var(--ph-orange);
  color: var(--ph-black);
  border-color: var(--ph-orange);
  transform: translateY(-2px);
}

.page-numbers.dots {
  background: none;
  box-shadow: none;
  border: none;
  color: var(--ph-light-gray);
}

/* 页脚 */
.site-footer {
  background-color: var(--ph-black);
  padding: 40px 0;
  margin-top: 60px;
  color: var(--ph-light-gray);
  text-align: center;
}

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

.site-info {
  font-size: 14px;
  line-height: 1.8;
}

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

/* 无结果 */
.no-results {
  text-align: center;
  padding: 50px 30px;
  background-color: var(--ph-card-bg);
  border: 2px solid var(--ph-orange);
  border-radius: 15px;
  color: var(--ph-white);
}

.no-results a {
  color: var(--ph-orange);
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .entry-cards {
    grid-template-columns: repeat(3, 1fr); /* 中等屏幕3列 */
    gap: 12px;
    padding: 0 3px;
  }
  .related-videos .entry-cards {
    grid-template-columns: repeat(3, 1fr); /* 中等屏幕相关视频3列 */
  }
  .video-title {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .container {
    width: 99%; /* 移动端进一步减少边距 */
    padding: 0 5px;
  }
  
  .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;
    font-size: 24px;
  }
  
  .main-navigation {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background-color: var(--ph-black);
    padding: 80px 20px 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    z-index: 9;
    overflow-y: auto;
    margin-left: 0;
    border-left: 2px solid var(--ph-orange);
  }
  
  .main-navigation.active {
    right: 0;
  }
  
  .main-navigation ul {
    flex-direction: column;
    align-items: flex-start;
    max-height: none;
  }
  
  .main-navigation li {
    margin: 8px 0;
    width: 100%;
  }
  
  .main-navigation a {
    display: block;
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
  }
  
  .main-navigation a.more-categories {
    background-color: var(--ph-orange);
    color: var(--ph-black);
    margin-bottom: 0;
    font-weight: bold;
  }
  
  .menu-toggle {
    display: flex;
    margin-left: 15px;
  }
  
  .header-search {
    margin-right: 15px;
  }
  
  .search-btn {
    padding: 6px 15px;
    font-size: 12px;
  }
  
  .entry-cards {
    grid-template-columns: repeat(2, 1fr); /* 移动端2列 */
    gap: 10px;
    padding: 0 2px;
  }
  
  .related-videos .entry-cards {
    grid-template-columns: repeat(2, 1fr); /* 移动端相关视频2列 */
  }
  
  .entry-title {
    height: 48px;
    font-size: 13px;
    padding: 10px 12px;
  }
  
  .video-title {
    font-size: 22px;
  }
  
  .refresh-btn {
    padding: 6px 12px;
    font-size: 12px;
    margin-left: 8px;
  }
}

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

/* 卡片分类标签 */
.card-category {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: var(--ph-orange);
  color: var(--ph-black);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 12px;
  z-index: 5;
  text-transform: uppercase;
}

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

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

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

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--ph-card-bg);
  border: 2px solid var(--ph-gray);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ph-white);
  transition: all 0.3s ease;
  text-decoration: none;
}

.category-item:hover {
  background-color: var(--ph-orange);
  color: var(--ph-black);
  border-color: var(--ph-orange);
  transform: translateY(-2px);
}

.category-count {
  color: var(--ph-yellow);
  font-size: 12px;
  font-weight: bold;
  background-color: var(--ph-dark-gray);
  padding: 2px 8px;
  border-radius: 10px;
}

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

.refresh-btn {
  background: var(--ph-orange);
  border: 2px solid var(--ph-orange);
  color: var(--ph-black);
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 20px;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.refresh-btn:hover {
  background: var(--ph-yellow);
  border-color: var(--ph-yellow);
  transform: scale(1.05);
}

.refresh-btn svg {
  display: block;
}
