:root {
  --bg: #f2f6fb;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --surface: #ffffff;
  --primary: #0f172a;
  --primary-hover: #334155;
  --accent: #0f172a;
  --text: #334155;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: #dbe4ef;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(148, 163, 184, 0.24);
  --shadow-sm: 0 8px 20px -18px rgba(15, 23, 42, 0.24);
  --shadow-md: 0 14px 38px -24px rgba(15, 23, 42, 0.32);
  --shadow-lg: 0 24px 56px -28px rgba(15, 23, 42, 0.36);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Noto Serif SC', 'STSong', serif;
  --font-brand-title: 'Noto Serif SC', 'STSong', serif;
  --font-brand-desc: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container: 1080px;
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-elevated: rgba(15, 23, 42, 0.72);
  --surface: #1e293b;
  --primary: #f8fafc;
  --primary-hover: #e2e8f0;
  --accent: #f8fafc;
  --text: #94a3b8;
  --text-dark: #f8fafc;
  --text-muted: #7b8ea8;
  --border: #334155;
  --glass: rgba(15, 23, 42, 0.72);
  --glass-border: rgba(100, 116, 139, 0.36);
  --shadow-sm: 0 8px 20px -18px rgba(2, 6, 23, 0.85);
  --shadow-md: 0 16px 40px -24px rgba(2, 6, 23, 0.9);
  --shadow-lg: 0 24px 56px -26px rgba(2, 6, 23, 0.95);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(148, 163, 184, 0.18), transparent 60%),
    radial-gradient(1000px 520px at 92% -6%, rgba(125, 145, 173, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(241, 245, 249, 0.78) 45%, rgba(236, 242, 248, 0.9) 100%);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(1000px 520px at 12% -12%, rgba(51, 65, 85, 0.3), transparent 62%),
    radial-gradient(900px 460px at 92% -10%, rgba(30, 41, 59, 0.3), transparent 58%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(11, 15, 25, 0.95) 100%);
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }
.fade-enter { opacity: 0; transform: translateY(10px); }
.fade-enter-active { opacity: 1; transform: translateY(0); transition: opacity 0.4s ease, transform 0.4s ease; }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0;
  z-index: 1000;
  transition: width 0.1s;
}

.back-to-top-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  z-index: 90;
}

.back-to-top-btn:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(100, 116, 139, 0.38);
  transform: translateY(-3px);
}
.back-to-top-btn.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }
.back-to-top-btn svg { width: 20px; height: 20px; }

.site-header {
  background: #2f3742;
  border-bottom: 1px solid #3b4654;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.site-header .site-branding h1,
.site-header .nav-item,
.site-header .icon-btn {
  color: #eef3f8;
}
.site-header .site-desc { color: #b9c4d3; }
.site-header .nav-item::after {
  background: #cfd8e3;
}
.site-header .search-box input {
  background: #3a4350;
  border: 1px solid #4a5667;
  color: #e8eef6;
  box-shadow: none;
}
.site-header .search-box input::placeholder { color: #c1cbd8; }
.site-header .search-box input:focus {
  border-color: #8ea0b8;
  background: #404a58;
}
[data-theme="dark"] .site-header {
  background: #2f3742;
  border-bottom-color: #3b4654;
}

.header-inner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-branding {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.site-branding h1 {
  font-family: var(--font-brand-title);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  line-height: 1.15;
}
.site-desc {
  font-family: var(--font-brand-desc);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.site-nav { display: flex; align-items: center; gap: 24px; }
.mobile-nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-item {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 3px;
}
.nav-item::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  background: linear-gradient(90deg, rgba(71, 85, 105, 0.2), rgba(15, 23, 42, 0.82), rgba(71, 85, 105, 0.2));
}
.nav-item:hover { color: var(--accent); }
.nav-item:hover::after { transform: scaleX(1); }

.search-box { position: relative; }
.search-box input {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 13px;
  width: 160px;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}
.search-box input:focus {
  width: 220px;
  border-color: rgba(15, 23, 42, 0.34);
  background: rgba(255, 255, 255, 0.76);
}
[data-theme="dark"] .search-box input {
  background: rgba(15, 23, 42, 0.5);
}
[data-theme="dark"] .search-box input:focus {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.7);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  transition: color 0.2s, background-color 0.2s;
}
.icon-btn:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .icon-btn:hover {
  background: rgba(51, 65, 85, 0.45);
}
.icon-btn svg { width: 20px; height: 20px; }

.mobile-only { display: none !important; }

.mobile-category-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #eef3f8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.mobile-category-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}
.mobile-category-btn .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.mobile-category-btn.is-open .icon { transform: scale(0.94); }

.mobile-overlay {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 80px);
  padding: 16px;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
[data-theme="dark"] .mobile-overlay { background: rgba(2, 6, 23, 0.5); }
.mobile-overlay.hidden { opacity: 0; pointer-events: none; visibility: hidden; }

.mobile-menu-sheet {
  width: min(100%, 640px);
  max-height: calc(100vh - 112px);
  background: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .mobile-menu-sheet {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(71, 85, 105, 0.9);
}
.mobile-overlay.hidden .mobile-menu-sheet { transform: translateY(24px); }

.mobile-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.mobile-menu-title {
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text-dark);
}
.mobile-menu-close {
  border: none;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-dark);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.mobile-menu-close:hover {
  background: rgba(148, 163, 184, 0.22);
  transform: rotate(90deg);
}
.mobile-menu-close .icon {
  width: 18px;
  height: 18px;
}

.mobile-menu-content {
  padding: 18px 20px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mobile-menu-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text-dark);
}
.mobile-menu-current-label {
  font-size: 12px;
  color: var(--text-muted);
}
.mobile-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-category-item {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-dark);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
[data-theme="dark"] .mobile-category-item {
  background: rgba(30, 41, 59, 0.88);
}
.mobile-category-item.active {
  border-color: var(--accent);
  background: #0f172a;
  color: #f8fafc;
  transform: translateY(-1px);
}
[data-theme="dark"] .mobile-category-item.active {
  background: #f8fafc;
  color: #0f172a;
}
.mobile-category-count {
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  font-size: 12px;
  text-align: center;
}
.mobile-category-item.active .mobile-category-count {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.category-menu-bar {
  background: rgba(238, 243, 248, 0.72);
  border-bottom: 1px solid rgba(215, 224, 234, 0.85);
  border-top: 1px solid rgba(215, 224, 234, 0.72);
  padding: 0;
  position: sticky;
  top: 80px;
  z-index: 90;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.32);
}
[data-theme="dark"] .category-menu-bar {
  background: rgba(42, 49, 59, 0.74);
  border-top: 1px solid rgba(58, 68, 82, 0.78);
  border-bottom: 1px solid rgba(58, 68, 82, 0.9);
  box-shadow: 0 12px 28px -24px rgba(2, 6, 23, 0.9);
}

.category-menu-scroll {
  display: flex;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
  padding: 0;
  min-height: 50px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}

.category-menu-scroll::-webkit-scrollbar,
.tags-bar-scroll::-webkit-scrollbar {
  height: 4px;
}
.category-menu-scroll::-webkit-scrollbar-thumb,
.tags-bar-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.category-menu-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  margin: 0 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  border-radius: 8px;
}

.category-menu-item:hover {
  color: var(--text-dark);
  background: rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .category-menu-item:hover {
  background: rgba(148, 163, 184, 0.12);
}

.category-menu-item::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.category-menu-item:hover::after {
  transform: scaleX(1);
}

.category-menu-item.active {
  color: var(--text-dark);
  font-weight: 700;
  background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .category-menu-item.active {
  background: rgba(148, 163, 184, 0.16);
}

.category-menu-item.active::after {
  transform: scaleX(0);
}

.mobile-breadcrumb-bar {
  display: none;
  background: #eef3f8;
  border-top: 1px solid #d7e0ea;
  border-bottom: 1px solid #d7e0ea;
  position: sticky;
  top: 80px;
  z-index: 90;
}

[data-theme="dark"] .mobile-breadcrumb-bar {
  background: #2a313b;
  border-top-color: #3a4452;
  border-bottom-color: #3a4452;
}

.mobile-breadcrumb-inner {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-breadcrumb-links {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mobile-breadcrumb-links::-webkit-scrollbar { display: none; }

.mobile-breadcrumb-link {
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 0 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.mobile-breadcrumb-link.active {
  color: var(--text-dark);
  border-bottom-color: var(--accent);
}

.mobile-breadcrumb-trail {
  flex: 0 1 48%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .mobile-breadcrumb-trail {
  background: rgba(15, 23, 42, 0.32);
  border-color: rgba(100, 116, 139, 0.28);
}

.site-main {
  padding: var(--space-lg) 24px 88px;
  min-height: calc(100vh - 160px);
  position: relative;
}

.section-title {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.section-heading-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-title h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-dark);
}
.section-subtitle {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 560px;
}
.section-title .line { flex: 1; height: 1px; background: var(--border); }
.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.section-title-filtered {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 249, 252, 0.92)),
    repeating-linear-gradient(
      135deg,
      rgba(148, 163, 184, 0.05) 0,
      rgba(148, 163, 184, 0.05) 10px,
      rgba(255, 255, 255, 0) 10px,
      rgba(255, 255, 255, 0) 24px
    );
  box-shadow: 0 18px 36px -30px rgba(15, 23, 42, 0.28);
}
[data-theme="dark"] .section-title-filtered {
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92)),
    repeating-linear-gradient(
      135deg,
      rgba(100, 116, 139, 0.12) 0,
      rgba(100, 116, 139, 0.12) 10px,
      rgba(15, 23, 42, 0) 10px,
      rgba(15, 23, 42, 0) 24px
    );
  border-color: rgba(100, 116, 139, 0.22);
  box-shadow: 0 18px 36px -30px rgba(2, 6, 23, 0.88);
}
.section-title-filtered h2 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}
.section-title-filtered .section-count {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.86);
}
[data-theme="dark"] .section-title-filtered .section-count {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(100, 116, 139, 0.28);
  color: #cbd5e1;
}
.section-title-filtered .clear-filter {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.78);
}
.section-title-category {
  margin-bottom: 22px;
}
.section-title-category .section-count {
  border-color: rgba(125, 145, 173, 0.22);
}
.clear-filter {
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.clear-filter:hover {
  color: var(--accent);
  border-color: rgba(100, 116, 139, 0.4);
  background: #fff;
}

.posts-grid {
  display: block;
}

.home-combo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  align-items: stretch;
}

.featured-main-row {
  grid-column: 1 / span 2;
}

.featured-top-side {
  grid-column: 3;
}

.featured-main-row .post-card-featured-main,
.featured-top-side .post-card-featured-side {
  min-height: 240px;
  height: 100%;
}

.featured-main-row .post-card-featured-main {
  height: 240px;
  max-height: 240px;
}

.featured-top-side .featured-side-module {
  min-height: 240px;
  height: 240px;
  max-height: 240px;
}

.posts-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}

.post-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.88) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  position: relative;
  isolation: isolate;
}
[data-theme="dark"] .post-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(30, 41, 59, 0.82));
}

.post-card::before {
  content: none;
}

.post-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 160px;
  height: 120px;
  background: radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.14) 0%, rgba(255, 255, 255, 0) 74%);
  pointer-events: none;
  z-index: 0;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(100, 116, 139, 0.4);
  box-shadow: var(--shadow-md);
}

.post-card-featured-main {
  border-color: rgba(148, 163, 184, 0.22);
}

.post-card-featured-main::before,
.post-card-featured-main::after {
  display: none;
}

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

.card-inner {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.post-card-featured-main .card-inner { padding: 26px 30px; }

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 12px;
  font-family: var(--font-sans);
  flex-wrap: wrap;
}

.card-meta-top {
  margin-bottom: 10px;
  justify-content: space-between;
  flex-wrap: nowrap;
  width: 100%;
}

.card-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(241, 245, 249, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  color: #3f536c;
  letter-spacing: 0;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.card-date { color: var(--text-muted); z-index: 2; }
.card-meta-top .card-date { margin-left: auto; white-space: nowrap; }

.card-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.card-title-link:hover {
  text-decoration: none;
}

.post-card:hover .card-title,
.post-card:hover .card-title-link {
  color: var(--text-dark);
}

.post-card-featured-main .card-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-featured-main .card-excerpt {
  font-size: 15px;
  color: var(--text);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.post-card-featured-main .card-inner {
  justify-content: flex-start;
  min-height: 0;
}

.post-card-featured-side {
  min-height: 240px;
}

.post-card-featured-side .card-inner {
  padding: 20px 18px 16px;
}

.post-card-featured-side .card-title {
  font-size: 15px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  margin-bottom: 10px;
}

.post-card-featured-side .card-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.post-card-featured-side .card-meta {
  margin-bottom: 8px;
  padding-top: 0;
}

.post-card-featured-side .card-tag {
  display: none;
}

.post-card-featured-side .card-date {
  margin-left: auto;
}

.featured-side-module {
  --recommend-accent: #6f8aa3;
  --recommend-accent-soft: rgba(111, 138, 163, 0.12);
  --recommend-accent-line: rgba(111, 138, 163, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 240px;
  max-height: 240px;
  overflow: hidden;
}

[data-theme="dark"] .featured-side-module {
  --recommend-accent: #93abc1;
  --recommend-accent-soft: rgba(147, 171, 193, 0.14);
  --recommend-accent-line: rgba(147, 171, 193, 0.34);
}

.featured-recommend {
  min-height: 240px;
  height: 240px;
  max-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding-top: 2px;
  padding-bottom: 2px;
}

.featured-recommend-list {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--recommend-accent-line);
  overflow: hidden;
  counter-reset: recommend-index;
}

.featured-recommend-empty {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.featured-recommend-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: transparent;
  padding: 8px 2px 8px 0;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  transition: background-color 0.2s ease, padding-left 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  min-height: 0;
  overflow: hidden;
  position: relative;
  counter-increment: recommend-index;
}

.featured-recommend-item:last-child {
  border-bottom: 0;
}

.featured-recommend-item::before {
  content: '';
  position: absolute;
  left: 34px;
  top: 50%;
  width: 1px;
  height: 52%;
  border-radius: 1px;
  background: rgba(100, 116, 139, 0);
  transform: translateY(-50%);
  transition: background-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.8;
}

.featured-recommend-item:hover {
  background: linear-gradient(90deg, var(--recommend-accent-soft), rgba(111, 138, 163, 0.035) 72%, rgba(111, 138, 163, 0));
  padding-left: 6px;
  border-color: var(--recommend-accent-line);
}

.featured-recommend-item:hover::before {
  background: var(--recommend-accent);
}

.featured-recommend-item:focus-visible {
  outline: none;
  background: var(--recommend-accent-soft);
  padding-left: 6px;
}

.featured-recommend-item-index {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
  color: var(--recommend-accent);
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0.82;
}

.featured-recommend-item-index::before {
  content: counter(recommend-index, decimal-leading-zero);
}

.featured-recommend-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.1;
  letter-spacing: 0.015em;
  display: block;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.featured-recommend-item:hover .featured-recommend-item-title,
.featured-recommend-item:focus-visible .featured-recommend-item-title {
  color: var(--recommend-accent);
}

.featured-recommend-item-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  opacity: 0.88;
  color: var(--recommend-accent);
  justify-self: end;
  padding-left: 8px;
  line-height: 1;
}


.card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-readtime {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dark);
}

.card-cta-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.post-card:hover .card-cta-arrow {
  transform: translateX(4px);
}

.post-card-compact {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 252, 255, 0.92) 100%);
  box-shadow: 0 10px 22px -20px rgba(15, 23, 42, 0.28);
}
[data-theme="dark"] .post-card-compact {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
}
.post-card-compact:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.32);
}
.post-card-compact .card-inner {
  padding: 18px 18px 16px;
}
.post-card-compact .card-meta-top {
  margin-bottom: 8px;
}
.post-card-compact .card-title {
  font-size: 17px;
  margin-bottom: 8px;
  line-height: 1.36;
}
.post-card-compact .card-excerpt {
  font-size: 12px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.post-card-compact .card-category {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}
.post-card-compact .card-date {
  font-size: 12px;
}
.post-card-compact .card-footer {
  margin-top: 14px;
  padding-top: 12px;
}
.post-card-compact .card-readtime,
.post-card-compact .card-cta {
  font-size: 11px;
}

.pagination-area { text-align: center; margin-top: 8px; margin-bottom: 16px; }
.ssr-pagination-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.outline-btn {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--glass-border);
  color: var(--text-dark);
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), var(--shadow-sm);
}
.outline-btn:hover {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(15, 23, 42, 0.34);
  color: var(--accent);
  transform: translateY(-1px);
}
[data-theme="dark"] .outline-btn {
  background: rgba(15, 23, 42, 0.5);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .outline-btn:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(148, 163, 184, 0.45);
}

.archive-view {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 0 64px;
}

.archive-header { margin-bottom: 64px; text-align: center; }
.archive-page-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.archive-page-desc { color: var(--text-muted); font-size: 15px; }

.archive-year-group { margin-bottom: 48px; }
.archive-year {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 24px;
  position: relative;
  padding-left: 16px;
}
.archive-year::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--accent);
  border-radius: 4px;
}

.archive-items {
  list-style: none;
  padding-left: 16px;
  border-left: 1px dashed var(--border);
  margin-left: 18px;
}

.archive-item {
  display: flex;
  align-items: baseline;
  padding: 16px 0 16px 24px;
  position: relative;
  transition: all 0.2s;
}

.archive-item::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 24px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.archive-item:hover::before { background: var(--accent); }

.archive-date {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 14px;
  color: var(--text-muted);
  width: 64px;
  flex-shrink: 0;
}

.archive-title {
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.2s;
}
.archive-item:hover .archive-title { color: var(--accent); }

.post-view {
  max-width: var(--container);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.82));
  padding: 40px 60px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
[data-theme="dark"] .post-view {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.9));
}

.post-header { text-align: center; margin-bottom: 48px; }
.post-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  row-gap: 10px;
  font-family: var(--font-sans);
  flex-wrap: wrap;
  letter-spacing: 0.01em;
}

.meta-date,
.meta-category,
.meta-tags {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(248, 251, 255, 0.9);
  box-shadow: 0 6px 18px -16px rgba(15, 23, 42, 0.3);
  color: var(--text-dark);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.01em;
}

.meta-date {
  font-family: var(--font-sans);
  color: var(--text-muted);
}

.meta-category,
.meta-tags {
  font-weight: 600;
  color: var(--text-dark);
}

.meta-tags {
  max-width: min(72vw, 520px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-dot {
  display: none;
}

[data-theme="dark"] .meta-date,
[data-theme="dark"] .meta-category,
[data-theme="dark"] .meta-tags {
  border-color: rgba(100, 116, 139, 0.42);
  background: rgba(30, 41, 59, 0.82);
  box-shadow: 0 8px 20px -18px rgba(2, 6, 23, 0.9);
}

[data-theme="dark"] .meta-date {
  color: #9fb0c4;
}

[data-theme="dark"] .meta-category,
[data-theme="dark"] .meta-tags {
  color: #e2e8f0;
}

.post-title {
  font-family: var(--font-sans);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  line-height: 1.3;
}

.markdown-body { font-size: 16px; line-height: 1.7; color: var(--text); }
.markdown-body h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 2em 0 1em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}
.markdown-body h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 1.5em 0 0.8em;
}
.markdown-body p { margin-bottom: 1.5em; color: var(--text); }
.markdown-body ul, .markdown-body ol { margin-bottom: 1.5em; padding-left: 1.5em; color: var(--text); }
.markdown-body li { margin-bottom: 0.5em; }
.markdown-body blockquote {
  margin: 1.5em 0;
  padding: 12px 20px;
  background: var(--bg);
  border-left: 3px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: 0 4px 4px 0;
  font-size: 15px;
}
.markdown-body code {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--text-dark);
}
.markdown-body pre {
  background: rgba(255, 255, 255, 0.56);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}
.markdown-body pre code { background: none; border: none; color: var(--text-dark); padding: 0; }
[data-theme="dark"] .markdown-body pre {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: none;
}
[data-theme="dark"] .markdown-body pre code { color: #f8fafc; }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 1em 0; }
.about-view .markdown-body img,
#about-content img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
}
.markdown-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.markdown-body a:hover { border-bottom-color: var(--accent); }

.post-footer { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); text-align: center; }
.back-btn {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.back-btn .arrow { transition: transform 0.2s; }
.back-btn:hover { color: var(--text-dark); }
.back-btn:hover .arrow { transform: translateX(-4px); }

.bottom-sections { margin-top: var(--space-xl); }
.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.bottom-module {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 251, 255, 0.84) 100%);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}
[data-theme="dark"] .bottom-module {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.9));
}
.bottom-module:hover {
  transform: translateY(-3px);
  border-color: rgba(100, 116, 139, 0.4);
  box-shadow: var(--shadow-md);
}

.module-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.module-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.module-post-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.module-post-thumb {
  width: 56px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #e2e8f0;
}

.module-post-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.module-post-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.module-post-title:hover { color: var(--accent); }
.module-post-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'SF Mono', ui-monospace, monospace;
  white-space: nowrap;
  flex-shrink: 0;
}
.no-posts { color: var(--text-muted); font-style: italic; font-size: 14px; }

.popular-tags-bottom {
  margin-top: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .popular-tags-bottom {
  background: var(--surface);
  border-color: var(--border);
}

.tags-bottom-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tags-bottom-head h3 {
  font-size: 15px;
  color: var(--text-dark);
}

.tags-scroll-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.tags-bar-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.tags-bar-scroll::-webkit-scrollbar {
  display: none;
}

.tags-scroll-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.tags-scroll-fade-left {
  left: 36px;
  background: linear-gradient(90deg, rgba(247, 250, 253, 0.96) 0%, rgba(247, 250, 253, 0) 100%);
}

.tags-scroll-fade-right {
  right: 36px;
  background: linear-gradient(270deg, rgba(247, 250, 253, 0.96) 0%, rgba(247, 250, 253, 0) 100%);
}

[data-theme="dark"] .tags-scroll-fade-left {
  background: linear-gradient(90deg, rgba(18, 24, 35, 0.96) 0%, rgba(18, 24, 35, 0) 100%);
}

[data-theme="dark"] .tags-scroll-fade-right {
  background: linear-gradient(270deg, rgba(18, 24, 35, 0.96) 0%, rgba(18, 24, 35, 0) 100%);
}

.tag-bar-item {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-bar-item:hover {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  transform: translateY(-1px);
}

.tag-bar-item.active {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.92);
}

.tag-count { opacity: 0.75; font-size: 11px; }
.no-tags { color: var(--text-muted); font-size: 13px; font-style: italic; }

.site-footer {
  text-align: center;
  padding: 40px 0 32px;
  color: #b9c4d3;
  font-size: 13px;
  border-top: 1px solid #3b4654;
  background: #2f3742;
  position: relative;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="dark"] .site-footer {
  background: #2f3742;
  border-top-color: #3b4654;
}
.site-footer::before {
  content: none;
}
.admin-link { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.admin-link:hover { color: var(--accent); }

/* Micro polish pass: unify the shell, cards, reading surface and utility controls */
:root {
  --bg: #f4efe8;
  --bg-elevated: rgba(249, 244, 238, 0.88);
  --surface: #fcfaf7;
  --primary: #564b43;
  --primary-hover: #6e6056;
  --accent: #a87058;
  --text: #685e56;
  --text-dark: #443a33;
  --text-muted: #8e8176;
  --border: #ddd0c3;
  --glass: rgba(250, 246, 241, 0.78);
  --glass-border: rgba(194, 174, 156, 0.28);
  --canvas-edge: rgba(252, 248, 243, 0.94);
  --surface-strong: rgba(252, 249, 245, 0.96);
  --surface-soft: rgba(242, 235, 227, 0.88);
  --border-strong: rgba(203, 185, 168, 0.38);
  --accent-soft: rgba(168, 112, 88, 0.08);
  --shadow-sm: 0 8px 18px -18px rgba(92, 72, 58, 0.12);
  --shadow-md: 0 16px 34px -28px rgba(92, 72, 58, 0.14);
  --shadow-lg: 0 22px 48px -32px rgba(92, 72, 58, 0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg: #26211d;
  --bg-elevated: rgba(40, 34, 30, 0.88);
  --surface: #302a26;
  --primary: #f3e8db;
  --primary-hover: #fff2e5;
  --accent: #c38c72;
  --text: #d0c0b1;
  --text-dark: #f5ebe0;
  --text-muted: #b2a293;
  --border: #4d433c;
  --glass: rgba(48, 42, 38, 0.78);
  --glass-border: rgba(145, 124, 108, 0.2);
  --canvas-edge: rgba(48, 42, 38, 0.92);
  --surface-strong: rgba(48, 42, 38, 0.94);
  --surface-soft: rgba(63, 55, 49, 0.84);
  --border-strong: rgba(145, 124, 108, 0.24);
  --accent-soft: rgba(195, 140, 114, 0.12);
  --shadow-sm: 0 8px 18px -18px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 16px 34px -28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 22px 48px -32px rgba(0, 0, 0, 0.46);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)),
    radial-gradient(820px 420px at 50% -12%, rgba(255, 255, 255, 0.2), transparent 64%);
  opacity: 0.9;
  z-index: -1;
}

[data-theme="dark"] body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    radial-gradient(900px 520px at 50% -10%, rgba(148, 163, 184, 0.05), transparent 65%);
}

.site-header {
  background: rgba(251, 247, 242, 0.84);
  border-bottom: 1px solid rgba(214, 196, 178, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 26px -26px rgba(92, 72, 58, 0.16);
}

[data-theme="dark"] .site-header {
  background: rgba(40, 34, 30, 0.84);
  border-bottom-color: rgba(98, 84, 74, 0.72);
  box-shadow: 0 10px 26px -22px rgba(0, 0, 0, 0.44);
}

.site-header .site-branding h1,
.site-header .nav-item,
.site-header .icon-btn {
  color: var(--text-dark);
}

.site-header .site-desc {
  color: var(--text-muted);
}

.site-header .nav-item::after {
  background: linear-gradient(90deg, rgba(201, 143, 123, 0), rgba(201, 143, 123, 0.88), rgba(201, 143, 123, 0));
}

.site-header .search-box input {
  background: rgba(253, 250, 246, 0.9);
  border: 1px solid rgba(214, 196, 178, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 8px 18px -16px rgba(120, 95, 76, 0.14);
}

.site-header .search-box input:focus {
  border-color: rgba(201, 143, 123, 0.42);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 12px 26px -20px rgba(120, 95, 76, 0.18);
}

[data-theme="dark"] .site-header .search-box input {
  background: rgba(77, 64, 86, 0.54);
  border-color: rgba(207, 175, 197, 0.28);
}

[data-theme="dark"] .site-header .search-box input:focus {
  background: rgba(15, 23, 42, 0.76);
}

.icon-btn,
.outline-btn,
.clear-filter,
.back-btn,
.tag-bar-item,
.mobile-category-item {
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

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

.section-title,
.section-title-filtered,
.bottom-module,
.popular-tags-bottom,
.post-view,
.archive-view {
  position: relative;
}

.section-title-filtered,
.bottom-module,
.popular-tags-bottom {
  border-color: var(--border-strong);
}

.section-title-filtered {
  padding: 14px 16px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(250, 244, 236, 0.96), rgba(247, 243, 238, 0.92)),
    repeating-linear-gradient(
      135deg,
      rgba(201, 143, 123, 0.04) 0,
      rgba(201, 143, 123, 0.04) 10px,
      rgba(255, 255, 255, 0) 10px,
      rgba(255, 255, 255, 0) 24px
    );
  box-shadow: none;
}

.section-count {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--border-strong);
}

.clear-filter,
.outline-btn {
  background: rgba(255, 251, 248, 0.88);
  border-color: var(--border-strong);
  border-radius: 999px;
  box-shadow: none;
}

.outline-btn {
  padding: 11px 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.outline-btn:hover,
.clear-filter:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(201, 143, 123, 0.32);
  box-shadow: 0 18px 30px -24px rgba(120, 95, 76, 0.18);
}

.post-card {
  background:
    linear-gradient(180deg, rgba(253, 250, 246, 0.98), rgba(246, 239, 231, 0.92)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(244, 238, 231, 0.16));
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme="dark"] .post-card {
  background:
    linear-gradient(180deg, rgba(73, 60, 82, 0.92), rgba(58, 48, 66, 0.9)),
    linear-gradient(135deg, rgba(255, 180, 189, 0.04), rgba(184, 235, 214, 0.02));
  border-color: var(--border-strong);
  box-shadow: none;
}

.post-card::after {
  width: 180px;
  height: 140px;
  background: radial-gradient(circle at 100% 0%, rgba(222, 202, 183, 0.28) 0%, rgba(255, 255, 255, 0) 74%);
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 143, 123, 0.28);
  box-shadow: 0 14px 24px -24px rgba(92, 72, 58, 0.14);
}

.card-inner {
  padding: 24px 24px 20px;
}

.card-meta {
  margin-bottom: 12px;
  gap: 10px;
}

.card-category {
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border-color: rgba(168, 112, 88, 0.1);
  background: rgba(244, 238, 230, 0.94);
  color: var(--text-dark);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

[data-theme="dark"] .card-category {
  background: rgba(117, 88, 116, 0.56);
  border-color: rgba(207, 175, 197, 0.18);
}

.card-date {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.28;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.card-excerpt {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.card-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top-color: rgba(168, 112, 88, 0.08);
}

.card-readtime,
.card-cta {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-cta {
  color: var(--text-dark);
}

.post-card-featured-main .card-title {
  font-size: 38px;
  line-height: 1.08;
}

.post-card-featured-main .card-excerpt {
  font-size: 15px;
  max-width: 42ch;
}

.post-card-compact {
  border-radius: 10px;
}

.posts-grid-list {
  gap: 18px 22px;
}

.home-combo {
  gap: 18px;
}

.post-view {
  max-width: var(--container);
  background:
    linear-gradient(180deg, rgba(253, 250, 246, 0.96), rgba(245, 238, 230, 0.92)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(245, 239, 233, 0.18));
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 54px 58px;
  box-shadow: 0 18px 40px -40px rgba(92, 72, 58, 0.14);
}

[data-theme="dark"] .post-view {
  background:
    linear-gradient(180deg, rgba(58, 48, 66, 0.92), rgba(49, 40, 57, 0.86)),
    linear-gradient(135deg, rgba(255, 180, 189, 0.04), rgba(184, 235, 214, 0.02));
  border-color: var(--border-strong);
}

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

.post-meta {
  margin-bottom: 22px;
  gap: 10px;
}

.meta-date,
.meta-category,
.meta-tags {
  min-height: 36px;
  padding: 0 15px;
  border-color: var(--border-strong);
  background: rgba(249, 243, 237, 0.92);
}

.post-title {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1.14;
  letter-spacing: -0.03em;
  max-width: 14ch;
  margin: 0 auto;
}

.markdown-body {
  font-size: 18px;
  line-height: 1.95;
}

.markdown-body h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  margin-top: 2.4em;
  margin-bottom: 1.05em;
  border-bottom-color: rgba(168, 112, 88, 0.14);
}

.markdown-body h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-top: 1.9em;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body pre,
.markdown-body blockquote {
  margin-bottom: 1.6em;
}

.markdown-body blockquote {
  padding: 16px 20px;
  border-left-width: 3px;
  border-radius: 0 10px 10px 0;
  background: var(--surface-soft);
}

.markdown-body code {
  padding: 0.24em 0.5em;
  border-radius: 8px;
}

.markdown-body pre {
  border-radius: 16px;
  padding: 18px 20px;
}

.bottom-module {
  border-radius: 12px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(252, 249, 245, 0.96), rgba(246, 240, 233, 0.92));
  box-shadow: none;
}

.bottom-module:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px -22px rgba(92, 72, 58, 0.16);
}

.module-title {
  font-family: var(--font-serif);
  font-size: 19px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom-color: rgba(168, 112, 88, 0.12);
}

.popular-tags-bottom {
  border-radius: 16px !important;
  padding: 18px 18px 16px !important;
}

.tag-bar-item {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(250, 246, 241, 0.95);
  border-color: var(--border-strong);
  font-weight: 600;
}

.tag-bar-item:hover,
.tag-bar-item.active {
  background: #e4d3c4;
  border-color: #dcc7b6;
  color: #4f453e;
  box-shadow: 0 18px 28px -24px rgba(120, 95, 76, 0.18);
}

.site-footer {
  background:
    linear-gradient(180deg, rgba(245, 238, 230, 0.88), rgba(250, 246, 241, 0.96));
  border-top: 1px solid rgba(214, 196, 178, 0.68);
  color: var(--text-muted);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-theme="dark"] .site-footer {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(11, 15, 25, 0.96));
  border-top-color: rgba(51, 65, 85, 0.8);
  color: #9fb0c4;
}

.admin-link {
  color: var(--text-dark);
  font-weight: 600;
}

.module-post-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(203, 185, 168, 0.26);
}

.module-post-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.module-post-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.module-post-meta {
  margin-left: auto;
  font-size: 11px;
}

/* Paper background + restrained category navigation */
:root {
  --bg: #f7f3ee;
  --bg-elevated: rgba(252, 248, 243, 0.9);
  --glass: rgba(252, 248, 243, 0.82);
  --glass-border: rgba(203, 185, 168, 0.26);
  --canvas-edge: rgba(252, 248, 243, 0.96);
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0)),
    radial-gradient(760px 360px at 50% -14%, rgba(255, 255, 255, 0.14), transparent 62%);
}

.category-menu-bar {
  background: rgba(247, 243, 238, 0.92);
  border-top: 1px solid rgba(221, 208, 195, 0.72);
  border-bottom: 1px solid rgba(221, 208, 195, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px -18px rgba(92, 72, 58, 0.12);
}

[data-theme="dark"] .category-menu-bar {
  background: rgba(38, 33, 29, 0.92);
  border-top-color: rgba(77, 67, 60, 0.78);
  border-bottom-color: rgba(77, 67, 60, 0.92);
  box-shadow: 0 8px 18px -18px rgba(0, 0, 0, 0.32);
}

.category-menu-scroll {
  gap: 18px;
  min-height: 44px;
}

/* Category menu items styled by main rules and html[data-theme-style] */


/* Final lock: keep flat CMS styling and readability */
.post-view {
  max-width: var(--container) !important;
  padding: 48px 52px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.post-title {
  font-size: clamp(34px, 4vw, 42px) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  max-width: 18ch !important;
}

.markdown-body {
  font-size: 17px !important;
  line-height: 1.9 !important;
}

.section-title-category,
.card-category,
.featured-recommend-item-tag,
.meta-category,
.meta-tags {
  background: #edf2f6 !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.popular-tags-bottom {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.tag-bar-item {
  background: #eef3f7 !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.tag-bar-item:hover,
.tag-bar-item.active {
  background: #dde6ee !important;
  border-color: #c6d4e1 !important;
  color: var(--text-dark) !important;
  box-shadow: none !important;
}

.category-menu-bar {
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

/* Category menu items styled by main rules and html[data-theme-style] */

.mobile-category-btn {
  background: var(--surface) !important;
  color: var(--text-dark) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.mobile-category-btn:hover {
  background: #edf2f6 !important;
  border-color: #c6d4e1 !important;
}

.mobile-overlay {
  background: rgba(47, 58, 70, 0.2) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.mobile-menu-sheet {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .section-title-category,
[data-theme="dark"] .card-category,
[data-theme="dark"] .featured-recommend-item-tag,
[data-theme="dark"] .meta-category,
[data-theme="dark"] .meta-tags,
[data-theme="dark"] .tag-bar-item,
[data-theme="dark"] .mobile-category-btn {
  background: #202c38 !important;
  border-color: #324355 !important;
  color: #c7d5e2 !important;
}

[data-theme="dark"] .tag-bar-item:hover,
[data-theme="dark"] .tag-bar-item.active,
[data-theme="dark"] .mobile-category-btn:hover {
  background: #2a3949 !important;
  border-color: #42576d !important;
  color: #e5eef6 !important;
}

[data-theme="dark"] .category-menu-bar,
[data-theme="dark"] .popular-tags-bottom,
[data-theme="dark"] .post-view,
[data-theme="dark"] .mobile-menu-sheet {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  .post-view {
    max-width: none !important;
    padding: 30px 18px !important;
    border-radius: 10px !important;
  }

  .post-title {
    font-size: 30px !important;
    max-width: none !important;
  }

  .markdown-body {
    font-size: 16px !important;
    line-height: 1.8 !important;
  }

  .mobile-category-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
}

/* EOF lock: post article title only */
#post-view .post-header {
  text-align: center !important;
}

#post-view #post-title.post-title {
  font-family: var(--font-serif) !important;
  font-weight: 600 !important;
  font-size: clamp(22px, 2vw, 26px) !important;
  line-height: 1.38 !important;
  letter-spacing: -0.01em !important;
  max-width: none !important;
  margin: 0 auto !important;
}

@media (max-width: 768px) {
  #post-view #post-title.post-title {
    font-size: 24px !important;
    line-height: 1.36 !important;
    max-width: none !important;
  }
}

/* Post page title only (hard override): serif + smaller + centered */
#post-view .post-header {
  text-align: center !important;
}

#post-view #post-title.post-title {
  font-family: var(--font-serif) !important;
  font-weight: 600 !important;
  font-size: clamp(22px, 2vw, 26px) !important;
  line-height: 1.38 !important;
  letter-spacing: -0.01em !important;
  max-width: none !important;
  margin: 0 auto !important;
}

@media (max-width: 768px) {
  #post-view #post-title.post-title {
    font-size: 26px !important;
    line-height: 1.36 !important;
    max-width: none !important;
  }
}

/* Post page title only (hard override): serif + smaller + centered */
#post-view .post-header {
  text-align: center !important;
}

#post-view #post-title.post-title {
  font-family: var(--font-serif) !important;
  font-weight: 600 !important;
  font-size: clamp(22px, 2vw, 26px) !important;
  line-height: 1.38 !important;
  letter-spacing: -0.01em !important;
  max-width: none !important;
  margin: 0 auto !important;
}

@media (max-width: 768px) {
  #post-view #post-title.post-title {
    font-size: 26px !important;
    line-height: 1.36 !important;
    max-width: none !important;
  }
}

/* Final title style: serif + balanced + centered */
.post-header {
  text-align: center !important;
  padding-bottom: 28px !important;
  margin-bottom: 36px !important;
  border-bottom: 1px solid var(--border) !important;
}

.post-title {
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  font-size: clamp(26px, 2.4vw, 30px) !important;
  line-height: 1.36 !important;
  letter-spacing: -0.015em !important;
  max-width: none !important;
  margin: 0 auto !important;
  color: var(--text-dark) !important;
}

@media (max-width: 768px) {
  .post-title {
    font-size: 24px !important;
    line-height: 1.4 !important;
    max-width: none !important;
  }
}

/* Variant B: restrained CMS title style */
.post-header {
  text-align: left !important;
  margin-bottom: 36px !important;
}

.post-meta {
  margin-bottom: 18px !important;
  gap: 8px !important;
}

.meta-date,
.meta-category,
.meta-tags {
  min-height: 30px !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 999px !important;
  letter-spacing: 0.01em !important;
}

.post-title {
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  font-size: clamp(22px, 2vw, 26px) !important;
  line-height: 1.38 !important;
  letter-spacing: -0.01em !important;
  max-width: none !important;
  margin: 0 !important;
}

@media (max-width: 768px) {
  .post-header {
    margin-bottom: 26px !important;
  }

  .post-meta {
    margin-bottom: 14px !important;
    gap: 6px !important;
  }

  .meta-date,
  .meta-category,
  .meta-tags {
    min-height: 28px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
  }

  .post-title {
    font-size: 28px !important;
    line-height: 1.34 !important;
    max-width: none !important;
  }
}

/* Final override (must stay at file end): flat + readability */
.post-view {
  max-width: var(--container) !important;
  padding: 48px 52px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.post-title {
  font-size: clamp(22px, 2vw, 26px) !important;
  line-height: 1.38 !important;
  letter-spacing: -0.01em !important;
  max-width: none !important;
}

.markdown-body {
  font-size: 17px !important;
  line-height: 1.9 !important;
}

.section-title-category,
.card-category,
.featured-recommend-item-tag,
.meta-category,
.meta-tags {
  background: #edf2f6 !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.popular-tags-bottom {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.tag-bar-item {
  background: #eef3f7 !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.tag-bar-item:hover,
.tag-bar-item.active {
  background: #dde6ee !important;
  border-color: #c6d4e1 !important;
  color: var(--text-dark) !important;
  box-shadow: none !important;
}

.category-menu-bar {
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

/* Category menu items styled by main rules and html[data-theme-style] */

.mobile-category-btn {
  background: var(--surface) !important;
  color: var(--text-dark) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.mobile-category-btn:hover {
  background: #edf2f6 !important;
  border-color: #c6d4e1 !important;
}

.mobile-overlay {
  background: rgba(47, 58, 70, 0.2) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.mobile-menu-sheet {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .section-title-category,
[data-theme="dark"] .card-category,
[data-theme="dark"] .featured-recommend-item-tag,
[data-theme="dark"] .meta-category,
[data-theme="dark"] .meta-tags,
[data-theme="dark"] .tag-bar-item,
[data-theme="dark"] .mobile-category-btn {
  background: #202c38 !important;
  border-color: #324355 !important;
  color: #c7d5e2 !important;
}

[data-theme="dark"] .tag-bar-item:hover,
[data-theme="dark"] .tag-bar-item.active,
[data-theme="dark"] .mobile-category-btn:hover {
  background: #2a3949 !important;
  border-color: #42576d !important;
  color: #e5eef6 !important;
}

[data-theme="dark"] .category-menu-bar,
[data-theme="dark"] .popular-tags-bottom,
[data-theme="dark"] .post-view,
[data-theme="dark"] .mobile-menu-sheet {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  .post-view {
    max-width: none !important;
    padding: 30px 18px !important;
    border-radius: 10px !important;
  }

  .post-title {
    font-size: 30px !important;
    max-width: none !important;
  }

  .markdown-body {
    font-size: 16px !important;
    line-height: 1.8 !important;
  }

  .mobile-category-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
}

/* Final tuning: readable flat CMS layout */
.post-view {
  max-width: var(--container) !important;
  padding: 48px 52px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.post-title {
  font-size: clamp(22px, 2vw, 26px) !important;
  line-height: 1.38 !important;
  letter-spacing: -0.01em !important;
  max-width: none !important;
}

.markdown-body {
  font-size: 17px !important;
  line-height: 1.9 !important;
}

.section-title-category,
.card-category,
.featured-recommend-item-tag,
.meta-category,
.meta-tags {
  background: #edf2f6 !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.popular-tags-bottom {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.tag-bar-item {
  background: #eef3f7 !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.tag-bar-item:hover,
.tag-bar-item.active {
  background: #dde6ee !important;
  border-color: #c6d4e1 !important;
  color: var(--text-dark) !important;
  box-shadow: none !important;
}

.category-menu-bar {
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

/* Category menu items styled by main rules and html[data-theme-style] */

.mobile-category-btn {
  background: var(--surface) !important;
  color: var(--text-dark) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.mobile-category-btn:hover {
  background: #edf2f6 !important;
  border-color: #c6d4e1 !important;
}

.mobile-overlay {
  background: rgba(47, 58, 70, 0.2) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.mobile-menu-sheet {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .section-title-category,
[data-theme="dark"] .card-category,
[data-theme="dark"] .featured-recommend-item-tag,
[data-theme="dark"] .meta-category,
[data-theme="dark"] .meta-tags,
[data-theme="dark"] .tag-bar-item,
[data-theme="dark"] .mobile-category-btn {
  background: #202c38 !important;
  border-color: #324355 !important;
  color: #c7d5e2 !important;
}

[data-theme="dark"] .tag-bar-item:hover,
[data-theme="dark"] .tag-bar-item.active,
[data-theme="dark"] .mobile-category-btn:hover {
  background: #2a3949 !important;
  border-color: #42576d !important;
  color: #e5eef6 !important;
}

[data-theme="dark"] .category-menu-bar,
[data-theme="dark"] .popular-tags-bottom,
[data-theme="dark"] .post-view,
[data-theme="dark"] .mobile-menu-sheet {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  .post-view {
    max-width: none !important;
    padding: 30px 18px !important;
    border-radius: 10px !important;
  }

  .post-title {
    font-size: 30px !important;
    max-width: none !important;
  }

  .markdown-body {
    font-size: 16px !important;
    line-height: 1.8 !important;
  }

  .mobile-category-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
}

/* Full palette unification to remove warm remnants */
.site-header {
  background: rgba(244, 248, 252, 0.84);
  border-bottom-color: rgba(215, 225, 234, 0.72);
}

[data-theme="dark"] .site-header {
  background: rgba(19, 26, 33, 0.9);
  border-bottom-color: rgba(44, 59, 74, 0.78);
}

.post-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 252, 0.92)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(237, 244, 250, 0.16));
  border-color: rgba(168, 184, 198, 0.32);
}

[data-theme="dark"] .post-card {
  background:
    linear-gradient(180deg, rgba(30, 42, 55, 0.92), rgba(23, 33, 44, 0.9)),
    linear-gradient(135deg, rgba(132, 164, 194, 0.05), rgba(132, 164, 194, 0.02));
}

.post-card::after {
  background: radial-gradient(circle at 100% 0%, rgba(183, 202, 220, 0.3) 0%, rgba(255, 255, 255, 0) 74%);
}

.post-card:hover {
  border-color: rgba(95, 125, 154, 0.32);
  box-shadow: 0 14px 24px -24px rgba(31, 52, 71, 0.2);
}

.section-title-filtered {
  background:
    linear-gradient(135deg, rgba(243, 248, 252, 0.96), rgba(249, 252, 255, 0.92)),
    repeating-linear-gradient(
      135deg,
      rgba(95, 125, 154, 0.035) 0,
      rgba(95, 125, 154, 0.035) 10px,
      rgba(255, 255, 255, 0) 10px,
      rgba(255, 255, 255, 0) 24px
    );
}

.bottom-module {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 252, 0.92));
  border-color: rgba(168, 184, 198, 0.32);
}

.module-title {
  border-bottom-color: rgba(95, 125, 154, 0.12);
}

.module-post-item {
  border-bottom-color: rgba(168, 184, 198, 0.28);
}

.popular-tags-bottom {
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.96), rgba(243, 248, 252, 0.92));
  border-color: rgba(168, 184, 198, 0.32);
}

.tag-bar-item {
  background: rgba(246, 250, 253, 0.95);
  border-color: rgba(168, 184, 198, 0.32);
}

.tag-bar-item:hover,
.tag-bar-item.active {
  background: #dce7f2;
  border-color: #ccdced;
  color: #2f3a46;
  box-shadow: 0 18px 28px -24px rgba(31, 52, 71, 0.24);
}

.site-footer {
  background: linear-gradient(180deg, rgba(239, 246, 251, 0.88), rgba(247, 251, 255, 0.96));
  border-top-color: rgba(215, 225, 234, 0.68);
}

[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, rgba(19, 26, 33, 0.9), rgba(14, 20, 27, 0.96));
  border-top-color: rgba(44, 59, 74, 0.82);
  color: #a9bbcc;
}

[data-theme="dark"] .category-menu-item.active {
  border-bottom-color: #84a4c2;
}

/* Strict flat mode: remove gradients and elevation */
body,
[data-theme="dark"] body {
  background-image: none !important;
  background-color: var(--bg);
}

body::before {
  display: none !important;
}

.site-header,
.category-menu-bar,
.post-card,
.post-card-featured-main,
.post-card-featured-side,
.post-card-compact,
.featured-side-module,
.featured-recommend,
.bottom-module,
.popular-tags-bottom,
.post-view,
.section-title-filtered,
.tag-bar-item,
.outline-btn,
.clear-filter,
.search-box input {
  background-image: none !important;
  box-shadow: none !important;
}

.site-header {
  background-color: var(--bg-elevated) !important;
}

.category-menu-bar {
  background-color: color-mix(in srgb, var(--bg) 88%, var(--surface) 12%) !important;
}

.post-card,
.post-card-featured-main,
.post-card-featured-side,
.post-card-compact,
.bottom-module,
.popular-tags-bottom,
.post-view {
  background-color: var(--surface) !important;
}

.post-card::after,
.post-card::before {
  display: none !important;
}

@media (max-width: 768px) {
  .header-inner {
    height: 64px;
    gap: 12px;
  }
  .site-branding,
  #theme-toggle,
  .mobile-breadcrumb-bar {
    display: none !important;
  }
  .site-nav {
    width: 100%;
    gap: 10px;
    justify-content: space-between;
  }
  .mobile-nav-links {
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .nav-item {
    font-size: 13px;
    padding-bottom: 2px;
    white-space: nowrap;
  }
  .site-header .nav-item::after {
    bottom: -5px;
  }
  .category-menu-bar { display: none; }
  .mobile-overlay {
    top: 64px;
    height: calc(100vh - 64px);
  }
  .mobile-menu-sheet {
    max-height: calc(100vh - 96px);
  }
  .post-view {
    padding: 36px 22px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
  }
  .post-title { font-size: 34px; max-width: none; }
  .home-combo {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .featured-main-row {
    grid-column: auto;
  }
  .featured-top-side {
    grid-column: auto;
    display: none;
  }
  .posts-grid-list { grid-template-columns: 1fr; }
  .section-title,
  .section-title-filtered {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  #grid-title-container.section-title-filtered {
    display: none !important;
  }
  .section-title .line {
    display: none;
  }
  .section-count {
    order: 3;
  }
  .post-card-featured-main .card-title { font-size: 30px; }
  .featured-main-row .post-card-featured-main,
  .featured-top-side .post-card-featured-side,
  .featured-top-side .featured-side-module {
    min-height: 200px;
    height: 200px;
    max-height: 200px;
  }
  .featured-main-row .post-card-featured-main {
    height: 200px;
    max-height: 200px;
  }
  .post-card-featured-side {
    min-height: 180px;
  }
  .featured-recommend {
    min-height: 200px;
    height: 200px;
    max-height: 200px;
  }
  .featured-recommend-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    column-gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .featured-recommend-item::before { left: 28px; }
  .featured-recommend-item-index { font-size: 13px; }
  .featured-recommend-item-title {
    font-size: 12px;
  }
  .featured-recommend-item-date {
    font-size: 9px;
    padding-left: 6px;
  }
  .post-card-featured-main .card-excerpt {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .card-inner { padding: 20px; }
  .search-box input {
    width: 118px;
    min-width: 0;
    padding: 7px 10px;
    font-size: 12px;
  }
  .search-box input:focus { width: 132px; }
  .hidden-mobile { display: none !important; }
  .mobile-only {
    display: flex !important;
    align-items: center;
  }
  .back-to-top-btn { bottom: 20px; right: 20px; }
  .bottom-sections { padding: 40px 0; margin-top: 32px; }
  .bottom-grid { grid-template-columns: 1fr; gap: 24px; }
  .bottom-module { padding: 20px; }
  .tags-bar-scroll {
    padding: 4px 0;
  }
  .tags-scroll-fade {
    display: none !important;
  }
  .site-main {
    padding-top: 22px;
  }
}

/* Palette override: Mist Blue Gray */
:root {
  --bg: #f2f5f8;
  --bg-elevated: rgba(246, 249, 252, 0.9);
  --surface: #ffffff;
  --primary: #2f3a46;
  --primary-hover: #425363;
  --accent: #5f7d9a;
  --text: #3f4b57;
  --text-dark: #2f3a46;
  --text-muted: #6b7a88;
  --border: #d7e1ea;
}

[data-theme="dark"] {
  --bg: #131a21;
  --bg-elevated: rgba(22, 31, 40, 0.9);
  --surface: #1a2430;
  --primary: #e4edf5;
  --primary-hover: #f4f8fc;
  --accent: #84a4c2;
  --text: #c4d2df;
  --text-dark: #e7eef6;
  --text-muted: #97a9bc;
  --border: #2c3b4a;
}

body::before {
  display: none;
}

/* Flat lock */
.post-view,
.popular-tags-bottom,
.category-menu-bar,
.mobile-menu-sheet {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.post-view {
  max-width: var(--container) !important;
  padding: 48px 52px !important;
}

.section-title-category,
.card-category,
.featured-recommend-item-tag,
.meta-category,
.meta-tags,
.tag-bar-item,
.mobile-category-btn {
  background: #edf2f6 !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

/* Category menu items styled by html[data-theme-style] rules */


/* Article title �?final rule */
#post-view .post-header {
  text-align: center !important;
  padding-bottom: 28px !important;
  margin-bottom: 36px !important;
  border-bottom: 1px solid var(--border) !important;
}

#post-view #post-title.post-title {
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  font-size: clamp(26px, 2.4vw, 30px) !important;
  line-height: 1.36 !important;
  letter-spacing: -0.015em !important;
  max-width: none !important;
  margin: 0 auto !important;
  color: var(--text-dark) !important;
}

@media (max-width: 768px) {
  .post-view {
    max-width: none !important;
    padding: 30px 18px !important;
    border-radius: 10px !important;
  }

  #post-view #post-title.post-title {
    font-size: 24px !important;
    line-height: 1.4 !important;
    max-width: none !important;
  }
}

/* --- UNIFIED COMPONENT BACKGROUNDS --- */
.outline-btn,
.search-box input,
.markdown-body pre,
.meta-date,
.meta-category,
.meta-tags,
.card-category,
.section-title-category,
.featured-recommend-item-tag,
.tag-bar-item,
.mobile-category-btn,
.markdown-body blockquote {
  background: rgba(255, 255, 255, 0.56) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68) !important;
}

.outline-btn,
.search-box input,
.markdown-body pre {
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: var(--text-dark) !important;
}

[data-theme='dark'] .outline-btn,
[data-theme='dark'] .search-box input,
[data-theme='dark'] .markdown-body pre,
[data-theme='dark'] .meta-date,
[data-theme='dark'] .meta-category,
[data-theme='dark'] .meta-tags,
[data-theme='dark'] .card-category,
[data-theme='dark'] .section-title-category,
[data-theme='dark'] .featured-recommend-item-tag,
[data-theme='dark'] .tag-bar-item,
[data-theme='dark'] .mobile-category-btn,
[data-theme='dark'] .markdown-body blockquote {
  background: rgba(15, 23, 42, 0.5) !important;
  box-shadow: none !important;
}

[data-theme='dark'] .outline-btn,
[data-theme='dark'] .search-box input,
[data-theme='dark'] .markdown-body pre {
  border: 1px solid rgba(148, 163, 184, 0.45) !important;
  color: #f8fafc !important;
}

.markdown-body pre code {
  color: inherit !important;
}

.outline-btn:hover,
.search-box input:focus {
  background: rgba(255, 255, 255, 0.76) !important;
  border-color: rgba(15, 23, 42, 0.34) !important;
}

[data-theme='dark'] .outline-btn:hover,
[data-theme='dark'] .search-box input:focus {
  background: rgba(30, 41, 59, 0.7) !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
}

/* Final guard: keep the homepage category bar visible on desktop. */
.category-menu-bar {
  display: block !important;
}

.category-menu-bar .container {
  display: block;
}

.category-menu-scroll {
  display: flex !important;
  align-items: center;
  min-height: 44px;
}

@media (max-width: 768px) {
  .category-menu-bar {
    display: none !important;
  }
}

/* Final guard: keep bottom article modules from overflowing. */
.bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
}

.bottom-module,
.module-content,
.module-post-item,
.module-post-title {
  min-width: 0;
}

.module-post-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center;
  gap: 12px;
}

.module-post-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.module-post-meta {
  margin-left: 0 !important;
  white-space: nowrap;
  justify-self: end;
}

@media (max-width: 768px) {
  .bottom-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ============================================================
   WARM EDITION �?Full style overhaul
   All suggestions applied with a terracotta / amber accent
   ============================================================ */

/* 1. Color tokens �?warm palette */
:root {
  --bg: #faf6f1;
  --bg-elevated: rgba(252, 248, 243, 0.92);
  --surface: #ffffff;
  --primary: #3d2e27;
  --primary-hover: #56403a;
  --accent: #c0623a;          /* terracotta warm accent */
  --accent-hover: #a64e2c;
  --accent-muted: rgba(192, 98, 58, 0.10);
  --text: #5a4840;
  --text-dark: #2e211a;
  --text-muted: #9a8478;
  --border: #e2d3c7;
  --border-strong: rgba(192, 150, 120, 0.34);
  --glass: rgba(252, 248, 243, 0.82);
  --glass-border: rgba(192, 150, 120, 0.24);
  --shadow-sm: 0 6px 16px -14px rgba(92, 60, 44, 0.18);
  --shadow-md: 0 14px 32px -24px rgba(92, 60, 44, 0.22);
  --shadow-lg: 0 22px 50px -32px rgba(92, 60, 44, 0.28);
}

[data-theme="dark"] {
  --bg: #201610;
  --bg-elevated: rgba(36, 26, 20, 0.92);
  --surface: #2e1f18;
  --primary: #f5e8db;
  --primary-hover: #fff2e5;
  --accent: #e08060;          /* lighter terracotta for dark */
  --accent-hover: #c8684a;
  --accent-muted: rgba(224, 128, 96, 0.14);
  --text: #d4b9a8;
  --text-dark: #f5ebe0;
  --text-muted: #b4957e;
  --border: #4a342a;
  --border-strong: rgba(148, 100, 75, 0.28);
  --glass: rgba(46, 31, 24, 0.82);
  --glass-border: rgba(148, 100, 75, 0.22);
  --shadow-sm: 0 6px 16px -14px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 14px 32px -24px rgba(0, 0, 0, 0.52);
  --shadow-lg: 0 22px 50px -32px rgba(0, 0, 0, 0.58);
}

/* 2. Progress bar �?warm gradient */
.progress-bar {
  background: linear-gradient(90deg, #c0623a, #e0a060, #c0623a) !important;
  background-size: 200% 100% !important;
}

/* 3. Site header �?warm glass */
.site-header {
  background: rgba(252, 248, 243, 0.86) !important;
  border-bottom: 1px solid rgba(210, 180, 155, 0.6) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
  box-shadow: 0 8px 22px -22px rgba(92, 60, 44, 0.14) !important;
}
[data-theme="dark"] .site-header {
  background: rgba(36, 26, 20, 0.88) !important;
  border-bottom-color: rgba(100, 68, 50, 0.6) !important;
}
.site-header .site-branding h1,
.site-header .nav-item,
.site-header .icon-btn {
  color: var(--text-dark) !important;
}
.site-header .site-desc { color: var(--text-muted) !important; }
.site-header .nav-item::after {
  background: linear-gradient(90deg, rgba(192, 98, 58, 0), rgba(192, 98, 58, 0.82), rgba(192, 98, 58, 0)) !important;
}
.site-header .search-box input {
  background: rgba(255, 252, 248, 0.9) !important;
  border: 1px solid rgba(210, 180, 155, 0.6) !important;
}
.site-header .search-box input:focus {
  border-color: rgba(192, 98, 58, 0.38) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}
[data-theme="dark"] .site-header .search-box input {
  background: rgba(46, 31, 24, 0.66) !important;
  border-color: rgba(148, 100, 75, 0.38) !important;
}

/* 4. Background */
body,
[data-theme="dark"] body {
  background-image: none !important;
  background-color: var(--bg) !important;
}
body::before { display: none !important; }

/* 5. Category menu bar �?warm tone */
.category-menu-bar {
  background: rgba(252, 248, 243, 0.94) !important;
  border-top: 1px solid rgba(210, 180, 155, 0.6) !important;
  border-bottom: 1px solid rgba(210, 180, 155, 0.6) !important;
  box-shadow: none !important;
  display: block !important;
}
.category-menu-bar .container { display: block !important; }
.category-menu-scroll {
  display: flex !important;
  align-items: center !important;
  min-height: 44px !important;
}
[data-theme="dark"] .category-menu-bar {
  background: rgba(36, 26, 20, 0.94) !important;
  border-top-color: rgba(100, 68, 50, 0.66) !important;
  border-bottom-color: rgba(100, 68, 50, 0.66) !important;
}
/* Category menu items already styled by html[data-theme-style] rules above */
@media (max-width: 768px) {
  .category-menu-bar { display: none !important; }
}

/* 6. Post cards �?warm flat */
.post-card,
.post-card-featured-main,
.post-card-featured-side,
.post-card-compact {
  background: var(--surface) !important;
  background-image: none !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
.post-card::before,
.post-card::after { display: none !important; }

.post-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(192, 98, 58, 0.32) !important;
  box-shadow: 0 16px 32px -24px rgba(92, 60, 44, 0.2) !important;
}
.post-card-compact:hover { transform: translateY(-2px) !important; }

/* 6b. CTA arrow �?smooth slide on hover */
.card-cta { color: var(--accent) !important; }
.card-cta-arrow { transition: transform 0.26s ease !important; }
.post-card:hover .card-cta-arrow {
  animation: warm-slide-right 0.6s ease infinite alternate !important;
}
@keyframes warm-slide-right {
  from { transform: translateX(0); }
  to   { transform: translateX(5px); }
}

/* 7. Tags & categories �?warm pill style */
.section-title-category,
.card-category,
.featured-recommend-item-tag,
.meta-category,
.meta-tags,
.tag-bar-item,
.mobile-category-btn {
  background: rgba(240, 226, 212, 0.72) !important;
  color: var(--text-dark) !important;
  border: 1px solid rgba(192, 150, 120, 0.28) !important;
  box-shadow: none !important;
}
.tag-bar-item:hover,
.tag-bar-item.active {
  background: rgba(192, 98, 58, 0.14) !important;
  border-color: rgba(192, 98, 58, 0.36) !important;
  color: var(--accent) !important;
}
[data-theme="dark"] .section-title-category,
[data-theme="dark"] .card-category,
[data-theme="dark"] .featured-recommend-item-tag,
[data-theme="dark"] .meta-category,
[data-theme="dark"] .meta-tags,
[data-theme="dark"] .tag-bar-item,
[data-theme="dark"] .mobile-category-btn {
  background: rgba(70, 44, 32, 0.72) !important;
  border-color: rgba(148, 100, 75, 0.3) !important;
  color: var(--text) !important;
}
[data-theme="dark"] .tag-bar-item:hover,
[data-theme="dark"] .tag-bar-item.active {
  background: rgba(224, 128, 96, 0.16) !important;
  border-color: rgba(224, 128, 96, 0.38) !important;
  color: var(--accent) !important;
}

/* 8. Mobile menu */
.mobile-category-btn {
  background: var(--surface) !important;
  color: var(--text-dark) !important;
  border: 1px solid var(--border) !important;
}
.mobile-category-btn:hover {
  background: rgba(240, 226, 212, 0.72) !important;
  border-color: rgba(192, 98, 58, 0.3) !important;
}
.mobile-overlay {
  background: rgba(80, 50, 36, 0.18) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.mobile-menu-sheet {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
[data-theme="dark"] .mobile-menu-sheet {
  background: var(--surface) !important;
}

/* 9. Post view – content width limited for readability */
.post-view {
  max-width: var(--container) !important;
  padding: 48px 56px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
[data-theme="dark"] .post-view {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
@media (max-width: 768px) {
  .post-view {
    max-width: none !important;
    padding: 30px 18px !important;
    border-radius: 10px !important;
  }
}

/* 9b. Reading content max-width for comfortable line length */
.markdown-body {
  font-size: 17px !important;
  line-height: 1.9 !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 10. Markdown blockquote �?styled with warm accent */
.markdown-body blockquote {
  background: rgba(240, 226, 212, 0.42) !important;
  border-left: 3px solid var(--accent) !important;
  border-radius: 0 10px 10px 0 !important;
  padding: 14px 20px !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
[data-theme="dark"] .markdown-body blockquote {
  background: rgba(70, 44, 32, 0.5) !important;
  border-left-color: var(--accent) !important;
}

/* 10b. Markdown links �?accent color */
.markdown-body a {
  color: var(--accent) !important;
  border-bottom: 1px solid transparent !important;
  transition: border-color 0.2s !important;
}
.markdown-body a:hover { border-bottom-color: var(--accent) !important; }

/* 11. Code blocks �?warm-tinted */
.markdown-body pre {
  background: rgba(250, 244, 237, 0.8) !important;
  border: 1px solid rgba(210, 180, 155, 0.4) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
[data-theme="dark"] .markdown-body pre {
  background: rgba(36, 22, 16, 0.7) !important;
  border-color: rgba(100, 68, 50, 0.36) !important;
}
.markdown-body pre code { color: inherit !important; }

/* 12. Archive accent marks */
.archive-year::before { background: var(--accent) !important; }
.archive-item:hover::before { background: var(--accent) !important; }
.archive-item:hover .archive-title { color: var(--accent) !important; }

/* 13. Bottom modules */
.bottom-module,
.popular-tags-bottom {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
.bottom-module:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 24px -20px rgba(92, 60, 44, 0.16) !important;
  border-color: rgba(192, 98, 58, 0.26) !important;
}
.module-title { border-bottom-color: rgba(192, 98, 58, 0.12) !important; }
.module-post-title:hover { color: var(--accent) !important; }

/* 14. Buttons */
.outline-btn,
.clear-filter {
  background: rgba(255, 252, 249, 0.9) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  color: var(--text-dark) !important;
}
.outline-btn:hover,
.clear-filter:hover {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(192, 98, 58, 0.3) !important;
  color: var(--accent) !important;
}
.search-box input {
  background: rgba(255, 252, 248, 0.88) !important;
  border: 1px solid rgba(210, 180, 155, 0.5) !important;
  box-shadow: none !important;
}
.search-box input:focus {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(192, 98, 58, 0.36) !important;
}
[data-theme="dark"] .search-box input {
  background: rgba(46, 31, 24, 0.6) !important;
  border-color: rgba(148, 100, 75, 0.36) !important;
}
[data-theme="dark"] .search-box input:focus {
  background: rgba(60, 40, 30, 0.8) !important;
  border-color: rgba(192, 98, 58, 0.4) !important;
}

/* 15. Site footer �?Single Line Minimal Design */
.site-footer {
  background: var(--bg) !important;
  border-top: 1px solid var(--border) !important;
  padding: 20px 0 !important;
  color: var(--text-muted) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-theme="dark"] .site-footer {
  background: var(--bg) !important;
  border-top-color: var(--border) !important;
  color: var(--text-muted) !important;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}

.footer-copyright {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.footer-separator {
  color: var(--text-muted);
  user-select: none;
  font-weight: 300;
  opacity: 0.4;
  margin: 0 2px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.01em;
  padding: 4px 8px;
  border-radius: 5px;
  position: relative;
}

.footer-link:hover {
  color: var(--accent);
  background: rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .footer-link:hover {
  background: rgba(148, 163, 184, 0.12);
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.footer-link:hover::after {
  transform: scaleX(1);
}

.footer-powered {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

/* 15b. Footer inner decoration */
.site-footer::after {
  content: none !important;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 18px 0 !important;
  }
  
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  
  .footer-left {
    font-size: 11px;
    gap: 8px;
    justify-content: center;
  }
  
  .footer-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
  }
  
  .footer-link {
    font-size: 11px;
    padding: 4px 7px;
  }
  
  .footer-link::after {
    left: 7px;
    right: 7px;
  }
}

/* 16. Post title */
#post-view .post-header {
  text-align: left !important;
  padding-bottom: 24px !important;
  margin-bottom: 32px !important;
  border-bottom: 1px solid var(--border) !important;
}
#post-view #post-title.post-title {
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  font-size: clamp(24px, 2.5vw, 30px) !important;
  line-height: 1.38 !important;
  letter-spacing: -0.015em !important;
  max-width: none !important;
  margin: 0 !important;
  color: var(--text-dark) !important;
}
.post-meta {
  margin-bottom: 18px !important;
  gap: 8px !important;
}
.meta-date,
.meta-category,
.meta-tags {
  min-height: 30px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 999px !important;
}
[data-theme="dark"] .meta-date { color: var(--text-muted) !important; }

/* 17. Mobile search input in header */
@media (max-width: 768px) {
  .search-box input {
    width: 112px !important;
    font-size: 12px !important;
  }
  .search-box input:focus { width: 138px !important; }

  #post-view #post-title.post-title {
    font-size: 24px !important;
    line-height: 1.4 !important;
  }
  .markdown-body {
    max-width: none !important;
  }
  .post-view {
    padding: 30px 18px !important;
  }
}

/* 18. Section filter bar */
.section-title-filtered {
  background:
    linear-gradient(135deg, rgba(250, 244, 236, 0.96), rgba(247, 243, 238, 0.92)) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

/* 19. Back-to-top button warm accent on hover */
.back-to-top-btn:hover {
  border-color: rgba(192, 98, 58, 0.3) !important;
  color: var(--accent) !important;
}

/* ============================================================
   Strictly keep desktop category bar visible
   ============================================================ */
@media (min-width: 769px) {
  .category-menu-bar { display: block !important; }
  .category-menu-scroll { display: flex !important; }
}

/* ============================================================
   Theme Style Presets
   ============================================================ */
html[data-theme-style="warm-clay"] {
  --bg: #faf6f1;
  --bg-elevated: rgba(252, 248, 243, 0.92);
  --surface: #ffffff;
  --primary: #3d2e27;
  --primary-hover: #56403a;
  --accent: #c0623a;
  --text: #5b4b43;
  --text-dark: #2f221b;
  --text-muted: #9a8478;
  --border: #e2d3c7;
  --theme-header-bg: rgba(252, 248, 243, 0.86);
  --theme-header-border: rgba(210, 188, 174, 0.7);
  --theme-header-strong: #2f221b;
  --theme-header-muted: #9a8478;
  --theme-field-bg: rgba(255, 252, 248, 0.88);
  --theme-field-focus-bg: rgba(255, 255, 255, 0.96);
  --theme-field-border: rgba(210, 180, 155, 0.5);
  --theme-pill-bg: rgba(240, 226, 212, 0.72);
  --theme-pill-hover-bg: rgba(192, 98, 58, 0.14);
  --theme-blockquote-bg: rgba(240, 226, 212, 0.42);
  --theme-code-bg: rgba(250, 244, 237, 0.8);
  --theme-panel-bg: rgba(250, 244, 236, 0.96);
  --theme-panel-bg-2: rgba(247, 243, 238, 0.92);
  --theme-progress-mid: #e0a060;
}
html[data-theme-style="warm-clay"][data-theme="dark"] {
  --bg: #201610;
  --bg-elevated: rgba(36, 26, 20, 0.92);
  --surface: #2e1f18;
  --primary: #f5e8db;
  --primary-hover: #fff2e5;
  --accent: #e08060;
  --text: #d8c5b8;
  --text-dark: #f5ebe0;
  --text-muted: #b89f91;
  --border: #644432;
  --theme-header-bg: rgba(36, 26, 20, 0.88);
  --theme-header-border: rgba(100, 68, 50, 0.72);
  --theme-header-strong: #f5ebe0;
  --theme-header-muted: #c7b4a7;
  --theme-field-bg: rgba(46, 31, 24, 0.6);
  --theme-field-focus-bg: rgba(60, 40, 30, 0.8);
  --theme-field-border: rgba(148, 100, 75, 0.36);
  --theme-pill-bg: rgba(70, 44, 32, 0.72);
  --theme-pill-hover-bg: rgba(224, 128, 96, 0.16);
  --theme-blockquote-bg: rgba(70, 44, 32, 0.5);
  --theme-code-bg: rgba(36, 22, 16, 0.7);
  --theme-panel-bg: rgba(54, 38, 30, 0.96);
  --theme-panel-bg-2: rgba(43, 30, 24, 0.92);
  --theme-progress-mid: #f0a56c;
}

html[data-theme-style="mist-blue"] {
  --bg: #f2f5f8;
  --bg-elevated: rgba(246, 249, 252, 0.9);
  --surface: #ffffff;
  --primary: #2f3a46;
  --primary-hover: #425363;
  --accent: #5f7d9a;
  --text: #556575;
  --text-dark: #24313d;
  --text-muted: #7d90a3;
  --border: #d8e2eb;
  --theme-header-bg: rgba(244, 248, 252, 0.84);
  --theme-header-border: rgba(194, 207, 219, 0.72);
  --theme-header-strong: #24313d;
  --theme-header-muted: #7d90a3;
  --theme-field-bg: rgba(255, 255, 255, 0.9);
  --theme-field-focus-bg: rgba(255, 255, 255, 0.98);
  --theme-field-border: rgba(191, 204, 217, 0.62);
  --theme-pill-bg: rgba(237, 242, 246, 0.92);
  --theme-pill-hover-bg: rgba(95, 125, 154, 0.12);
  --theme-blockquote-bg: rgba(224, 233, 242, 0.46);
  --theme-code-bg: rgba(240, 245, 249, 0.9);
  --theme-panel-bg: rgba(241, 246, 251, 0.96);
  --theme-panel-bg-2: rgba(247, 251, 255, 0.92);
  --theme-progress-mid: #8da7c2;
}
html[data-theme-style="mist-blue"][data-theme="dark"] {
  --bg: #131a21;
  --bg-elevated: rgba(22, 31, 40, 0.9);
  --surface: #1a2430;
  --primary: #e4edf5;
  --primary-hover: #f4f8fc;
  --accent: #84a4c2;
  --text: #b2c0cd;
  --text-dark: #eef5fb;
  --text-muted: #91a4b7;
  --border: #324252;
  --theme-header-bg: rgba(19, 26, 33, 0.9);
  --theme-header-border: rgba(50, 66, 82, 0.76);
  --theme-header-strong: #eef5fb;
  --theme-header-muted: #91a4b7;
  --theme-field-bg: rgba(25, 36, 48, 0.72);
  --theme-field-focus-bg: rgba(35, 47, 60, 0.86);
  --theme-field-border: rgba(80, 104, 126, 0.44);
  --theme-pill-bg: rgba(32, 44, 56, 0.82);
  --theme-pill-hover-bg: rgba(132, 164, 194, 0.18);
  --theme-blockquote-bg: rgba(34, 46, 58, 0.66);
  --theme-code-bg: rgba(20, 29, 38, 0.82);
  --theme-panel-bg: rgba(27, 37, 48, 0.96);
  --theme-panel-bg-2: rgba(22, 30, 40, 0.92);
  --theme-progress-mid: #a6c0da;
}

html[data-theme-style="gray-paper"] {
  --bg: #f6f6f4;
  --bg-elevated: rgba(251, 251, 249, 0.92);
  --surface: #ffffff;
  --primary: #2e3135;
  --primary-hover: #43484e;
  --accent: #6b7280;
  --text: #575e66;
  --text-dark: #252a30;
  --text-muted: #858c95;
  --border: #dddfe3;
  --theme-header-bg: rgba(249, 250, 248, 0.9);
  --theme-header-border: rgba(213, 217, 222, 0.76);
  --theme-header-strong: #252a30;
  --theme-header-muted: #858c95;
  --theme-field-bg: rgba(255, 255, 255, 0.92);
  --theme-field-focus-bg: rgba(255, 255, 255, 0.98);
  --theme-field-border: rgba(200, 205, 212, 0.68);
  --theme-pill-bg: rgba(239, 241, 243, 0.94);
  --theme-pill-hover-bg: rgba(107, 114, 128, 0.12);
  --theme-blockquote-bg: rgba(237, 239, 242, 0.58);
  --theme-code-bg: rgba(243, 245, 247, 0.92);
  --theme-panel-bg: rgba(245, 247, 249, 0.98);
  --theme-panel-bg-2: rgba(250, 251, 252, 0.94);
  --theme-progress-mid: #9aa3ad;
}
html[data-theme-style="gray-paper"][data-theme="dark"] {
  --bg: #16181b;
  --bg-elevated: rgba(26, 29, 33, 0.92);
  --surface: #20242a;
  --primary: #eef1f4;
  --primary-hover: #ffffff;
  --accent: #b0b7c1;
  --text: #c3c9d1;
  --text-dark: #f4f7fa;
  --text-muted: #9ba3ad;
  --border: #3a4048;
  --theme-header-bg: rgba(22, 24, 27, 0.92);
  --theme-header-border: rgba(58, 64, 72, 0.78);
  --theme-header-strong: #f4f7fa;
  --theme-header-muted: #a7afb8;
  --theme-field-bg: rgba(33, 37, 43, 0.82);
  --theme-field-focus-bg: rgba(42, 47, 54, 0.9);
  --theme-field-border: rgba(100, 108, 118, 0.44);
  --theme-pill-bg: rgba(43, 48, 55, 0.84);
  --theme-pill-hover-bg: rgba(176, 183, 193, 0.16);
  --theme-blockquote-bg: rgba(42, 46, 53, 0.66);
  --theme-code-bg: rgba(24, 27, 31, 0.84);
  --theme-panel-bg: rgba(29, 33, 38, 0.96);
  --theme-panel-bg-2: rgba(24, 27, 31, 0.94);
  --theme-progress-mid: #c1c7cf;
}

html[data-theme-style="forest-journal"] {
  --bg: #f3f6f1;
  --bg-elevated: rgba(247, 250, 245, 0.92);
  --surface: #ffffff;
  --primary: #25372d;
  --primary-hover: #355042;
  --accent: #5f7f63;
  --text: #536559;
  --text-dark: #203027;
  --text-muted: #7f9483;
  --border: #d7e1d5;
  --theme-header-bg: rgba(245, 249, 243, 0.88);
  --theme-header-border: rgba(198, 212, 196, 0.76);
  --theme-header-strong: #203027;
  --theme-header-muted: #7f9483;
  --theme-field-bg: rgba(252, 255, 251, 0.92);
  --theme-field-focus-bg: rgba(255, 255, 255, 0.98);
  --theme-field-border: rgba(184, 199, 183, 0.66);
  --theme-pill-bg: rgba(232, 239, 231, 0.92);
  --theme-pill-hover-bg: rgba(95, 127, 99, 0.14);
  --theme-blockquote-bg: rgba(227, 237, 227, 0.56);
  --theme-code-bg: rgba(240, 246, 239, 0.92);
  --theme-panel-bg: rgba(241, 247, 240, 0.98);
  --theme-panel-bg-2: rgba(248, 251, 247, 0.94);
  --theme-progress-mid: #8fa892;
}
html[data-theme-style="forest-journal"][data-theme="dark"] {
  --bg: #142019;
  --bg-elevated: rgba(22, 35, 28, 0.92);
  --surface: #1b2b22;
  --primary: #e5efe7;
  --primary-hover: #f5fbf6;
  --accent: #8eb394;
  --text: #bfd0c2;
  --text-dark: #edf6ef;
  --text-muted: #9db4a2;
  --border: #34503d;
  --theme-header-bg: rgba(20, 32, 25, 0.92);
  --theme-header-border: rgba(52, 80, 61, 0.78);
  --theme-header-strong: #edf6ef;
  --theme-header-muted: #9db4a2;
  --theme-field-bg: rgba(29, 45, 36, 0.82);
  --theme-field-focus-bg: rgba(36, 55, 44, 0.9);
  --theme-field-border: rgba(88, 122, 97, 0.44);
  --theme-pill-bg: rgba(36, 57, 45, 0.84);
  --theme-pill-hover-bg: rgba(142, 179, 148, 0.16);
  --theme-blockquote-bg: rgba(35, 54, 43, 0.7);
  --theme-code-bg: rgba(18, 29, 23, 0.84);
  --theme-panel-bg: rgba(28, 43, 34, 0.96);
  --theme-panel-bg-2: rgba(22, 34, 27, 0.94);
  --theme-progress-mid: #a8c9ac;
}

html[data-theme-style="cyber-ai"] {
  --bg: #f0f4f8;
  --bg-elevated: rgba(250, 252, 255, 0.92);
  --surface: #ffffff;
  --primary: #1a2332;
  --primary-hover: #2d3e52;
  --accent: #0ea5e9;
  --text: #4a5568;
  --text-dark: #1a2332;
  --text-muted: #718096;
  --border: #cbd5e1;
  --theme-header-bg: rgba(248, 250, 252, 0.88);
  --theme-header-border: rgba(203, 213, 225, 0.72);
  --theme-header-strong: #1a2332;
  --theme-header-muted: #718096;
  --theme-field-bg: rgba(255, 255, 255, 0.9);
  --theme-field-focus-bg: rgba(255, 255, 255, 0.98);
  --theme-field-border: rgba(203, 213, 225, 0.6);
  --theme-pill-bg: rgba(224, 242, 254, 0.7);
  --theme-pill-hover-bg: rgba(14, 165, 233, 0.15);
  --theme-blockquote-bg: rgba(241, 245, 249, 0.5);
  --theme-code-bg: rgba(241, 245, 249, 0.9);
  --theme-panel-bg: rgba(248, 250, 252, 0.96);
  --theme-panel-bg-2: rgba(250, 252, 255, 0.92);
  --theme-progress-mid: #38bdf8;
}
html[data-theme-style="cyber-ai"][data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-elevated: rgba(15, 23, 42, 0.92);
  --surface: #1e293b;
  --primary: #f0f9ff;
  --primary-hover: #e0f2fe;
  --accent: #06b6d4;
  --text: #cbd5e1;
  --text-dark: #f0f9ff;
  --text-muted: #94a3b8;
  --border: #334155;
  --theme-header-bg: rgba(10, 14, 26, 0.9);
  --theme-header-border: rgba(51, 65, 85, 0.76);
  --theme-header-strong: #f0f9ff;
  --theme-header-muted: #94a3b8;
  --theme-field-bg: rgba(30, 41, 59, 0.7);
  --theme-field-focus-bg: rgba(51, 65, 85, 0.85);
  --theme-field-border: rgba(100, 116, 139, 0.4);
  --theme-pill-bg: rgba(14, 165, 233, 0.15);
  --theme-pill-hover-bg: rgba(6, 182, 212, 0.2);
  --theme-blockquote-bg: rgba(30, 41, 59, 0.6);
  --theme-code-bg: rgba(15, 23, 42, 0.8);
  --theme-panel-bg: rgba(30, 41, 59, 0.96);
  --theme-panel-bg-2: rgba(22, 34, 51, 0.92);
  --theme-progress-mid: #22d3ee;
}

html[data-theme-style] body {
  background-image: none !important;
  background-color: var(--bg) !important;
}
html[data-theme-style] .progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--theme-progress-mid), var(--accent)) !important;
  background-size: 200% 100% !important;
}
html[data-theme-style] .site-header {
  background: color-mix(in srgb, var(--surface) 96%, var(--bg) 4%) !important;
  border-bottom: 1px solid var(--theme-header-border) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  margin-top: 0 !important;
}
html[data-theme-style] .site-header .site-branding h1,
html[data-theme-style] .site-header .nav-item,
html[data-theme-style] .site-header .icon-btn {
  color: var(--theme-header-strong) !important;
}
html[data-theme-style] .site-header .site-desc {
  color: var(--theme-header-muted) !important;
}
html[data-theme-style] .site-header .nav-item::after {
  background: linear-gradient(90deg, transparent, var(--accent), transparent) !important;
}
html[data-theme-style] .search-box input,
html[data-theme-style] .outline-btn,
html[data-theme-style] .clear-filter {
  background: var(--theme-field-bg) !important;
  border: 1px solid var(--theme-field-border) !important;
  color: var(--text-dark) !important;
  box-shadow: none !important;
}
html[data-theme-style] .search-box input:focus,
html[data-theme-style] .outline-btn:hover,
html[data-theme-style] .clear-filter:hover {
  background: var(--theme-field-focus-bg) !important;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border) 58%) !important;
  color: var(--accent) !important;
}
html[data-theme-style] .site-header .search-box input::placeholder {
  color: color-mix(in srgb, var(--theme-header-muted) 88%, transparent) !important;
}
html[data-theme-style][data-theme="dark"] .site-header .search-box input {
  background: var(--theme-field-bg) !important;
  border-color: var(--theme-field-border) !important;
  color: var(--theme-header-strong) !important;
  box-shadow: none !important;
}
html[data-theme-style][data-theme="dark"] .site-header .search-box input:focus {
  background: var(--theme-field-focus-bg) !important;
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border) 52%) !important;
  color: var(--theme-header-strong) !important;
}
html[data-theme-style][data-theme="dark"] .site-header .search-box input::placeholder {
  color: color-mix(in srgb, var(--theme-header-muted) 82%, transparent) !important;
}
html[data-theme-style] .category-menu-bar,
html[data-theme-style] .popular-tags-bottom,
html[data-theme-style] .post-view,
html[data-theme-style] .mobile-menu-sheet,
html[data-theme-style] .bottom-module,
html[data-theme-style] .post-card,
html[data-theme-style] .post-card-compact {
  background: var(--surface) !important;
  background-image: none !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
html[data-theme-style] .section-title-category,
html[data-theme-style] .card-category,
html[data-theme-style] .featured-recommend-item-tag,
html[data-theme-style] .meta-category,
html[data-theme-style] .meta-tags,
html[data-theme-style] .tag-bar-item,
html[data-theme-style] .mobile-category-btn,
html[data-theme-style] .mobile-category-item {
  background: var(--theme-pill-bg) !important;
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border) 80%) !important;
  color: var(--text-dark) !important;
}
html[data-theme-style] .tag-bar-item:hover,
html[data-theme-style] .tag-bar-item.active,
html[data-theme-style] .mobile-category-btn:hover,
html[data-theme-style] .mobile-category-item:hover,
html[data-theme-style] .mobile-category-item.active {
  background: var(--theme-pill-hover-bg) !important;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border) 60%) !important;
  color: var(--accent) !important;
}
html[data-theme-style] .section-title-filtered {
  background: linear-gradient(135deg, var(--theme-panel-bg), var(--theme-panel-bg-2)) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
html[data-theme-style] .markdown-body blockquote {
  background: var(--theme-blockquote-bg) !important;
  border-left: 3px solid var(--accent) !important;
  box-shadow: none !important;
}
html[data-theme-style] .markdown-body pre {
  background: var(--theme-code-bg) !important;
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border) 76%) !important;
}
html[data-theme-style] .site-footer {
  background: var(--bg) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}
html[data-theme-style] .site-footer .admin-link:hover,
html[data-theme-style] .markdown-body a,
html[data-theme-style] .module-post-title:hover,
html[data-theme-style] .card-cta,
html[data-theme-style] .archive-item:hover .archive-title {
  color: var(--accent) !important;
}
html[data-theme-style] .back-to-top-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border) 62%) !important;
  color: var(--accent) !important;
}
html[data-theme-style] .category-menu-bar {
  background: color-mix(in srgb, var(--surface) 92%, var(--bg) 8%) !important;
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent) !important;
  box-shadow: none !important;
}
html[data-theme-style] .category-menu-bar .container {
  display: block !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
html[data-theme-style] .category-menu-scroll {
  display: flex !important;
  align-items: center !important;
  gap: 30px !important;
  min-height: 48px !important;
  padding: 0 !important;
}
html[data-theme-style] .category-menu-item {
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-family: var(--font-serif) !important;
  color: color-mix(in srgb, var(--text-dark) 62%, var(--bg) 38%) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.015em !important;
  padding: 10px 14px !important;
  margin: 0 2px !important;
  min-height: auto !important;
  line-height: 1.2 !important;
  opacity: 0.94 !important;
  transition: all 0.2s ease !important;
  position: relative !important;
}
html[data-theme-style] .category-menu-item::after {
  content: '' !important;
  position: absolute !important;
  bottom: 8px !important;
  left: 14px !important;
  right: 14px !important;
  height: 1px !important;
  background: var(--accent) !important;
  transform: scaleX(0) !important;
  transition: transform 0.2s ease !important;
}
html[data-theme-style] .category-menu-item:hover {
  background: rgba(148, 163, 184, 0.08) !important;
  color: var(--text-dark) !important;
  opacity: 1 !important;
}
html[data-theme-style] .category-menu-item:hover::after {
  transform: scaleX(1) !important;
}
[data-theme="dark"] html[data-theme-style] .category-menu-item:hover {
  background: rgba(148, 163, 184, 0.12) !important;
}
html[data-theme-style] .category-menu-item.active {
  background: rgba(148, 163, 184, 0.12) !important;
  color: color-mix(in srgb, var(--accent) 82%, var(--text-dark) 18%) !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
[data-theme="dark"] html[data-theme-style] .category-menu-item.active {
  background: rgba(148, 163, 184, 0.16) !important;
}
html[data-theme-style] .category-menu-item.active::after {
  transform: scaleX(0) !important;
}
html[data-theme-style="warm-clay"] .site-footer::after,
html[data-theme-style="mist-blue"] .site-footer::after,
html[data-theme-style="gray-paper"] .site-footer::after,
html[data-theme-style="forest-journal"] .site-footer::after,
html[data-theme-style="cyber-ai"] .site-footer::after {
  content: none !important;
}

html[data-theme-style] .bottom-module .module-title,
html[data-theme-style] .popular-tags-bottom .tags-bottom-head h3 {
  font-weight: 500 !important;
  color: color-mix(in srgb, var(--text-dark) 76%, var(--text) 24%) !important;
}
html[data-theme-style] .bottom-module .module-post-title,
html[data-theme-style] .featured-recommend-item-title {
  font-weight: 400 !important;
  color: color-mix(in srgb, var(--text-dark) 68%, var(--text) 32%) !important;
}
html[data-theme-style] .popular-tags-bottom .tag-bar-item {
  font-weight: 400 !important;
  color: color-mix(in srgb, var(--text-dark) 66%, var(--text) 34%) !important;
}
html[data-theme-style] .popular-tags-bottom .tag-count {
  opacity: 0.64 !important;
}

html[data-theme-style] .popular-tags-bottom {
  padding: 16px 18px !important;
  border-radius: 16px !important;
}
html[data-theme-style] .tags-bottom-head {
  display: none !important;
}
html[data-theme-style] .tags-bar-scroll {
  padding: 4px 0 !important;
}
html[data-theme-style] .tags-scroll-fade-left {
  left: 0 !important;
}
html[data-theme-style] .tags-scroll-fade-right {
  right: 0 !important;
}

html,
body {
  margin: 0 !important;
  padding: 0 !important;
}
body {
  padding-top: 0 !important;
}
html[data-theme-style] .site-header {
  top: 0 !important;
}

/* Desktop top layout hardening:
   lock header/category bar to viewport top to avoid sticky gap artifacts. */
@media (min-width: 769px) {
  html[data-theme-style] .site-header {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }
  html[data-theme-style] .category-menu-bar {
    position: fixed !important;
    top: 80px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }
  html[data-theme-style] .site-main {
    padding-top: 136px !important;
  }
}



/* ==================== 查看更多按钮 - 纯文字链接样式 ==================== */

.load-more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.load-more-text {
  position: relative;
  letter-spacing: 0.3px;
}

.load-more-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
  opacity: 0.8;
}

.load-more-link:hover {
  color: var(--primary-hover);
  transform: translateX(4px);
}

.load-more-link:hover .load-more-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.load-more-link:active {
  transform: translateX(2px);
}

/* 深色模式 */
[data-theme="dark"] .load-more-link {
  color: var(--accent);
}

[data-theme="dark"] .load-more-link:hover {
  color: var(--primary);
}

/* 移动端优化 */
@media (max-width: 768px) {
  .load-more-link {
    font-size: 13px;
    padding: 6px 0;
    margin: 10px auto 0;
  }
  
  .load-more-arrow {
    width: 14px;
    height: 14px;
  }
}

/* ==================== 底部标签 - 纯文字样式 ==================== */

.tag-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  margin: 0 12px 8px 0;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  color: var(--text-muted) !important;
  font-size: 14px;
  font-weight: 400 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none !important;
}

.tag-bar-item:hover {
  color: var(--accent) !important;
  transform: translateX(2px);
}

.tag-bar-item.active {
  color: var(--accent) !important;
  font-weight: 500 !important;
}

.tag-count {
  opacity: 0.6 !important;
  font-size: 13px;
}

/* 深色模式 */
[data-theme="dark"] .tag-bar-item {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .tag-bar-item:hover,
[data-theme="dark"] .tag-bar-item.active {
  color: var(--accent) !important;
}

/* 主题适配 */
html[data-theme-style] .tag-bar-item {
  background: none !important;
  border: none !important;
  color: var(--text-muted) !important;
}

html[data-theme-style] .tag-bar-item:hover,
html[data-theme-style] .tag-bar-item.active {
  color: var(--accent) !important;
}

/* 移动端 */
@media (max-width: 768px) {
  .tag-bar-item {
    font-size: 13px;
    margin: 0 10px 6px 0;
  }
}



/* ==================== 文章导航：上一篇/下一篇 ==================== */

.post-navigation {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-nav-prev {
  text-align: left;
}

.post-nav-next {
  text-align: right;
  align-items: flex-end;
}

.post-nav-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.post-nav-title {
  font-size: 15px;
  color: var(--text-dark);
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.5;
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-nav-title:hover {
  color: var(--accent);
  transform: translateX(2px);
}

.post-nav-prev .post-nav-title:hover {
  transform: translateX(-2px);
}

.post-nav-end {
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.6;
  font-style: italic;
}

.post-nav-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
  align-self: center;
}

.post-nav-home:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .post-nav-home:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 移动端优化 */
@media (max-width: 768px) {
  .post-navigation {
    margin-top: 32px;
    padding-top: 24px;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .post-nav-item {
    text-align: left !important;
    align-items: flex-start !important;
  }
  
  .post-nav-title {
    max-width: 100%;
  }
  
  .post-nav-home {
    width: 100%;
    justify-content: center;
  }
  
  .post-nav-next {
    order: 3;
  }
  
  .post-nav-home {
    order: 2;
  }
}

/* Markdown Image Styling */
.markdown-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px -6px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin: 32px auto;
}

[data-theme="dark"] .markdown-body img {
  box-shadow: 0 4px 20px -6px rgba(2, 6, 23, 0.4);
  border-color: rgba(100, 116, 139, 0.28);
}

/* ==========================================================================
   Markdown Elements Styling (.markdown-body)
   ========================================================================== */
.markdown-body {
  font-family: inherit;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
  word-wrap: break-word;
}

.markdown-body > *:first-child { margin-top: 0 !important; }
.markdown-body > *:last-child { margin-bottom: 0 !important; }

/* Headers */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-dark);
}
.markdown-body h1 {
  font-size: 2.2em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.3em;
}
.markdown-body h2 {
  font-size: 1.6em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.3em;
}
.markdown-body h3 { font-size: 1.35em; }
.markdown-body h4 { font-size: 1.15em; }

[data-theme="dark"] .markdown-body h1,
[data-theme="dark"] .markdown-body h2 {
  border-color: rgba(100, 116, 139, 0.3);
}

/* Paragraphs & Blocks */
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre,
.markdown-body details {
  margin-top: 0;
  margin-bottom: 1.4em;
}

/* Links */
.markdown-body a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.2s ease;
}
.markdown-body a:hover {
  border-bottom-color: var(--accent);
}

/* Blockquotes */
.markdown-body blockquote {
  padding: 16px 20px;
  color: var(--text-muted);
  border-left: 4px solid var(--accent);
  background: rgba(148, 163, 184, 0.08);
  border-radius: 0 8px 8px 0;
  margin-left: 0;
  margin-right: 0;
}
[data-theme="dark"] .markdown-body blockquote {
  background: rgba(15, 23, 42, 0.3);
}

/* Lists */
.markdown-body ul,
.markdown-body ol {
  padding-left: 2em;
}
.markdown-body li > p {
  margin-top: 0.5em;
}
.markdown-body li + li {
  margin-top: 0.25em;
}

/* Inline Code */
.markdown-body code {
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Consolas, Liberation Mono, Menlo, monospace;
  background-color: rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  color: #ea580c; /* warm accent for inline code */
}
[data-theme="dark"] .markdown-body code {
  background-color: rgba(0, 0, 0, 0.3);
  color: #fb923c;
}

/* Code Blocks */
.markdown-body pre {
  padding: 18px 20px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.6;
  background-color: #1e1e1e !important;
  border-radius: 12px;
  margin-bottom: 1.5em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}
.markdown-body pre code {
  display: inline;
  padding: 0;
  margin: 0;
  overflow: visible;
  line-height: inherit;
  word-wrap: normal;
  background-color: transparent;
  border: 0;
  color: #d1d5db; /* baseline text color for dark code blocks */
}

/* Tables */
.markdown-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
  border-spacing: 0;
  margin-bottom: 24px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.2);
}
.markdown-body table th {
  font-weight: 600;
  background: rgba(148, 163, 184, 0.08);
}
.markdown-body table th,
.markdown-body table td {
  padding: 10px 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.markdown-body table tr {
  background-color: transparent;
}
.markdown-body table tr:nth-child(2n) {
  background-color: rgba(148, 163, 184, 0.04);
}

[data-theme="dark"] .markdown-body table {
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.3);
}
[data-theme="dark"] .markdown-body table th,
[data-theme="dark"] .markdown-body table td {
  border-color: rgba(100, 116, 139, 0.3);
}
[data-theme="dark"] .markdown-body table th {
  background: rgba(15, 23, 42, 0.5);
}
[data-theme="dark"] .markdown-body table tr:nth-child(2n) {
  background-color: rgba(15, 23, 42, 0.3);
}

/* Horizontal Rules */
.markdown-body hr {
  height: 2px;
  padding: 0;
  margin: 36px 0;
  background-color: rgba(148, 163, 184, 0.15);
  border: 0;
  border-radius: 4px;
}
