/* ============================================
   Mirages Theme - Premium Styles
   ============================================ */

:root {
    --primary-color: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);
    --shadow-glow: 0 0 20px rgb(59 130 246 / 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: "Noto Serif SC", Georgia, "Times New Roman", serif;
    --content-width: 720px;
    --sidebar-width: 300px;
    --header-height: 70px;
}

.dark-mode {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --border-color: #334155;
    --border-light: #1e293b;
    --shadow-glow: 0 0 20px rgb(96 165 250 / 0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-sans); font-size: 1rem; line-height: 1.8; color: var(--text-primary); background: var(--bg-primary); transition: background-color var(--transition-slow), color var(--transition-slow); min-height: 100vh; }
::selection { background: var(--primary-color); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
a { color: var(--primary-color); text-decoration: none; transition: var(--transition-base); position: relative; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

.loading-bar { position: fixed; top: 0; left: 0; width: 0; height: 2px; background: linear-gradient(90deg, var(--primary-color), var(--primary-light)); z-index: 9999; transition: width 0.3s ease; box-shadow: 0 0 10px var(--primary-color); }
.loading-bar.active { width: 70%; }
.loading-bar.complete { width: 100%; opacity: 0; transition: opacity 0.4s ease 0.2s; }

.site-sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-width); height: 100vh; background: var(--bg-secondary); border-right: 1px solid var(--border-color); z-index: 100; overflow-y: auto; overflow-x: hidden; transition: var(--transition-slow); }
.site-sidebar::before { content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%; background: linear-gradient(to bottom, transparent, var(--border-color), transparent); opacity: 0.5; }
.sidebar-inner { padding: 2.5rem 2rem; min-height: 100%; display: flex; flex-direction: column; position: relative; }

.site-branding { text-align: center; margin-bottom: 2.5rem; position: relative; }
.site-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1rem; object-fit: cover; border: 3px solid var(--bg-primary); box-shadow: var(--shadow-md); transition: var(--transition-base); }
.site-avatar:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.site-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); display: block; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.site-description { font-size: 0.8125rem; color: var(--text-tertiary); line-height: 1.6; font-weight: 400; }

.sidebar-navigation { margin-bottom: 1.5rem; }
.sidebar-navigation ul { list-style: none; }
.sidebar-navigation li { margin-bottom: 0.25rem; }
.sidebar-navigation a { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 0.9375rem; font-weight: 500; transition: var(--transition-base); position: relative; overflow: hidden; }
.sidebar-navigation a::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0); width: 3px; height: 60%; background: var(--primary-color); border-radius: 0 2px 2px 0; transition: var(--transition-base); }
.sidebar-navigation a:hover, .sidebar-navigation .current-menu-item a { color: var(--primary-color); background: var(--bg-tertiary); }
.sidebar-navigation a:hover::before, .sidebar-navigation .current-menu-item a::before { transform: translateY(-50%) scaleY(1); }
.sidebar-navigation .current-menu-item a { font-weight: 600; }

.sidebar-widgets { margin-top: auto; padding-top: 1.5rem; border-top: 1px solid var(--border-light); }
.widget { margin-bottom: 1.5rem; }
.widget-title { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-tertiary); margin-bottom: 0.875rem; padding-left: 1rem; }
.widget ul { list-style: none; }
.widget li { padding: 0.375rem 0; }
.widget a { color: var(--text-secondary); font-size: 0.875rem; display: block; padding: 0.25rem 1rem; border-radius: var(--radius-sm); transition: var(--transition-fast); }
.widget a:hover { color: var(--primary-color); background: var(--bg-tertiary); padding-left: 1.25rem; }

.sidebar-footer { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); }
.social-links { display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text-tertiary); background: var(--bg-tertiary); transition: var(--transition-base); }
.social-links a:hover { color: #fff; background: var(--primary-color); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.dark-mode-toggle { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.625rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-secondary); font-size: 0.8125rem; font-weight: 500; cursor: pointer; margin-bottom: 1rem; transition: var(--transition-base); }
.dark-mode-toggle:hover { background: var(--bg-tertiary); border-color: var(--primary-color); color: var(--primary-color); }
.dark-mode-toggle .sun-icon { display: block; }
.dark-mode-toggle .moon-icon { display: none; }
.dark-mode .dark-mode-toggle .sun-icon { display: none; }
.dark-mode .dark-mode-toggle .moon-icon { display: block; }
.copyright { text-align: center; font-size: 0.6875rem; color: var(--text-tertiary); letter-spacing: 0.02em; }

.site-header.top-nav { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); background: rgba(255, 255, 255, 0.85); border-bottom: 1px solid var(--border-light); z-index: 100; backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); transition: var(--transition-slow); }
.dark-mode .site-header.top-nav { background: rgba(15, 23, 42, 0.85); }
.header-inner { max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; }
.top-nav .site-branding { margin-bottom: 0; text-align: left; display: flex; align-items: center; gap: 0.75rem; }
.top-nav .site-title { font-size: 1.125rem; margin-bottom: 0; }
.main-navigation ul { display: flex; list-style: none; gap: 0.25rem; align-items: center; }
.main-navigation a { display: block; padding: 0.5rem 1rem; color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; border-radius: var(--radius-sm); transition: var(--transition-base); position: relative; }
.main-navigation a::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%) scaleX(0); width: 20px; height: 2px; background: var(--primary-color); border-radius: 1px; transition: var(--transition-base); }
.main-navigation a:hover, .main-navigation .current-menu-item a { color: var(--primary-color); }
.main-navigation a:hover::after, .main-navigation .current-menu-item a::after { transform: translateX(-50%) scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 0.5rem; }
.header-tools button { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; transition: var(--transition-base); position: relative; }
.header-tools button:hover { background: var(--bg-tertiary); color: var(--primary-color); }
.header-tools button::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-sm); border: 1px solid transparent; transition: var(--transition-base); }
.header-tools button:hover::after { border-color: var(--border-color); }
.mobile-menu-toggle { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.mobile-menu-toggle span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px; transition: var(--transition-base); }

.search-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; opacity: 0; visibility: hidden; transition: var(--transition-slow); }
.search-overlay.active { opacity: 1; visibility: visible; }
.search-container { width: 90%; max-width: 640px; background: var(--bg-card); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow-xl); transform: translateY(-30px) scale(0.95); transition: var(--transition-slow); border: 1px solid var(--border-color); }
.search-overlay.active .search-container { transform: translateY(0) scale(1); }
.search-form { display: flex; gap: 0.75rem; }
.search-field { flex: 1; padding: 1rem 1.25rem; border: 2px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-secondary); color: var(--text-primary); font-size: 1rem; outline: none; transition: var(--transition-base); font-family: var(--font-sans); }
.search-field:focus { border-color: var(--primary-color); box-shadow: 0 0 0 4px rgb(59 130 246 / 0.1); }
.search-field::placeholder { color: var(--text-tertiary); }
.search-submit, .search-close { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border: none; border-radius: var(--radius-lg); background: var(--bg-tertiary); color: var(--text-secondary); cursor: pointer; transition: var(--transition-base); }
.search-submit:hover, .search-close:hover { background: var(--primary-color); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.site-content { margin-left: var(--sidebar-width); min-height: 100vh; position: relative; }
.nav-top .site-content { margin-left: 0; padding-top: var(--header-height); }
.main-content { max-width: var(--content-width); margin: 0 auto; padding: 3rem 2rem; }

.hero-banner { position: relative; height: 420px; margin: -3rem -2rem 3rem; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.5) 100%); }
.hero-banner::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 120px; background: linear-gradient(to top, var(--bg-primary), transparent); }
.hero-content { position: relative; z-index: 1; text-align: center; color: #fff; padding: 0 2rem; max-width: 600px; }
.hero-title { font-size: 2.75rem; font-weight: 700; margin-bottom: 1rem; text-shadow: 0 2px 20px rgba(0,0,0,0.3); letter-spacing: -0.02em; line-height: 1.2; }
.hero-desc { font-size: 1.125rem; opacity: 0.9; font-weight: 400; text-shadow: 0 1px 10px rgba(0,0,0,0.2); }

.section-header { margin-bottom: 2.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.section-title::after { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--primary-color); border-radius: 50%; margin-left: 0.5rem; vertical-align: middle; }
.posts-container { display: flex; flex-direction: column; gap: 2rem; }

.posts-container.card .post-item { background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition-slow); border: 1px solid var(--border-light); position: relative; }
.posts-container.card .post-item::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary-color), var(--primary-light)); opacity: 0; transition: var(--transition-slow); z-index: 2; }
.posts-container.card .post-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); border-color: var(--border-color); }
.posts-container.card .post-item:hover::before { opacity: 1; }
.posts-container.card .post-thumbnail { display: block; height: 240px; overflow: hidden; position: relative; }
.posts-container.card .post-thumbnail::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3)); opacity: 0; transition: var(--transition-slow); }
.posts-container.card .post-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.posts-container.card .post-item:hover .post-thumbnail img { transform: scale(1.08); }
.posts-container.card .post-item:hover .post-thumbnail::after { opacity: 1; }
.posts-container.card .post-body { padding: 1.75rem; }
/* Card Link - 整个卡片可点击 */
.post-card-link { display: block; color: inherit; text-decoration: none; }
.post-card-link:hover { color: inherit; opacity: 1; }
.post-card-link .post-title { color: var(--text-primary); transition: var(--transition-base); }
.post-card-link:hover .post-title { color: var(--primary-color); }
.post-card-link .read-more { color: var(--primary-color); font-weight: 600; transition: var(--transition-base); }
.post-card-link:hover .read-more { padding-left: 4px; }
.post-card-link .category-link { pointer-events: none; }


.posts-container.list .post-item { display: flex; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--border-light); transition: var(--transition-base); position: relative; }
.posts-container.list .post-item:hover { padding-left: 0.5rem; }
.posts-container.list .post-item::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0); width: 3px; height: 40%; background: var(--primary-color); border-radius: 0 2px 2px 0; transition: var(--transition-base); }
.posts-container.list .post-item:hover::before { transform: translateY(-50%) scaleY(1); }
.posts-container.list .post-thumbnail { flex-shrink: 0; width: 200px; height: 140px; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.posts-container.list .post-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.posts-container.list .post-item:hover .post-thumbnail img { transform: scale(1.05); }

.post-title { font-size: 1.25rem; font-weight: 700; line-height: 1.4; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--primary-color); }
.post-excerpt { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.75; margin-bottom: 1.25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 1.25rem; font-size: 0.8125rem; color: var(--text-tertiary); font-weight: 500; }
.post-meta span { display: inline-flex; align-items: center; gap: 0.375rem; }
.read-more a { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--primary-color); font-weight: 600; font-size: 0.875rem; }
.read-more a:hover { gap: 0.625rem; }
.post-categories { margin-bottom: 0.75rem; }
.category-link { display: inline-flex; align-items: center; padding: 0.25rem 0.875rem; background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: #fff; font-size: 0.6875rem; font-weight: 700; border-radius: 9999px; text-transform: uppercase; letter-spacing: 0.05em; box-shadow: var(--shadow-xs); transition: var(--transition-base); }
.category-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); color: #fff; }

.post-banner { position: relative; height: 420px; margin: -3rem -2rem 3rem; overflow: hidden; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.post-banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.7) 100%); }
.single-post .post-header { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border-light); }
.single-post .post-title { font-size: 2.25rem; margin-bottom: 1.25rem; line-height: 1.3; letter-spacing: -0.02em; font-weight: 800; }
.post-meta { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.post-meta .post-date, .post-meta .read-time, .post-meta .post-views, .post-meta .post-comments { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-tertiary); font-weight: 500; }

.post-content { font-size: 1.0625rem; line-height: 1.9; color: var(--text-primary); }
.post-content > * + * { margin-top: 1.5rem; }
.post-content h2, .post-content h3, .post-content h4 { margin: 2.5rem 0 1rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.post-content h2 { font-size: 1.625rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--border-color); position: relative; }
.post-content h2::after { content: ""; position: absolute; bottom: -2px; left: 0; width: 60px; height: 2px; background: linear-gradient(90deg, var(--primary-color), var(--primary-light)); }
.post-content h3 { font-size: 1.375rem; }
.post-content h4 { font-size: 1.125rem; }
.post-content p { margin-bottom: 1.5rem; line-height: 1.9; }
.post-content a { color: var(--primary-color); border-bottom: 1px solid transparent; transition: var(--transition-base); }
.post-content a:hover { border-bottom-color: var(--primary-color); }
.post-content img { border-radius: var(--radius-lg); margin: 2rem 0; box-shadow: var(--shadow-md); }
.post-content blockquote { margin: 2rem 0; padding: 1.25rem 1.75rem; border-left: 4px solid var(--primary-color); background: var(--bg-secondary); border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--text-secondary); font-style: italic; position: relative; }
.post-content blockquote::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary-color) 0%, transparent 100%); opacity: 0.03; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.post-content code { padding: 0.2em 0.5em; background: var(--bg-tertiary); border-radius: var(--radius-sm); font-family: "SF Mono", Monaco, "Cascadia Code", monospace; font-size: 0.85em; color: var(--primary-color); font-weight: 500; }
.post-content pre { margin: 2rem 0; padding: 1.5rem; background: var(--bg-secondary); border-radius: var(--radius-lg); overflow-x: auto; border: 1px solid var(--border-light); position: relative; }
.post-content pre::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.post-content pre code { padding: 0; background: none; color: inherit; font-weight: 400; }
.post-content table { width: 100%; margin: 2rem 0; border-collapse: collapse; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.post-content th, .post-content td { padding: 0.875rem 1.25rem; border: 1px solid var(--border-color); text-align: left; }
.post-content th { background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary)); font-weight: 700; color: var(--text-primary); }
.post-content tr:nth-child(even) { background: var(--bg-secondary); }
.post-content ul, .post-content ol { margin: 1.25rem 0; padding-left: 1.75rem; }
.post-content li { margin-bottom: 0.625rem; position: relative; }
.post-content li::marker { color: var(--primary-color); }
.post-content hr { margin: 2.5rem 0; border: none; height: 1px; background: linear-gradient(to right, transparent, var(--border-color), transparent); }

.post-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-light); }
.post-tags { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-bottom: 2rem; }
.tag-link { padding: 0.375rem 1rem; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 9999px; font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; transition: var(--transition-base); }
.tag-link:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.post-navigation { margin: 2.5rem 0; padding: 1.5rem 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.nav-previous, .nav-next { padding: 1.25rem; background: var(--bg-secondary); border-radius: var(--radius-lg); transition: var(--transition-base); border: 1px solid var(--border-light); position: relative; overflow: hidden; }
.nav-previous:hover, .nav-next:hover { background: var(--bg-card); border-color: var(--border-color); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nav-previous::before, .nav-next::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: linear-gradient(to bottom, var(--primary-color), var(--primary-light)); opacity: 0; transition: var(--transition-base); }
.nav-previous:hover::before, .nav-next:hover::before { opacity: 1; }
.nav-next { text-align: right; }
.nav-next::before { left: auto; right: 0; }
.nav-label { display: block; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-tertiary); margin-bottom: 0.5rem; font-weight: 700; }
.nav-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }

.related-posts { margin: 2.5rem 0; }
.related-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1.25rem; letter-spacing: -0.01em; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.related-item { background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition-slow); border: 1px solid var(--border-light); }
.related-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-color); }
.related-thumb { display: block; height: 140px; overflow: hidden; position: relative; }
.related-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.3)); }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.related-item:hover .related-thumb img { transform: scale(1.08); }
.related-item-title { padding: 1rem; font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
.related-item-title a { color: var(--text-primary); }
.related-item-title a:hover { color: var(--primary-color); }
.related-date { display: block; padding: 0 1rem 1rem; font-size: 0.75rem; color: var(--text-tertiary); font-weight: 500; }

.toc-widget { position: fixed; right: 2rem; top: 50%; transform: translateY(-50%) translateX(20px); width: 260px; max-height: 70vh; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; opacity: 0; visibility: hidden; transition: var(--transition-slow); z-index: 50; box-shadow: var(--shadow-lg); }
.toc-widget.active { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }
.toc-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.02em; }
.toc-toggle { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; background: var(--bg-tertiary); border-radius: var(--radius-sm); color: var(--text-tertiary); cursor: pointer; transition: var(--transition-base); }
.toc-toggle:hover { background: var(--primary-color); color: #fff; }
.toc-body { padding: 0.75rem; overflow-y: auto; max-height: calc(70vh - 60px); }
.toc-body ul { list-style: none; }
.toc-body li { margin: 0; }
.toc-body a { display: block; padding: 0.5rem 0.875rem; color: var(--text-secondary); font-size: 0.8125rem; font-weight: 500; border-radius: var(--radius-sm); transition: var(--transition-fast); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid transparent; }
.toc-body a:hover { color: var(--primary-color); background: var(--bg-tertiary); border-left-color: var(--primary-light); }
.toc-body a.active { color: var(--primary-color); background: var(--bg-tertiary); border-left-color: var(--primary-color); font-weight: 600; }
.toc-body .toc-h3 { padding-left: 1.5rem; }
.toc-body .toc-h4 { padding-left: 2.25rem; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-light); }
.pagination a, .pagination .current { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 0.875rem; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600; transition: var(--transition-base); }
.pagination a { color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--border-light); }
.pagination a:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pagination .current { background: var(--primary-color); color: #fff; border: 1px solid var(--primary-color); box-shadow: var(--shadow-glow); }
.pagination .dots { color: var(--text-tertiary); }

.comments-area-wrapper { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-light); }
.comments-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.01em; }
.comment-list { list-style: none; }
.comment { margin-bottom: 1.5rem; padding: 1.25rem; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border-light); transition: var(--transition-base); }
.comment:hover { border-color: var(--border-color); box-shadow: var(--shadow-sm); }
.comment-meta { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 0.875rem; }
.comment-author .avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border-light); }
.comment-author-name { font-weight: 700; font-size: 0.9375rem; }
.comment-date { font-size: 0.75rem; color: var(--text-tertiary); font-weight: 500; }
.comment-content { font-size: 0.9375rem; line-height: 1.75; color: var(--text-secondary); }
.comment-reply-link { display: inline-flex; align-items: center; gap: 0.25rem; margin-top: 0.875rem; font-size: 0.8125rem; font-weight: 600; color: var(--primary-color); }
.comment-reply-link:hover { gap: 0.5rem; }

.comment-respond { margin-top: 2rem; padding: 1.5rem; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
.comment-reply-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1.25rem; }
.comment-form label { display: block; margin-bottom: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.comment-form input, .comment-form textarea { width: 100%; padding: 0.875rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); color: var(--text-primary); font-size: 0.9375rem; outline: none; transition: var(--transition-base); font-family: var(--font-sans); }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1); }
.comment-form textarea { min-height: 140px; resize: vertical; }
.form-submit input { width: auto; padding: 0.75rem 2rem; background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: #fff; border: none; border-radius: var(--radius-md); font-size: 0.9375rem; font-weight: 600; cursor: pointer; transition: var(--transition-base); box-shadow: var(--shadow-sm); }
.form-submit input:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.error-404 { text-align: center; padding: 8rem 1.5rem; }
.error-code { font-size: 10rem; font-weight: 800; color: var(--primary-color); line-height: 1; margin-bottom: 1rem; opacity: 0.15; letter-spacing: -0.05em; }
.error-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; }
.error-desc { color: var(--text-secondary); margin-bottom: 2rem; font-size: 1rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.875rem 2rem; border-radius: var(--radius-lg); font-size: 0.9375rem; font-weight: 600; transition: var(--transition-base); cursor: pointer; border: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.back-to-top { position: fixed; right: 2rem; bottom: 2rem; width: 48px; height: 48px; border: none; border-radius: 50%; background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.8); transition: var(--transition-slow); z-index: 90; box-shadow: var(--shadow-glow); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.back-to-top:hover { transform: translateY(-4px) scale(1.1); box-shadow: 0 8px 25px rgb(59 130 246 / 0.3); }

.no-posts { text-align: center; padding: 4rem 1.5rem; color: var(--text-tertiary); }
.no-posts svg { margin-bottom: 1rem; opacity: 0.5; }

@media (max-width: 1200px) { .toc-widget { display: none; } }
@media (max-width: 768px) {
    :root { --sidebar-width: 0; }
    .site-sidebar { transform: translateX(-100%); width: 280px; box-shadow: var(--shadow-xl); }
    .site-sidebar.active { transform: translateX(0); }
    .site-content { margin-left: 0; }
    .mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 99; opacity: 0; visibility: hidden; transition: var(--transition-slow); }
    .mobile-overlay.active { opacity: 1; visibility: visible; }
    .mobile-menu-toggle { display: flex; }
    .hero-banner { height: 300px; margin: -1.5rem -1.5rem 1.5rem; }
    .hero-title { font-size: 2rem; }
    .single-post .post-title { font-size: 1.75rem; }
    .posts-container.list .post-item { flex-direction: column; }
    .posts-container.list .post-thumbnail { width: 100%; height: 200px; }
    .related-grid { grid-template-columns: 1fr; }
    .nav-links { grid-template-columns: 1fr; }
    .post-banner { height: 280px; margin: -1.5rem -1.5rem 1.5rem; }
    .back-to-top { right: 1rem; bottom: 1rem; width: 40px; height: 40px; }
    .main-content { padding: 1.5rem; }
}
@media (max-width: 480px) {
    .hero-banner { height: 240px; }
    .hero-title { font-size: 1.5rem; }
    .single-post .post-title { font-size: 1.5rem; }
    .post-content { font-size: 1rem; }
    .section-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
}
