/**
 * WG3 模板样式 - 浅色卡片风格
 * 设计理念：清新、卡片化、圆润、绿色自然
 * 布局特点：左右分栏、卡片瀑布流、侧边栏
 */

/* ==================== 基础变量 ==================== */
:root {
    /* 主色调 - 清新绿 */
    --primary-color: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --primary-bg: rgba(16, 185, 129, 0.08);
    
    /* 辅助色 */
    --accent-color: #8b5cf6;
    --accent-light: #a78bfa;
    
    /* 背景色 - 浅色系 */
    --bg-body: #f0fdf4;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-muted: #f1f5f9;
    
    /* 文字颜色 */
    --text-dark: #1e293b;
    --text-body: #475569;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    
    /* 边框 */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 4px 20px rgba(16, 185, 129, 0.25);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 尺寸 */
    --header-height: 70px;
    --sidebar-width: 320px;
    --container-width: 1280px;
    
    /* 过渡 */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-body);
    line-height: 1.7;
    font-size: 15px;
}

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

a:hover {
    color: var(--primary-dark);
}

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

ul, ol {
    list-style: none;
}

/* ==================== 布局容器 ==================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 30px;
    padding-top: 30px;
}

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

.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    height: fit-content;
}

/* ==================== 头部导航 - 居中简洁风格 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 38px;
}

.logo-text img {
    height: 20px;
    opacity: 0.8;
}

/* 导航 - 胶囊风格 */
.nav-list {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-muted);
    padding: 6px;
    border-radius: var(--radius-full);
}

.nav-list li a {
    display: block;
    padding: 8px 20px;
    color: var(--text-body);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.nav-list li a:hover,
.nav-list li a.active {
    background: var(--bg-white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* 移动端菜单 */
.menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ==================== 主体区域 ==================== */
.main {
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* ==================== 首页 Banner - 波浪卡片风格 ==================== */
.banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, #6ee7b7 100%);
    border-radius: var(--radius-xl);
    padding: 60px 50px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.banner::before {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -20%;
    width: 80%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.banner::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -10%;
    width: 50%;
    height: 80%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.banner-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.banner-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}

.banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.banner-desc {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 30px;
    line-height: 1.7;
}

.banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--bg-white);
    color: var(--primary-dark);
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.banner-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-dark);
}

/* ==================== 区块标题 - 标签风格 ==================== */
.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.section-title i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 16px;
}

.section-more {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: var(--bg-white);
    color: var(--text-muted);
    font-size: 13px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.section-more:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== 文章卡片 - 大图上下结构 ==================== */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.article-card-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-muted);
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-card-image img {
    transform: scale(1.08);
}

.article-card-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.article-card-body {
    padding: 20px;
}

.article-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-title a {
    color: inherit;
}

.article-card-title a:hover {
    color: var(--primary-color);
}

.article-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.article-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.article-item:hover {
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.article-item-image {
    flex-shrink: 0;
    width: 180px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-muted);
}

.article-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-item:hover .article-item-image img {
    transform: scale(1.05);
}

.article-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.article-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.5;
}

.article-item-title a {
    color: inherit;
}

.article-item-title a:hover {
    color: var(--primary-color);
}

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

.article-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.article-item-tag {
    padding: 4px 12px;
    background: var(--primary-bg);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.article-item-meta {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== 侧边栏 ==================== */
.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--bg-muted);
}

.sidebar-title i {
    color: var(--primary-color);
}

/* 热门文章 */
.hot-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hot-item {
    display: flex;
    gap: 14px;
}

.hot-item-rank {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.hot-item-rank.top {
    background: var(--primary-color);
    color: #fff;
}

.hot-item-content {
    flex: 1;
    min-width: 0;
}

.hot-item-title {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-item-title a {
    color: inherit;
}

.hot-item-title a:hover {
    color: var(--primary-color);
}

.hot-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    padding: 6px 14px;
    background: var(--bg-muted);
    color: var(--text-body);
    font-size: 13px;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ==================== 服务卡片 - 图标在上 ==================== */
.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.service-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-primary);
    border-color: var(--primary-light);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(16, 185, 129, 0.15) 100%);
    border-radius: var(--radius-lg);
}

.service-icon img {
    width: 38px;
    height: 38px;
}

.service-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.service-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==================== 详情页 ==================== */
.detail-wrap {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-light);
    margin-bottom: 30px;
}

.detail-header {
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    border-bottom: 1px solid var(--border-light);
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-meta a {
    color: var(--primary-color);
}

.detail-content {
    padding: 40px;
}

.detail-content p {
    margin-bottom: 1.5em;
    line-height: 1.9;
}

.detail-content img {
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.detail-content h2, .detail-content h3 {
    color: var(--text-dark);
    margin: 1.8em 0 1em;
    font-weight: 600;
}

.detail-content blockquote {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* 标签区域 */
.detail-tags {
    padding: 24px 40px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-tags-label {
    font-size: 14px;
    color: var(--text-muted);
}

.detail-tags a {
    padding: 6px 14px;
    background: var(--bg-white);
    color: var(--text-body);
    font-size: 13px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.detail-tags a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 上下篇导航 */
.detail-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-nav-item {
    padding: 24px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.detail-nav-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.detail-nav-item.next {
    text-align: right;
}

.detail-nav-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-nav-item.next .detail-nav-label {
    justify-content: flex-end;
}

.detail-nav-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-nav-item:hover .detail-nav-title {
    color: var(--primary-color);
}

.detail-nav-empty {
    background: var(--bg-light);
}

.detail-nav-empty .detail-nav-title {
    color: var(--text-muted);
}

/* 相关推荐 */
.related-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border-light);
}

.related-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--bg-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-title i {
    color: var(--primary-color);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-item {
    padding: 18px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.related-item:hover {
    background: var(--bg-muted);
}

.related-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-item-title a {
    color: inherit;
}

.related-item-title a:hover {
    color: var(--primary-color);
}

.related-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

/* ==================== 分类页头部 ==================== */
.category-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 50px;
    margin-bottom: 30px;
    text-align: center;
    color: #fff;
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-desc {
    font-size: 1rem;
    opacity: 0.9;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-white);
    color: var(--text-body);
    font-size: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ==================== 页脚 ==================== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-top: 16px;
}

.footer-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .nav-list {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-white);
        padding: 16px;
        border-radius: 0;
        box-shadow: var(--shadow-lg);
        gap: 4px;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .banner {
        padding: 40px 24px;
        border-radius: var(--radius-lg);
    }
    
    .banner-title {
        font-size: 1.6rem;
    }
    
    .banner-desc {
        font-size: 0.95rem;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .article-item {
        flex-direction: column;
    }
    
    .article-item-image {
        width: 100%;
        height: 180px;
    }
    
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-header,
    .detail-content {
        padding: 24px;
    }
    
    .detail-title {
        font-size: 1.4rem;
    }
    
    .detail-nav {
        grid-template-columns: 1fr;
    }
    
    .detail-nav-item.next {
        text-align: left;
    }
    
    .detail-nav-item.next .detail-nav-label {
        justify-content: flex-start;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .category-header {
        padding: 30px 20px;
        border-radius: var(--radius-lg);
    }
    
    .category-title {
        font-size: 1.5rem;
    }
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== 选中样式 ==================== */
::selection {
    background: var(--primary-color);
    color: #fff;
}