/* 现代化模板样式 - 重构版 */
:root {
  /* 主色调 */
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;
  --secondary-color: #f97316;
  --secondary-hover: #ea580c;
  
  /* 中性色调 */
  --text-color: #1e293b;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* 动画 */
  --transition-fast: all 0.2s ease;
  --transition: all 0.3s ease;
  
  /* 布局 */
  --container-width: 1140px;
  --content-padding: 1.5rem;
  --header-height: 3.5rem;
  --nav-height: 3.5rem;
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition-fast);
}

/* 布局容器 */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--content-padding);
}

/* 头部样式 */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 0.75rem 0;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 导航栏样式 */
nav {
  background-color: var(--card-bg);
  padding: 0.75rem 1rem;
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: calc(var(--header-height) - 1px);
  z-index: 90;
}

nav::-webkit-scrollbar {
  display: none;
}

nav a {
  display: inline-block;
  margin-right: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

nav a:first-child {
  color: var(--primary-color);
  font-weight: 600;
}

nav a:hover, nav a:focus {
  background-color: var(--primary-light);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* 文章卡片样式 */
.article {
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.article:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.article img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: var(--transition);
}

.article:hover img {
  transform: scale(1.03);
}

.article-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article h2 {
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.article h2 a {
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article h2 a:hover {
  color: var(--primary-color);
}

.article small {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  margin-top: auto;
}

.article small::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  margin-right: 0.5rem;
}

/* 文章详情页样式 */
.post-article {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.post-article h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--text-color);
}

.post-article p {
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.post-article img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.post-article a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0 0.5rem 0.5rem 0;
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.post-article a:hover {
  background-color: var(--primary-color);
  color: white;
}

.post-article div {
  line-height: 1.8;
  color: var(--text-color);
  margin-top: 1.5rem;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 2rem 0;
  gap: 0.5rem;
}

.page-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-weight: 500;
  transition: var(--transition-fast);
  border: 1px solid var(--border-color);
}

.page-link:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-light);
}

.page-link.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

.page-info {
  margin-left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 页脚样式 */
footer {
  text-align: center;
  padding: 1.5rem;
  background-color: var(--card-bg);
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

footer p {
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (min-width: 768px) {
  .article {
    flex-direction: row;
  }
  
  .article img {
    width: 280px;
    height: 180px;
    aspect-ratio: auto;
  }
  
  .article-content {
    flex: 1;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .post-article {
    padding: 2.5rem;
  }
  
  .post-article h1 {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --content-padding: 2rem;
  }
  
  .article img {
    width: 320px;
    height: 200px;
  }
  
  .post-article {
    padding: 3rem;
  }
  
  .post-article h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 576px) {
  :root {
    --content-padding: 1rem;
  }
  
  .pagination {
    gap: 0.25rem;
  }
  
  .page-link {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.9rem;
  }
  
  .page-info {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0.75rem;
    margin-left: 0;
  }
  
  .post-article {
    padding: 1.25rem;
  }
  
  .post-article h1 {
    font-size: 1.5rem;
  }
  
  .article h2 a {
    font-size: 1.1rem;
  }
}
.post-article img{
    max-width: 100%;
}
.post-article a{
    all: unset;
    color: #3498db;
    font-weight: bold;
}