/* ============================================
   Template Redesign — jichantuijian.github.io
   清爽浅色现代卡片风
   ============================================ */

/* 基础变量 */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #e11d48;
  --accent-hover: #be123c;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

/* 全局 */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Hero 推荐区
   ============================================ */
.hero-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1d4ed8 100%);
  padding: 60px 20px 50px;
  text-align: center;
  color: #fff;
  margin-top: 76px; /* 导航栏高度补偿 */
}

.hero-section h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero-section .hero-subtitle {
  font-size: clamp(15px, 2vw, 18px);
  opacity: 0.9;
  margin: 0 0 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 200px;
  flex: 1;
  gap: 6px;
}

.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.hero-card.hero-main {
  background: #e11d48;
  color: #fff;
  border: 2px solid #e11d48;
}

.hero-card.hero-main:hover {
  background: #be123c;
  border-color: #be123c;
}

.hero-card.hero-alt {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}

.hero-card.hero-alt:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
}

.hero-card.hero-shop {
  background: #fff;
  color: #1e40af;
  border: 2px solid #fff;
  flex-basis: 100%;
  min-width: unset;
}

.hero-card.hero-shop:hover {
  background: #f0f4ff;
  color: #1e3a8a;
}

/* ============================================
   首页文章列表
   ============================================ */
.section-content {
  padding: 40px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-light), transparent);
  margin-left: 12px;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.post-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 24px;
}

.post-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.post-card .post-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.post-card .post-date {
  white-space: nowrap;
}

.post-card .post-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.post-card .post-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ============================================
   分页
   ============================================ */
.pagination-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  padding: 20px 0;
}

.pagination-bar a,
.pagination-bar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
}

.pagination-bar a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

.pagination-bar .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination-bar .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================
   文章页布局
   ============================================ */
.post-wrapper {
  max-width: var(--max-width);
  margin: 88px auto 0;
  padding: 0 20px;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 32px 0;
}

@media (min-width: 992px) {
  .post-layout {
    grid-template-columns: 1fr 300px;
  }
}

/* 文章正文区 */
.post-main {
  min-width: 0;
}

.post-header {
  margin-bottom: 28px;
}

.post-header h1 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 14px;
  color: var(--text);
}

.post-header .post-meta-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
}

.post-header .post-meta-header .post-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-header .post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-header .post-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.post-header .post-tag:hover {
  background: var(--primary);
  color: #fff;
}

/* 文章正文排版 */
.post-content {
  font-size: 16px;
  line-height: 1.8;
  color: #374151;
}

.post-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.post-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: var(--primary-dark);
}

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

.post-content li {
  margin-bottom: 6px;
}

.post-content blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 4px solid var(--primary-light);
  background: #f0f4ff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #475569;
}

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

.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
  margin: 20px 0;
}

/* ============================================
   侧边栏
   ============================================ */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-sticky {
  position: sticky;
  top: 100px;
}

.sidebar-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar-card .widget-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
}

.sidebar-card .widget-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-card .widget-title i {
  color: var(--primary-light);
}

.sidebar-card .widget-content {
  padding: 6px 0;
}

.sidebar-card .widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-card .widget-item {
  border-bottom: 1px solid #f3f4f6;
}

.sidebar-card .widget-item:last-child {
  border-bottom: none;
}

.sidebar-card .widget-link {
  display: flex;
  flex-direction: column;
  padding: 10px 18px;
  text-decoration: none;
  transition: all 0.2s;
  gap: 3px;
}

.sidebar-card .widget-link:hover {
  background: #f8faff;
}

.sidebar-card .widget-link .item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-card .widget-link:hover .item-title {
  color: var(--primary);
}

.sidebar-card .widget-link .item-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* 侧边栏推荐卡片 */
.sidebar-promo {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: #fff;
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
}

.sidebar-promo h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}

.sidebar-promo .promo-btn {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.sidebar-promo .promo-btn:last-child {
  margin-bottom: 0;
}

.sidebar-promo .promo-btn-main {
  background: #e11d48;
  color: #fff;
}

.sidebar-promo .promo-btn-main:hover {
  background: #be123c;
  color: #fff;
}

.sidebar-promo .promo-btn-alt {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.sidebar-promo .promo-btn-alt:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ============================================
   相关文章
   ============================================ */
.related-posts {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 2px solid var(--border);
}

.related-posts h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.related-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}

.related-card a {
  text-decoration: none;
  color: inherit;
}

.related-card a:hover h4 {
  color: var(--primary);
}

.related-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card .related-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   上下篇导航
   ============================================ */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.post-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
  max-width: 48%;
}

.post-nav a:hover {
  border-color: var(--primary-light);
  background: #f8faff;
}

.post-nav .nav-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.post-nav .nav-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav a:hover .nav-title {
  color: var(--primary);
}

.post-nav .nav-right {
  text-align: right;
}

/* ============================================
   响应式微调
   ============================================ */
@media (max-width: 767px) {
  .hero-section {
    padding: 40px 16px 36px;
    margin-top: 60px;
  }

  .hero-card {
    min-width: 100%;
    padding: 14px 20px;
    font-size: 14px;
  }

  .section-content {
    padding: 24px 16px;
  }

  .post-card a {
    padding: 18px;
  }

  .post-wrapper {
    margin-top: 60px;
    padding: 0 16px;
  }

  .post-layout {
    padding: 20px 0;
    gap: 24px;
  }
}

/* ============================================
   与现有主题兼容
   ============================================ */
/* 隐藏旧首页的 intro-header（beautiful-jekyll 残留） */
body.home .intro-header {
  display: none;
}

/* 面包屑已保留，保持干净 */
.breadcrumb-nav {
  background: transparent;
  padding: 0;
  margin-bottom: 20px;
  box-shadow: none;
  border-radius: 0;
}

.breadcrumb-nav .breadcrumb {
  padding: 0;
}

/* footer 保持干净 */
.beautiful-jekyll-footer {
  margin-top: 0;
  padding-top: 30px;
}