:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --mobile-breakpoint: 768px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none !important;
  color: inherit;
}

img {
  width: 50%;
  max-width: 50%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: #fff;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.responsive-logo {
  max-width: 150px;
  height: auto;
  transition: opacity 0.3s ease;
}

.desktop-nav {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.desktop-nav a.nav-link {
  position: relative;
  color: var(--primary-color);
  padding: 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.desktop-nav a.nav-link:hover {
  color: var(--secondary-color);
  transform: translateY(-2px);
}

.desktop-nav a.nav-link:hover::after {
  width: 100%;
}

.desktop-nav a.nav-link.active {
  color: var(--secondary-color);
  font-weight: 600;
  transform: scale(1.05);
}

.desktop-nav a.nav-link.active::after {
  width: 100%;
}

.mobile-menu-toggle {
  display: none;
  cursor: pointer;
  z-index: 1000;
}

.mobile-menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--primary-color);
  transition: 
    transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55),
    opacity 0.2s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========== 文章页面布局 ========== */
.article-detail-container {
  padding-bottom: 20vh;
  max-width: 1200px;
  margin: 6rem auto 2rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 列表容器样式 */
.article-list-container {
  max-width: 1200px;
  margin: 100px auto 2rem;
  padding: 0 1rem;
}

.article-list-wrapper {
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 1.5rem 0; /* 配合 container 与 grid 的左右间距，减少双重内边距 */
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

/* 响应式调整：文章网格与卡片在小屏优化 */
@media (max-width: 768px) {
  .article-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .article-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .article-list-wrapper {
  padding: 1rem 8px; /* 移动端保留少量左右留白 */
  }

  .article-overlay {
    padding: 1.2rem;
  }
}

/* 卡片基础样式 */


/* 悬停效果在文末“悬停效果增强”中已统一声明，这里去重移除 */

/* 卡片内容布局 */
.article-overlay {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* 页脚在小屏恢复文档流 */
@media (max-width: 768px) {
  .main-footer {
    position: static;
    padding-bottom: 0;
  }
  .article-detail-container {
    padding-bottom: 20vh;
  }
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 24px;
  }
  
  .responsive-logo {
    max-width: 120px;
  }
}

/* 列表卡片缩略图 */
.article-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

/* 列表卡片内文本容器 */
.article-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}





/* 文章卡片图片样式已在“图片容器修正”中统一声明，这里去重移除 */

/* 文章卡片顶部渐变遮罩 */
.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.7));
  z-index: 1;
}

/* 文章卡片文字覆盖层 */
.article-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  color: white;
  z-index: 2;
}

/* 文章元信息（作者/时间/阅读数等） */
.article-meta {
  display: flex;
  gap: 2rem;
  margin: 1rem 0;
  font-size: 0.95em;
  color: #666;
}

/* 视图计数图标前缀 */
#detailViews::before {
  content: '👁️ ';
}

/* 页脚 */
.main-footer {
  position: static;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 3rem;
}

.article-detail-container {
  /* 去重：保留一个 padding-bottom 定义 */
  padding-bottom: 20vh;
}

/* 文章详情标题 */
.article-detail-title {
  font-size: 2.5rem;
  margin: 1rem 0 1.5rem;
  line-height: 1.3;
  color: var(--primary-color);
  padding-top: 2rem;
}

/* 文章插图（详情页） */
.content-illustration {
  max-width: 400px;
  width: 50%;
  margin: 2rem auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block;
  height: auto;
  object-fit: contain;
}

/* 文章正文（详情页） */
.article-content {
  max-width: 800px;
  width: 100%;
  text-align: justify;
  line-height: 1.8;
}

/* 正文内图片 */
.article-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
}

/* 详情封面容器 */
.article-cover {
  position: relative;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 返回链接按钮 */
.back-link {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--secondary-color);
  color: white;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.back-link:hover {
  background-color: #2980b9;
}

/* 文章链接（无装饰） */
.article-link {
  text-decoration: none;
  color: inherit;
  display: block;
}



/* 首页栏目容器 */
.articles-column {
  width: 100%;
  margin-bottom: 3rem;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* 栏目头部行 */
.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* 更多按钮（栏目右上角） */
.more-button {
  background: var(--secondary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9em;
  transition: transform 0.2s ease;
}

.more-button:hover {
  transform: translateY(-2px);
}

/* 首页与网格在小屏的布局调整 */
@media (max-width: 768px) {
  .main-footer {
    position: static;
    padding-bottom: 0;
  }
  .article-detail-container {
    padding-bottom: 20vh;
  }
  .desktop-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 24px;
  }

  .article-item-wrapper,
  .home-articles {
    flex-direction: column;
    padding: 0 1rem;
    gap: 1.5rem;
  }

  .articles-column {
    padding: 1rem;
  }

  .column-header h2 {
    font-size: 1.4rem;
  }

  .article-card {
    height: auto;
    aspect-ratio: 16/9;
  }

  .article-overlay {
    padding: 1rem;
  }

  .mobile-menu-active .desktop-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 80px;
    left: 20px;
    width: 80vw;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.12) 0%, rgba(155, 89, 182, 0.08) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 320px;
    z-index: 999;
    animation: menuSlide 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  }

  .desktop-nav a.nav-link {
    padding: 1rem 1.5rem;
    margin: 0.4rem 0;
    font-size: 1.1rem;
    border-radius: 8px;
  }

  .desktop-nav a.nav-link:hover {
    background: rgba(52, 152, 219, 0.12);
    box-shadow: 3px 0 12px rgba(52, 152, 219, 0.15);
  }

  .article-thumbnail {
    width: 100%;
    height: auto;
    min-height: 200px;
  }

  .article-link {
    text-decoration: none !important;
  }

  .home-article-card {
    flex-basis: 100%;
    max-width: 100%;
    margin: 0 0 1rem;
  }

  .article-card h3 {
    font-size: 5vw;
    padding: 0 3vw;
  }

  .home-article-content {
    padding: 1rem;
    font-size: 0.9em;
  }
}

/* 宽屏布局微调 */
@media (min-width: 1200px) {
  .home-articles {
    max-width: 1200px;
    grid-template-columns: repeat(8, 1fr);
  }
}

/* 菜单滑入动画 */
@keyframes menuSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



.home-article-card:hover {
  transform: translateY(-5px);
}



/* 合并重复的卡片样式定义 */
.article-card {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

/* 图片容器修正 */
.article-card img {
  width: 240px;
  height: 160px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

/* 文字区域优化 */
.article-overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 15px;
}

/* 移动端适配修正 */
@media (max-width: 768px) {
  .article-card {
    flex-direction: column;
    padding: 15px;
    align-items: stretch;
  }
  
  .article-card img {
    width: 100%;
    height: 180px;
    margin-bottom: 1rem;
  }
}

/* 悬停效果增强 */
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
