/* 自定义样式 - 程序员G的笔记 */

/* 导航栏固定不随滚动移动 */
.navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Banner 区域不随滚动视差移动 */
.banner {
  background-attachment: scroll !important;
}

/* 加宽主内容区域 */
.index .main-content,
.post .main-content {
  max-width: 920px;
}

/* 文章卡片改进 */
.index .index-card {
  margin-bottom: 32px;
  padding: 28px 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.index .index-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

/* 无封面图时文章信息占满全宽 */
.index .index-info {
  max-width: 100%;
  flex: 0 0 100%;
}

/* 隐藏空的封面图区域 */
.index .index-img:empty {
  display: none;
}

.index .post-list .post-item:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

/* 文章标题样式 */
.index .index-header {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 0;
  margin-bottom: 12px;
}

/* 文章摘要 */
.index .index-excerpt {
  font-size: 15px;
  line-height: 1.8;
  color: #555;
  margin-bottom: 16px;
}

/* 封面图完整显示 */
.index .index-card img,
.post .post-content img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* 标签样式 */
.index .post-meta .tag,
.post .post-meta .tag {
  display: inline-block;
  padding: 2px 10px;
  margin: 2px 4px;
  background: #f0f5ff;
  color: #2f6fd6;
  border-radius: 12px;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s;
}

.index .post-list .post-meta .tag:hover {
  background: #d6e4ff;
}

/* 日期和分类图标 */
.index .post-metas,
.post .post-metas {
  font-size: 14px;
  color: #888;
}

/* 导航栏改进 */
.navbar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Banner 区域 */
.index .banner {
  min-height: 400px;
}

/* 页脚改进 */
footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid #eee;
}

/* 文章详情页 */
.post .post-content {
  font-size: 16px;
  line-height: 1.9;
  color: #333;
}

.post .post-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

.post .post-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.post .post-content p {
  margin-bottom: 16px;
}

.post .post-content blockquote {
  border-left: 4px solid #4a9eff;
  background: #f8faff;
  padding: 12px 20px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
  color: #555;
}

.post .post-content ul,
.post .post-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.post .post-content li {
  margin-bottom: 8px;
  line-height: 1.8;
}

/* 暗色模式适配 */
html[data-user-color-scheme="dark"] .index .index-card {
  background: #252d38;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

html[data-user-color-scheme="dark"] .index .index-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

html[data-user-color-scheme="dark"] .index .post-meta .tag {
  background: #1a3a5a;
  color: #6ab0ff;
}

html[data-user-color-scheme="dark"] .index .post-meta .tag:hover {
  background: #2a4a6a;
}

/* 响应式 */
@media (max-width: 768px) {
  .index .index-card {
    padding: 16px;
    margin-bottom: 24px;
  }

  .index .index-header {
    font-size: 18px;
  }

  .index .index-excerpt {
    font-size: 14px;
  }
}

/* 语言切换按钮 */
.lang-switch-btn {
  display: inline-flex !important;
  align-items: center;
  padding: 4px 12px !important;
  margin-left: 8px;
  font-size: 13px !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none !important;
  user-select: none;
}

.lang-switch-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.lang-nav-item {
  list-style: none;
  display: inline-flex;
  align-items: center;
}

/* 暗色模式下语言按钮 */
html[data-user-color-scheme="dark"] .lang-switch-btn {
  border-color: rgba(255, 255, 255, 0.2);
}

html[data-user-color-scheme="dark"] .lang-switch-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}