/* ============================================
   全局重置与变量 — 绿色自然主题
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f4faf5;
  --surface: #ffffff;
  --text-primary: #1a2e1f;
  --text-secondary: #4f6b55;
  --accent: #2d6a4f;
  --accent-light: #40916c;
  --accent-soft: #e3f2e9;
  --border-light: #d8e8dd;
  --shadow-sm: 0 4px 12px rgba(45, 106, 79, 0.04), 0 1px 3px rgba(45, 106, 79, 0.03);
  --shadow-hover: 0 12px 28px rgba(45, 106, 79, 0.1), 0 4px 12px rgba(45, 106, 79, 0.05);
  --radius-card: 20px;
  --radius-sm: 12px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
}

body {
  background-color: var(--bg);
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.blog-wrapper {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   页眉
   ============================================ */
.blog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================
   Logo 图标区（1:1 固定大小图片）
   ============================================ */
.logo-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;         /* 40px 尺寸下圆角稍小更协调 */
  overflow: hidden;
  background: var(--accent-soft);
}

.logo-icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.logo-text h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--accent);
}

.logo-text .tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.search-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 0.6rem 1.2rem;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: default;
}

/* ============================================
   Hero 特色区域
   ============================================ */
.hero-section {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.hero-main {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  transition: box-shadow 0.3s ease;
}

.hero-main:hover {
  box-shadow: var(--shadow-hover);
}

.hero-image {
  height: 280px;
  background: linear-gradient(145deg, #a8d5ba, #74b49b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffffcc;
  position: relative;
}

.hero-image::after {
  content: "❋ ❋ ❋";
  letter-spacing: 12px;
  font-size: 1.6rem;
  opacity: 0.5;
  color: #fff;
}

.hero-content {
  padding: 2rem 1.8rem 1.8rem;
}

.category-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 40px;
  margin-bottom: 0.9rem;
}

.hero-content h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.9rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.meta-row i {
  margin-right: 4px;
  font-size: 0.8rem;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.side-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  padding: 1.5rem 1.6rem;
  transition: box-shadow 0.3s ease;
}

.side-card:hover {
  box-shadow: var(--shadow-hover);
}

.side-card h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.side-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.avatar-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.avatar-large {
  width: 48px;
  height: 48px;
  background: #b7dac7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #1f4d38;
  font-size: 1.2rem;
  font-family: var(--font-serif);
}

/* 社交链接：图标 + 文字的小胶囊（与列表页分类 chip 同一套视觉语言） */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.32rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 40px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.social-links a i {
  font-size: 0.95rem;
}

/* ============================================
   文章网格
   ============================================ */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.8rem;
}

.section-title h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.section-title a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  transition: opacity 0.2s;
}

.section-title a:hover {
  opacity: 0.7;
}

.section-title a i {
  font-size: 0.8rem;
  margin-left: 4px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.post-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.post-thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #2b6b4f;
}

.post-thumb i {
  font-size: 2.8rem;
  opacity: 0.75;
}

.post-content {
  padding: 1.5rem 1.5rem 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.post-content h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  transition: color 0.2s;
}

.post-card:hover .post-content h3 {
  color: var(--accent);
}

.post-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  padding-top: 0.9rem;
  margin-top: auto;
}

.post-meta i {
  margin-right: 5px;
  font-size: 0.7rem;
}

/* ============================================
   订阅板块
   ============================================ */
.newsletter-section {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 3rem 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
}

.newsletter-section h3 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.newsletter-section p {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 2rem;
  font-size: 1rem;
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.subscribe-form input {
  flex: 1 1 240px;
  padding: 1rem 1.4rem;
  border: 1px solid var(--border-light);
  border-radius: 60px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: var(--bg);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.subscribe-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.subscribe-form button {
  background: var(--accent);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem 2rem;
  border-radius: 60px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
}

.subscribe-form button:hover {
  background: #1e5a3e;
}

.subscribe-form button:active {
  transform: scale(0.97);
}

.subscribe-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 订阅结果提示（成功后变主题绿，出错用暖色，保持自然色调） */
.subscribe-status {
  min-height: 1.4em;
  margin-top: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.subscribe-status.is-ok {
  color: var(--accent);
}

.subscribe-status.is-error {
  color: #b4552d;
}

/* ============================================
   页脚
   ============================================ */
.blog-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-secondary);
  margin-left: 2rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ============================================
   文章详情页（第 3 期）
   ============================================ */
.post-detail {
  max-width: 780px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.back-link i {
  font-size: 0.8rem;
}

.post-article {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 3rem 3rem 2.5rem;
}

.detail-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.2rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 1rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.4rem;
  margin-bottom: 1.8rem;
}

.detail-meta i {
  margin-right: 5px;
  font-size: 0.8rem;
}

.detail-thumb {
  height: 220px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 1.8rem;
}

.detail-thumb i {
  opacity: 0.7;
}

.detail-lead {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-secondary);
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent-soft);
  margin-bottom: 1.8rem;
}

.detail-body p {
  font-size: 1.02rem;
  line-height: 1.9;
  margin-bottom: 1.4rem;
}

.detail-body blockquote {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--accent);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 2rem;
}

.nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

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

.nav-item.next {
  text-align: right;
}

.nav-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.nav-label i {
  font-size: 0.7rem;
}

.nav-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.5;
}

.nav-item.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.post-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
}

.post-empty h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.post-empty p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* 首页卡片改为可点击链接（<a class="post-card">）后的补充样式 */
a.post-card {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   文章列表页：搜索 + 分类筛选（第 3 期）
   ============================================ */
.archive-section {
  margin-bottom: 1rem;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 60px;
  padding: 0.85rem 1.3rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field i {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 40px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.result-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
}

.empty-state[hidden] {
  display: none;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

/* 页头「搜索」由静态 div 改为可点击链接 */
a.search-btn {
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

a.search-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* 搜索胶囊不需要导航下划线动画 */
.nav-links a.search-btn::after {
  display: none;
}

/* ============================================
   首屏主推区改为可点击卡片（<a class="hero-main">）
   ============================================ */
a.hero-main {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.hero-main:not([href]) {
  cursor: default;
}

a.hero-main h2 {
  transition: color 0.2s;
}

a.hero-main:hover h2 {
  color: var(--accent);
}

/* ============================================
   关于页（第 3 期）
   ============================================ */
.about-section {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 2.4rem 2.6rem;
  transition: box-shadow 0.3s ease;
}

.about-card:hover {
  box-shadow: var(--shadow-hover);
}

.about-card h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.about-desc p {
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
}

.about-desc p:last-child {
  margin-bottom: 1.6rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1.6rem;
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  line-height: 1.2;
  color: var(--accent);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.about-bio {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-top: 1.2rem;
}

/* 关于页锚点（页脚「联系」跳到这里）定位时留出呼吸空间 */
#contact {
  scroll-margin-top: 1.5rem;
}

/* ============================================
   项目角色署名（作品集场景）
   ============================================ */
/* 列表卡片：标题下方的小字署名 */
.post-role {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
}

/* 详情页：带「角色」小标签的署名行 */
.detail-role {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.3rem;
}

.detail-role[hidden] {
  display: none;
}

.detail-role::before {
  content: '角色';
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
}