/*
 * ========================================
 * 苹果CMS主题样式文件 - index.css
 * ========================================
 */
html,
body {
  background-color: #000;
  color: #e1e3e5;
  height: 100%;
  overflow-x: hidden;
  /* 阻止 iOS Safari 拉动回弹 */
  /* overscroll-behavior: none; */
  -webkit-font-smoothing: antialiased;
  font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
}

html {
  scrollbar-width: thin; /* 细滚动条 */
  scrollbar-color: rgba(156, 163, 175, 0.4) rgba(28, 28, 32, 0.3); /* 滑块颜色 轨道颜色 */
}

.main {
  padding-top: 70px; /* 为顶部导航栏留出空间 */
  padding-bottom: 70px; /* 为底部导航栏留出空间 */
}

/* ==========================================
 * 一、动画定义区域
 * ========================================== */
html {
  /* touch-action: manipulation; */  /* 注释掉这行，防止浏览器操作栏隐藏 */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 排行榜项目淡入动画 */
@keyframes rankFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
 * 二、移动端搜索功能样式
 * ========================================== */

@media (max-width: 639px) {
  /* 移动端全屏搜索效果 */
  #search-main.open {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(28, 28, 32, 1);
    /* 添加padding模拟头部布局 */
    padding: 12px 8px 0 8px;
    display: flex;
    flex-direction: column;
  }

  #search-main.open .search-form {
    display: flex;
  }

  #search-main.open #search-input {
    flex: 1;
  }

  #search-main.open #search-btn {
    right: 60px;
  }

  #search-main.open #cancel-btn {
    display: block;
  }

  #search-main.open #search-recommend {
    top: 60px;
    height: 100vh;
    box-shadow: none;
  }
}

@media (min-width: 640px) {
  /* 详情页样式 */
  .module-info-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -20px;
    height: 100%;
    border-left: 2px dashed #666;
    z-index: -1;
  }
  .player-info-heading h1::before,
  .module-info-heading h1::before {
    content: '';
    position: absolute;
    left: 0;
    height: 40px;
    width: 5px;
    background: #f8cf03;
    border-radius: 0 4px 4px 0;
  }

  .player-info-heading h1::before {
    top: 13px;
  }
  .module-tab-item.active {
    background: transparent !important;
    color: #edc603 !important;
    border-radius: 0 !important;
  }
}
/* ==========================================
 * 三、排行榜样式
 * ========================================== */

/* 排行榜项目基础样式和动画 */
.rank-item {
  transition: all 0.3s;
  animation: rankFadeIn 0.5s ease-out forwards;
  opacity: 0;
  transform: translateY(8px);
}

/* 排行榜项目动画延迟设置 */
.rank-item:nth-child(1) {
  animation-delay: 0.05s;
}
.rank-item:nth-child(2) {
  animation-delay: 0.1s;
}
.rank-item:nth-child(3) {
  animation-delay: 0.15s;
}
.rank-item:nth-child(4) {
  animation-delay: 0.2s;
}
.rank-item:nth-child(5) {
  animation-delay: 0.25s;
}

/* 排行榜前三名特殊颜色 */
.rank-1 .rank-num {
  background-color: #f44336; /* 第一名 - 红色 */
}

.rank-2 .rank-num {
  background-color: #ff5722; /* 第二名 - 橙色 */
}

.rank-3 .rank-num {
  background-color: #ffc107; /* 第三名 - 黄色 */
}

/* 排行榜4-5名普通颜色 */
.rank-4 .rank-num,
.rank-5 .rank-num {
  background-color: #616161; /* 4-5名 - 灰色 */
}

/* ==========================================
 * 四、懒加载图片状态样式
 * ========================================== */

/* 图片懒加载基础样式 */
img.lazy {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* 图片加载中状态 */
img.loading {
  position: relative;
  background: #1a1a1a;
}

/* 图片加载中动画效果 */
img.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #333;
  border-top: 2px solid #f8cf03;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 图片加载成功状态 */
img.loaded {
  opacity: 1;
}

/* 图片加载失败状态 */
img.error {
  opacity: 0.6;
  filter: grayscale(100%);
}

/* 加载动画关键帧 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================
 * 五、历史记录样式
 * ========================================== */

/* 历史记录时间线效果 */
.history-item::after {
  content: "";
  border-left: 1px dashed #32323c;
  position: absolute;
  left: 13px;
  top: 0;
  z-index: -1;
  height: 100%;
}

/* 历史记录链接样式 */
.history-link {
  display: flex;
  padding: 5px;
  padding-left: 9px;
  position: relative;
  height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* 历史记录圆点标记 */
.history-link::before {
  content: "";
  height: 9px;
  width: 9px;
  border: 1px solid #f8cf03;
  border-radius: 50%;
}

/* 历史记录悬停效果 */
.history-link:hover:before {
  background: #f8cf03;
}
.history-link:hover {
  color: #f8cf03;
}

/* ==========================================
 * 五、历史记录空状态样式
 * ========================================== */

/* 空状态样式 */
.history-empty-state {
  padding: 130px 35px 0;
  background: url(../images/history.svg) no-repeat center 20px;
  height: 165px;
  background-size: 40%;
  text-align: center;
  color: #9e9e9e;
  font-size: 13px;
}

.poster-bg:before {
  content: '';
  position: absolute;
  height: 100%;
  width: 100%;

  background: linear-gradient(to bottom, rgba(37, 37, 43, 0) 0%, #25252b 80%, #25252b 100%);
  backdrop-filter: blur(10px);
}

.item-cover:before {
  content: '';
  position: absolute;
  z-index: 2;
  height: 30%;
  width: 100%;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, #000 100%);
}


.info-tag {
  display:flex;
  align-items: center;
  background: #32323c;
  border-radius: 8px;
  padding: 3px 9px;
  flex-wrap: wrap;
  
}

.module-info-item {
  margin-bottom: 5px;
  display: flex;
  word-break: break-all;
  align-items: center;
}

.module-info-item-title {
  display: inline-block;
  min-width: 50px;
  font-weight: 700;
}
.module-info-item-content {
  display: block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
  margin-top: 2px;
}

.slash {
  padding: 0 7px;
  color: #c2c6d0;
  font-size: 12px;
  vertical-align: text-bottom;
}

.slash:last-child {
  display: none;
}

.module-tab-drop+.shortcuts-mobile-overlay {
  top: 0;
  background-color: rgba(0, 0, 0, 0.6);
  pointer-events: auto
}
#source-tab.module-tab-drop .module-tab-items {
  transform: translateZ(0)
}

.module-tab-items {
  visibility: hidden;
  position: fixed;
  width: 100%;
  min-height: 50vh;
  max-height: 80vh;
  border-radius: 20px 20px 0 0;
  background: #25252b;
  padding: 16px;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s linear 0s;
}
.module-tab-item.active {
  background: #f8cf03;
  color: #000;
  font-weight: 700;
}
.module-tab-item.active small {
  background: #d4b725;
  color: #fff;
}
.tab-list.active { display: block; }

.playon {
	height: 8px;
	position: absolute;
	left: calc(50% - 11px);
	bottom: 0
}

.playon i {
	width: 4px;
	height: 6px;
	border-radius: 4px 4px 0 0;
	background-color: #f8cf03;
	position: absolute;
	bottom: 0;
	left: 0
}

.playon i:nth-last-child(1) {
	animation: playon .8s .3s infinite
}

.playon i:nth-last-child(2) {
	animation: playon .8s .1s infinite;
	left: 6px
}

.playon i:nth-last-child(3) {
	animation: playon .6s .2s infinite;
	left: 12px
}

.playon i:nth-last-child(4) {
	animation: playon 1s .3s infinite;
	left: 18px
}

@keyframes playon {
	0% {
		height: 70%
	}

	50% {
		height: 100%
	}

	100% {
		height: 35%
	}
}

.play-list-item.active {
  color: #f8cf03;
  font-weight: 700;
  background: #25252b !important;
}

/* 现代化自适应toast样式 */
.mac_pop_msg_bg,.pop_top {
  display: none; /* 完全隐藏背景遮罩 */
}


.mac_pop_msg { 
  position: fixed;  
  top: 20px;  
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  
  /* 自适应尺寸 */
  width: auto;
  height: auto;
  min-width: 200px;
  max-width: 90vw; /* 响应式最大宽度 */
  
  /* 透明背景样式 */
  padding: 12px 20px;  
  border-radius: 8px;  
  background: rgba(0, 0, 0, 0.8);  /* 半透明黑色背景 */
  color: white;
  font-size: 14px;
  line-height: 1.4;
  
  /* 阴影和动画 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px); /* 背景模糊效果 */
  animation: slideInDown 0.3s ease-out;
  
  /* 确保不被其他元素覆盖 */
  pointer-events: auto;
}

.mac_pop_msg .pop-msg {  
  text-align: center;  
  margin: 0;
  word-wrap: break-word; /* 长文本自动换行 */
  white-space: pre-wrap; /* 保留换行符 */
}

/* 进入动画 */
@keyframes slideInDown {
  from {
      transform: translateX(-50%) translateY(-100%);
      opacity: 0;
  }
  to {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .mac_pop_msg {
      left: 10px;
      right: 10px;
      transform: none;
      max-width: none;
      margin: 0 auto;
  }
}

.card-item-type::after {
  content: '';
  position: absolute;
  left: -13px;
  top: 0;
  background: #16161a;
  border-radius: 8px;
  width: 100%;
  height: 100%;
  transform: skewX(-20deg);
  z-index: -1;
}

.page-link {
    line-height: 34px;
    display: inline-block;
    font-size: 14px;
    border-radius: 8px;
    background: #25252b;
    min-width: 34px;
    position: relative;
    margin: 5px;
}

.page-current:hover, .page-current {
    background: #f8cf03;
    color: #fff;
    background: linear-gradient(to right, #f8cf03 0%, #f8cf03 100%);
    box-shadow: 0 10px 12px -4px rgba(229, 9, 20, .25);
    font-weight: 700;
}

/* ==========================================
 * 六、历史弹窗动画系统（纯Animation实现）
 * ========================================== */

/* 历史弹窗基础样式 */
#history-panel {
  display: none;
  transform-origin: top right;
  pointer-events: none;
}

/* 弹窗显示时启用交互 */
#history-panel.active {
  display: block;
  pointer-events: auto;
}

/* ==========================================
 * 动画关键帧定义
 * ========================================== */

/* 缩放淡入动画（类似zoomIn效果） */
@keyframes historyZoomIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-20px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 缩放淡出动画 */
@keyframes historyZoomOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.3) translateY(-20px);
  }
}

/* 动画类 */
.history-zoom-in {
  animation: historyZoomIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.history-zoom-out {
  animation: historyZoomOut 0.3s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

.nav-item {
  border:1px solid transparent;
  border-radius: 4px;
  margin: 0 4px;
}

.nav-item:hover,
.nav-item.active {
  border:1px solid #f8cf03;
  color: #f8cf03;
}
#search-input:focus-visible {
  outline: none !important;
}


.foot-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9EA3AE;
  min-height: 56px;
}
.foot-item.active {
  color: #FFD700;
}

/* ==========================================
 * 七、Rank页面样式
 * ========================================== */

/* 拖拽相关样式 */
.cursor-grabbing { cursor: grabbing !important; }
.scroll-x { cursor: grab; user-select: none; }
#rank-scroll-x { will-change: scroll-position; transform: translateZ(0); }

/* Tab样式 */
.rank-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  background: #16161a;
  border-radius: 8px;
  padding: 4px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.rank-tab {
  flex: 1;
  padding: 8px 16px;
  text-align: center;
  color: #9e9e9e;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
}

.rank-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.rank-tab.active {
  color: #ffffff;
  background: #FFD700;
  box-shadow: 0 2px 8px rgba(255, 43, 43, 0.3);
}

.rank-content {
  display: none;
}

.rank-content.active {
  display: block;
}

/* ==========================================
 * 八、专题页面样式
 * ========================================== */

/* 文本行数限制 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 专题卡片悬停效果优化 */
.topic-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}