/* 蜢引 - 前台样式（砖红个性风） */
:root {
    --primary: #c2410c;
    --primary-light: #fff7ed;
    --primary-dark: #9a3412;
    --accent: #fb923c;
    --bg: #fafaf9;
    --card-bg: #ffffff;
    --text: #292524;
    --text-light: #78716c;
    --text-dark: #1c1917;
    --border: #e7e5e4;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 10px 25px rgba(194,65,12,0.1), 0 4px 10px rgba(0,0,0,0.05);
}

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

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

/* 噪点纹理层 */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 导航栏 */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 20px;
}
.nav-logo {
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-menu {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 8px 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
}
.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.nav-search {
    display: flex;
    position: relative;
}
.nav-search input {
    width: 220px;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.nav-search input:focus { border-color: var(--primary); }
.nav-search button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
}

/* Hero区 */
.hero {
    position: relative;
    padding: 60px 20px;
    text-align: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(194,65,12,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.hero-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.3;
}
.hero-subtitle {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 28px;
}
.hero-search {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    gap: 8px;
}
.hero-search input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.hero-search input:focus { border-color: var(--primary); }
.hero-search button {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hero-search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194,65,12,0.3);
}

/* 搜索结果页头 */
.search-result-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 10px;
}
.search-result-header h1 { font-size: 24px; margin-bottom: 6px; }
.search-result-header p { color: var(--text-light); }

/* 分类栏 */
.category-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
}
.category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.cat-tag {
    padding: 6px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}
.cat-tag:hover { border-color: var(--primary); color: var(--primary); }
.cat-tag.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-color: transparent;
}

/* 主内容布局 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
    position: relative;
    z-index: 1;
}
.content-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.main-col { flex: 1; min-width: 0; }

/* 文章网格 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.article-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.25s ease;
    animation: fadeInUp 0.4s ease both;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(194,65,12,0.2);
}
.card-body { padding: 18px; }
.card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.card-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}
.card-title a:hover { color: var(--primary); }
.card-summary {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}
.meta-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.meta-item { display: flex; align-items: center; gap: 4px; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 侧边栏 */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}
.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.widget-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-dark);
}
.widget-list { list-style: none; }
.widget-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.widget-list li:last-child { border-bottom: none; }
.list-rank {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    color: var(--text-light);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.list-rank.hot {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}
.widget-list a {
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    transition: color 0.2s;
}
.widget-list a:hover { color: var(--primary); }
.widget-cats { list-style: none; }
.widget-cats li { padding: 6px 0; }
.widget-cats a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.widget-cats a:hover { background: var(--primary-light); color: var(--primary); }
.cat-count {
    background: var(--border);
    color: var(--text-light);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.cta-widget {
    background: linear-gradient(135deg, var(--primary-light), #fff);
    border-color: rgba(194,65,12,0.2);
}
.cta-widget p { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.cta-btn {
    display: block;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: transform 0.2s;
}
.cta-btn:hover { transform: translateY(-1px); }
.cta-btn.secondary {
    background: var(--card-bg);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* 文章详情 */
.article-detail {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
}
.breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .current { color: var(--text); }
.article-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-dark);
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-light);
}
.article-cover {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
}
.article-cover img { width: 100%; display: block; }
.summary-block {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text);
}
.article-content {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text);
}
.article-content p { margin-bottom: 16px; }
.article-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--text-dark);
}
.article-content ul, .article-content ol { margin: 0 0 16px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(194,65,12,0.3);
}
.article-content a:hover { border-bottom-color: var(--primary); }
.article-content img { max-width: 100%; border-radius: var(--radius-sm); }

/* FAQ区 */
.faq-block {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.faq-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}
.faq-item { margin-bottom: 14px; }
.faq-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}
.faq-answer {
    font-size: 14px;
    color: var(--text);
    padding-left: 16px;
}

/* 文末导流卡片 */
.cta-card {
    margin-top: 32px;
    background: linear-gradient(135deg, var(--primary-light), #fff);
    border: 1px solid rgba(194,65,12,0.2);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
}
.cta-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}
.cta-card p { color: var(--text-light); margin-bottom: 20px; }
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-buttons .cta-btn { margin-bottom: 0; padding: 12px 28px; }

/* 标签 */
.article-tags {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-item {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
}

/* 上一篇/下一篇 */
.article-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.nav-prev, .nav-next {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    transition: all 0.2s;
}
.nav-prev:hover, .nav-next:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}
.nav-prev.disabled, .nav-next.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.nav-label {
    font-size: 12px;
    color: var(--text-light);
    display: block;
    margin-bottom: 4px;
}
.nav-title {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}
.nav-next { text-align: right; }

/* 分类页头 */
.category-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 10px;
    text-align: center;
}
.category-header h1 { font-size: 32px; margin-bottom: 8px; }
.category-header p { color: var(--text-light); margin-bottom: 4px; }
.category-count { font-size: 13px; color: var(--text-light); }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.page-link {
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.current {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-color: transparent;
}
.page-dots { color: var(--text-light); padding: 0 4px; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 16px; }
.empty-state .cta-btn { display: inline-block; margin-top: 16px; }

/* 页脚 */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    position: relative;
    z-index: 1;
}
.footer-icp { margin-top: 4px; font-size: 12px; }

/* 响应式 */
@media (max-width: 900px) {
    .content-layout { flex-direction: column; }
    .sidebar { width: 100%; position: static; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .nav-menu.open { display: flex; }
    .nav-toggle { display: block; }
    .nav-search { display: none; }
    .hero-title { font-size: 26px; }
    .article-detail { padding: 20px; }
    .article-title { font-size: 22px; }
    .article-grid { grid-template-columns: 1fr; }
    .article-nav { flex-direction: column; }
}
