/* ===== 基础 ===== */
:root {
  --bg: #faf8f5;
  --bg-card: #ffffff;
  --text: #2c2c2c;
  --text-light: #888;
  --accent: #c0392b;
  --accent-light: #e74c3c;
  --border: #e8e4df;
  --serif: 'Noto Serif SC', 'Songti SC', serif;
  --display: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-light); }
img { max-width: 100%; height: auto; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
}

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(250,248,245,0.92);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: 2px;
}

.site-nav { display: flex; gap: 24px; }

.nav-link {
  color: var(--text-light);
  font-size: 0.95rem;
  letter-spacing: 1px;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 32px 0 48px;
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-cover {
  height: 320px;
  background-size: cover;
  background-position: center;
}

.hero-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 32px 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
}

.hero-text h1 {
  font-family: var(--display);
  font-size: 2.4rem;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  letter-spacing: 2px;
}

/* ===== Section Title ===== */
.section-title {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  letter-spacing: 2px;
}

/* ===== Post Grid (首页) ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.post-card-cover img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.post-card-body { padding: 16px 20px; }

.post-date {
  font-size: 0.85rem;
  color: var(--text-light);
}

.post-card-body h3 {
  margin: 6px 0 8px;
  font-size: 1.1rem;
  line-height: 1.5;
}
.post-card-body h3 a { color: var(--text); }
.post-card-body h3 a:hover { color: var(--accent); }

.post-summary {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ===== 分类卡片 (首页) ===== */
.photo-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.category-name {
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: 2px;
  font-weight: 600;
}

/* 分类页头部 */
.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0 32px;
}
.category-header .category-icon {
  font-size: 2.4rem;
}
.category-header h1 {
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: 3px;
}

/* ===== Photo Grid ===== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.photo-card:hover { transform: scale(1.02); }

.photo-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.photo-card-body {
  padding: 10px 14px;
}
.photo-card-body h3 { font-size: 0.95rem; margin-bottom: 2px; }
.photo-card-body h3 a { color: var(--text); }
.photo-card-body time { font-size: 0.8rem; color: var(--text-light); }

/* ===== Post List (列表页) ===== */
.page-header {
  margin: 40px 0 32px;
}
.page-header h1 {
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: 3px;
}

.post-list { margin-bottom: 48px; }

.post-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: none; }

.post-item-cover {
  flex-shrink: 0;
  width: 200px;
  border-radius: var(--radius);
  overflow: hidden;
}
.post-item-cover img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.post-item-body time {
  font-size: 0.85rem;
  color: var(--text-light);
}
.post-item-body h2 {
  font-size: 1.2rem;
  margin: 4px 0 8px;
}
.post-item-body h2 a { color: var(--text); }
.post-item-body h2 a:hover { color: var(--accent); }
.post-item-body p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

.tags { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(192,57,43,0.08);
  padding: 2px 10px;
  border-radius: 12px;
}

/* ===== Post Detail ===== */
.post-detail { margin: 40px 0 48px; }

.post-header {
  margin-bottom: 24px;
}
.post-header time {
  font-size: 0.9rem;
  color: var(--text-light);
}
.post-header h1 {
  font-family: var(--display);
  font-size: 2rem;
  margin: 8px 0 12px;
  letter-spacing: 2px;
  line-height: 1.4;
}

.post-cover {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ===== 文章内容排版 ===== */
.post-content {
  font-size: 1.05rem;
  line-height: 2;
}

.post-content h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 48px 0 16px;
  letter-spacing: 1px;
}

.post-content h3 {
  font-size: 1.25rem;
  margin: 36px 0 12px;
}

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

.post-content img {
  border-radius: var(--radius);
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(192,57,43,0.04);
  color: var(--text-light);
  font-style: italic;
}

.post-content code {
  background: #f0ece6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ===== 文章导航 ===== */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-nav a { font-size: 0.95rem; }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .hero-cover { height: 200px; }
  .hero-text h1 { font-size: 1.6rem; }
  .post-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-categories { grid-template-columns: repeat(2, 1fr); }
  .post-item { flex-direction: column; gap: 12px; }
  .post-item-cover { width: 100%; }
  .post-item-cover img { height: 180px; }
  .header-inner { flex-direction: column; gap: 12px; }
  .site-nav { gap: 16px; }
}
