/*
Theme Name: 极简三栏博客
Theme URI: 
Description: 轻量化Typecho极简三栏博客主题，响应式适配，性能优先，代码规范
Version: 1.1
Author: 
Author URI: 
License: MIT
*/

/* ========== 全局变量 & 初始化 ========== */

* {
  font-family:"Gen Jyuu Gothic Regular";
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --bg-body: #f9fafb;
  --bg-card: #ffffff;
  --radius-main: 16px;
  --radius-sm: 12px;
  --width-wide: 1200px;
  --width-narrow: 800px;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease-in-out;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, "Helvetica Neue", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  padding: 0 24px;
  line-height: 1.5;
}

/* 清除浮动 & 通用工具类 */
.clearfix::after {
  content: "";
  display: block;
  clear: both;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-normal);
}

/* ========== 公共头部 ========== */
.header {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 48px 0 36px;
  text-align: center;
}

/* 内页头部适配（文章/独立页/归档） */
body:not(.index-page) .header {
  max-width: var(--width-narrow);
  padding: 36px 0;
}

.site-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.nav a, .header-back {
  font-size: 15px;
  color: var(--text-secondary);
}

.nav a:hover, .header-back:hover {
  color: var(--text-primary);
}

/* ========== 首页布局 ========== */
.main-wrap {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding-bottom: 80px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 42px;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-cover {
  width: 100%;
  height: 240px;
  border-radius: var(--radius-main);
  background-color: #e5e7eb;
  background-size: cover;
  background-position: center;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.post-card:hover .card-cover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.card-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
}

.card-title a {
  color: var(--text-primary);
}

/* ========== 文章/独立页/归档布局 ========== */
.content-wrap {
  max-width: var(--width-narrow);
  margin: 0 auto 60px;
  padding-bottom: 40px;
}

.article-header {
  margin-bottom: 40px;
  text-align: center;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-meta {
  font-size: 14px;
  color: var(--text-secondary);
}

.article-content {
  font-size: 17px;
  line-height: 1.8;
  color: #222;
}

.article-content p {
  margin-bottom: 1em;
}

.article-content img {
  border-radius: var(--radius-sm);
  margin: 1em 0;
}

/* ========== 归档列表 ========== */
.archive-list {
  margin-top: 20px;
}

.archive-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  align-items: center;
  flex-wrap: wrap;
}

.archive-date {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

.archive-item a {
  color: var(--text-primary);
  font-size: 16px;
  flex: 1;
  min-width: 200px;
}

.archive-item a:hover {
  color: #000;
}

.archive-pagination {
  text-align: center;
  margin-top: 40px;
  font-size: 16px;
}

.archive-pagination a {
  color: var(--text-primary);
  margin: 0 10px;
}

/* ========== 公共底部 ========== */
.footer {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 40px 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

body:not(.index-page) .footer {
  max-width: var(--width-narrow);
}

/* ========== 图片懒加载预留样式 ========== */
.lazy-img {
  opacity: 0;
  transition: opacity var(--transition-slow), transform var(--transition-normal);
  transform: translateY(10px);
}

.lazy-img.loaded {
  opacity: 1;
  transform: translateY(0);
}

.skeleton-loading {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.card-cover, .article-content img {
  background-color: #e5e7eb;
}

/* ========== 响应式适配 ========== */
@media (max-width: 900px) {
  .post-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .card-cover {
    height: 220px;
  }

  .header {
    padding: 32px 0 24px;
  }

  .site-title {
    font-size: 24px;
  }

  .article-title {
    font-size: 28px;
  }

  .nav {
    gap: 20px;
  }
}