/**
 * ========================
 * 全局基础样式
 * ========================
 */
:root {
  /* 色彩系统 */
  --primary-color: #3498db;       /* 主蓝 - 用于链接/按钮/交互元素 */
  --secondary-color: #2c3e50;     /* 深蓝 - 标题/重要文字 */
  --text-color: #333;             /* 正文深灰 - 最佳可读性 */
  --light-text: #95a5a6;          /* 辅助浅灰 - 次要信息 */
  --border-color: #f0f0f0;        /* 极浅灰边框 - 分隔线 */
  
  /* 视觉效果 */
  --shadow-light: 0 3px 10px rgba(0,0,0,0.08);  /* 标准卡片阴影 */
  --shadow-hover: 0 5px 15px rgba(0,0,0,0.12);  /* 悬停强化阴影 */
  --transition: all 0.3s cubic-bezier(0.25,0.1,0.25,1); /* 平滑动画曲线 */
}

/**
 * ========================
 * 布局结构
 * ========================
 */

/* 封面图片容器 */
.index-cover,
.bg-cover {
  margin-bottom: 80px;            /* 与正文间距 */
  position: relative;
  z-index: 10;                    /* 确保在背景上层 */
}

/* 两栏核心布局 */
.two-columns {
  display: flex;                  /* 使用弹性布局 */
  gap: 30px;                     /* 主栏与侧边栏间距 */
  align-items: flex-start;       /* 顶部对齐防止拉伸 */
  margin-top: 20px;              /* 顶部安全距离 */
}

.left-column {
  flex: 3;                       /* 主内容区占比75% */
  min-width: 0;                  /* 修复flex溢出 */
}

.right-column {
  flex: 1;                       /* 侧边栏占比25% */
  min-width: 0;
  position: sticky;              /* 粘性定位 */
  top: 40px;                    /* 低于导航栏的距离 */
}

/**
 * ========================
 * 文章卡片系统
 * ========================
 */
.article-card {
  margin-bottom: 50px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.article-card:hover {
  transform: translateY(-5px);   /* 悬停上浮 */
  box-shadow: var(--shadow-hover);
}

.article-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin: 0 0 15px;
  line-height: 1.5;              /* 舒适行高 */
}

.article-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease-in-out; /* 颜色过渡 */
}

.article-title a:hover {
  color: var(--primary-color);
  text-decoration: underline;    /* 下划线反馈 */
}

.article-meta {
  font-size: 0.85rem;
  color: var(--light-text);
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;               /* 元信息换行 */
  gap: 12px;                    /* 合理间距 */
}

.article-excerpt {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.8;
  margin: 0 0 25px;
  display: -webkit-box;
  -webkit-line-clamp: 3;         /* 限制三行文本 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;       /* 省略号 */
}

.article-tags {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-tags .tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: rgba(0,0,0,0.03);  /* 半透明背景 */
  color: var(--text-color);
  border-radius: 12px;           /* 圆角 */
  transition: var(--transition);
}

.article-tags .tag:hover {
  background: rgba(0,0,0,0.08);  /* 悬停背景加深 */
}

/**
 * ========================
 * 侧边栏系统
 * ========================
 */
.sidebar-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
}

.sidebar-section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* 个人信息卡片 */
.profile-card {
  text-align: center;
  padding: 25px 20px;
}

.sidebar-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;              /* 圆形头像 */
  border: 3px solid #f8f9fa;      /* 头像边框 */
  box-shadow: var(--shadow-light);
  margin: 0 auto 15px;
  object-fit: cover;               /* 确保图片不变形 */
  
  /* 旋转动画 */
  animation: avatarRotate 5s linear infinite;
  transition: transform 0.5s ease;
}

.sidebar-avatar:hover {
  transform: rotate(360deg) scale(1.05); /* 悬停旋转+放大 */
  animation-duration: 1s;                /* 加速动画 */
}

/* 旋转动画定义 */
@keyframes avatarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.site-title {
  font-size: 1.8rem;
  margin: 15px 0 10px;
  color: var(--secondary-color);
  letter-spacing: -0.5px;          /* 紧凑字距 */
}

.site-description {
  font-size: 1rem;
  color: var(--light-text);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* 统计数字模块 */
.stats-container {
  display: flex;
  justify-content: space-around;
  margin: 25px 0;
}

.stat-item {
  flex: 1;
  position: relative;              /* 装饰线定位 */
}

.stat-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 40%;
  width: 1px;
  background: var(--border-color); /* 分隔线 */
}

.stat-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  transition: var(--transition);
}

.stat-link:hover {
  transform: scale(1.05);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--light-text);
  margin-bottom: 3px;
}

.stat-number {
  font-size: 1.4rem;
  font-weight: 700;               /* 加粗数字 */
  color: var(--primary-color);
}

/* 公告区域 */
.announcement-content {
  padding: 0 10px;
  text-align: center;
}

.announcement-text {
  font-size: 0.95rem;
  line-height: 1.7;               /* 适合长文本 */
  color: var(--text-color);
  margin-bottom: 15px;
  font-style: italic;             /* 斜体强调 */
}

.qrcode-container {
  margin: 15px auto;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  display: inline-block;          /* 适应内容宽度 */
}

.sidebar-qrcode {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  display: block;                 /* 消除图片底部间隙 */
}

.sidebar-qrcode:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.contact-info {
  font-size: 0.85rem;
  color: var(--light-text);
  line-height: 1.6;
  margin-top: 15px;
}

.contact-info strong {
  color: var(--primary-color);
  font-weight: 600;
  padding: 0 2px;
}

/* 最新文章模块 */
.recent-posts {
  position: relative;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(0,0,0,0.08); /* 虚线分隔 */
  transition: var(--transition);
}

.post-item:hover {
  border-bottom-color: var(--primary-color); /* 悬停高亮 */
}

.post-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.post-title {
  display: block;
  font-size: 0.95rem;
  color: var(--secondary-color);
  line-height: 1.5;
  margin-bottom: 6px;
  transition: var(--transition);
  position: relative;
  padding-left: 12px;             /* 装饰圆点预留空间 */
}

.post-title::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-color);    /* 装饰圆点 */
}

.post-title:hover {
  color: var(--primary-color);
  padding-left: 15px;             /* 悬停滑动效果 */
}

.post-meta {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--light-text);
  gap: 10px;
}

.post-date {
  background: rgba(0,0,0,0.03);
  padding: 2px 8px;
  border-radius: 10px;
  font-family: monospace;         /* 等宽字体 */
}

.post-reading-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

/**
 * ========================
 * 响应式设计
 * ========================
 */
@media (max-width: 992px) {
  .two-columns {
    gap: 20px;
  }
  
  .article-card {
    margin-bottom: 40px;
  }
}

@media (max-width: 768px) {
  .two-columns {
    flex-direction: column;
    gap: 0;
  }
  
  .right-column {
    position: static;            /* 取消粘性 */
    margin-top: 40px;
  }
  
  .stats-container {
    flex-direction: column;     /* 统计垂直排列 */
    gap: 15px;
  }
  
  .stat-item:not(:last-child)::after {
    display: none;              /* 移动端移除分隔线 */
  }
  
  .post-item {
    margin-bottom: 14px;
    padding-bottom: 14px;
  }
}

@media (max-width: 480px) {
  .article-title {
    font-size: 1.3rem;          /* 缩小标题 */
  }
  
  .site-title {
    font-size: 1.5rem;
  }
  
  .sidebar-qrcode {
    width: 80px;                /* 二维码缩小 */
    height: 80px;
  }
}

/* 分类模块 */
.category-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 两列布局 */
  gap: 12px;
  margin-top: 15px;
}

.category-item {
  margin-bottom: 0;
}

.category-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0,0,0,0.02);
  border-radius: 6px;
  text-decoration: none;
  transition: var(--transition);
}

.category-link:hover {
  background: rgba(0,0,0,0.05);
  transform: translateX(3px);
}

.category-name {
  font-size: 0.9rem;
  color: var(--secondary-color);
  font-weight: 500;
}

.category-count {
  font-size: 0.85rem;
  color: var(--light-text);
  background: rgba(0,0,0,0.05);
  padding: 2px 8px;
  border-radius: 10px;
}

/* 标签云调整 */
.tag-cloud a {
  border-radius: 15px !important;
  padding: 4px 12px !important;
  margin-bottom: 8px !important;
  transition: all 0.3s !important;
}

.tag-cloud a:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

/* 归档模块 */
.archive-list ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.1);
}

.archive-list a {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 0.9rem;
  flex: 1;
  padding-right: 10px;
}

.archive-list a:hover {
  color: var(--primary-color);
}

.archive-count {
  background: rgba(0,0,0,0.05);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--light-text);
  min-width: 20px;
  text-align: center;
}

.archive-list li:last-child {
  border-bottom: none;
}

/* 网站资讯 */
.info-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;          /* 基线对齐 */
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.08);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-color);
  font-size: 0.9rem;
  flex: 1;
  padding-right: 15px;
}

.info-value {
  color: var(--secondary-color);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: right;
  min-width: 80px;                /* 保证对齐 */
}

.info-value:first-child {
  font-family: 'Roboto Mono', monospace; /* 等宽字体 */
}

/* 移动端适配 */
@media (max-width: 768px) {
  .info-value {
    min-width: 70px;
    font-size: 0.85rem;
  }
}
