/* ============================================
   51E8 技术站主题样式
   Web3.0 极简技术风 · 明亮/暗黑双模式
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
    --51e8-accent: #3b82f6;
    --51e8-accent-rgb: 59, 130, 246;
    --51e8-radius: 10px;
    --51e8-radius-sm: 6px;
    --51e8-transition: 0.25s ease;
}

/* 明亮模式 */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-nav: rgba(255,255,255,0.85);
    --bg-code: #f1f5f9;
    --bg-input: #f1f5f9;
    --bg-side-hover: rgba(0,0,0,0.03);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --hero-bg: #f0f5ff;
    --hero-grid: rgba(59,130,246,0.04);
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --footer-heading: #f1f5f9;
    --pagination-bg: #f1f5f9;
    --pagination-active: #3b82f6;
    --pagination-text: #475569;
    --tag-bg: #eef2ff;
    --tag-text: #4338ca;
    --badge-bg: rgba(59,130,246,0.1);
    --badge-text: #3b82f6;
    --code-block-bg: #1e293b;
    --blockquote-border: #3b82f6;
    --blockquote-bg: #f8fafc;
    --alert-bg: #fef3c7;
    --alert-text: #b45309;
}

/* 暗黑模式 */
[data-theme="dark"] {
    --bg-primary: #0b1120;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1e293b;
    --bg-nav: rgba(11,17,32,0.92);
    --bg-code: #1e293b;
    --bg-input: #1e293b;
    --bg-side-hover: rgba(255,255,255,0.04);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #1e293b;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --hero-bg: #0b1120;
    --hero-grid: rgba(59,130,246,0.06);
    --footer-bg: #070c17;
    --footer-text: #64748b;
    --footer-heading: #cbd5e1;
    --pagination-bg: #1e293b;
    --pagination-active: #3b82f6;
    --pagination-text: #94a3b8;
    --tag-bg: rgba(59,130,246,0.15);
    --tag-text: #93c5fd;
    --badge-bg: rgba(59,130,246,0.2);
    --badge-text: #93c5fd;
    --code-block-bg: #0f172a;
    --blockquote-border: #3b82f6;
    --blockquote-bg: #111827;
    --alert-bg: #78350f;
    --alert-text: #fbbf24;
}

/* 等宽字体模式 */
[data-font="mono"] {
    --font-body: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-heading: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}
[data-font="system"], :root {
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
[data-font="serif"] {
    --font-body: 'Noto Serif SC', 'Source Han Serif SC', Georgia, 'Times New Roman', serif;
    --font-heading: 'Noto Serif SC', 'Source Han Serif SC', Georgia, 'Times New Roman', serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background var(--51e8-transition), color var(--51e8-transition);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--51e8-accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .85; }
img { max-width: 100%; height: auto; }
::selection { background: rgba(var(--51e8-accent-rgb), 0.25); color: var(--text-primary); }

/* ---------- Container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--51e8-transition), border-color var(--51e8-transition);
}
.header-inner {
    display: flex; align-items: center; gap: 0; height: 60px;
    position: relative;
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff; font-size: 14px; font-weight: 700; font-family: monospace; letter-spacing: -1px;
}
.brand-logo { display: block; }
.brand-name {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
    transition: color var(--51e8-transition);
}

/* ---------- Navigation ---------- */
.main-nav { flex: 1; display: flex; justify-content: flex-end; }
.main-nav .nav-list {
    list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px;
}
.main-nav .nav-link {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 6px 14px; border-radius: var(--51e8-radius-sm);
    font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none;
    transition: all var(--51e8-transition); white-space: nowrap;
}
.main-nav .nav-link:hover,
.main-nav .nav-link.active { color: var(--51e8-accent); background: var(--badge-bg); }
.main-nav .nav-link.active { font-weight: 600; }
.main-nav .nav-caret { font-size: 10px; transition: transform .2s; }
.main-nav .has-dropdown:hover .nav-caret { transform: rotate(180deg); }

/* Dropdown */
.main-nav .has-dropdown { position: relative; }
.main-nav .dropdown {
    display: none; position: absolute; top: 100%; left: 0; z-index: 999;
    min-width: 180px; padding: 6px; list-style: none;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--51e8-radius); box-shadow: var(--shadow-lg);
}
.main-nav .has-dropdown:hover .dropdown { display: block; }
.dropdown-link {
    display: block; padding: 8px 12px; border-radius: var(--51e8-radius-sm);
    font-size: 13px; color: var(--text-secondary); text-decoration: none;
    transition: all .15s;
}
.dropdown-link:hover, .dropdown-link.active { color: var(--51e8-accent); background: var(--bg-side-hover); }

/* ---------- Header Actions ---------- */
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.header-search { position: relative; display: none; }
.header-search-input {
    width: 180px; height: 34px; padding: 0 34px 0 12px; border-radius: 17px;
    border: 1px solid var(--border-color); background: var(--bg-input);
    font-size: 13px; color: var(--text-primary); outline: none;
    transition: all var(--51e8-transition);
}
.header-search-input:focus { width: 220px; border-color: var(--51e8-accent); }
.header-search-btn {
    position: absolute; right: 2px; top: 2px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--text-muted); cursor: pointer;
    border-radius: 50%; font-size: 14px;
}
.header-search-btn:hover { background: var(--badge-bg); color: var(--51e8-accent); }

/* Theme Toggle */
.theme-toggle {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); border-radius: 50%; background: transparent;
    color: var(--text-secondary); cursor: pointer; font-size: 15px;
    transition: all var(--51e8-transition); flex-shrink: 0;
}
.theme-toggle:hover { background: var(--badge-bg); color: var(--51e8-accent); border-color: transparent; }
.theme-toggle.ghost { border: none; width: auto; height: auto; padding: 4px 8px; border-radius: 6px; gap: 4px; font-size: 13px; }
.theme-toggle.ghost:hover { background: var(--bg-side-hover); }
[data-theme="dark"] .theme-toggle [data-icon="light"],
[data-theme="light"] .theme-toggle [data-icon="dark"] { display: none; }

/* Nav Toggle (mobile) */
.nav-toggle { display: none; width: 34px; height: 34px; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); border-radius: 6px; background: transparent;
    color: var(--text-secondary); cursor: pointer; font-size: 18px; flex-shrink: 0; }

/* ---------- Main ---------- */
.site-main { min-height: 60vh; padding: 24px 0 48px; }
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.content-layout.is-wide { grid-template-columns: 1fr; }
.content-main { min-width: 0; }
.content-side { position: sticky; top: 84px; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    background: var(--hero-bg); border-radius: 14px;
    padding: 52px 40px 48px; margin-bottom: 32px; text-align: center;
    transition: background var(--51e8-transition);
}
.hero-grid {
    position: absolute; inset: 0; opacity: .5;
    background-image:
        linear-gradient(var(--hero-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
    background-size: 40px 40px;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    background: var(--badge-bg); color: var(--badge-text); font-size: 12px; font-weight: 600;
    letter-spacing: 0.5px; margin-bottom: 16px;
}
.hero-title {
    font-family: var(--font-heading); font-size: 28px; font-weight: 800;
    color: var(--text-primary); margin: 0 0 10px; line-height: 1.3;
}
.hero-sub { font-size: 15px; color: var(--text-secondary); margin: 0 0 24px; }
.hero-search {
    display: inline-flex; align-items: center; width: 100%; max-width: 480px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
    padding: 0 4px 0 16px; box-shadow: var(--shadow-sm); transition: all var(--51e8-transition);
    margin-bottom: 20px;
}
.hero-search:focus-within { border-color: var(--51e8-accent); box-shadow: 0 0 0 3px rgba(var(--51e8-accent-rgb), 0.15); }
.hero-search-icon { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.hero-search input {
    flex: 1; border: none; background: transparent; padding: 12px 10px; font-size: 14px;
    color: var(--text-primary); outline: none; font-family: var(--font-body);
}
.hero-search button {
    padding: 8px 20px; border-radius: 8px; border: none;
    background: var(--51e8-accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: opacity .15s; flex-shrink: 0;
}
.hero-search button:hover { opacity: .9; }
.hero-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-cat {
    padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-color);
    text-decoration: none; transition: all .15s;
}
.hero-cat:hover { color: var(--51e8-accent); border-color: var(--51e8-accent); background: var(--badge-bg); }

/* ---------- Section Head ---------- */
.section-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.section-title {
    font-family: var(--font-heading); font-size: 20px; font-weight: 700;
    display: flex; align-items: center; gap: 10px; margin: 0;
    color: var(--text-primary);
}
.section-title.small { font-size: 17px; }
.section-bar {
    display: inline-block; width: 3px; height: 18px; border-radius: 2px;
    background: linear-gradient(180deg, var(--51e8-accent), #8b5cf6); flex-shrink: 0;
}
.section-more {
    font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none;
    display: flex; align-items: center; gap: 4px; transition: color .15s;
}
.section-more:hover { color: var(--51e8-accent); }

/* ---------- Post Card (list) ---------- */
.post-grid { display: flex; flex-direction: column; gap: 16px; }
.post-card {
    display: flex; flex-direction: row; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--51e8-radius);
    overflow: hidden; transition: all var(--51e8-transition);
}
.post-card:hover { border-color: transparent; box-shadow: var(--shadow-md); }
.post-card-thumb {
    position: relative; flex: 0 0 260px; overflow: hidden; display: block;
    min-height: 160px; background: var(--bg-secondary);
}
.post-card-thumb img {
    width: 100%; height: 100%; object-fit: cover; transition: transform .4s;
}
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.thumb-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); opacity: 0; transition: opacity .3s; color: #fff; font-size: 24px;
}
.post-card:hover .thumb-overlay { opacity: 1; }
.post-card-body {
    flex: 1; padding: 20px 24px; display: flex; flex-direction: column; min-width: 0;
}
.post-card-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cat-badge { display: inline-block; }
.cat-badge a {
    display: inline-block; padding: 2px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 600; color: var(--badge-text);
    background: var(--badge-bg); text-decoration: none;
}
.cat-badge a:hover { opacity: .8; }
.meta-date { font-size: 12px; color: var(--text-muted); }
.post-card-title {
    margin: 0 0 8px; font-size: 17px; font-weight: 700; font-family: var(--font-heading);
    line-height: 1.4;
}
.post-card-title a { color: var(--text-primary); text-decoration: none; }
.post-card-title a:hover { color: var(--51e8-accent); }
.post-card-title .pin { color: #ef4444; font-size: 14px; margin-right: 4px; }
.post-card-excerpt {
    font-size: 14px; color: var(--text-secondary); line-height: 1.6;
    margin: 0 0 12px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.foot-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.read-more {
    font-size: 13px; font-weight: 600; color: var(--51e8-accent); text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.read-more:hover { gap: 8px; }

/* ---------- Archive Head ---------- */
.archive-head { margin-bottom: 24px; }
.archive-title {
    font-family: var(--font-heading); font-size: 22px; font-weight: 700; margin: 0 0 6px;
    display: flex; align-items: center; gap: 10px;
}
.archive-desc { margin: 0; font-size: 14px; color: var(--text-secondary); }
.archive-count {
    display: inline-block; margin-top: 8px; font-size: 12px; padding: 2px 10px;
    border-radius: 4px; background: var(--badge-bg); color: var(--badge-text);
}

/* ---------- Single Post ---------- */
.post-detail { background: var(--bg-card); border-radius: var(--51e8-radius); padding: 32px; }
.post-head { margin-bottom: 24px; }
.post-title {
    font-family: var(--font-heading); font-size: 26px; font-weight: 800; margin: 0 0 12px;
    line-height: 1.35; color: var(--text-primary);
}
.post-meta {
    display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-muted);
}
.post-meta i { margin-right: 4px; }
.post-meta a { color: var(--text-muted); text-decoration: none; }
.post-meta a:hover { color: var(--51e8-accent); }
.post-thumb { border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.post-thumb img { width: 100%; display: block; }

/* Post Content (文章内容区) */
.post-content {
    font-size: 15px; line-height: 1.8; color: var(--text-primary);
}
.post-content h2, .post-content h3, .post-content h4 {
    font-family: var(--font-heading); font-weight: 700; margin-top: 1.8em; margin-bottom: 0.6em;
    color: var(--text-primary);
}
.post-content h2 { font-size: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.post-content h3 { font-size: 18px; }
.post-content p { margin: 0 0 1.2em; }
.post-content a { color: var(--51e8-accent); text-decoration: underline; text-underline-offset: 2px; }
.post-content img { border-radius: 8px; margin: 1em 0; }
.post-content blockquote {
    margin: 1.5em 0; padding: 16px 20px; border-left: 3px solid var(--blockquote-border);
    background: var(--blockquote-bg); border-radius: 0 var(--51e8-radius-sm) var(--51e8-radius-sm) 0;
    color: var(--text-secondary); font-style: italic;
}
.post-content pre {
    background: var(--code-block-bg); color: #e2e8f0; padding: 16px 20px; border-radius: 8px;
    overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 1.2em 0;
}
.post-content code {
    font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em; padding: 2px 6px; border-radius: 4px; background: var(--bg-code);
    color: var(--51e8-accent);
}
.post-content pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin: 1em 0; }
.post-content li { margin-bottom: 0.4em; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.post-content th, .post-content td { padding: 10px 14px; border: 1px solid var(--border-color); text-align: left; }
.post-content th { background: var(--bg-secondary); font-weight: 600; }

/* Tags */
.post-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.tags-label { font-size: 13px; color: var(--text-muted); }
.tag-pill {
    display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
    background: var(--tag-bg); color: var(--tag-text); text-decoration: none; transition: all .15s;
}
.tag-pill:hover { opacity: .8; }

/* ---------- Author Card ---------- */
.author-card {
    display: flex; align-items: center; gap: 16px; padding: 20px; margin-top: 24px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--51e8-radius);
}
.author-avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.author-name { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.author-bio { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ---------- Post Nav ---------- */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.post-nav-item {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 20px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--51e8-radius);
    text-decoration: none; transition: all var(--51e8-transition);
}
.post-nav-item:hover { border-color: transparent; box-shadow: var(--shadow-sm); }
.post-nav-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.post-nav-title { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Related Posts ---------- */
.related-box { margin-top: 24px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-card {
    display: block; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--51e8-radius); overflow: hidden; text-decoration: none;
    transition: all var(--51e8-transition);
}
.related-card:hover { border-color: transparent; box-shadow: var(--shadow-md); }
.related-thumb {
    width: 100%; height: 120px; background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-thumb i { font-size: 28px; color: var(--text-muted); opacity: .4; }
.related-title {
    padding: 10px 14px; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4;
    color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
    display: flex; flex-direction: column; gap: 20px;
}
.sidebar .sd-widget {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--51e8-radius); padding: 20px; transition: background var(--51e8-transition);
}
.sidebar .sd-widget-title {
    font-family: var(--font-heading); font-size: 14px; font-weight: 700; margin: 0 0 14px;
    display: flex; align-items: center; gap: 8px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color); color: var(--text-primary);
}
.sidebar .sd-widget-title::before {
    content: ''; display: inline-block; width: 3px; height: 14px; border-radius: 2px;
    background: var(--51e8-accent); flex-shrink: 0;
}

/* Side list (最新文章) */
.side-list li { border-bottom: 1px solid var(--border-light); }
.side-list li:last-child { border-bottom: none; }
.side-list a {
    display: flex; align-items: center; gap: 10px; padding: 10px 0;
    text-decoration: none; transition: all .15s;
}
.side-list a:hover { padding-left: 4px; }
.side-index {
    flex-shrink: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; font-size: 11px; font-weight: 700; color: var(--text-muted);
    background: var(--bg-secondary); transition: all .15s;
}
.side-list a:hover .side-index { background: var(--badge-bg); color: var(--51e8-accent); }
.side-title { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.side-date { font-size: 11px; color: var(--text-muted); }

/* Side cats (分类列表) */
.side-cats li { border-bottom: 1px solid var(--border-light); }
.side-cats li:last-child { border-bottom: none; }
.side-cats a {
    display: flex; align-items: center; justify-content: space-between; padding: 10px 0;
    font-size: 13px; color: var(--text-primary); font-weight: 500; text-decoration: none;
    transition: all .15s;
}
.side-cats a:hover { color: var(--51e8-accent); padding-left: 4px; }
.side-cats .badge {
    font-size: 11px; padding: 1px 8px; border-radius: 10px;
    background: var(--bg-secondary); color: var(--text-muted); font-weight: 500;
}

/* Side links (友链) */
.side-links { display: flex; flex-wrap: wrap; gap: 6px; }
.side-link {
    display: inline-block; padding: 4px 12px; border-radius: 6px; font-size: 12px;
    color: var(--text-secondary); background: var(--bg-secondary); text-decoration: none;
    transition: all .15s;
}
.side-link:hover { color: var(--51e8-accent); background: var(--badge-bg); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg); color: var(--footer-text); padding: 40px 0 0;
    margin-top: 48px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 24px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.footer-brand .brand-mark { width: 28px; height: 28px; font-size: 12px; }
.footer-brand .fw-bold { color: var(--footer-heading); font-size: 15px; }
.footer-desc { font-size: 13px; line-height: 1.6; margin: 0; }
.footer-title {
    font-family: var(--font-heading); font-size: 13px; font-weight: 700; margin: 0 0 12px;
    color: var(--footer-heading); text-transform: uppercase; letter-spacing: 0.5px;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a {
    font-size: 13px; color: var(--footer-text); text-decoration: none; transition: color .15s;
}
.footer-links a:hover { color: var(--51e8-accent); }
.footer-theme-switch { font-size: 13px; }
.footer-theme-switch .theme-label { font-weight: 600; color: var(--footer-heading); }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.06); font-size: 12px;
}
.footer-copy { margin: 0; }
.footer-icp { color: var(--footer-text); text-decoration: none; }
.footer-icp:hover { color: var(--51e8-accent); }
.footer-powered { margin: 0; }
.footer-powered a { color: var(--footer-text); text-decoration: none; }
.footer-powered a:hover { color: var(--51e8-accent); }

/* ---------- Pagination ---------- */
.post-list .pagination { margin-top: 24px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 20px 0 0; }
.page-item { margin: 0; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 6px;
    font-size: 13px; font-weight: 500; color: var(--pagination-text);
    background: var(--pagination-bg); border: 1px solid var(--border-color);
    text-decoration: none; transition: all .15s;
}
.page-link:hover { color: var(--51e8-accent); border-color: var(--51e8-accent); }
.page-item.active .page-link {
    background: var(--pagination-active); color: #fff; border-color: var(--pagination-active);
}

/* ---------- 404 ---------- */
.error-404 {
    text-align: center; padding: 64px 20px; background: var(--bg-card);
    border-radius: var(--51e8-radius); border: 1px solid var(--border-color);
}
.error-code {
    font-size: 80px; font-weight: 800; font-family: monospace; margin-bottom: 8px;
    color: var(--text-primary); display: flex; align-items: center; justify-content: center; gap: 4px;
}
.error-zero { color: var(--51e8-accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.error-title { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.error-desc { color: var(--text-secondary); font-size: 14px; margin: 0 0 28px; line-height: 1.6; }
.error-actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.error-search { display: inline-flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.error-search input { border: none; padding: 8px 12px; background: transparent; color: var(--text-primary); font-size: 13px; outline: none; width: 180px; }
.error-search button { border: none; background: transparent; padding: 8px 12px; color: var(--text-muted); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn-primary-solid {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; border-radius: 8px;
    border: none; background: var(--51e8-accent); color: #fff; font-size: 14px; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: opacity .15s;
}
.btn-primary-solid:hover { opacity: .9; color: #fff; }

/* ---------- Comments ---------- */
.comments-box { margin-top: 28px; }
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.comment-item:last-child { border-bottom: none; }
.comment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-meta { display: flex; flex-direction: column; gap: 1px; }
.comment-author { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.comment-date { font-size: 11px; color: var(--text-muted); }
.comment-body { font-size: 14px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 6px; }
.comment-actions { display: flex; gap: 12px; }
.comment-reply { font-size: 12px; color: var(--text-muted); text-decoration: none; cursor: pointer; }
.comment-reply:hover { color: var(--51e8-accent); }
.comment-children { margin-left: 20px; padding-left: 16px; border-left: 2px solid var(--border-color); }
.comment-form { margin-top: 24px; padding: 24px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--51e8-radius); }
.comment-form-title { font-size: 15px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.cancel-reply-btn { background: none; border: none; color: #ef4444; font-size: 13px; cursor: pointer; padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-full { grid-column: 1 / -1; }
.form-field { position: relative; }
.f-input, .f-textarea {
    width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border-color);
    background: var(--bg-input); color: var(--text-primary); font-size: 13px; font-family: var(--font-body);
    outline: none; transition: all .15s;
}
.f-input:focus, .f-textarea:focus { border-color: var(--51e8-accent); box-shadow: 0 0 0 3px rgba(var(--51e8-accent-rgb), 0.12); }
.f-textarea { resize: vertical; }
.logged-in-msg { font-size: 13px; color: var(--text-secondary); padding: 10px 14px; background: var(--bg-secondary); border-radius: 8px; margin: 0; }
.captcha-field { display: flex; align-items: center; gap: 8px; }
.captcha-img { border-radius: 6px; cursor: pointer; height: 40px; }
.alert-msg { padding: 10px 16px; border-radius: 8px; font-size: 13px; background: var(--alert-bg); color: var(--alert-text); margin-bottom: 16px; }

/* ---------- Gallery ---------- */
.gallery-masonry {
    column-count: 3; column-gap: 14px;
}
.gallery-item {
    display: inline-block; break-inside: avoid; margin-bottom: 14px;
    position: relative; border-radius: var(--51e8-radius); overflow: hidden;
    background: var(--bg-secondary); text-decoration: none;
}
.gallery-item img { width: 100%; display: block; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-noimg {
    min-height: 140px; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 28px; opacity: .4;
}
.gallery-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 20px 14px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff; opacity: 0; transition: opacity .3s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-title { display: block; font-size: 13px; font-weight: 600; }
.gallery-date { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state i { font-size: 48px; color: var(--text-muted); opacity: .3; display: block; margin-bottom: 12px; }
.empty-state h4 { font-size: 16px; color: var(--text-secondary); font-weight: 500; margin: 0 0 16px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0; font-size: 13px; list-style: none; padding: 0; margin: 0; }
.breadcrumb-item { display: inline-flex; align-items: center; }
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--51e8-accent); }
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { content: ''; }

/* ---------- Highlight (search) ---------- */
.highlight { background: rgba(251,191,36,0.3); color: var(--text-primary); padding: 0 2px; border-radius: 2px; }

/* ---------- Page About ---------- */
.page-about .about-hero { text-align: center; padding: 24px 0 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .content-layout { grid-template-columns: 1fr; }
    .content-side { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .gallery-masonry { column-count: 2; }
}

@media (max-width: 768px) {
    .header-inner { justify-content: space-between; }
    .main-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg-nav); backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-color); padding: 12px 16px;
    }
    .main-nav.is-open { display: block; }
    .main-nav .nav-list { flex-direction: column; gap: 0; }
    .main-nav .nav-link { width: 100%; padding: 10px 14px; }
    .main-nav .dropdown { position: static; box-shadow: none; border: none; padding-left: 16px; background: transparent; }
    .main-nav .has-dropdown:hover .dropdown { display: none; }
    .main-nav .has-dropdown .dropdown.is-open { display: block; }
    .nav-toggle { display: flex; }
    .header-search { display: none; }
    .hero { padding: 32px 20px 28px; }
    .hero-title { font-size: 22px; }
    .hero-sub { font-size: 14px; }
    .post-card { flex-direction: column; }
    .post-card-thumb { flex: 0 0 200px; min-height: 180px; }
    .post-detail { padding: 20px; }
    .post-title { font-size: 22px; }
    .post-nav { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .form-grid { grid-template-columns: 1fr; }
    .gallery-masonry { column-count: 2; }
}

@media (max-width: 500px) {
    .gallery-masonry { column-count: 1; }
    .hero-search { flex-direction: column; border-radius: 10px; overflow: hidden; }
    .hero-search button { width: 100%; border-radius: 0; padding: 10px; }
}