/* 全局变量 - 清新配色方案 */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9fc;
  --bg-tertiary: #e8ecf1;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafb;

  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-muted: #8b95a5;

  --accent-primary: #3498db;
  --accent-secondary: #7f8c8d;
  --accent-tertiary: #27ae60;
  --accent-quaternary: #e67e22;
  --accent-success: #27ae60;
  --accent-warning: #f39c12;
  --accent-error: #e74c3c;

  --border-color: #e1e8ed;
  --border-hover: #3498db;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 6px 20px rgba(52, 152, 219, 0.15);

  --font-family: 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

/* 顶部导航栏 */
.top-nav {
  width: 100%;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  margin: 0;
  padding: 0;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.nav-item a {
  display: block;
  padding: 18px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.nav-item a:hover {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.nav-item a.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  padding-top: 40px;
}

/* 头部样式 */
.header {
  position: relative;
  left: 0;
  right: 0;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin-bottom: 40px;
  border-radius: 0;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="p" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect fill="url(%23p)" width="100" height="100"/></svg>');
  opacity: 0.3;
}

.blog-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
  letter-spacing: 2px;
  position: relative;
}

.blog-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
  position: relative;
}

/* 主体布局 */
.main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  margin-bottom: 50px;
  width: 100%;
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
}

/* 内容区域 */
.content {
  background: transparent;
}

.articles-container {
  margin-bottom: 30px;
}

.page-title {
  font-size: 1.6rem;
  margin-bottom: 30px;
  color: var(--text-primary);
  font-weight: 600;
  position: relative;
  padding-left: 15px;
}

.page-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 2px;
}

/* 文章网格 */
.articles-grid {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* 文章卡片 */
.article-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 30px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.article-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
  transition: color var(--transition-fast);
  line-height: 1.4;
}

.article-card:hover .article-title {
  color: var(--accent-primary);
}

.article-summary {
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.8;
  font-size: 0.95rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  align-items: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag {
  padding: 5px 14px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--accent-primary);
  color: white;
}

/* 侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 25px;
  border: 1px solid var(--border-color);
}

.widget-title {
  font-size: 1.05rem;
  margin-bottom: 18px;
  color: var(--text-primary);
  font-weight: 600;
  position: relative;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

/* 搜索框 */
.search-box {
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: #ffffff;
}

.search-btn {
  padding: 12px 20px;
  background: var(--accent-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: white;
  transition: background-color var(--transition-fast);
  font-weight: 500;
}

.search-btn:hover {
  background: #2980b9;
}

.search-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* 分类列表 */
.category-list {
  list-style: none;
}

.category-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  border-radius: 6px;
}

.category-item a:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  padding-left: 20px;
}

.category-count {
  background: var(--bg-tertiary);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 标签云 */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.pagination button.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 关于我页面 */
.about-main {
  display: block;
}

.about-container {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 40px;
  border: 1px solid var(--border-color);
  max-width: 800px;
  margin: 0 auto;
}

.about-header {
  text-align: center;
  margin-bottom: 40px;
}

.about-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin: 0 auto 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: white;
  font-weight: 700;
}

.about-name {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.about-intro {
  font-size: 1.15rem;
  color: var(--accent-primary);
  margin-bottom: 25px;
  font-weight: 500;
}

.about-bio {
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 35px;
  text-align: justify;
  font-size: 1rem;
}

.about-section {
  margin-bottom: 30px;
}

.about-section-title {
  font-size: 1.2rem;
  margin-bottom: 18px;
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-item {
  padding: 8px 18px;
  background: var(--bg-secondary);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.skill-item:hover {
  background: var(--accent-primary);
  color: white;
}

.contact-list {
  list-style: none;
}

.contact-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-list a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-weight: 500;
}

.contact-list a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* 友情链接页面 */
.links-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.link-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 30px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  text-decoration: none;
  display: block;
}

.link-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.link-name {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.link-card:hover .link-name {
  color: var(--accent-primary);
}

.link-description {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* 页脚 */
.footer {
  position: relative;
  left: 0;
  right: 0;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border-top: 3px solid var(--accent-primary);
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: 0;
  margin-top: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .blog-title {
    font-size: 2.2rem;
  }

  .blog-subtitle {
    font-size: 1rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .article-title {
    font-size: 1.3rem;
  }

  .nav-list {
    flex-wrap: wrap;
  }

  .nav-item a {
    padding: 14px 18px;
    font-size: 0.9rem;
  }

  .links-container {
    grid-template-columns: 1fr;
  }

  .about-avatar {
    width: 90px;
    height: 90px;
    font-size: 2.3rem;
  }

  .about-name {
    font-size: 1.7rem;
  }

  .header {
    padding: 40px 20px 30px;
  }

  .container {
    padding-top: 70px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 选中效果 */
::selection {
  background: rgba(52, 152, 219, 0.2);
  color: var(--text-primary);
}

/* 无文章提示 */
.no-articles {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* 链接样式 */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* 移除原来的导航栏样式 */
.nav {
  display: none;
}
