/**
 * 前台企业网站样式
 * 自定义商务风格设计
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --accent: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --max-width: 1200px;
}

body {
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    color: var(--dark);
    background: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 头部 ========== */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary);
    color: white;
    padding: 8px 0;
    font-size: 13px;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    font-size: 15px;
    font-weight: 500;
    padding: 10px 0;
    display: block;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
}

.nav-menu li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu a {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.nav-menu .sub-menu a:last-child {
    border-bottom: none;
}

/* ========== Hero 区域 ========== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-btn {
    display: inline-block;
    padding: 14px 40px;
    background: var(--accent);
    color: white;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ========== 内容区域 ========== */
.main-content {
    padding: 60px 0;
    background: var(--light);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

/* 文章列表 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.article-card.has-image {
    display: grid;
    grid-template-columns: 280px 1fr;
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card.has-image .article-image {
    height: 100%;
    min-height: 240px;
}

.article-content {
    padding: 24px;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 12px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-title a:hover {
    color: var(--primary);
}

.article-summary {
    color: var(--gray);
    margin-bottom: 16px;
    line-height: 1.8;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.read-more {
    color: var(--primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.read-more:hover {
    gap: 10px;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--light);
    transition: all 0.3s;
}

.category-list a:hover {
    background: var(--primary);
    color: white;
}

.category-count {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

/* 最新文章小部件 */
.latest-posts-widget ul {
    list-style: none;
}

.latest-posts-widget li {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.latest-posts-widget li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.latest-post-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 6px;
}

.latest-post-date {
    font-size: 12px;
    color: var(--gray);
}

/* ========== 文章详情页 ========== */
.article-detail {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.article-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 30px;
}

.article-body {
    font-size: 16px;
    line-height: 1.9;
}

.article-body h2 {
    font-size: 26px;
    margin: 40px 0 20px;
    color: var(--primary);
}

.article-body h3 {
    font-size: 20px;
    margin: 30px 0 15px;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-body ul,
.article-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 30px 0;
    color: var(--gray);
    font-style: italic;
}

.article-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--light);
    border-radius: 20px;
    font-size: 13px;
    color: var(--gray);
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary);
    color: white;
}

/* ========== 页脚 ========== */
.site-footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--accent);
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.7);
    line-height: 2;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s;
}

.pagination a:hover,
.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .article-card.has-image {
        grid-template-columns: 1fr;
    }
    
    .article-detail {
        padding: 24px;
    }
    
    .article-header h1 {
        font-size: 26px;
    }
}