/* ==========================================
   SEO站群CMS - 资讯站主题样式
   特点：简洁资讯风格，阅读体验优先，SEO友好
   ========================================== */

/* ---------- 基础重置与变量 ---------- */
:root {
    --primary: #1a73e8;
    --text: #333;
    --text-light: #666;
    --bg: #f8f9fa;
    --white: #fff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

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

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- 头部导航 ---------- */
.site-header {
    background: var(--white);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.site-logo { display: flex; align-items: center; margin-right: 60px; }
.logo-text { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

.main-nav { display: flex; gap: 24px; }
.main-nav a {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-decoration: none;
}
.nav-item-with-children { position: relative; }
.sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: var(--shadow);
    min-width: 140px;
    z-index: 200;
    padding: 8px 0;
    flex-direction: column;
}
.nav-item-with-children:hover .sub-nav { display: flex; }
.sub-nav a {
    display: block;
    padding: 6px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
    border-bottom: none;
}
.sub-nav a:hover {
    background: var(--bg);
    color: var(--primary);
    text-decoration: none;
}

/* ---------- 搜索栏 ---------- */
.header-search {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.header-search input {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 200px;
    font-size: 0.9rem;
    outline: none;
}
.header-search input:focus {
    border-color: var(--primary);
}
.header-search button {
    padding: 6px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
    padding: 10px 0;
    font-size: 0.85rem;
    color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- 焦点文章 ---------- */
.featured-section { margin: 24px 0; }
.featured-article a {
    display: flex;
    gap: 24px;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
}
.featured-article a:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.featured-article img { width: 400px; height: 267px; object-fit: cover; }
.featured-info { padding: 24px; flex: 1; }
.featured-info h2 { font-size: 1.4rem; margin-bottom: 12px; }
.featured-info .summary { color: var(--text-light); margin-bottom: 12px; }
.featured-info .date { font-size: 0.85rem; color: var(--text-light); }

/* ---------- 文章列表 ---------- */
.article-list-section { display: flex; gap: 24px; }
.article-list { flex: 1; }

.article-item {
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.article-item a {
    display: flex;
    gap: 16px;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
}
.article-item a:hover { text-decoration: none; }
.article-thumb { flex-shrink: 0; }
.article-thumb img { width: 300px; height: 200px; object-fit: cover; border-radius: 4px; }
.article-info { flex: 1; }
.article-info h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.article-info .summary { font-size: 0.9rem; color: var(--text-light); margin-bottom: 8px; }
.article-info .meta { font-size: 0.8rem; color: #999; }
.article-info .meta .category { margin-right: 12px; }

/* ---------- 侧边栏 ---------- */
.sidebar { width: 300px; flex-shrink: 0; }
.widget {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.widget h3 { font-size: 1rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
.widget ul { list-style: none; }
.widget li { padding: 6px 0; }
.widget li a { color: var(--text-light); font-size: 0.9rem; }
.widget li a:hover { color: var(--primary); }
.widget .sub-categories { list-style: none; padding-left: 16px; margin-top: 4px; }
.widget .sub-categories li { padding: 3px 0; }
.widget .sub-categories li a { font-size: 0.85rem; color: #999; }
.widget .sub-categories li a:hover { color: var(--primary); }

.sub-categories-section { margin-bottom: 24px; }
.sub-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.sub-cat-card {
    display: block;
    background: var(--white);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sub-cat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); text-decoration: none; }
.sub-cat-card h3 { font-size: 1rem; margin-bottom: 4px; color: var(--primary); }
.sub-cat-card p { font-size: 0.85rem; color: var(--text-light); margin: 0; }

/* ---------- 文章详情 ---------- */
.article-detail {
    background: var(--white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 24px auto;
}

.article-title { font-size: 1.8rem; line-height: 1.4; margin-bottom: 16px; }

.article-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.article-meta .author { margin-right: 12px; }
.article-meta .category a { color: var(--primary); }

.article-cover { margin-bottom: 24px; }
.article-cover img { width: 100%; max-height: 400px; object-fit: cover; border-radius: 4px; }

.article-content { line-height: 1.9; word-wrap: break-word; overflow-wrap: break-word; }
.article-content * { max-width: 100%; }
.article-content h2 { font-size: 1.4rem; margin: 24px 0 12px; padding-left: 12px; border-left: 4px solid var(--primary); }
.article-content h3 { font-size: 1.2rem; margin: 20px 0 10px; }
.article-content p { margin-bottom: 16px; }
.article-content img { max-width: 100%; height: auto; border-radius: 4px; }
.article-content a { color: var(--primary); }
.article-content blockquote {
    border-left: 4px solid var(--border);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--bg);
    border-radius: 0 4px 4px 0;
}
.article-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 16px 0;
}
.article-content code { background: var(--bg); padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }
.article-content pre code { background: none; padding: 0; }

.article-tags { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.tags-label { font-size: 0.9rem; color: var(--text-light); }
.tag-link {
    display: inline-block;
    padding: 2px 10px;
    margin: 0 4px;
    background: var(--bg);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}
.tag-link:hover { background: var(--primary); color: var(--white); text-decoration: none; }

/* ---------- 相关文章 ---------- */
.related-articles {
    max-width: 800px;
    margin: 24px auto;
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.related-articles h2 { font-size: 1.2rem; margin-bottom: 16px; }
.related-articles ul { list-style: none; }
.related-articles li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.related-articles li:last-child { border-bottom: none; }
.related-articles .date { font-size: 0.8rem; color: #999; }

/* ---------- 底部 ---------- */
.site-footer {
    background: #2d2d2d;
    color: #aaa;
    padding: 24px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
}
.site-footer a { color: #aaa; }
.site-footer .icp { margin-top: 4px; }

/* ---------- 分页标题 ---------- */
.page-title { font-size: 1.5rem; margin: 24px 0; }

/* ---------- 空提示 ---------- */
.empty-tip { text-align: center; padding: 60px 0; color: var(--text-light); }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px; }
    .site-logo { margin-right: 16px; order: 1; }
    .logo-text { font-size: 1.2rem; }
    .main-nav { order: 3; width: 100%; gap: 12px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
    .main-nav a { font-size: 0.95rem; }
    .header-search { order: 2; flex: 1; min-width: 0; display: flex; }
    .header-search input { font-size: 14px; }
    .featured-article a { flex-direction: column; }
    .featured-article img { width: 100%; height: 200px; }
    .article-list-section { flex-direction: column; }
    .sidebar { width: 100%; }
    .article-item a { flex-direction: column; }
    .article-thumb img { width: 100%; height: 200px; }
    .article-detail { padding: 16px; }
    .article-title { font-size: 1.4rem; }
    .article-content h2 { font-size: 1.2rem; }
    .article-content h3 { font-size: 1.1rem; }
    .breadcrumb { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    .logo-text { font-size: 1.1rem; }
    .main-nav a { font-size: 0.9rem; }
    .article-title { font-size: 1.2rem; }
    .featured-info h2 { font-size: 1.1rem; }
    .hero-banner h1 { font-size: 1.3rem; }
    .section-title { font-size: 1.1rem; }
}
