:root {
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.09);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --article-tag-bg: #f3f4f6;
    --article-tag-text: #4b5563;
    --footer-bg: #ffffff;
    --footer-border: #e5e7eb;
    --nav-link-color: #4b5563;
    --breadcrumb-color: #6b7280;
}

[data-theme="dark"] {
    --bg: #111827;
    --card-bg: #1f2937;
    --text: #f1f5f9;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: #374151;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: #1e3a5f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
    --article-tag-bg: #374151;
    --article-tag-text: #d1d5db;
    --footer-bg: #1f2937;
    --footer-border: #374151;
    --nav-link-color: #d1d5db;
    --breadcrumb-color: #9ca3af;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s;
}
[data-theme="dark"] .header {
    background: rgba(31, 41, 55, 0.88);
}
.header-inner {
    max-width: 1260px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 20px;
    height: 56px;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    margin-right: auto;
}
.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #2563eb, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.75rem;
}
.nav-menu {
    display: flex;
    gap: 6px;
    align-items: center;
    list-style: none;
    flex-wrap: wrap;
}
.nav-menu li a {
    display: block;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--nav-link-color);
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    border: 1px solid transparent;
}
.nav-menu li a:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--border);
}
.nav-menu li a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text);
    flex-shrink: 0;
    font-weight: 700;
    margin-left: 8px;
}
.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: scale(1.04);
}

@media (max-width: 768px) {
    .header-inner {
height: auto;
padding: 10px 16px;
flex-direction: column;
gap: 8px;
align-items: flex-start;
    }
    .nav-menu {
overflow-x: auto;
width: 100%;
padding-bottom: 4px;
    }
    .theme-toggle {
position: absolute;
top: 10px;
right: 16px;
    }
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.82rem;
    color: var(--breadcrumb-color);
    padding: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--breadcrumb-color);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.breadcrumb .separator {
    user-select: none;
}
.breadcrumb .current {
    color: var(--text);
    font-weight: 600;
}

/* Main Layout */
.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 24px 18px 40px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 860px) {
    .container {
grid-template-columns: 1fr;
    }
}

.main-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.side-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}
@media (max-width: 860px) {
    .side-col {
position: static;
    }
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--accent);
}

/* Article Detail */
.article-header {
    margin-bottom: 20px;
}
.article-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text);
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.article-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--article-tag-bg);
    color: var(--article-tag-text);
}
.article-body {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text);
}
.article-body h4 {
    font-size: 1.15rem;
    margin: 24px 0 12px;
    color: var(--accent);
}
.article-body p {
    margin-bottom: 16px;
}
.article-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--border);
}
.article-body ul {
    margin: 12px 0;
    padding-left: 20px;
}
.article-body li {
    margin-bottom: 8px;
}

/* 上一篇 / 下一篇 */
.pagination-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.pagination-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.pagination-nav a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
.pagination-nav .disabled {
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.6;
}
.pagination-nav .prev::before {
    content: '←';
    font-size: 1rem;
}
.pagination-nav .next::after {
    content: '→';
    font-size: 1rem;
}

/* 相关文章列表 */
.related-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.related-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    display: block;
    font-size: 0.85rem;
}
.related-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: var(--shadow-sm);
}
.related-item .related-title {
    font-weight: 600;
    margin-bottom: 4px;
}
.related-item .related-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}
.empty-state {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 16px;
}

/* 广告位 */
.ad-placeholder {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    background: var(--bg);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    padding: 24px 20px 20px;
    margin-top: 40px;
    transition: background 0.3s;
}
.footer-inner {
    max-width: 1260px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}
.footer-copyright {
    font-size: 0.7rem;
    color: var(--text-muted);
}
@media (max-width: 640px) {
    .footer-bottom {
flex-direction: column;
align-items: flex-start;
    }
    .ad-placeholder {
width: 100%;
    }
    .article-title {
font-size: 1.4rem;
    }
    .card {
padding: 16px 18px;
    }
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c6;
    border-radius: 10px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #48484a;
}