:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --surface: rgba(255, 255, 255, 0.78);
  --text: #2d2b28;
  --muted: #77716a;
  --line: #ded8cf;
  --accent: #865f45;
  --content-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, #fffdf8 0, transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  font-size: 17px;
  line-height: 1.85;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8rem auto;
  border-radius: 12px;
}

.container {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(222, 216, 207, 0.8);
  background: rgba(246, 243, 237, 0.88);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-title {
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  font-size: 14px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.site-main {
  min-height: calc(100vh - 150px);
  padding-top: 64px;
  padding-bottom: 80px;
}

.page-heading {
  margin-bottom: 46px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

h1,
h2,
h3 {
  line-height: 1.35;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 7vw, 52px);
}

h2 {
  font-size: 25px;
}

.page-description,
.article-description {
  color: var(--muted);
  font-size: 18px;
}

.post-list {
  display: grid;
  gap: 22px;
}

.post-card {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(76, 62, 48, 0.05);
}

.post-card h2 {
  margin: 6px 0 12px;
}

.post-card h2 a {
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.post-summary {
  margin-bottom: 12px;
  color: #56514c;
}

.read-more {
  color: var(--accent);
  font-size: 15px;
  text-decoration: none;
}

.article {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 45px rgba(76, 62, 48, 0.06);
}

.article-header {
  margin-bottom: 38px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin-top: 10px;
}

.article-content p {
  margin: 1.15em 0;
}

.article-content blockquote {
  margin: 1.6rem 0;
  padding: 0.25rem 0 0.25rem 1.2rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
}

.article-content code {
  padding: 0.15em 0.35em;
  border-radius: 5px;
  background: #ece6dd;
}

.article-content pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 10px;
  background: #262421;
  color: #f4f1ec;
}

.article-content pre code {
  padding: 0;
  background: transparent;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

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

.empty-message {
  color: var(--muted);
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .header-inner {
    display: block;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 12px 16px;
    margin-top: 8px;
  }

  .site-main {
    padding-top: 38px;
  }

  .post-card,
  .article {
    padding: 22px 19px;
    border-radius: 13px;
  }

  h1 {
    font-size: 34px;
  }
}

/* ===== 博客首页：栏目与最新文章 ===== */

.home-heading {
  margin-bottom: 54px;
}

.home-section {
  margin-top: 48px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-size: 28px;
}

.section-heading > a {
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}

.section-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 94px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(76, 62, 48, .045);
  text-decoration: none;
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    border-color .2s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: rgba(134, 95, 69, .42);
  box-shadow: 0 15px 34px rgba(76, 62, 48, .09);
}

.category-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  background: #eee7dc;
  font-size: 22px;
}

.category-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.category-info strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-info small {
  margin-top: 3px;
  color: var(--muted);
}

.category-arrow {
  color: var(--accent);
  font-size: 19px;
}

.post-card h3 {
  margin: 7px 0 12px;
  font-size: 24px;
  line-height: 1.4;
}

.post-card h3 a,
.post-meta a {
  text-decoration: none;
}

.post-meta a:hover,
.post-card h3 a:hover {
  color: var(--accent);
}

@media (max-width: 680px) {
  .home-heading {
    margin-bottom: 40px;
  }

  .home-section {
    margin-top: 38px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 25px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .category-card {
    min-height: 82px;
    padding: 16px;
  }

  .category-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    font-size: 19px;
  }

  .post-card h3 {
    font-size: 21px;
  }
}

.category-card-empty {
  cursor: default;
  opacity: .62;
}

.category-card-empty:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(76, 62, 48, .045);
}

.category-card-empty .category-arrow {
  color: var(--muted);
  font-size: 12px;
}

.home-quote {
  margin-top: 18px;
}

.home-quote span {
  margin-left: 8px;
  color: var(--muted);
  font-size: .88em;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .home-quote span {
    display: block;
    margin: 7px 0 0;
  }
}

.home-heading {
  padding-top: 18px;
}

.home-quote {
  margin: 0;
  font-size: 22px;
  line-height: 1.8;
}

.home-quote span {
  font-size: 15px;
}

@media (max-width: 680px) {
  .home-heading {
    padding-top: 8px;
  }

  .home-quote {
    font-size: 18px;
  }
}

.home-quote {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.home-quote span {
  margin-left: 18px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
}

@media (max-width: 680px) {
  .home-quote {
    font-size: 30px;
    line-height: 1.5;
  }

  .home-quote span {
    margin-top: 10px;
    font-size: 16px;
  }
}

/* ===== 全站备案信息 ===== */
.site-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  max-width: 1100px;
  margin: 70px auto 0;
  padding: 22px 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-beian a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-beian a:hover {
  color: var(--accent);
}

.site-beian img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

@media (max-width: 680px) {
  .site-beian {
    margin-top: 48px;
    padding: 18px 14px 24px;
    gap: 4px 10px;
    font-size: 11px;
  }
}

/* ===== 全站备案信息 ===== */
.site-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  max-width: 1100px;
  margin: 70px auto 0;
  padding: 22px 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-beian a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-beian a:hover {
  color: var(--accent);
}

.site-beian img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

@media (max-width: 680px) {
  .site-beian {
    margin-top: 48px;
    padding: 18px 14px 24px;
    gap: 4px 10px;
    font-size: 11px;
  }
}

/* ===== 首页栏目压缩 ===== */
.home-categories {
  margin-top: 42px;
}

.home-categories .category-grid {
  gap: 10px;
}

.home-categories .category-card {
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 13px;
}

.home-categories .category-icon {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
}

.home-categories .category-info strong {
  font-size: 15px;
}

.home-categories .category-info small {
  font-size: 12px;
}

@media (max-width: 680px) {
  .home-categories .category-card {
    min-height: 64px;
    padding: 12px 14px;
  }
}
