/* 基础排版与配色，针对中文优化 */
:root {
  --bg: #f7f7f7;
  --bg-elevated: #ffffff;
  --fg: #222222;
  --fg-muted: #666666;
  --accent: #f25d50;
  --border-subtle: #e0e0e0;
  --radius-md: 10px;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #fef6f3, #f5f7fb 45%, #eef1f7 80%);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.7;
}

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* 首页第一个 section 紧贴顶部 */
main.container > section:first-of-type {
  margin-top: 0;
  padding-top: 0;
}

/* 简化版栅格，用于复刻 lightbi-hugo 布局结构 */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  align-items: stretch;
}

[class*="col-"] {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  box-sizing: border-box;
}

.col-sm-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .col-md-8 {
    flex: 0 0 66.6667%;
    max-width: 66.6667%;
  }
  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 992px) {
  .col-lg-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .col-lg-8 {
    flex: 0 0 66.6667%;
    max-width: 66.6667%;
  }
  .col-lg-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  .col-xl-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .col-xl-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.mt-10 {
  margin-top: 3rem;
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-5 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.pb-0 {
  padding-bottom: 0;
}

.pb-1 {
  padding-bottom: 0.25rem;
}

.pb-2 {
  padding-bottom: 0.5rem;
}

.pb-5 {
  padding-bottom: 2rem;
}

.section-primary-bg {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.5rem 0 3rem;
  margin-top: 0 !important;
}

.intro-header {
  align-items: center;
}

.fw-medium {
  font-weight: 600;
}

.fw-light {
  font-weight: 300;
  color: var(--fg-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-success.bg-cgreen {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(242, 93, 80, 0.35);
}

.btn-success.bg-cgreen:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(242, 93, 80, 0.45);
}

.link-underline {
  text-decoration: none;
  color: var(--accent);
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: rgba(242, 93, 80, 0.55);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(248, 250, 252, 0.78);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.site-header .container {
  display: flex;
  align-items: center;
}

.site-header .site-branding {
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: auto;
}

.site-header .site-title {
  text-decoration: none;
  color: var(--fg);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.2rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.site-nav li.is-active a {
  color: var(--accent);
  font-weight: 600;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 0.9rem;
  text-align: center;
}

.home-profile-avatar img {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(248, 113, 113, 0.65);
}

.post-card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  padding: 1.2rem 1.4rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.post-card-title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.post-card-title a {
  text-decoration: none;
  color: var(--fg);
}

.post-card-meta {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
}

.post-card-tags a,
.post-tags a {
  text-decoration: none;
  color: var(--accent);
  margin-right: 0.3rem;
  font-size: 0.85rem;
}

.post-card-excerpt {
  margin: 0.4rem 0 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
  flex: 1 1 auto;
}

.post-card-more {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.post {
  margin-top: 2.5rem;
}

.post-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.6rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 1.2rem;
}

.post-content {
  font-size: 1rem;
}

.post-content p {
  margin: 0 0 1rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

/* 少儿编程页面样式 */
.kids-hero {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  padding: 1.8rem 1.6rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(255, 247, 237, 0.96));
  box-shadow: var(--shadow-soft);
}

.kids-hero-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.kids-hero-title {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
}

.kids-hero-subtitle {
  margin: 0;
  font-size: 0.98rem;
  color: var(--fg-muted);
}

.kids-section {
  margin: 1.8rem 0;
  padding: 1.4rem 1.2rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.kids-section > h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

.kids-section ul {
  padding-left: 1.2rem;
}

.kids-funcode-card {
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 10px 30px rgba(248, 113, 113, 0.12);
}

.page-header {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.pagination a {
  text-decoration: none;
  color: var(--accent);
}

@media (max-width: 720px) {
  .container {
    padding: 1rem;
  }

  .site-header,
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .home-profile-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .post-card {
    padding: 1rem 1.1rem;
  }

  .row.intro-header {
    flex-direction: column;
  }

  .col-sm-12.col-md-8.col-lg-8,
  .col-sm-12.col-md-4.col-lg-4 {
    max-width: 100%;
    flex: 0 0 100%;
    text-align: center;
  }
}
