/* ===== Thred Blog 自定义样式 ===== */

/* ---------- CSS 变量 ---------- */
:root {
  --color-bg: #ffffff;
  --color-bgr: #ebebeb;
  --color-bgr-tone: #dedede;
  --color-typ: #1a1a1a;
  --color-typ-secondary: #666666;
  --color-brd: #e2e2e2;
  --color-brand: #ff4400;
  --color-brand-hover: #e63d00;
  --sidebar-width: 260px;
  --right-sidebar-width: 240px;
  --header-height: 56px;
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", "Fira Code", "Consolas", monospace;
}

.dark {
  --color-bg: #0d0d0d;
  --color-bgr: #1a1a1a;
  --color-bgr-tone: #262626;
  --color-typ: #f0f0f0;
  --color-typ-secondary: #999999;
  --color-brd: #333333;
  --color-brand: #ff4400;
  --color-brand-hover: #ff6633;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-typ);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-typ);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-brand);
}

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

ul, ol {
  list-style: none;
}

/* ---------- Layout ---------- */
.page-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  padding-top: var(--header-height);
}

.layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

/* ---------- Mobile Header ---------- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-brd);
  z-index: 1000;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-header .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-typ);
}

.mobile-header .logo .logo-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  background: var(--color-brand);
  color: #fff;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  margin-right: 8px;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--color-typ);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-dark-btn {
  background: none;
  border: none;
  color: var(--color-typ);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

/* ---------- Desktop Header ---------- */
.desktop-header {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-brd);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  z-index: 1001;
  padding: 0 24px;
  align-items: center;
}

.desktop-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.desktop-header .header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.desktop-header .header-logo img {
  height: 28px;
  width: auto;
}

.desktop-header .header-logo-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  background: var(--color-brand);
  color: #fff;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}

.desktop-header .header-logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-typ);
}

.desktop-header .header-search {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 480px;
  margin: 0 24px;
}

.desktop-header .header-search form {
  display: flex;
  width: 100%;
  position: relative;
}

.desktop-header .search-input {
  width: 100%;
  padding: 6px 36px 6px 14px;
  border: 1px solid var(--color-brd);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--color-bgr);
  color: var(--color-typ);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.desktop-header .search-input:focus {
  outline: none;
  border-color: var(--color-brand);
}

.desktop-header .search-input::placeholder {
  color: var(--color-typ-secondary);
}

.desktop-header .search-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-typ-secondary);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.9rem;
}

.desktop-header .search-btn:hover {
  color: var(--color-brand);
}

.desktop-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.desktop-header .header-social-link {
  font-size: 0.8rem;
  color: var(--color-typ-secondary);
  transition: color 0.2s;
}

.desktop-header .header-social-link:hover {
  color: var(--color-brand);
}

.desktop-header .header-dark-btn {
  background: none;
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  color: var(--color-typ-secondary);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 1rem;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.desktop-header .header-dark-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.dark .desktop-header {
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dark .sidebar,
.dark .right-sidebar {
  background: var(--color-bgr);
}

/* ---------- Left Sidebar ---------- */
.sidebar {
  position: sticky;
  top: var(--header-height);
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid var(--color-brd);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 999;
  transition: transform 0.3s ease;
}

.sidebar.collapsed {
  display: none;
}

/* Sidebar toggle button */
.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-right: 8px;
  color: var(--color-typ-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
}

.sidebar-toggle:hover {
  color: var(--color-brand);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 32px 24px;
  overflow-y: auto;
}

.sidebar .logo {
  margin-bottom: 40px;
}

.sidebar .logo a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar .logo-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  background: var(--color-brand);
  color: #fff;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.2rem;
}

.sidebar .logo-text {
  font-size: 1.25rem;
  font-weight: 700;
}

.nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 14px 10px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-typ);
  transition: all 0.2s;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  border-radius: 2px;
  opacity: 1;
  background: #aaa;
  transition: all 0.25s ease;
}

.nav-item:hover {
  color: var(--color-brand);
  background: var(--color-bgr-tone);
  border-radius: 8px;
  padding-left: 28px;
}

.nav-item:hover::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  left: 12px;
}

.nav-item.active {
  color: var(--color-brand);
  font-weight: 600;
}

.nav-item.active::before {
  /* colored bar set per nth-child below */
}

.nav-item.active:hover {
  background: var(--color-bgr-tone);
  border-radius: 8px;
  padding-left: 28px;
}

.nav-item.active:hover::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  left: 12px;
}

.nav-item.active:nth-child(1)::before { background: var(--color-brand); }
.nav-item.active:nth-child(2)::before { background: #3b82f6; }
.nav-item.active:nth-child(3)::before { background: #10b981; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--color-brd);
}

.dark-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--color-typ);
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.dark-toggle-btn:hover {
  background: var(--color-bgr-tone);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-links a {
  color: var(--color-typ-secondary);
  font-size: 0.85rem;
}

.social-links a:hover {
  color: var(--color-brand);
}

.copyright {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--color-typ-secondary);
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  padding: 72px 0 48px;
  margin-bottom: 24px;
  border-radius: 16px;
  overflow: hidden;
  /* Modern mesh gradient: warm sunset + tech blue tones */
  background:
    radial-gradient(ellipse 70% 50% at 20% 30%, rgba(255,110,30,0.18) 0%, transparent 50%),
    radial-gradient(ellipse 50% 70% at 75% 50%, rgba(99,102,241,0.12) 0%, transparent 50%),
    linear-gradient(135deg, #faf6f0 0%, #fff0e6 50%, #f2f0fa 100%);
}

.dark .hero {
  background:
    radial-gradient(ellipse 70% 50% at 20% 30%, rgba(255,110,30,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 70% at 75% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
    linear-gradient(135deg, #0d0d0d 0%, #1a1210 50%, #0d0d14 100%);
}

/* Subtle grid pattern overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.3;
  max-width: 640px;
  color: var(--color-typ);
}

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

.hero-subtitle {
  font-size: 1.05rem;
  color: #6b7280;
  max-width: 520px;
  margin-top: 16px;
  line-height: 1.6;
}

.dark .hero-subtitle {
  color: #9ca3af;
}

/* ---------- Page Header ---------- */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 2rem; font-weight: 700; }
.page-desc { font-size: 0.9rem; color: var(--color-typ-secondary); margin-top: 4px; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  padding: 48px 48px;
  min-width: 0;
  overflow: hidden;
}

/* ---------- Right Sidebar ---------- */
.right-sidebar {
  width: var(--right-sidebar-width);
  padding: 48px 28px;
  border-left: 1px solid var(--color-brd);
  flex-shrink: 0;
  background: #ffffff;
}

.sidebar-widget {
  margin-bottom: 32px;
}

.sidebar-widget h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-typ-secondary);
  margin-bottom: 16px;
}

.recent-posts li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-brd);
}

.recent-posts li:last-child {
  border-bottom: none;
}

.recent-posts a {
  font-size: 0.9rem;
  display: block;
}

.recent-posts a:hover {
  color: var(--color-brand);
}

/* ---------- Sidebar Tags (Left Sidebar) ---------- */
.sidebar-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-brd);
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  padding: 10px 14px 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-typ-secondary);
}

.sidebar-section-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  margin-bottom: 4px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-typ);
  font-family: var(--font-sans);
  border-radius: 8px;
  transition: all 0.2s;
}

.sidebar-section-toggle:hover {
  background: var(--color-bgr);
  color: var(--color-brand);
}

.sidebar-section-arrow {
  font-size: 0.7rem;
  color: var(--color-typ-secondary);
  transition: color 0.2s;
}

.sidebar-section-toggle:hover .sidebar-section-arrow {
  color: var(--color-brand);
}



.sidebar-tag-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--color-typ);
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-tag-item:hover {
  background: var(--color-bgr-tone);
  color: var(--color-brand);
  padding-left: 14px;
}

.sidebar-tag-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  margin-right: 10px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-tag-item:hover .sidebar-tag-bar {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.sidebar-tag-name {
  flex: 1;
}

.sidebar-tag-count {
  font-size: 0.75rem;
  color: var(--color-typ-secondary);
  opacity: 0;
  transition: opacity 0.15s;
}

.sidebar-tag-item:hover .sidebar-tag-count {
  opacity: 1;
}

/* ---------- About Widget (Right Sidebar) ---------- */
.about-widget h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-typ-secondary);
  margin-bottom: 12px;
}

.about-widget .about-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-typ-secondary);
  margin-bottom: 12px;
}

.about-widget .about-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-widget .about-social a {
  font-size: 0.8rem;
  padding: 4px 12px;
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  color: var(--color-typ-secondary);
  transition: all 0.2s;
  text-decoration: none;
}

.about-widget .about-social a:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.recent-posts li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-brd);
}

.recent-posts li:last-child {
  border-bottom: none;
}

.recent-posts a {
  font-size: 0.9rem;
  display: block;
}

.recent-posts a:hover {
  color: var(--color-brand);
}

/* ---------- Filter Bar (Underline Tabs) ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-brd);
  flex-wrap: wrap;
  justify-content: space-between;
}

.filter-btn {
  padding: 8px 16px;
  margin-bottom: -2px;
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-typ-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.filter-btn:hover {
  color: var(--color-typ);
}

.filter-btn.active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
}

.filter-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
  padding-bottom: 8px;
}

/* ---------- Article Cards ---------- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.article-card {
  display: flex;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--color-brd);
  transition: all 0.3s ease;
  border-radius: 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.article-card:hover {
  background: var(--color-bgr);
}

.dark .article-card:hover {
  background: var(--color-bgr);
}

.article-card:first-child {
  padding-top: 0;
  border-top: 1px solid var(--color-brd);
}

/* Compact variant for tag/search pages */
.article-list.compact .article-card {
  padding: 16px 16px;
  gap: 16px;
}
.article-list.compact .article-card-thumb {
  width: 80px;
  height: 56px;
}
.article-list.compact .article-card-title {
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.article-list.compact .article-card-excerpt {
  font-size: 0.8rem;
  margin-bottom: 6px;
}
.article-list.compact .article-card-meta {
  gap: 8px;
}

.article-card-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-bgr-tone);
}

.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-thumb .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-typ-secondary);
  background: linear-gradient(135deg, var(--color-bgr-tone) 0%, var(--color-bgr) 100%);
  position: relative;
}

.article-card-thumb .placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 68, 0, 0.04) 100%);
}

.article-card-body {
  flex: 1;
  min-width: 0;
}

.article-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.article-card-title a {
  color: var(--color-typ);
}

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

.article-card-excerpt {
  font-size: 0.875rem;
  color: var(--color-typ-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.article-card-date {
  font-size: 0.8rem;
  color: var(--color-typ-secondary);
}

.article-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.article-card-tags a {
  font-size: 0.75rem;
  padding: 3px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
}

.article-card-tags a:nth-of-type(6n+1) { background: #f3f0ff; color: #6b5ce7; }
.article-card-tags a:nth-of-type(6n+2) { background: #eff6ff; color: #3b82f6; }
.article-card-tags a:nth-of-type(6n+3) { background: #ecfdf5; color: #10b981; }
.article-card-tags a:nth-of-type(6n+4) { background: #fff7ed; color: #f59e0b; }
.article-card-tags a:nth-of-type(6n+5) { background: #fdf2f8; color: #ec4899; }
.article-card-tags a:nth-of-type(6n+6) { background: #f0fdfa; color: #14b8a6; }

.article-card-tags a:hover {
  background: var(--color-brand) !important;
  color: #fff !important;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-brand);
  font-weight: 600;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-brd);
}

.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.pagination a {
  border: 1px solid var(--color-brd);
  color: var(--color-typ);
}

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

.pagination .current {
  background: var(--color-brand);
  color: #fff;
  border: 1px solid var(--color-brand);
}

.pagination .disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Article Detail ---------- */
.article-header {
  margin-bottom: 32px;
}

.article-header .article-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-header .article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--color-typ-secondary);
  font-size: 0.9rem;
}

.article-header .featured-image {
  margin-top: 24px;
  border-radius: 12px;
  overflow: hidden;
}

.article-header .featured-image img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

/* ---------- Prose (文章内容排版) ---------- */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-typ);
  overflow-x: hidden;
  word-wrap: break-word;
}

.prose h1 { font-size: 1.8rem; font-weight: 700; margin: 2rem 0 1rem; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 0.8rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--color-brd); }
.prose h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.6rem; }
.prose h4 { font-size: 1.1rem; font-weight: 600; margin: 1.2rem 0 0.5rem; }

.heading-marker {
  color: var(--color-brd);
  font-weight: 400;
  margin-right: 0.3em;
  opacity: 0.6;
}
.prose h5, .prose h6 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.4rem; }

.prose p { margin-bottom: 1.2rem; }

.prose a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { opacity: 0.8; }

.prose strong { font-weight: 600; }
.prose em { font-style: italic; }

.prose blockquote {
  margin: 1.5rem 0;
  padding: 12px 20px;
  border-left: 4px solid var(--color-brand);
  background: var(--color-bgr);
  border-radius: 0 8px 8px 0;
}

.prose blockquote p { margin-bottom: 0; }

.prose pre {
  margin: 1.5rem 0;
  padding: 16px 20px;
  background: var(--color-bgr);
  border: 1px solid var(--color-brd);
  border-radius: 8px;
  overflow-x: auto;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--color-bgr);
  border-radius: 4px;
}

.prose pre code {
  padding: 0;
  background: none;
  border-radius: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ---------- Code Block Copy Button ---------- */
.code-block-wrapper {
  position: relative;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  background: var(--color-bgr);
  color: var(--color-typ-secondary);
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s;
}

.copy-code-btn:hover {
  background: var(--color-bgr-tone);
  color: var(--color-typ);
  border-color: var(--color-typ-secondary);
}

.copy-code-btn.copied {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

.prose ul, .prose ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li { margin-bottom: 0.4rem; }

.prose img {
  display: block;
  margin: 1.5rem auto;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.prose th, .prose td {
  padding: 10px 14px;
  border: 1px solid var(--color-brd);
  text-align: left;
}

.prose th {
  background: var(--color-bgr);
  font-weight: 600;
}

.prose hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid var(--color-brd);
}

/* ---------- Post Navigation ---------- */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-brd);
}

.post-nav-item {
  flex: 1;
  padding: 16px;
  border: 1px solid var(--color-brd);
  border-radius: 8px;
  transition: all 0.2s;
}

.post-nav-item:hover {
  border-color: var(--color-brand);
}

.post-nav-item .nav-label {
  font-size: 0.8rem;
  color: var(--color-typ-secondary);
  margin-bottom: 4px;
}

.post-nav-item .nav-title {
  font-size: 0.95rem;
  font-weight: 500;
}

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

.share-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-brd);
}

.share-bar .share-label {
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
}

.share-btn {
  padding: 8px 16px;
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  background: none;
  color: var(--color-typ-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.share-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.share-btn-wechat-wrap {
  position: relative;
  display: inline-flex;
}

.share-btn-wechat { color: #07C160; border-color: #07C160; }
.share-btn-wechat:hover { background: #07C160; color: #fff; border-color: #07C160; }
.share-btn-qq { color: #12B7F5; border-color: #12B7F5; }
.share-btn-qq:hover { background: #12B7F5; color: #fff; border-color: #12B7F5; }
.share-btn-weibo { color: #E6162D; border-color: #E6162D; }
.share-btn-weibo:hover { background: #E6162D; color: #fff; border-color: #E6162D; }
.share-btn-twitter { color: #1DA1F2; border-color: #1DA1F2; }
.share-btn-twitter:hover { background: #1DA1F2; color: #fff; border-color: #1DA1F2; }

.share-wechat-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 6px 12px;
  background: #07C160;
  color: #fff;
  font-size: 0.8rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
}

.share-wechat-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #07C160;
}

/* ---------- Tags Page ---------- */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.tag-card {
  display: block;
  padding: 24px;
  background: var(--color-bgr);
  border: 1px solid var(--color-brd);
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s;
}

.tag-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 68, 0, 0.1);
}

.tag-card .tag-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-typ);
}

.tag-card:hover .tag-name {
  color: var(--color-brand);
}

.tag-card .tag-count {
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
  margin-top: 4px;
}

/* ---------- Projects Page ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  border: 1px solid var(--color-brd);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  background: var(--color-bg);
}

.project-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.dark .project-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.project-card-image {
  height: 200px;
  background: var(--color-bgr-tone);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-image .placeholder {
  font-size: 2.5rem;
  color: var(--color-typ-secondary);
}

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

.project-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--color-typ-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.project-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card-tags {
  display: flex;
  gap: 4px;
}

.project-card-tags span {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--color-bgr);
  border-radius: 4px;
  color: var(--color-typ-secondary);
}

.project-card-link {
  font-size: 0.85rem;
  color: var(--color-brand);
  font-weight: 500;
}

/* ---------- Album Page ---------- */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.album-card {
  border: 1px solid var(--color-brd);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.album-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-2px);
}

.album-card-cover {
  height: 200px;
  background: var(--color-bgr-tone);
  overflow: hidden;
}

.album-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-card-body {
  padding: 16px;
}

.album-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.album-card-desc {
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
}

.album-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.album-image-item {
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bgr-tone);
  aspect-ratio: 1;
}

.album-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Search Page ---------- */
.search-form {
  margin-bottom: 32px;
}

.search-form .search-input-group {
  display: flex;
  gap: 8px;
}

.search-form input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--color-brd);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-typ);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.search-form input[type="text"]:focus {
  outline: none;
  border-color: var(--color-brand);
}

.search-form button {
  padding: 12px 24px;
  background: var(--color-brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.2s;
}

.search-form button:hover {
  background: var(--color-brand-hover);
}

.search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-typ-secondary);
}

.search-empty .icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* ---------- Page Header ---------- */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.page-header .page-desc {
  color: var(--color-typ-secondary);
  margin-top: 8px;
  font-size: 0.95rem;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-typ-secondary);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--color-typ);
}

/* ---------- 404 Page ---------- */
.error-page {
  text-align: center;
  padding: 100px 20px;
}

.error-page h1 {
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 16px;
}

.error-page p {
  font-size: 1.1rem;
  color: var(--color-typ-secondary);
  margin-bottom: 24px;
}

.error-page a {
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-brand);
  color: #fff;
  border-radius: 8px;
  font-weight: 500;
}

/* ---------- Admin ---------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  padding: 0 24px;
}

.admin-sidebar {
  width: 220px;
  background: var(--color-bgr);
  border-right: 1px solid var(--color-brd);
  padding: 24px 16px;
  flex-shrink: 0;
}

.admin-sidebar .admin-logo {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: block;
}

.admin-sidebar .admin-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.admin-sidebar .admin-nav a:hover,
.admin-sidebar .admin-nav a.active {
  background: var(--color-bgr-tone);
  color: var(--color-brand);
}

.admin-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-brd);
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  font-weight: 600;
  color: var(--color-typ-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.admin-table tr:hover td {
  background: var(--color-bgr);
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-sans);
  text-decoration: none;
}

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

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

.btn-secondary {
  background: var(--color-bgr);
  color: var(--color-typ);
  border: 1px solid var(--color-brd);
}

.btn-secondary:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.8rem;
}

/* ---------- Admin Form ---------- */
.admin-form {
  max-width: 720px;
}

.admin-form .form-group {
  margin-bottom: 20px;
}

.admin-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-typ);
}

.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--color-bg);
  color: var(--color-typ);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--color-brand);
}

.admin-form textarea {
  resize: vertical;
  min-height: 120px;
}

.admin-form textarea.content-editor {
  min-height: 400px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}

.admin-form .form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-form .form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.admin-form .form-hint {
  font-size: 0.8rem;
  color: var(--color-typ-secondary);
  margin-top: 4px;
}

/* ---------- Admin Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  background: var(--color-bgr);
  border: 1px solid var(--color-brd);
  border-radius: 12px;
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-brand);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
  margin-top: 4px;
}

/* ---------- Login Page ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-bgr);
}

.login-box {
  width: 360px;
  padding: 40px;
  background: var(--color-bg);
  border-radius: 12px;
  border: 1px solid var(--color-brd);
}

.login-box h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.login-box .form-group {
  margin-bottom: 16px;
}

.login-box label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.login-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--color-bg);
  color: var(--color-typ);
}

.login-box input:focus {
  outline: none;
  border-color: var(--color-brand);
}

.login-box .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.login-error {
  text-align: center;
  color: #dc2626;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .right-sidebar {
    display: none;
  }
  .main-content {
    padding-right: 40px;
  }
}

@media (max-width: 1024px) {
  .page-wrapper {
    max-width: 100%;
    padding-top: 0;
  }

  .desktop-header {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  .main-content {
    padding: calc(var(--header-height) + 24px) 20px 40px;
  }

  .right-sidebar {
    display: none;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: calc(var(--header-height) + 16px) 16px 32px;
  }

  .article-card {
    flex-direction: column;
    gap: 12px;
  }

  .article-card-thumb {
    width: 100%;
    height: 180px;
  }

  .article-header .article-title {
    font-size: 1.5rem;
  }

  .post-navigation {
    flex-direction: column;
  }

  .projects-grid,
  .albums-grid {
    grid-template-columns: 1fr;
  }

  .tags-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .admin-sidebar {
    display: none;
  }
}

/* ---------- About Page ---------- */
.about-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 0;
}

.about-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--color-bgr);
  border: 1px solid var(--color-brd);
  border-radius: 16px;
}

.about-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-bgr-tone);
  border: 3px solid var(--color-brand);
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-brand);
  background: var(--color-bgr-tone);
}

.about-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-tagline {
  font-size: 0.95rem;
  color: var(--color-typ-secondary);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-brd);
}

.about-bio {
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-typ);
  margin-bottom: 24px;
}

.about-bio p {
  margin-bottom: 12px;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.about-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-brd);
}

.about-social-link {
  display: inline-flex;
  padding: 8px 20px;
  border: 1px solid var(--color-brd);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--color-typ);
  transition: all 0.2s;
  text-transform: capitalize;
}

.about-social-link:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.about-contact {
  font-size: 0.9rem;
  color: var(--color-typ-secondary);
}

.contact-label {
  font-weight: 500;
  color: var(--color-typ);
  margin-right: 4px;
}

.about-contact a {
  color: var(--color-brand);
}

.about-contact a:hover {
  text-decoration: underline;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Geist font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap');

/* ---------- Gated Content ---------- */
.gated-wall {
  text-align: center;
  padding: 40px 32px;
  background: var(--color-bg);
  border: 1px solid var(--color-brd);
  border-radius: 16px;
  margin: 32px auto;
  max-width: 460px;
}

.gated-header {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-typ);
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-brd);
}

.gated-step {
  margin-bottom: 24px;
}

.gated-step-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 12px 0 8px;
  color: var(--color-typ);
}

.gated-step-note {
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.gated-step-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.gated-step-pill-gray {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.dark .gated-step-pill-gray {
  border-color: #4b5563;
  background: #1f2937;
  color: #d1d5db;
}

.gated-step-pill-green {
  background: #10b981;
  color: #fff;
}

.gated-qr {
  margin: 16px auto;
}

.gated-qr img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid var(--color-brd);
}

.gated-account-name {
  font-size: 0.85rem;
  color: #8b5cf6;
  font-weight: 500;
}

.gated-dots {
  font-size: 1.1rem;
  letter-spacing: 6px;
  color: var(--color-typ-secondary);
  margin: 20px 0;
  user-select: none;
}

.gated-input-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.gated-input {
  flex: 1;
  max-width: 240px;
  padding: 10px 14px;
  border: 1px solid var(--color-brd);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--color-bg);
  color: var(--color-typ);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.gated-input:focus {
  outline: none;
  border-color: #10b981;
}

.gated-verify-btn {
  padding: 10px 22px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: background 0.2s;
}

.gated-verify-btn:hover {
  background: #059669;
}

.gated-verify-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.gated-error {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 12px;
}

.gated-footer {
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--color-brd);
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
}

@media (max-width: 480px) {
  .gated-wall {
    padding: 24px 16px;
    margin: 24px 0;
  }

  .gated-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .gated-input {
    max-width: none;
  }

  .gated-verify-btn {
    width: 100%;
    text-align: center;
  }

  .gated-qr img {
    width: 150px;
    height: 150px;
  }
}

/* ---------- TOC Widget ---------- */
.toc-widget {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list a {
  display: block;
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--color-typ-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.toc-list a:hover {
  color: var(--color-brand);
}

.toc-h3 a {
  padding-left: 16px;
  font-size: 0.8rem;
}

.toc-item.active a {
  color: var(--color-brand);
  font-weight: 600;
}

/* ---------- Utility ---------- */
[x-cloak] { display: none !important; }

/* ---------- Subscribe Widget (Sidebar) ---------- */
.subscribe-widget {
  padding-top: 20px;
  margin-top: 16px;
  border-top: 1px solid var(--color-brd);
}

.subscribe-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-typ);
  margin-bottom: 2px;
}

.subscribe-desc {
  font-size: 0.75rem;
  color: var(--color-typ-secondary);
  margin-bottom: 10px;
}

.subscribe-form {
  display: flex;
  gap: 6px;
}

.subscribe-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--color-bg);
  color: var(--color-typ);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.subscribe-input:focus {
  outline: none;
  border-color: var(--color-brand);
}

.subscribe-input::placeholder {
  color: var(--color-typ-secondary);
  font-size: 0.75rem;
}

.subscribe-btn {
  padding: 6px 14px;
  background: var(--color-brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: opacity 0.2s;
}

.subscribe-btn:hover {
  opacity: 0.9;
}

.subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.subscribe-msg {
  font-size: 0.75rem;
  margin-top: 6px;
}

.subscribe-success {
  color: #10b981;
}

.subscribe-error {
  color: #dc2626;
}

/* ---------- CTA Card ---------- */
.cta-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--color-brd);
  border-radius: 12px;
  margin-top: 32px;
}

.cta-card-image {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.cta-card-body {
  flex: 1;
}

.cta-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-typ);
}

.cta-card-desc {
  font-size: 0.9rem;
  color: var(--color-typ-secondary);
  margin-bottom: 12px;
}

.cta-card-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--color-brand);
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
}

.cta-card-btn:hover {
  background: var(--color-brand-hover);
  color: #fff;
}

@media (max-width: 640px) {
  .cta-card {
    flex-direction: column;
    text-align: center;
  }
  .cta-card-image {
    width: 80px;
    height: 80px;
  }
}

/* ---------- Related Articles ---------- */
.related-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-brd);
}

.related-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.related-card {
  border: 1px solid var(--color-brd);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--color-brand);
}

.related-card-thumb {
  height: 120px;
  background: var(--color-bgr-tone);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-body {
  padding: 12px;
}

.related-card-title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.related-card-date {
  font-size: 0.75rem;
  color: var(--color-typ-secondary);
}

/* ---------- View Count (FEATURE 1) ---------- */
.view-count {
  font-size: 0.75rem;
  color: var(--color-typ-secondary);
}

/* ---------- Series Nav (FEATURE 3) ---------- */
.series-nav {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--color-bgr);
  border: 1px solid var(--color-brd);
  border-radius: 12px;
}

.series-nav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.series-nav-icon {
  font-size: 1.2rem;
}

.series-nav-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-typ);
}

.series-nav-count {
  font-size: 0.8rem;
  color: var(--color-typ-secondary);
  margin-left: auto;
}

.series-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.series-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.15s;
  color: var(--color-typ);
  text-decoration: none;
}

.series-nav-item:hover {
  background: var(--color-bgr-tone);
}

.series-nav-item.active {
  background: var(--color-brand);
  color: #fff;
}

.series-nav-item.active:hover {
  background: var(--color-brand-hover);
  color: #fff;
}

.series-nav-num {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background: var(--color-bgr-tone);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.series-nav-item.active .series-nav-num {
  background: rgba(255,255,255,0.2);
}

.series-nav-title {
  flex: 1;
}

.series-nav-current {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(255,255,255,0.25);
  border-radius: 10px;
  font-weight: 500;
}

/* ---------- Scheduled Badge (FEATURE 2) ---------- */
.scheduled-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  padding: 2px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 10px;
  font-weight: 500;
  cursor: help;
}

.dark .scheduled-badge {
  background: #422006;
  color: #fbbf24;
}

/* ---------- Subscribe Sidebar Widget (FEATURE 4) ---------- */
.subscribe-sidebar-widget h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-typ-secondary);
  margin-bottom: 6px;
}

.subscribe-sidebar-widget .subscribe-desc {
  font-size: 0.75rem;
  color: var(--color-typ-secondary);
  margin-bottom: 10px;
}

.subscribe-form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subscribe-form-sidebar .subscribe-input {
  padding: 8px 12px;
  border: 1px solid var(--color-brd);
  border-radius: 6px;
  font-size: 0.82rem;
  background: var(--color-bg);
  color: var(--color-typ);
  font-family: var(--font-sans);
}

.subscribe-form-sidebar .subscribe-input:focus {
  outline: none;
  border-color: var(--color-brand);
}

.subscribe-form-sidebar .subscribe-input::placeholder {
  color: var(--color-typ-secondary);
  font-size: 0.75rem;
}

.subscribe-form-sidebar .subscribe-btn {
  padding: 8px 14px;
  background: var(--color-brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: opacity 0.2s;
}

.subscribe-form-sidebar .subscribe-btn:hover {
  opacity: 0.9;
}

.subscribe-form-sidebar .subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.subscribe-sidebar-widget .subscribe-msg {
  font-size: 0.75rem;
  margin-top: 6px;
}

.subscribe-sidebar-widget .subscribe-success,
.subscribe-sidebar-widget .subscribe-success {
  color: #10b981;
}

.subscribe-sidebar-widget .subscribe-error,
.subscribe-sidebar-widget .subscribe-error {
  color: #dc2626;
}

/* ---------- Ad Cards (Right Sidebar) ---------- */
.ad-card {
  display: block;
  border: 1px solid var(--color-brd);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--color-bg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
  text-decoration: none;
}

.ad-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.dark .ad-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.40);
}

.ad-card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bgr);
}

.ad-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-bgr) 0%, var(--color-bgr-tone) 100%);
  font-size: 2rem;
  color: var(--color-typ-secondary);
  opacity: 0.6;
}

.ad-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  background: var(--color-brand);
  color: #fff;
  border-radius: 12px;
  z-index: 2;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.ad-card-body {
  padding: 14px 16px;
}

.ad-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-typ);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-card-desc {
  font-size: 0.8rem;
  color: var(--color-typ-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 10px;
}

.ad-card-btn {
  display: inline-block;
  padding: 8px 22px;
  background: var(--color-brand);
  color: #fff;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: opacity 0.2s, transform 0.15s;
}

.ad-card:hover .ad-card-btn {
  transform: scale(1.03);
}

.ad-card-more {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-typ-secondary);
  padding: 10px 0;
  transition: color 0.2s;
  text-decoration: none;
  border-top: 1px solid var(--color-brd);
}

.ad-card-more:hover {
  color: var(--color-brand);
}

.ad-card-empty {
  text-align: center;
  padding: 20px 12px;
  color: var(--color-typ-secondary);
  font-size: 0.8rem;
}

.ad-card-empty-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
  opacity: 0.5;
}
