/* ======================================== */
/* 现代化 Collection 页面设计 */
/* ======================================== */

/* 0. 防止 FOUC (Flash of Unstyled Content) */
#tag-count-modern,
#tag-buttons-container-modern {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

#tag-count-modern.loaded,
#tag-buttons-container-modern.loaded {
  opacity: 1;
}

/* 0.1 立即移除列表样式，防止闪现 */
.post-list-with-tags,
.post-list-with-tags ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.post-item {
  list-style: none !important;
}

/* 0.2 移除移动端列表样式 */
.post-list-mobile {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.mobile-post-item {
  list-style: none !important;
}

.mobile-post-item::marker {
  display: none !important;
}

/* 移动端论文列表紧凑样式 */
.mobile-post-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mobile-post-item:hover {
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.mobile-post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.mobile-post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: nowrap;
}

.mobile-post-date {
  font-size: 0.75em;
  color: #6b7280;
  font-weight: 500;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mobile-post-tag {
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.mobile-post-title {
  font-size: 0.9em;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.4;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex: 1;
  min-width: 0;
}

.mobile-post-item:hover .mobile-post-title {
  color: rgba(59, 130, 246, 0.9);
}

/* 1. 页面头部区域 - 英雄式设计 */
.collection-hero {
  background:
    linear-gradient(135deg,
      rgba(15, 23, 42, 0.98) 0%,
      rgba(30, 41, 59, 0.98) 30%,
      rgba(51, 65, 85, 0.98) 60%,
      rgba(71, 85, 105, 0.98) 100%
    ),
    linear-gradient(45deg,
      rgba(59, 130, 246, 0.08) 0%,
      rgba(16, 185, 129, 0.08) 30%,
      rgba(99, 102, 241, 0.06) 60%,
      rgba(6, 182, 212, 0.08) 100%
    );
  color: white;
  padding: 80px 0;
  margin: -2em -15px 3em -15px;
  position: relative;
  overflow: hidden;
}

/* Geek风格网格背景 */
.collection-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
}

/* 霓虹光晕效果 */
.collection-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(99, 102, 241, 0.1) 0%,
    rgba(168, 85, 247, 0.05) 25%,
    transparent 50%
  );
  animation: neon-pulse 4s ease-in-out infinite alternate;
}

@keyframes grid-move {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

@keyframes neon-pulse {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0.6; transform: scale(1.1); }
}

.collection-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: min(1200px, 85vw);
  margin: 0 auto;
  padding: 0 max(20px, 3vw);
}

.collection-hero h1 {
  font-size: 4em;
  font-weight: 800;
  margin: 0 0 20px 0;
  text-shadow:
    0 0 20px rgba(59, 130, 246, 0.4),
    0 0 40px rgba(16, 185, 129, 0.2),
    0 2px 4px rgba(0,0,0,0.3);
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, #dbeafe 40%, #d1fae5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: title-glow 3s ease-in-out infinite alternate;
}

@keyframes title-glow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.2); }
}

.collection-hero-subtitle {
  font-size: 1.4em;
  opacity: 0.95;
  margin-bottom: 40px;
  font-weight: 400;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  color: rgba(255, 255, 255, 0.95);
}

.collection-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 25px;
  min-width: 140px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.stat-item:hover::before {
  left: 100%;
}

.stat-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-number {
  font-size: 2.8em;
  font-weight: 800;
  display: block;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.stat-label {
  font-size: 0.95em;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* RSS 订阅入口 */
.rss-subscribe-section {
  margin-top: 2rem;
  text-align: center;
}

.rss-subscribe-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rss-subscribe-link:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.rss-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.rss-text {
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 2. 现代化标签过滤器 */
.modern-tag-filter {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 30px;
  margin: 2em 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  overflow: hidden;
}

.modern-tag-filter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8), rgba(6, 182, 212, 0.8));
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.tag-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.tag-filter-title {
  font-size: 1.5em;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-filter-title::before {
  content: '🎯';
  font-size: 1.2em;
}

.tag-stats-modern {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.tag-buttons-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.tag-btn-modern {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 25px;
  padding: 10px 20px;
  font-size: 0.9em;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.tag-btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s;
}

.tag-btn-modern:hover::before {
  left: 100%;
}

.tag-btn-modern:hover {
  background: #f7fafc;
  border-color: rgba(59, 130, 246, 0.6);
  color: rgba(59, 130, 246, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.tag-btn-modern.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8) 0%, rgba(16, 185, 129, 0.8) 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.tag-btn-count {
  background: rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.8em;
  font-weight: 600;
}

.tag-btn-modern.active .tag-btn-count {
  background: rgba(255,255,255,0.2);
}

/* 3. 现代化导航设计 */
.modern-navigation {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 2em;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  overflow: hidden;
}

.modern-navigation::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8), rgba(6, 182, 212, 0.8));
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.main-category-modern {
  margin-bottom: 25px;
  border: none;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.main-category-modern:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

.main-category-summary-modern {
  cursor: pointer;
  list-style: none;
  padding: 25px 30px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05));
}

.main-category-summary-modern::-webkit-details-marker {
  display: none;
}

.main-category-title-modern {
  font-size: 1.3em;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
}

.main-category-title-modern::before {
  content: '';
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8));
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.main-category-summary-modern::after {
  content: '▼';
  font-size: 16px;
  color: rgba(59, 130, 246, 0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg);
  background: rgba(59, 130, 246, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-category-modern[open] > .main-category-summary-modern::after {
  transform: rotate(180deg);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8));
  color: white;
}

.main-category-summary-modern:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
}

.main-category-summary-modern:hover::after {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.1);
}

.main-category-content-modern {
  padding: 30px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* 4. 现代化面包屑 */
.breadcrumb-modern {
  font-size: 14px;
  color: #4a5568;
  margin-bottom: 25px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.08));
  border-radius: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(59, 130, 246, 0.15);
  position: relative;
  overflow: hidden;
}

.breadcrumb-modern::before {
  content: '📁';
  margin-right: 12px;
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
}

.breadcrumb-modern::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8));
  border-radius: 0 2px 2px 0;
}

/* 5. 现代化卡片网格 */
.post-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: max(25px, 3vw);
  margin-top: 20px;
  align-items: start;
}

/* 移动端：如果容器是列表模式，隐藏卡片；否则保持卡片显示 */
@media (max-width: 768px) {
  .post-grid-modern:not(.post-list-mobile-modern) {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 15px;
    padding: 0 10px;
  }
  
  /* 列表模式下隐藏卡片 */
  .post-list-mobile-modern .post-card-modern {
    display: none !important;
  }
  
  /* 非列表模式下保持卡片显示 */
  .post-grid-modern:not(.post-list-mobile-modern) .post-card-modern {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
  }
}

@media (max-width: 480px) {
  .post-grid-modern {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 10px;
    padding: 0 5px;
  }
  
  .post-card-modern {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }
}

.post-card-modern {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: visible;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* 桌面端确保卡片正常显示 */
@media (min-width: 769px) {
  .post-grid-modern .post-card-modern {
    display: flex !important;
  }
}

.post-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8));
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.post-card-modern:hover::before {
  opacity: 1;
}

.post-card-modern:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.15);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(59, 130, 246, 0.4);
}

.post-card-link-modern {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-thumb-modern {
  position: relative;
  width: 100%;
  height: 240px;
  min-height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

/* 移动端卡片缩略图优化 */
@media (max-width: 768px) {
  .post-card-thumb-modern {
    height: 200px;
    width: 100%;
    padding: 6px;
  }
  
  .post-card-thumb-modern img {
    object-fit: contain;
    object-position: center;
  }
  
  .post-card-body-modern {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .post-card-thumb-modern {
    height: 180px;
    width: 100%;
    padding: 5px;
  }
  
  .post-card-thumb-modern img {
    object-fit: contain;
    object-position: center;
  }
  
  .post-card-body-modern {
    padding: 12px;
  }
}

.post-card-thumb-modern img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
  display: block;
  border-radius: 8px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.post-card-modern:hover .post-card-thumb-modern img {
  transform: scale(1.05);
}

.post-card-body-modern {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  min-height: auto;
}

.post-card-meta-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.post-meta-modern {
  font-size: 0.85em;
  color: #6c757d;
  font-weight: 500;
}

.post-card-tag-modern {
  padding: 4px 12px;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 12px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ARXIV标签 - 绿色渐变 */
.post-card-tag-modern.tag-arxiv {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* 其他标签 - 蓝紫色渐变 */
.post-card-tag-modern:not(.tag-arxiv) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8));
}

.post-card-title-modern {
  font-weight: 600;
  line-height: 1.4;
  color: #2d3748;
  font-size: 1.1em;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 移动端卡片标题优化 */
@media (max-width: 768px) {
  .post-card-title-modern {
    font-size: 1.05em;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

@media (max-width: 480px) {
  .post-card-title-modern {
    font-size: 1em;
    line-height: 1.25;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

.post-card-excerpt-modern {
  color: #6b7280;
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* 移动端卡片摘要优化 */
@media (max-width: 768px) {
  .post-card-excerpt-modern {
    font-size: 0.85em;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

@media (max-width: 480px) {
  .post-card-excerpt-modern {
    font-size: 0.8em;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* 超大屏幕优化 */
@media (min-width: 1600px) {
  .post-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 3.5rem;
  }
  
  .collection-hero h1 {
    font-size: 4.5em;
  }
  
  .collection-hero-subtitle {
    font-size: 1.5em;
  }
  
  .modern-tag-filter,
  .modern-navigation {
    padding: 45px;
  }
}

/* 超宽屏优化 (2560px+) */
@media (min-width: 2560px) {
  .post-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 4rem;
  }
  
  .collection-hero h1 {
    font-size: 5em;
  }
  
  .collection-hero-subtitle {
    font-size: 1.6em;
  }
  
  .modern-tag-filter,
  .modern-navigation {
    padding: 50px;
  }
}

/* 6. 响应式设计 */
@media (max-width: 768px) {
  .collection-hero {
    margin: -2em -15px 2em -15px;
    padding: 40px 0;
  }
  
  .collection-hero h1 {
    font-size: 2.5em;
  }
  
  .collection-stats {
    gap: 20px;
  }
  
  .stat-item {
    min-width: 100px;
    padding: 15px;
  }
  
  .post-grid-modern {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 10px;
  }
  
  .tag-buttons-modern {
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .tag-btn-modern {
    padding: 8px 16px;
    font-size: 0.85em;
    flex: 1;
    min-width: 0;
    text-align: center;
  }
  
  .post-card-tag-modern {
    font-size: 0.7em;
    padding: 3px 10px;
  }
  
  .modern-tag-filter {
    margin: 1em 0;
    padding: 20px;
  }
  
  .modern-navigation {
    margin: 1em 0;
    padding: 20px;
  }
  
  .main-category-summary-modern {
    padding: 20px;
  }
  
  .main-category-content-modern {
    padding: 20px;
  }
  
  /* 确保移动端内容区域占满宽度 */
  .collection-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .collection-hero {
    padding: 30px 0;
    margin: -2em -10px 1.5em -10px;
  }
  
  .collection-hero h1 {
    font-size: 2em;
  }
  
  .collection-hero-subtitle {
    font-size: 1em;
  }
  
  .collection-stats {
    gap: 15px;
  }
  
  .stat-item {
    min-width: 80px;
    padding: 15px;
  }
  
  .stat-number {
    font-size: 1.8em;
  }
  
  .rss-subscribe-link {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .rss-icon {
    font-size: 1.3rem;
  }
  
  .rss-text {
    font-size: 1rem;
  }
  
  .modern-tag-filter,
  .modern-navigation {
    padding: 15px;
    margin: 0.5em 0;
  }
  
  .main-category-summary-modern {
    padding: 15px;
  }
  
  .post-grid-modern {
    padding: 0 5px;
    gap: 15px;
  }
  
  .tag-btn-modern {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  
  /* 确保移动端内容区域占满宽度 */
  .collection-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  
  .main-category-content-modern {
    padding: 15px;
  }
  
  .post-card-body-modern {
    padding: 15px;
  }
  
  .post-card-tag-modern {
    font-size: 0.65em;
    padding: 2px 8px;
  }
  
  .tag-btn-modern {
    padding: 6px 12px;
    font-size: 0.8em;
  }
}

/* 7. 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card-modern {
  animation: fadeInUp 0.6s ease-out;
}

.post-card-modern:nth-child(1) { animation-delay: 0.1s; }
.post-card-modern:nth-child(2) { animation-delay: 0.2s; }
.post-card-modern:nth-child(3) { animation-delay: 0.3s; }
.post-card-modern:nth-child(4) { animation-delay: 0.4s; }
.post-card-modern:nth-child(5) { animation-delay: 0.5s; }
.post-card-modern:nth-child(6) { animation-delay: 0.6s; }

/* 8. 滚动条美化 */
.modern-navigation::-webkit-scrollbar {
  width: 6px;
}

.modern-navigation::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modern-navigation::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8));
  border-radius: 3px;
}

.modern-navigation::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #3b82f6, #10b981);
}

/* 9. 演示文稿特殊样式 */
.slides-icon {
  font-size: 4em;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
}

.no-slides-modern {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 40px;
}

.no-slides-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  max-width: 500px;
}

.no-slides-card h3 {
  color: #2d3748;
  margin-bottom: 20px;
  font-size: 1.5em;
  font-weight: 600;
}

.no-slides-card p {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 15px;
}

.no-slides-card code {
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  color: rgba(59, 130, 246, 0.9);
  font-weight: 600;
}

/* ======================================== */
/* 移动端搜索结果列表样式 */
/* ======================================== */

/* 只在移动端显示列表样式 */
@media (max-width: 768px) {
  .post-list-mobile-modern {
    display: block !important;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* 移动端列表容器：使用 block 布局 */
  .post-grid-modern.post-list-mobile-modern {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
  }
  
  /* 移动端列表模式下，确保列表项显示，卡片隐藏 */
  .post-list-mobile-modern .post-list-item-mobile {
    display: block !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .post-list-mobile-modern .post-card-modern {
    display: none !important;
  }
  
  /* 确保搜索结果列表容器也有正确的宽度 */
  #results-list.post-list-mobile-modern,
  .results-list.post-list-mobile-modern,
  .category-papers-list.post-list-mobile-modern {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* 桌面端：确保卡片正常显示，隐藏列表项 */
@media (min-width: 769px) {
  /* 桌面端：列表容器类本身不隐藏，但列表项需要隐藏 */
  /* 注意：不要隐藏 .post-list-mobile-modern 容器，因为 resize 时容器类可能会同时存在 */
  
  /* 桌面端隐藏列表项 */
  .post-list-item-mobile {
    display: none !important;
  }
  
  /* 桌面端确保卡片正常显示 */
  .post-card-modern {
    display: flex !important;
  }
  
  /* 桌面端：在网格容器中，确保卡片显示 */
  .post-grid-modern .post-card-modern {
    display: flex !important;
  }
  
  /* 桌面端：无论容器是什么类，都要显示卡片 */
  .category-papers-list .post-card-modern {
    display: flex !important;
  }
  
  /* 桌面端：在列表容器中，也要显示卡片（如果存在） */
  .post-list-mobile-modern .post-card-modern {
    display: flex !important;
  }
  
  /* 桌面端确保列表项不显示 */
  .post-grid-modern .post-list-item-mobile,
  .post-list-mobile-modern .post-list-item-mobile,
  .category-papers-list .post-list-item-mobile {
    display: none !important;
  }
  
  /* 桌面端：确保容器使用网格布局 */
  .category-papers-list.post-grid-modern {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
  }
}

/* 列表项样式（只在移动端显示） */
.post-list-item-mobile {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  /* 确保列表项占据完整宽度 */
}

.post-list-item-mobile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(16, 185, 129, 0.9));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 14px 0 0 14px;
}

.post-list-item-mobile:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
  transform: translateY(-3px);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.post-list-item-mobile:hover::before {
  opacity: 1;
}

.post-list-item-mobile-content {
  padding: 12px 14px;
  position: relative;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  /* 确保内容区域占据完整宽度 */
}

.post-list-item-mobile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
  /* 确保元数据区域占据完整宽度 */
}

.post-list-item-mobile-date {
  font-size: 0.75rem;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.post-list-item-mobile-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.post-list-item-mobile-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post-list-item-mobile-tag.tag-arxiv {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.post-list-item-mobile-tag:not(.tag-arxiv) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(16, 185, 129, 0.8));
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.post-list-item-mobile-link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  /* 确保链接占据完整宽度 */
  box-sizing: border-box;
}

.post-list-item-mobile-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  width: 100%;
  /* 确保标题占据完整宽度 */
  box-sizing: border-box;
}

.post-list-item-mobile-link:hover .post-list-item-mobile-title {
  color: rgba(59, 130, 246, 0.95);
  text-shadow: 0 1px 2px rgba(59, 130, 246, 0.1);
}

/* 移动端标题响应式优化 */
@media (max-width: 480px) {
  .post-list-item-mobile-title {
    font-size: 0.9rem;
    line-height: 1.4;
    -webkit-line-clamp: 4;
  }
  
  .post-list-item-mobile-content {
    padding: 10px 12px;
  }
  
  .post-list-item-mobile-meta {
    margin-bottom: 6px;
  }
}

@media (max-width: 360px) {
  .post-list-item-mobile-title {
    font-size: 0.85rem;
    line-height: 1.35;
    -webkit-line-clamp: 5;
  }
  
  .post-list-item-mobile-content {
    padding: 8px 10px;
  }
}

/* 移动端收藏和点赞按钮样式调整 */
@media (max-width: 768px) {
  .post-list-item-mobile .card-favorite-btn,
  .post-list-item-mobile .card-like-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 6px;
  }
  
  .post-list-item-mobile .card-like-btn {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
  }
  
  .post-list-item-mobile .card-favorite-btn:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
  }
  
  .post-list-item-mobile .card-like-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
  }
  
  .post-list-item-mobile .card-favorite-btn.favorited {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
  }
  
  .post-list-item-mobile .card-like-btn.liked {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
  }
  
  .post-list-item-mobile .card-favorite-btn .favorite-icon,
  .post-list-item-mobile .card-like-btn .like-icon {
    font-size: 1rem;
    line-height: 1;
  }
  
  .post-list-item-mobile .card-favorite-btn .favorite-count,
  .post-list-item-mobile .card-like-btn .like-count {
    font-size: 0.7rem;
    margin-left: 2px;
    font-weight: 600;
    color: #64748b;
    line-height: 1;
  }
  
  .post-list-item-mobile .card-favorite-btn.favorited .favorite-count {
    color: #f59e0b;
  }
  
  .post-list-item-mobile .card-like-btn.liked .like-count {
    color: #ef4444;
  }
  
  /* 确保按钮内容不换行 */
  .post-list-item-mobile .card-favorite-btn,
  .post-list-item-mobile .card-like-btn {
    white-space: nowrap;
    overflow: hidden;
  }
}
