@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;700&display=swap');

:root {
  /* 主色彩系统 */
  --primary: #667eea;
  --primary-light: #764ba2;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary: #f093fb;
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  
  /* 中性色彩 */
  --background: #fafbfc;
  --surface: #ffffff;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --text-muted: #a0aec0;
  --border: #e2e8f0;
  --border-light: #f7fafc;
  
  /* 功能色彩 */
  --success: #48bb78;
  --warning: #ed8936;
  --error: #f56565;
  --info: #4299e1;
  
  /* 阴影系统 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  
  /* 圆角系统 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* 字体系统 */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', monospace;
  
  /* 间距系统 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* 过渡动画 */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: var(--border-light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* 选中文本样式 */
::selection {
  background: var(--primary);
  color: white;
}

/* 焦点样式 */
*:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* 头部容器特殊布局 */
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
}

/* 头部美化 */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  transition: var(--transition-normal);
}

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

.logo svg {
  transition: var(--transition-normal);
}

.logo:hover svg {
  transform: rotate(5deg);
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg) 0;
  margin-bottom: var(--space-2xl);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition-normal);
}

/* 头部右侧控制区域样式 */
.header-right-controls {
  display: flex !important;
  align-items: center;
  gap: var(--space-md);
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

/* 确保搜索框和主题切换按钮的正确排列 */
.header-right-controls .search-container {
  order: 1 !important;
  flex-shrink: 1;
}

.header-right-controls .theme-toggle {
  order: 2 !important;
  margin-left: var(--space-sm) !important;
}

/* 主题切换按钮样式 */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  order: 2;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.theme-toggle:hover {
  background: var(--border-light);
  color: var(--primary);
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-sm);
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.site-nav a.active, .site-nav a:hover {
  background: var(--primary);
  color: #fff;
}

main.container {
  min-height: 60vh;
}

/* 首页文章卡片美化 */
.post-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(33, 118, 255, 0.08);
  margin-bottom: 2.5rem;
  padding: 2.2rem 2rem 1.5rem 2rem;
  /* 移除transition动画 */
  position: relative;
}
.post-card:hover {
  /* 移除动画效果，保持静态样式 */
}
.post-title {
  color: var(--primary);
  font-size: 1.7rem;
  margin: 0 0 0.7rem 0;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
}
.post-meta {
  color: #888;
  font-size: 1rem;
  margin-bottom: 1.2rem;
}
.post-excerpt {
  color: #333;
  font-size: 1.08rem;
  margin-bottom: 1.5rem;
}
.read-more {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 0.35em 1.2em;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.read-more:hover {
  background: var(--primary-light);
  color: #fff;
}

/* 图片美化 */
.post-content img, .post-excerpt img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  margin: 1.2rem auto;
  box-shadow: 0 2px 8px rgba(33, 118, 255, 0.08);
}

/* 页脚美化 */
.site-footer {
  border-top: 1px solid var(--border);
  color: #888;
  text-align: center;
  padding: 2.5rem 0 1.5rem 0;
  margin-top: 3rem;
  font-size: 1rem;
  background: #fff;
  border-radius: 0 0 18px 18px;
}

/* 暗色模式预留 */
body.dark {
  --background: #181c27;
  --text: #e6e6e6;
  --border: #23283a;
  --main-color: var(--primary);
}
body.dark .site-header,
body.dark .site-footer,
body.dark .post-card {
  background: #23283a;
  color: #e6e6e6;
}
body.dark .post-card {
  border: 1px solid #2d334d;
}
body.dark .site-nav a {
  color: #e6e6e6;
}
body.dark .site-nav a.active, body.dark .site-nav a:hover {
  background: var(--primary);
  color: #fff;
}

/* 代码块美化 */
/* 分页样式 */
.pagination {
  margin: 3rem 0 2rem;
  padding: 2rem 0;
  border-top: 1px solid #e1e8ed;
}

.pagination-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.page-info {
  color: #657786;
  font-size: 0.9rem;
  background: #f7f9fa;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: inline-block;
}

.pagination-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid var(--primary);
}

.pagination-btn:hover {
  background: transparent;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.pagination-btn.disabled {
  background: #e1e8ed;
  color: #aab8c2;
  border-color: #e1e8ed;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f7f9fa;
  color: #657786;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.pagination-page:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.pagination-page.current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  cursor: default;
  box-shadow: 0 2px 8px rgba(0, 188, 212, 0.4);
}

.pagination-ellipsis {
  color: #aab8c2;
  padding: 0 0.5rem;
  font-weight: bold;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .pagination {
    margin: 2rem 0 1rem;
    padding: 1.5rem 0;
  }
  
  .pagination-nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .pagination-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .pagination-pages {
    margin: 0;
    order: -1;
  }
  
  .pagination-page {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  
  .page-info {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  /* 移动端头部布局调整 */
  .site-header .container {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }
  
  .header-right-controls {
    justify-content: center;
    margin-left: 0;
    order: 2;
  }
  
  .site-nav {
    order: 1;
    justify-content: center;
    margin-top: 0;
  }
  
  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .pagination-pages {
    gap: 0.15rem;
  }
  
  .pagination-page {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  
  .pagination-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .pagination-btn span {
    display: none;
  }
  
  .pagination-btn i {
    margin: 0;
  }
}

/* 删除原有代码块美化相关样式，交由 prism-onedark.css 控制 */
/* 删除以下内容：
pre, code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: #f5f7fa;
  color: #234;
  border-radius: 6px;
}
pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
code {
  padding: 0.2em 0.4em;
  font-size: 0.97em;
}
.post-content code {
  background: #f5f7fa;
  color: #234;
  border-radius: 4px;
  padding: 0.2em 0.4em;
  font-size: 0.98em;
}
.post-content pre {
  background: #23283a;
  color: #e6e6e6;
  border-radius: 8px;
  padding: 1.2em;
  margin: 2em 0;
  font-size: 1.02em;
  overflow-x: auto;
  box-shadow: 0 2px 12px rgba(33, 118, 255, 0.10);
}
.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
*/

/* 响应式优化 */
@media (max-width: 600px) {
  .container {
    padding: 0 0.5rem;
  }
  .site-header, .site-footer {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .post-card {
    padding: 1rem;
  }
  .site-title {
    font-size: 1.3rem;
  }
  .site-nav {
    gap: 1.2rem;
  }
} 

/* 文章内容页美化 */
.post-detail {
  max-width: 820px;
  margin: 0 auto 3rem auto;
  padding: 2.5rem 2rem 2rem 2rem;
}
.post-detail .post-title {
  font-size: 2.3rem;
  font-weight: 900;
  margin-bottom: 0.7rem;
  color: var(--primary);
  text-align: left;
}
.post-detail .post-meta {
  color: #888;
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.post-detail .post-meta i {
  margin-right: 0.3em;
  font-style: normal;
}
.post-divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 1.5rem 0 2rem 0;
}
.post-content {
  font-size: 1.13rem;
  line-height: 1.85;
  color: #222;
}
.post-content h2, .post-content h3, .post-content h4 {
  color: var(--primary);
  margin-top: 2.2em;
  margin-bottom: 0.7em;
  font-weight: 700;
}
.post-content ul, .post-content ol {
  margin: 1.2em 0 1.2em 2em;
}
.post-content blockquote {
  border-left: 4px solid var(--primary);
  background: #f5f7fa;
  color: #555;
  margin: 1.5em 0;
  padding: 0.8em 1.2em;
  border-radius: 8px;
}
.post-content a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}
.post-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1.5em auto;
  display: block;
  box-shadow: 0 2px 8px rgba(33, 118, 255, 0.08);
}
.post-content table {
  border-collapse: collapse;
  margin: 1.5em 0;
  width: 100%;
}
.post-content th, .post-content td {
  border: 1px solid #e5e5e5;
  padding: 0.5em 1em;
}
/* 代码块样式已移至 prism-onedark.css，避免冲突 */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  gap: 1.5rem;
}
.post-prev, .post-next {
  color: var(--primary);
  background: #f5f7fa;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}
.post-prev:hover, .post-next:hover {
  background: #e3edff;
} 

/* 友情链接页面美化 */
.friends-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 0;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  min-height: 80px;
}

.friend-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(33, 118, 255, 0.12);
  border-color: var(--primary);
}

.friend-avatar {
  flex-shrink: 0;
}

.friend-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
}

.friend-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.friend-descr {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 响应式友链布局 */
@media (max-width: 768px) {
  .friends-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .friend-card {
    padding: 1rem;
    min-height: 70px;
  }
  
  .friend-avatar img {
    width: 56px;
    height: 56px;
  }
  
  .friend-name {
    font-size: 1rem;
  }
  
  .friend-descr {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .friend-card {
    padding: 0.875rem;
    gap: 0.75rem;
  }
  
  .friend-avatar img {
    width: 48px;
    height: 48px;
  }
}

/* 标签样式美化 */
.post-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.post-tag-link {
  display: inline-block;
  background-color: #f0f5ff;
  color: var(--primary);
  padding: 0.2em 0.8em;
  border-radius: 1em;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #d6e4ff;
}

.post-tag-link:hover {
  background-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

body.dark .post-tag-link {
  background-color: #2a3b68;
  border-color: #3a508a;
  color: #a0c8ff;
}

body.dark .post-tag-link:hover {
  background-color: var(--primary);
  color: #fff;
}

/* 文章元信息样式微调 */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem; /* 垂直间距0.5rem，水平间距1.5rem */
  align-items: center;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
}

.post-meta .bi {
  margin-right: 0.4em;
  vertical-align: -0.1em; /* 微调图标垂直对齐 */
}