/* 扩展样式 - UI Style 3 & Layout C */

.ui-style-3 {
  --primary-color: #2c5aa0;
  --primary-hover: #1a3d6b;
  --accent-color: #ff6b6b;
  --bg-light: #f5f5f5;
  --text-dark: #333;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 卡片悬停增强 */
.card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(44, 90, 160, 0.1), transparent);
  transition: left 0.5s;
}

.card:hover::before {
  left: 100%;
}

.card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* 标题动画 */
.section h2 {
  position: relative;
  animation: fadeInLeft 0.6s ease;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 网格布局增强 */
.grid {
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--primary-color);
  color: #fff;
  border-radius: 6px;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 标签悬停 */
.tags span {
  transition: all 0.3s;
  cursor: pointer;
}

.tags span:hover {
  background: #2c5aa0;
  color: #fff;
  transform: scale(1.05);
}

/* 链接下划线动画 */
.card h2 a, .card h3 a {
  position: relative;
  display: inline-block;
  transition: color 0.3s;
}

.card h2 a::after, .card h3 a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.card h2 a:hover::after, .card h3 a:hover::after {
  width: 100%;
}

/* 介绍框样式 */
.intro-box {
  border: 1px solid #e0e0e0;
  position: relative;
  animation: slideDown 0.6s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #2c5aa0, #4a90e2);
}

/* 页脚链接 */
footer a {
  color: #4a90e2;
  transition: color 0.3s;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* 响应式优化 */
@media (max-width: 992px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 576px) {
  .card {
    padding: 1rem;
  }

  .intro-box {
    padding: 1.5rem;
  }

  .section h2 {
    font-size: 1.4rem;
  }
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-color);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
}

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-5px);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(44, 90, 160, 0.3);
  border-radius: 50%;
  border-top-color: #2c5aa0;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 详情页信息框增强 */
.detail-info {
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s;
}

.detail-info:hover {
  background: #e8f0fe;
  border-left-width: 6px;
}

/* 排行榜序号样式 */
.rank-number {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
