/* ============================================
   SEO引流站 全站样式
   主色：#2563eb
   ============================================ */

/* CSS变量 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 15px rgba(0,0,0,0.1);
    --max-width: 1200px;
}

/* 重置 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

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

ul, ol { padding-left: 24px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ============================================
   顶部导航
   ============================================ */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.header-inner {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 30px;
}

.site-logo {
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.site-logo img { max-height: 36px; width: auto; }

.logo-text {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav { flex: 1; }
.main-nav ul { list-style: none; display: flex; gap: 6px; padding: 0; }
.main-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: all .2s;
}
.main-nav a:hover { background: var(--primary-light); color: var(--primary); }

.search-form { display: flex; flex-shrink: 0; }
.search-form input {
    width: 200px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.search-form input:focus { border-color: var(--primary); }
.search-form button {
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
}
.search-form button:hover { background: var(--primary-dark); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .3s;
}

/* ============================================
   Hero区域
   ============================================ */
.hero {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}
.hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}
.hero-title small {
    display: block;
    font-size: 16px;
    font-weight: 400;
    opacity: .85;
    margin-top: 8px;
}
.hero-desc {
    font-size: 17px;
    opacity: .9;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   内容布局
   ============================================ */
.content-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 30px 20px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.content-main { min-width: 0; }

/* ============================================
   文章卡片列表
   ============================================ */
.article-list { display: flex; flex-direction: column; gap: 20px; }

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    transition: box-shadow .25s, transform .25s;
}
.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-thumb {
    flex-shrink: 0;
    width: 240px;
    min-height: 160px;
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.article-card:hover .card-thumb img { transform: scale(1.05); }

.card-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-cat {
    display: inline-block;
    align-self: flex-start;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-weight: 500;
}

.card-title {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }

.card-summary {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    gap: 16px;
}

/* ============================================
   分页
   ============================================ */
.pagination { margin-top: 30px; }
.pagination ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .disabled span { color: var(--text-light); cursor: default; }

/* ============================================
   侧边栏
   ============================================ */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--primary-light);
    color: var(--text);
}
.widget p { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }

.widget-popular ul { list-style: none; padding: 0; }
.widget-popular li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.widget-popular li:last-child { border-bottom: none; }
.widget-popular a {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    flex: 1;
}
.widget-popular a:hover { color: var(--primary); }

.rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: #e2e8f0;
    color: var(--text-secondary);
    border-radius: 4px;
    text-align: center;
    line-height: 22px;
    font-size: 12px;
    font-weight: 700;
}
.rank-1 { background: #ef4444; color: #fff; }
.rank-2 { background: #f97316; color: #fff; }
.rank-3 { background: #eab308; color: #fff; }

/* ============================================
   按钮
   ============================================ */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 36px; font-size: 17px; }
.btn-block { display: block; width: 100%; }

/* ============================================
   文章详情页
   ============================================ */
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}
.breadcrumb li::after { content: '›'; margin-left: 6px; color: var(--text-light); }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--text); }

.article-detail {
    background: var(--white);
    border-radius: var(--radius);
    padding: 35px 40px;
    box-shadow: var(--shadow);
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--text);
}

.article-meta {
    font-size: 14px;
    color: var(--text-light);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 25px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.article-meta a { color: var(--text-secondary); }
.article-meta a:hover { color: var(--primary); }

.article-cover {
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
}
.article-cover img { width: 100%; }

.article-content { font-size: 16px; line-height: 1.9; color: #334155; }
.article-content p { margin-bottom: 18px; }
.article-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 30px 0 15px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
    color: var(--text);
}
.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text);
}
.article-content h4 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; }
.article-content ul, .article-content ol { margin-bottom: 18px; padding-left: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { color: var(--primary-dark); }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    color: #1e40af;
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}
.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #e11d48;
}
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.article-content th, .article-content td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}
.article-content th { background: #f8fafc; font-weight: 600; }

/* ============================================
   CTA引流卡片
   ============================================ */
.cta-card {
    margin-top: 35px;
    padding: 30px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    text-align: center;
}
.cta-icon { font-size: 40px; margin-bottom: 10px; }
.cta-card h3 {
    font-size: 20px;
    color: var(--primary-dark);
    margin-bottom: 10px;
}
.cta-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 15px;
}

/* ============================================
   相关文章
   ============================================ */
.related-articles { margin-top: 35px; }
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.related-item {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
}
.related-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.related-item img { width: 100%; height: 120px; object-fit: cover; background: #f1f5f9; }
.related-item h3 {
    font-size: 14px;
    font-weight: 500;
    padding: 12px;
    line-height: 1.5;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-item time {
    display: block;
    padding: 0 12px 12px;
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================
   分类页头
   ============================================ */
.category-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.category-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}
.category-desc { color: var(--text-secondary); font-size: 15px; }

/* ============================================
   搜索页
   ============================================ */
.search-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.search-title { font-size: 22px; font-weight: 700; margin-bottom: 15px; }
.search-form-large { display: flex; gap: 10px; }
.search-form-large input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}
.search-form-large input:focus { border-color: var(--primary); }
.search-count { color: var(--text-secondary); font-size: 14px; margin-top: 12px; }
.search-count strong { color: var(--primary); }

/* ============================================
   空状态/404
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state p { font-size: 16px; margin-bottom: 15px; }

.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page h1 {
    font-size: 96px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}
.error-page p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ============================================
   页脚
   ============================================ */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}
.footer-about h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
}
.footer-about p { font-size: 14px; line-height: 1.7; }
.footer-links h4 {
    color: #e2e8f0;
    font-size: 15px;
    margin-bottom: 12px;
}
.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #94a3b8; font-size: 14px; }
.footer-links a:hover { color: #60a5fa; }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #334155;
    font-size: 13px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 968px) {
    .content-wrap {
        grid-template-columns: 1fr;
    }
    .sidebar { order: -1; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        padding: 10px 20px;
        transform: translateY(-150%);
        transition: transform .3s;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    .main-nav.open { transform: translateY(0); }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav a { padding: 12px 0; border-bottom: 1px solid #f1f5f9; border-radius: 0; }
    .search-form { display: none; }

    .hero { padding: 40px 0; }
    .hero-title { font-size: 24px; }

    .article-card { flex-direction: column; }
    .card-thumb { width: 100%; min-height: 180px; }
    .card-body { padding: 16px 20px; }
    .card-title { font-size: 17px; }

    .article-detail { padding: 20px; }
    .article-title { font-size: 22px; }

    .footer-grid { grid-template-columns: 1fr; gap: 25px; }

    .related-grid { grid-template-columns: 1fr 1fr; }

    .header-inner { gap: 15px; }
}

@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
    .article-meta { font-size: 13px; gap: 12px; }
    .cta-card { padding: 20px; }
    .cta-card h3 { font-size: 18px; }
}
