/* ============================================================
   HotTrends / 热点速报 — 增强视觉效果样式
   时尚 + 活力 + 抓眼球
   ============================================================ */

/* --- 增强的 CSS 变量 --- */
:root {
  /* 渐变色系 */
  --gradient-primary: linear-gradient(135deg, #d4382c 0%, #ff6b5a 50%, #d4382c 100%);
  --gradient-hero: linear-gradient(135deg, rgba(212, 56, 44, 0.8) 0%, rgba(255, 107, 90, 0.6) 50%, rgba(212, 56, 44, 0.8) 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(212, 56, 44, 0.1) 0%, rgba(255, 107, 90, 0.05) 100%);
  
  /* 发光效果 */
  --glow-primary: 0 0 20px rgba(212, 56, 44, 0.3), 0 0 40px rgba(212, 56, 44, 0.1);
  --glow-card: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 56, 44, 0.1);
  --glow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 56, 44, 0.3), 0 0 20px rgba(212, 56, 44, 0.15);
  
  /* 分类专属颜色 */
  --tech-color: #2563eb;
  --tech-glow: rgba(37, 99, 235, 0.2);
  --business-color: #059669;
  --business-glow: rgba(5, 150, 105, 0.2);
  --world-color: #7c3aed;
  --world-glow: rgba(124, 58, 237, 0.2);
  --science-color: #0891b2;
  --science-glow: rgba(8, 145, 178, 0.2);
  --culture-color: #d97706;
  --culture-glow: rgba(217, 119, 6, 0.2);
  --sports-color: #dc2626;
  --sports-glow: rgba(220, 38, 38, 0.2);
  
  /* 动画时长 */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   Hero 区域增强 — 粒子流场背景
   ============================================================ */
.hero-article {
  position: relative;
  overflow: hidden;
}

.hero-article::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
  pointer-events: none;
}

.hero-article:hover::before {
  opacity: 0.15;
}

/* 粒子画布容器 */
#hero-particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
  mix-blend-mode: screen;
}

.hero-article a {
  position: relative;
  z-index: 2;
}

/* Hero 内容增强 */
.hero-content h1 {
  position: relative;
  display: inline-block;
}

.hero-content h1::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.hero-article:hover .hero-content h1::after {
  width: 120px;
}

/* ============================================================
   文章卡片增强 — 发光边框 + 动态阴影
   ============================================================ */
.article-card {
  position: relative;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  cursor: pointer;
  box-shadow: var(--glow-card);
}

/* 渐变边框效果 */
.article-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, rgba(212, 56, 44, 0.3) 50%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  z-index: 1;
}

.article-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--glow-card-hover);
  border-color: rgba(212, 56, 44, 0.3);
}

.article-card:hover::before {
  opacity: 1;
}

/* 分类专属卡片样式（通过父级 section 的 data-category） */
.category-section[data-category="tech"] .article-card {
  --card-accent: var(--tech-color);
  --card-glow: var(--tech-glow);
}

.category-section[data-category="business"] .article-card {
  --card-accent: var(--business-color);
  --card-glow: var(--business-glow);
}

.category-section[data-category="world"] .article-card {
  --card-accent: var(--world-color);
  --card-glow: var(--world-glow);
}

.category-section[data-category="science"] .article-card {
  --card-accent: var(--science-color);
  --card-glow: var(--science-glow);
}

.category-section[data-category="culture"] .article-card {
  --card-accent: var(--culture-color);
  --card-glow: var(--culture-glow);
}

.category-section[data-category="sports"] .article-card {
  --card-accent: var(--sports-color);
  --card-glow: var(--sports-glow);
}

/* 卡片图片增强 */
.article-card .card-image {
  position: relative;
  overflow: hidden;
}

.article-card .card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.article-card:hover .card-image::after {
  opacity: 1;
}

.article-card:hover .card-image img {
  transform: scale(1.1);
}

/* 卡片标题增强 */
.article-card .card-title {
  position: relative;
  display: inline-block;
}

.article-card .card-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width var(--transition-base);
}

.article-card:hover .card-title::after {
  width: 100%;
}

/* ============================================================
   分类标签增强 — 发光效果
   ============================================================ */
.category-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--size-meta);
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: var(--space-md);
  width: fit-content;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.category-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: tagPulse 2s ease-in-out infinite;
}

@keyframes tagPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.category-tag.tech {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.9));
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.category-tag.business {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.9), rgba(16, 185, 129, 0.9));
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.category-tag.world {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(139, 92, 246, 0.9));
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.category-tag.science {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.9), rgba(6, 182, 212, 0.9));
  box-shadow: 0 4px 15px rgba(8, 145, 178, 0.3);
}

.category-tag.culture {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.9), rgba(245, 158, 11, 0.9));
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.category-tag.sports {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9));
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

/* ============================================================
   分类区块增强 — 动态分割线
   ============================================================ */
.category-section {
  position: relative;
  overflow: hidden;
}

.category-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.category-section.visible::before {
  opacity: 1;
}

.section-header {
  position: relative;
}

.section-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: height var(--transition-base);
}

.section-title:hover::before {
  height: 28px;
}

/* ============================================================
   快讯滚动条增强 — 流动光效
   ============================================================ */
.news-ticker {
  position: relative;
  background: linear-gradient(90deg, var(--ticker-bg) 0%, rgba(212, 56, 44, 0.05) 50%, var(--ticker-bg) 100%);
}

.news-ticker::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 56, 44, 0.1), transparent);
  animation: tickerGlow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tickerGlow {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.ticker-label {
  position: relative;
  background: linear-gradient(135deg, var(--accent-color), #ff6b5a);
  box-shadow: 0 4px 15px rgba(212, 56, 44, 0.4);
}

.ticker-item {
  position: relative;
}

.ticker-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width var(--transition-fast);
}

.ticker-item:hover::after {
  width: 100%;
}

/* ============================================================
   导航栏增强 — 动态下划线
   ============================================================ */
.nav-list li a {
  position: relative;
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--size-nav);
  font-weight: 500;
  line-height: var(--line-nav);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.nav-list li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
  border-radius: 1px;
}

.nav-list li a:hover::after,
.nav-list li a.active::after {
  width: 80%;
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--text-primary);
  border-bottom-color: transparent;
}

/* ============================================================
   搜索框增强 — 发光边框
   ============================================================ */
.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(212, 56, 44, 0.2), 0 0 20px rgba(212, 56, 44, 0.1);
}

.search-panel {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(17, 17, 17, 0.95);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 56, 44, 0.1);
}

/* ============================================================
   控制按钮增强
   ============================================================ */
.ctrl-btn {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ctrl-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 56, 44, 0.2), rgba(255, 107, 90, 0.2));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.ctrl-btn:hover::before {
  opacity: 1;
}

.ctrl-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   页脚增强
   ============================================================ */
.site-footer {
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
}

.footer-logo {
  position: relative;
  display: inline-block;
}

.footer-logo::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

/* ============================================================
   动画关键帧 — 入场效果增强
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* 卡片入场动画 */
.article-card {
  animation: fadeInUp 0.6s ease both;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }

/* 分类区块入场动画 */
.category-section.visible {
  animation: fadeInUp 0.8s ease both;
}

/* ============================================================
   特殊效果 — 闪光边框
   ============================================================ */
@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(212, 56, 44, 0.3);
  }
  50% {
    border-color: rgba(255, 107, 90, 0.5);
  }
}

.article-card:hover {
  animation: borderGlow 2s ease-in-out infinite;
}

/* ============================================================
   响应式增强
   ============================================================ */
@media (max-width: 768px) {
  .hero-content h1::after {
    width: 40px;
  }
  
  .hero-article:hover .hero-content h1::after {
    width: 80px;
  }
  
  .category-tag {
    font-size: 10px;
    padding: 4px 8px;
  }
  
  .category-tag::before {
    width: 4px;
    height: 4px;
  }
}

/* ============================================================
   减少动效模式
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .article-card,
  .category-section,
  .hero-content h1::after,
  .nav-list li a::after,
  .category-tag::before,
  .news-ticker::before {
    animation: none !important;
    transition: none !important;
  }
  
  .article-card:hover {
    transform: none;
  }
}
