:root {
    --primary: #4a6cf7;
    --primary-dark: #3b5de7;
    --primary-light: #eef2ff;
    --secondary: #764ba2;
    --bg: #f5f7fa;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --white: #fff;
    --code-bg: #1e1e3f;
    --code-text: #d4d4d4;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --max-width: 1420px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
}

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

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

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

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 136px;
    height: auto;
    
    color: var(--white);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
}
.nav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 14px;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.nav a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav a i { font-size: 16px; }
.search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
}
.search-box i { color: var(--text-light); font-size: 16px; }
.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 160px;
    font-size: 14px;
    color: var(--text);
}
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 50px 0;
    text-align: center;
}
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { font-size: 16px; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 24px; }
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 28px; font-weight: 700; }
.hero-stat-label { font-size: 14px; opacity: 0.8; }

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-top: 3px solid transparent;
}
.category-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.category-card.cat-template { border-top-color: var(--primary); }
.category-card.cat-dev { border-top-color: var(--secondary); }
.category-card.cat-plugin { border-top-color: var(--warning); }
.category-card.cat-bug { border-top-color: var(--danger); }
.category-card.cat-server { border-top-color: var(--success); }
.category-card.cat-qa { border-top-color: #667eea; }
.category-card.cat-download { border-top-color: #00d2d3; }
.category-card.cat-xunrui { border-top-color: #f59e0b; }
.category-card .cat-icon { font-size: 32px; margin-bottom: 12px; display: block; }
.category-card h3 { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.category-card p { font-size: 15px; color: var(--text-light); margin-bottom: 12px; }
.category-card .cat-count { font-size: 13px; color: var(--primary); font-weight: 600; }

/* Main Layout */
.main-wrap {
    display: flex;
    gap: 30px;
    padding: 20px 0 40px;
}
.main-wrap > main { flex: 1; min-width: 0; }
.main-wrap > .sidebar { width: 300px; flex-shrink: 0; }

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* Article List */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-item {
    display: flex;
    gap: 16px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}
.article-item:hover { box-shadow: var(--shadow-lg); }
.article-item .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 24px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
    height: 24px;
}
.article-item .tag a{
    color:#fff;
}
.tag-template { background: var(--primary); }
.tag-dev { background: var(--secondary); }
.tag-plugin { background: var(--warning); }
.tag-bug { background: var(--danger); }
.tag-server { background: var(--success); }
.tag-qa { background: #667eea; }
.tag-download { background: #00d2d3; }
.tag-xunrui { background: #f59e0b; }
.article-content { flex: 1; min-width: 0; }
.article-content h3 { font-size: 16px; margin-bottom: 8px; }
.article-content h3 a { color: var(--text); }
.article-content h3 a:hover { color: var(--primary); text-decoration: none; }
.excerpt { font-size: 14px; color: var(--text-light); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-light); }
.article-meta span { display: flex; align-items: center; gap: 4px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 30px; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    text-decoration: none;
    transition: all 0.2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.sidebar-card h4 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.hot-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.hot-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.hot-list li a { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-list li a:hover { color: var(--primary); }
.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--text-light);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
    transition: all 0.2s;
}
.tag-cloud a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }

/* Article Detail */
.article-detail {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}
.article-detail h1 { font-size: 24px; margin-bottom: 16px; line-height: 1.4; }
.article-info { display: flex; gap: 20px; font-size: 13px; color: var(--text-light); margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-info span { display: flex; align-items: center; gap: 4px; }
.article-content-body { font-size: 15px; line-height: 1.8; }
.article-content-body h2 { font-size: 20px; margin: 24px 0 12px; }
.article-content-body h3 { font-size: 17px; margin: 20px 0 10px; }
.article-content-body p { margin-bottom: 14px; }
.article-content-body ul, .article-content-body ol { margin-bottom: 14px; padding-left: 24px; }
.article-content-body li { margin-bottom: 6px; }
.article-content-body pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 14px 0;
    font-size: 14px;
    line-height: 1.6;
}
.article-content-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--danger);
}
.article-content-body pre code { background: none; color: var(--code-text); padding: 0; }
.article-content-body blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    padding: 12px 16px;
    margin: 14px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text);
}
.article-content-body img { border-radius: var(--radius); margin: 14px 0;    margin: 0 auto;
    display: flex; }
.article-content-body table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.article-content-body th, .article-content-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-content-body th { background: var(--bg); font-weight: 600; }

/* TOC */
.toc {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.toc h4 { font-size: 16px; margin-bottom: 12px; }
.toc ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.toc a { font-size: 14px; color: var(--text-light); display: block; padding: 4px 0; }
.toc a:hover, .toc a.active { color: var(--primary); }
.toc .toc-h3 { padding-left: 16px; }

/* Article Nav */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.article-nav a {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow);
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
}
.article-nav a:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.article-nav a .nav-label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.article-nav .nav-next { text-align: right; }

/* Footer */
.footer {
    background: #1a202c;
    color: #cbd5e0;
    padding: 40px 0 0;
    margin-top: 40px;
}
.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #2d3748;
}
.footer-brand h4 { font-size: 18px; color: var(--white); margin-bottom: 12px; }
.footer-brand p { font-size: 14px; line-height: 1.7; }
.footer-links h5 { font-size: 15px; color: var(--white); margin-bottom: 12px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #a0aec0; font-size: 14px; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { padding: 16px 0; text-align: center; font-size: 13px; color: #718096; }

/* Back to Top */
.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}
.back-top.show { opacity: 1; visibility: visible; }
.back-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Responsive */
@media (max-width: 1024px) {
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    
    .logo{
        display:inline-flex;
    }
    
    
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; display:flex;}
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        order: 3;
    }
    .nav.open { display: flex;     position: fixed;
    z-index: 9999;
    top: 64px;
    background: #fff;
    width: 100%;
    left: 0;
    height: 100vh;}
    .nav a { width: 100%; padding: 10px 12px; border-radius: 0; border-bottom: 1px solid var(--border); }
    .mobile-toggle { display: inline-block; margin-left: auto; }
    .search-box { order: 2; flex: 1;display:inline-flex; }
    .search-box input { width: 100%; }
    .main-wrap { flex-direction: column; }
    .main-wrap > .sidebar { width: 100%; }
    .hero h1 { font-size: 24px; }
    .hero p { font-size: 14px; }
    .hero-stats { gap: 20px; }
    .hero-stat-num { font-size: 22px; }
    .article-item { flex-direction: column; gap: 10px; }
    .category-grid { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; }
    .article-detail { padding: 20px; }
    .article-detail h1 { font-size: 20px; }
    .article-nav { flex-direction: column; }
    .article-nav .nav-next { text-align: left; }
    .back-top { bottom: 20px; right: 20px; }
}
