/* ========== RESET & BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --sepia: 0.2;
  --paper-bg: #f5f0e8;
  --paper-dark: #e8e0d0;
  --ink: #2c2416;
  --ink-light: #5a4e3c;
  --ink-faint: #8a7e6c;
  --accent: #8b4513;
  --accent-light: #a0522d;
  --gold: #b8860b;
  --serif: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--mono);
  background-color: var(--paper-bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  position: relative;
  overflow-x: hidden;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(139, 69, 19, 0.015) 2px, rgba(139, 69, 19, 0.015) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

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

/* ========== NAVIGATION ========== */
.nav-toc {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--paper-bg);
  padding: 12px 40px;
  box-shadow: 0 1px 0 rgba(139,69,19,0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.nav-logo img {
  width: 140px;
  height: auto;
}

.nav-logo span {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-items {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-items a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  color: var(--ink-light);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  padding: 8px 14px;
  border-radius: 4px;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.nav-items a:hover {
  color: var(--accent);
  background: rgba(139, 69, 19, 0.06);
}

.nav-num {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-faint);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: inline-block;
  min-width: 20px;
}

.nav-items a:hover .nav-num {
  font-size: 26px;
  color: var(--accent);
  transform: translateY(2px);
  letter-spacing: -1px;
}

/* ========== FLASH MESSAGES ========== */
.flash-messages {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
}

.flash-msg {
  padding: 12px 20px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 13px;
  border-radius: 4px;
  animation: fadeSlideUp 0.4s ease forwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.flash-success { background: #f0f7e6; color: #3a6b1e; border: 1px solid #c5e0b4; }
.flash-error { background: #fde8e8; color: #8b1a1a; border: 1px solid #f5b7b7; }
.flash-info { background: #e8f0fd; color: #1a3a6b; border: 1px solid #b4c5e0; }

/* ========== HERO SECTION ========== */
.hero {
  margin-top: 110px;
  padding: 40px 0 30px;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: center;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: -60px;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: clamp(100px, 18vw, 220px);
  font-weight: 900;
  color: rgba(139, 69, 19, 0.04);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: -5px;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

.hero-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 16px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-light);
  max-width: 600px;
}

/* ========== SECTION DIVIDER ========== */
.section-divider {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,69,19,0.2), transparent);
}

.section-divider span {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ========== MASONRY CARDS ========== */
.masonry-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 60px;
}

.masonry-grid {
  columns: 3;
  column-gap: 24px;
}

.card {
  break-inside: avoid;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(139, 69, 19, 0.08);
  border-radius: 3px;
  overflow: hidden;
  transition: all 0.4s ease;
  position: relative;
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9) { animation-delay: 0.9s; }

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(44, 36, 22, 0.08);
  border-color: rgba(139, 69, 19, 0.15);
}

.card-image {
  width: 100%;
  display: block;
  filter: sepia(0.2);
  transition: filter 0.4s ease;
}

.card:hover .card-image {
  filter: sepia(0.05);
}

.card-body {
  padding: 20px 22px;
}

.card-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(139, 69, 19, 0.06);
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 10px;
}

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

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

.card-excerpt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 14px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  padding-top: 12px;
  border-top: 1px solid rgba(139, 69, 19, 0.06);
}

.card-read-more {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s;
}

.card-read-more:hover {
  color: var(--gold);
}

/* Card: Featured — 横跨全宽 */
.card-featured {
  column-span: all;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.card-featured .card-image {
  height: 100%;
  object-fit: cover;
}

.card-featured .card-body {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-featured .card-title {
  font-size: 26px;
}

/* Card: No Image — 渐变背景 */
.card-no-image .card-body {
  padding: 24px 22px;
  background: linear-gradient(135deg, rgba(139,69,19,0.03) 0%, rgba(255,255,255,0.4) 100%);
}

/* Card: Quote — 引用风格 */
.card-quote {
  border-left: 3px solid var(--accent);
  background: rgba(139, 69, 19, 0.02);
}

.card-quote .card-body {
  padding: 24px 22px;
}

.card-quote .card-excerpt {
  font-style: italic;
  font-size: 15px;
  line-height: 1.8;
}

/* ========== POST DETAIL ========== */
.post-detail {
  max-width: 800px;
  margin: 110px auto 40px;
  padding: 0 40px;
}

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

.post-category-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(139, 69, 19, 0.06);
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 16px;
  text-decoration: none;
}

.post-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 20px;
}

.post-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.post-cover {
  width: 100%;
  border-radius: 3px;
  margin-bottom: 30px;
  filter: sepia(0.15);
}

.post-content {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
}

.post-content h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.post-content h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--ink);
}

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

.post-content blockquote {
  border-left: 3px solid var(--accent);
  background: rgba(139, 69, 19, 0.03);
  padding: 16px 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--ink-light);
}

.post-content pre {
  background: rgba(44, 36, 22, 0.04);
  border: 1px solid rgba(139, 69, 19, 0.1);
  border-radius: 3px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.6;
}

.post-content code {
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(139, 69, 19, 0.06);
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 13px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content img {
  border-radius: 3px;
  margin: 20px 0;
  filter: sepia(0.1);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.post-content th, .post-content td {
  border: 1px solid rgba(139, 69, 19, 0.12);
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
}

.post-content th {
  background: rgba(139, 69, 19, 0.05);
  font-weight: 600;
}

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

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

.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,69,19,0.2), transparent);
  margin: 30px 0;
}

/* Post Tags */
.post-tags {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(139, 69, 19, 0.1);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.post-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-light);
  background: rgba(139, 69, 19, 0.04);
  padding: 4px 12px;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.3s;
}

.post-tag:hover {
  background: rgba(139, 69, 19, 0.1);
  color: var(--accent);
}

/* Related Posts */
.related-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid rgba(139, 69, 19, 0.1);
}

.related-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--ink);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.related-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(139, 69, 19, 0.08);
  border-radius: 3px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 36, 22, 0.06);
  border-color: rgba(139, 69, 19, 0.15);
}

.related-card-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.related-card-date {
  font-size: 11px;
  color: var(--ink-faint);
}

/* ========== COMMENTS ========== */
.comments-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid rgba(139, 69, 19, 0.1);
}

.comments-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.comment-item {
  padding: 18px 0;
  border-bottom: 1px solid rgba(139, 69, 19, 0.06);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(139, 69, 19, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.comment-nick {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.comment-date {
  font-size: 11px;
  color: var(--ink-faint);
}

.comment-body {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.7;
  padding-left: 42px;
}

.comment-reply {
  margin-left: 42px;
  padding-left: 16px;
  border-left: 2px solid rgba(139, 69, 19, 0.08);
}

/* Comment Form */
.comment-form {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(139, 69, 19, 0.08);
  border-radius: 3px;
  padding: 24px;
}

.comment-form h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 16px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(139, 69, 19, 0.12);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.3s;
}

.form-input:focus {
  border-color: var(--accent);
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 20px;
  border: 1px solid rgba(139, 69, 19, 0.2);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
}

.btn:hover {
  background: rgba(139, 69, 19, 0.06);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 11px;
}

.btn-danger {
  color: #8b1a1a;
  border-color: rgba(139, 26, 26, 0.2);
}

.btn-danger:hover {
  background: rgba(139, 26, 26, 0.06);
  border-color: #8b1a1a;
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 40px 0;
}

.pagination a, .pagination span {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid rgba(139, 69, 19, 0.12);
  border-radius: 3px;
  color: var(--ink-light);
  text-decoration: none;
  transition: all 0.3s;
}

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

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

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

/* ========== SEARCH ========== */
.search-box {
  max-width: 1200px;
  margin: 110px auto 30px;
  padding: 0 40px;
}

.search-form {
  display: flex;
  gap: 12px;
  max-width: 600px;
}

.search-input {
  flex: 1;
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(139, 69, 19, 0.15);
  border-radius: 3px;
  outline: none;
}

.search-input:focus { border-color: var(--accent); }

.search-results-count {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--paper-dark);
  border-top: 1px solid rgba(139, 69, 19, 0.1);
  padding: 60px 40px 40px;
  margin-top: 40px;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--accent);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.footer-col h4 {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
}

.footer-col p, .footer-col li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-light);
  line-height: 2;
  list-style: none;
}

.footer-col a { color: var(--ink-light); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(139, 69, 19, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.8;
}

.footer-issn {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.6;
}

.footer-counter {
  text-align: center;
  margin-top: 24px;
  padding: 14px 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.counter-label { font-size: 10px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; opacity: 0.6; }
.counter-divider { opacity: 0.25; font-weight: 300; }
.counter-item { display: inline-flex; align-items: baseline; gap: 5px; }
.counter-num { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; }
.counter-text { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.5px; }
.counter-dot { opacity: 0.3; font-size: 16px; }

.footer-deco {
  text-align: center;
  margin-top: 30px;
  font-family: var(--serif);
  font-size: 24px;
  color: rgba(139, 69, 19, 0.1);
  letter-spacing: 8px;
}

/* ========== CATEGORY/TAG PAGE HEADER ========== */
.page-header {
  max-width: 1200px;
  margin: 110px auto 20px;
  padding: 0 40px;
}

.page-header-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 8px;
}

.page-header-desc {
  font-size: 14px;
  color: var(--ink-light);
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 14px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* card animations are defined in the masonry section above */

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--paper-bg); }
::-webkit-scrollbar-thumb { background: rgba(139, 69, 19, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 69, 19, 0.35); }

::selection {
  background: rgba(139, 69, 19, 0.15);
  color: var(--ink);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .masonry-grid { columns: 2; }
  .card-featured { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .nav-items { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .masonry-grid { columns: 1; }
  .nav-toc { padding: 14px 20px 20px; }
  .masonry-section, .section-divider, .search-box, .page-header { padding-left: 20px; padding-right: 20px; }
  .post-detail { padding: 0 20px; }
  .footer { padding: 40px 20px 30px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
