/* 
   keke_custom.css - 复刻 keke1.app 核心样式 (深色模式校准)
   目标：提供全局配色、导航栏、海报墙布局
*/

/* Iconsax 图标库引入预留 (请在 header.html 中引入 CSS 链接) */
/* <link rel="stylesheet" href="https://vf.dkhtad.com/vod_pc_static_kkdy/css/iconsax-css/style.css"> */

:root {
  /* 配色系统 - 深色模式 */
  --fs-primary-color: #ffd000;    /* 金黄色高亮 */
  --fs-background-color: #181818; /* 全局背景 */
  --fs-background-second-color: #262626; /* 侧边栏/容器背景 */
  --fs-text-color: #adb7be;       /* 辅助文字颜色 */
  --fs-text-main: #ffffff;        /* 主要文字颜色 */
  --fs-text-highlight: #ffd000;
  
  --fs-spacing: 1rem;
  --fs-border-color: #333333;
  --fs-radius: 0.5rem;
}

/* 全局基础 */
body {
  background-color: var(--fs-background-color);
  color: var(--fs-text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* 侧边栏布局结构 (t-p-side) */
.t-p-side {
  width: 240px;
  background-color: var(--fs-background-second-color);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  border-right: 1px solid var(--fs-border-color);
  z-index: 100;
}

/* 主内容区偏移 */
.t-p-main {
  margin-left: 240px;
  min-height: 100vh;
  padding: var(--fs-spacing);
}

/* 导航项样式 */
.menu-item a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--fs-text-color);
  text-decoration: none;
  transition: all 0.3s;
}

.menu-item a:hover, .menu-item.active a {
  color: var(--fs-primary-color);
  background: rgba(255, 208, 0, 0.1);
}

/* 海报墙响应式网格 (Grid) */
.module-box-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--fs-spacing);
  padding: var(--fs-spacing) 0;
}

/* 影片卡片 (v-item) */
.v-item {
  display: block;
  text-decoration: none;
  transition: transform 0.3s;
}

/* 首页响应式网格布局 */
.index-grid {
  display: grid;
  gap: var(--fs-spacing);
  padding: var(--fs-spacing) 0;
}

/* 默认手机端: 3列 (针对首页) */
@media screen and (max-width: 767px) {
  .index-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .t-p-main { margin-left: 0; padding: 10px; }
  .t-p-side { display: none; } /* 移动端临时隐藏侧边栏，后续需适配开关 */
}

/* 平板端: 4列 */
@media screen and (min-width: 768px) and (max-width: 1199px) {
  .index-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 电脑端: 6列 */
@media screen and (min-width: 1200px) {
  .index-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 海报交互效果升级 */
.v-item-cover {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--fs-radius);
  overflow: hidden;
  background-color: #222;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.v-item:hover .v-item-cover {
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(0,0,0,0.6);
  z-index: 10;
}

/* 标题两行截断规范 */
.v-item-footer .v-item-title {
  margin-top: 0.75rem;
  color: var(--fs-text-main);
  font-size: 0.85rem;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  height: 2.8em; /* 预留两行空间，防止布局抖动 */
}

/* 覆盖原模板的 container 限制 */

.t-p-main .container {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 侧边栏 Logo 垂直居中 */
.t-p-side .header {
    border-bottom: 1px solid var(--fs-border-color);
}


.v-item:hover {
  transform: translateY(-5px);
}

.v-item-cover {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--fs-radius);
  overflow: hidden;
  background-color: #222;
}

.v-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-item-footer .v-item-title {
  margin-top: 0.5rem;
  color: var(--fs-text-main);
  font-size: 0.9rem;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 标签样式 (评分/清晰度) */
.v-item-top, .v-item-bottom {
  position: absolute;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.v-item-top { top: 5px; right: 5px; }
.v-item-bottom { bottom: 5px; right: 5px; color: var(--fs-primary-color); }

/* 详情页线路切换 */
.source-item {
  padding: 5px 15px;
  background: var(--fs-background-second-color);
  border: 1px solid var(--fs-border-color);
  border-radius: 4px;
  color: var(--fs-text-color);
  cursor: pointer;
}

.source-item.active {
  border-color: var(--fs-primary-color);
  color: var(--fs-primary-color);
}

/* 详情页复刻样式 */
.detail-header-wrap {
    position: relative;
    padding: 60px 0;
    margin: -20px -20px 20px -20px;
    overflow: hidden;
    color: #fff;
}

.detail-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.5);
    transform: scale(1.1);
    z-index: 1;
}

.detail-header-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--fs-background-color));
    z-index: 2;
}

.detail-header-content {
    position: relative;
    z-index: 3;
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.detail-poster {
    flex: 0 0 240px;
    height: 340px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.detail-title-h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 15px; }
.detail-meta-row { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; color: #ccc; font-size: 14px; }
.detail-meta-row span { background: rgba(255,255,255,0.1); padding: 2px 10px; border-radius: 4px; }

.detail-play-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 40px;
    background: var(--fs-primary-color);
    color: #000;
    font-weight: bold;
    border-radius: 30px;
    text-decoration: none;
    width: fit-content;
    transition: transform 0.2s;
}
.detail-play-btn:hover { transform: scale(1.05); }

/* 详情页列表 */
.episode-section { margin-top: 30px; background: var(--fs-background-second-color); border-radius: 12px; padding: 20px; }
.episode-tabs { display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.episode-tab-item { cursor: pointer; color: #888; font-weight: bold; }
.episode-tab-item.active { color: var(--fs-primary-color); border-bottom: 2px solid var(--fs-primary-color); padding-bottom: 8px; }

.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.episode-item {
    display: block;
    background: #333;
    color: #fff;
    text-align: center;
    padding: 8px 5px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}
.episode-item:hover { background: var(--fs-primary-color); color: #000; }

.detail-desc-box { line-height: 1.8; color: #aaa; margin-top: 20px; }
.detail-desc-box.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 播放页复刻样式 */
.player-theater-wrap {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 30px;
    background: #000;
    padding: 20px;
    border-radius: 12px;
}

.player-main-area {
    flex: 1;
}

.player-side-list {
    flex: 0 0 320px;
    background: #1a1a1a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-side-header {
    padding: 15px;
    background: #222;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid #333;
}

.player-side-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.player-video-box {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* 上一集/下一集控制条 */
.player-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    color: #fff;
}

.ctrl-btn {
    padding: 8px 20px;
    background: #333;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.ctrl-btn:hover { background: #444; }
.ctrl-btn.active { background: var(--fs-primary-color); color: #000; font-weight: bold; }

/* 侧边选集高亮 */
.side-episode-item {
    display: block;
    padding: 10px;
    background: #262626;
    margin-bottom: 8px;
    border-radius: 4px;
    color: #aaa;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.side-episode-item:hover { background: #333; color: #fff; }
.side-episode-item.active {
    background: var(--fs-primary-color);
    color: #000;
    font-weight: bold;
}

@media screen and (max-width: 991px) {
    .player-theater-wrap { flex-direction: column; padding: 10px; }
    .player-side-list { flex: none; width: 100%; max-height: 400px; }
}

/* 分页组件样式对齐 */
.ewave-page {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 20px 0;
}

.ewave-page li a, .ewave-page li span {
    display: block;
    padding: 8px 16px;
    background: #262626;
    color: #888;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.ewave-page li.active a {
    background: var(--fs-primary-color);
    color: #000;
    font-weight: bold;
}

.ewave-page li a:hover {
    background: #333;
    color: var(--fs-primary-color);
}
