/* style.css - 网站主样式文件 */

/* 全局样式 - 深色主题（兼容老旧浏览器） */
* { margin: 0; padding: 0; box-sizing: border-box !important; }
body { background-color: #1a1a1a; font-family: "Microsoft YaHei", Arial, sans-serif; overflow-x: hidden; }
.clearfix::after { content: ""; display: block; clear: both; visibility: hidden; height: 0; }
.main-container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.banner { width: 100%; background: #2d2d2d; padding: 16px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.3); margin-bottom: 24px; border-radius: 8px; overflow: hidden; position: relative; }
.banner-inner img { width: 100%; height: 100%; display: block; }
.img-fallback { background: #333 !important; display: flex !important; align-items: center; justify-content: center; color: #aaa; width: 100%; height: 100%; }

/* 搜索栏样式 */
.search-bar { width: 100%; background: #2d2d2d; padding: 16px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.3); margin-bottom: 24px; border-radius: 8px; }
.search-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 12px; }
.search-input { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; height: 40px; padding: 0 16px; border: 1px solid #444; background: #333; color: #fff; border-radius: 6px; font-size: 14px; outline: none; }
.search-input:focus { border-color: #7e22ce; box-shadow: 0 0 0 2px rgba(126, 34, 206, 0.2); }
.search-btn { height: 40px; padding: 0 24px; background: #7e22ce; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.search-btn:hover { background: #6b18b0; }

.card-wrap { width: 100%; margin: 0 auto; padding: 0; }
.card-container { width: 100%; overflow: visible; padding: 0; margin: 0; }

/* 卡片样式 */
.card { 
  width: 23%; min-width: 200px; 
  height: 320px; 
  margin: 2px 1% 24px 1%; 
  float: left; 
  background: #2d2d2d; 
  overflow: hidden; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); 
  cursor: pointer; 
  position: relative; 
  transition: all 0.3s ease; 
  border: 2px solid transparent; 
}

.card-img { width: 100%; height: 220px; overflow: hidden; }
/* 关键：强制缩放填满区域（不保持比例、不裁剪） */
.card-img img { 
  width: 100%; 
  height: 100%; 
  display: block; 
}

.card-text { padding: 16px; height: 100px; }
.card-title { font-size: 18px; font-weight: bold; color: #7e22ce; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { font-size: 14px; color: #aaa; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card:hover { 
  box-shadow: 0 4px 16px rgba(0,0,0,0.5); 
  transform: scale(1.01); 
  border: 2px solid #7e22ce; 
}

/* 占位卡片样式 */
.placeholder-card .card-title { color: #666; }
.placeholder-card:hover {
    outline: none; 
    transform: none; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); 
    border: 2px solid transparent; 
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: #7e22ce;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.3);
  display: none;
  z-index: 9999;
  transition: all 0.3s ease;
  text-align: center;
  line-height: 24px;
  padding-top: 8px;
}
.back-to-top:hover {
  background: #6b18b0;
  transform: scale(1.1);
}

/* 加载状态样式 */
.loading-indicator, .no-more-data {
  clear: both;
  text-align: center;
  padding: 20px;
  color: #aaa;
  font-size: 14px;
  display: none;
}
.loading-indicator.show, .no-more-data.show { display: block; }

/* 响应式适配 */
@media (max-width: 1200px) { .card { width: 31.33%; min-width: 180px; } }
@media (max-width: 768px) { 
  .card { width: 48%; min-width: 160px; } 
  .search-inner { display: block; gap: 8px; }
  .search-input { width: 100%; margin-bottom: 8px; }
  .search-btn { width: 100%; }
  .back-to-top { width: 40px; height: 40px; bottom: 20px; right: 20px; }
}
@media (max-width: 576px) { 
  .card { width: 98%; min-width: 160px; height: auto; } 
  .card-img { height: auto; min-height: 200px; }
  .card-text { height: auto; }
}
/* 主页右侧悬浮按钮 */
.homepage-float-btn {
  position: fixed !important;
  top: 50% !important;
  right: 20px !important; /* 这是右侧按钮的样式 */
  z-index: 9999 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  zoom: 1 !important;
  transform: translateY(-50%) !important;
}

/* 【新增】主页左侧悬浮按钮的样式 */
.homepage-float-btn-left {
  right: auto !important; /* 重置 right 属性 */
  left: 20px !important;  /* 设置 left 属性 */
}

/* 按钮内图片的样式 */
.homepage-float-btn img {
  max-width: 100px !important;
  height: auto !important;
  border: 0 !important;
  display: block !important;
}
/* 在 style.css 文件的任意位置添加 */
.loading-placeholder {
  text-align: center;
  padding: 20px;
  color: #aaa;
}