:root {
    --primary: #003366;
    --primary-light: #0a4a80;
    --accent: #FF6600;
    --accent-light: #ff8533;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 15px 45px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
    color: var(--text-main);
    background: var(--bg-light);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* 统一头部 */
header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.1); }
.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
}
.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.logo i { color: var(--accent); font-size: 22px; }
.logo span { color: var(--accent); }
.nav-menu { display: flex; list-style: none; gap: 4px; }
.nav-menu li { position: relative; }
.nav-menu a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 14.5px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: var(--transition);
    display: block;
    white-space: nowrap;
}
.nav-menu a:hover { color: var(--primary); background: #f1f5f9; }
.nav-menu a.active { color: var(--primary); font-weight: 700; background: #eef4fb; }
.mobile-btn {
    display: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--primary);
    padding: 8px;
    border-radius: 6px;
    background: none;
    border: none;
}
.mobile-btn:hover { background: #f1f5f9; }

/* 面包屑 */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    margin-top: 66px;
    position: sticky;
    top: 64px;
    z-index: 99;
}
.breadcrumb-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.breadcrumb-inner a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.breadcrumb-inner a:hover { color: var(--primary); }
.breadcrumb-inner .sep { color: #cbd5e1; font-size: 11px; }
.breadcrumb-inner .current { color: var(--primary); font-weight: 600; }

/* 主体双栏 */
.main-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 24px 50px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 36px;
}

/* 文章主体 */
.article-detail {
    background: #fff;
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-width: 0;
}
.article-header {
    border-bottom: 1px solid #eef2f8;
    padding-bottom: 24px;
    margin-bottom: 28px;
}
.article-header h1 {
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    color: var(--primary);
    line-height: 1.4;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13.5px;
    color: var(--text-muted);
    align-items: center;
}
.article-meta span { display: flex; align-items: center; gap: 5px; }
.article-meta .category-badge {
    background: #eef4fb;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}
/* 文章内容排版 */
.article-body {
    font-size: 15px;
    color: #334155;
    line-height: 1.85;
}
.article-body h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 32px 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef2f8;
}
.article-body h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 24px 0 10px;
}
.article-body p { margin-bottom: 14px; }
.article-body ul, .article-body ol { margin: 12px 0 18px 20px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--primary); }
.article-body img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
}
.article-body blockquote {
    background: #f8fafc;
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: #475569;
}
.article-body .formula-box {
    background: #f0f4fb;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    text-align: center;
    margin: 16px 0;
    border: 1px dashed var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.article-body table th, .article-body table td {
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    text-align: left;
}
.article-body table th {
    background: #f8fafc;
    color: var(--primary);
    font-weight: 700;
}
/* 文章底部标签与分享 */
.article-footer-tags {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #eef2f8;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.article-footer-tags .tag {
    background: #f1f5f9;
    color: #475569;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12.5px;
    transition: var(--transition);
    text-decoration: none;
}
.article-footer-tags .tag:hover { background: #e2e8f0; }
/* 上一篇/下一篇 */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 20px;
    flex-wrap: wrap;
}
.post-nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.post-nav a:hover { color: var(--accent); }

/* 右侧边栏 */
.sidebar { min-width: 0; }
.sidebar-widget {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.widget-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef2f8;
    display: flex;
    align-items: center;
    gap: 8px;
}
.widget-title i { color: var(--accent); font-size: 16px; }
.category-list { list-style: none; padding: 0; }
.category-list li { margin-bottom: 10px; }
.category-list a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    transition: var(--transition);
    padding: 4px 0;
}
.category-list a:hover { color: var(--accent); }
.category-list span {
    background: #f1f5f9;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.hot-post-item {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    align-items: center;
}
.hot-post-img {
    width: 70px;
    height: 55px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}
.hot-post-img img { width: 100%; height: 100%; object-fit: cover; }
.hot-post-info h4 {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}
.hot-post-info a { text-decoration: none; color: var(--text-main); transition: var(--transition); }
.hot-post-info a:hover { color: var(--primary); }
.hot-post-info .date { font-size: 11px; color: var(--text-light); }
.cta-widget {
    background: var(--primary);
    color: #fff;
    text-align: center;
}
.cta-widget .widget-title { color: #fff; border-bottom-color: rgba(255,255,255,0.2); }
.cta-widget p { font-size: 13.5px; opacity: 0.9; margin-bottom: 16px; }
.btn-cta-sidebar {
    display: block;
    background: var(--accent);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}
.btn-cta-sidebar:hover { background: #e55a00; }

/* 相关文章推荐 */
.related-section {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 24px 40px;
}
.related-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.related-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}
.related-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.related-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f1f5f9;
}
.related-card .card-body { padding: 14px 16px; }
.related-card .card-body h4 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1.4;
}
.related-card .card-body p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 底部 */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 24px 30px;
    margin-top: 30px;
}
.footer-grid {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 36px;
}
.footer-grid h4 { color: #fff; margin-bottom: 18px; font-size: 16px; }
.footer-grid p, .footer-grid li { font-size: 13.5px; line-height: 2; }
.footer-grid ul { list-style: none; }
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid #334155;
    font-size: 12.5px;
    color: #64748b;
}

/* 响应式 */
@media (max-width: 1024px) {
    .main-container {
grid-template-columns: 1fr;
    }
    .sidebar {
order: -1;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 16px;
    }
    .sidebar-widget { margin-bottom: 0; }
}
@media (max-width: 768px) {
    .nav-menu {
display: none;
position: absolute;
top: 62px;
left: 0;
width: 100%;
background: #fff;
flex-direction: column;
padding: 16px 20px;
box-shadow: 0 12px 28px rgba(0,0,0,0.12);
gap: 0;
    }
    .nav-menu.active { display: flex; }
    .nav-menu li { width: 100%; }
    .nav-menu a { padding: 10px 8px; border-bottom: 1px solid #f1f5f9; border-radius: 0; }
    .mobile-btn { display: block; }
    .breadcrumb-bar { margin-top: 58px; top: 56px; }
    .article-detail { padding: 24px 18px; }
    .article-header h1 { font-size: 22px; }
    .sidebar { display: block; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
    .article-body { font-size: 14px; }
    .post-nav { flex-direction: column; }
}