/* =========================================
   1. 全局变量与基础设置 (Global & Reset)
   ========================================= */
:root {
    --primary-color: #2E7D32;    /* 牧野绿 - 主色调 */
    --primary-light: #E8F5E9;    /* 浅绿背景 */
    --accent-color: #B8860B;     /* 古铜金 - 强调色 */
    --text-main: #333333;        /* 主要文字 */
    --text-light: #666666;       /* 次要文字 */
    --bg-body: #F4F7F4;          /* 页面背景 */
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.06);
    --radius: 8px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

/* 防止移动端水平溢出 */
html, body { overflow-x: hidden; width: 100%; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
a:hover { color: var(--primary-color); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   2. 顶部导航栏 (Header & Nav)
   ========================================= */
.header {
    background: var(--white);
    height: 65px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
    letter-spacing: -1px;
}
.logo span { color: var(--accent-color); margin-left: 2px; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.main-nav a {
    font-size: 1rem;
    font-weight: 500;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
}

.main-nav a.active, .main-nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* =========================================
   3. 页面主体布局 (Main Layout)
   ========================================= */
.main-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 3fr 1fr; /* 左内容 右侧边栏 */
    gap: 25px;
}

/* =========================================
   4. 首页专用样式 (Home Page Specifics)
   ========================================= */

/* 顶部4张大图 */
.hero-grid {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.hero-item {
    aspect-ratio: 600 / 400;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid var(--white);
}
.hero-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.hero-item:hover img { transform: scale(1.1); }

/* 核心优势区 */
.advantage-section { max-width: 1200px; margin: 40px auto; padding: 0 15px; }
.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    position: relative;
}
.section-title::after {
    content: ''; display: block; width: 50px; height: 4px; background: var(--accent-color); margin: 10px auto;
}
.advantage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.adv-item {
    background: var(--white);
    padding: 30px 20px;
    text-align: center;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-bottom: 4px solid var(--primary-color);
}
.adv-item i { font-size: 2.5rem; color: var(--accent-color); margin-bottom: 15px; display: block; }
.adv-item h3 { font-size: 1.2rem; margin-bottom: 10px; }
.adv-item p { font-size: 0.9rem; color: var(--text-light); }

/* 首页文章列表 */
.news-section { max-width: 1200px; margin: 40px auto; padding: 0 15px; }
.news-list { display: flex; flex-direction: column; gap: 15px; }
.news-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    border-left: 0 solid var(--primary-color);
    transition: 0.3s;
}
.news-item:hover {
    border-left-width: 6px;
    transform: translateX(5px);
    box-shadow: var(--shadow);
}
.news-info { flex: 1; }
.news-info h3 { font-size: 1.15rem; margin-bottom: 5px; color: var(--text-main); }
.news-info p { font-size: 0.9rem; color: var(--text-light); }
.news-date { font-size: 0.85rem; color: #999; margin-left: 20px; white-space: nowrap; }

/* 资讯中心-文章网格列表 */
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.article-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 3px solid transparent;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    border-top-color: var(--primary-color);
    transform: translateY(-5px);
}
.article-card h2 {
    font-size: 1.1rem; margin-bottom: 10px; color: var(--text-main);
    height: 3em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.article-card p {
    font-size: 0.9rem; color: var(--text-light); margin-bottom: 15px;
    height: 4.5em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.card-meta {
    margin-top: auto; display: flex; justify-content: space-between;
    font-size: 0.8rem; color: #999; border-top: 1px solid #f5f5f5; padding-top: 10px;
}

/* =========================================
   5. 文章详情页专用 (Article Detail Page)
   ========================================= */
.article-container {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
}

.article-title { font-size: 1.8rem; margin-bottom: 15px; line-height: 1.4; color: #000; }
.article-meta {
    color: #999; font-size: 0.9rem; margin-bottom: 30px;
    padding-bottom: 15px; border-bottom: 1px solid #eee; display: flex; gap: 20px;
}

/* 正文内容排版 */
.article-content p { margin-bottom: 20px; font-size: 1.05rem; text-align: justify; }
.article-content h2 {
    margin-top: 40px; margin-bottom: 20px; font-size: 1.4rem;
    border-left: 5px solid var(--primary-color); padding-left: 15px;
    color: var(--text-main); background: #f9f9f9; padding: 10px 15px;
}
.article-content h3 {
    margin-top: 25px; margin-bottom: 15px; font-size: 1.2rem;
    color: var(--primary-color); font-weight: bold;
}
.article-content ol, .article-content ul { margin-left: 20px; margin-bottom: 20px; color: #555; }
.article-content li { margin-bottom: 8px; }

/* 重点标记样式 */
.highlight-red { color: #d32f2f; font-weight: bold; background: #ffebee; padding: 0 4px; border-radius: 4px; }
.highlight-gold { color: #856404; background-color: #fff3cd; padding: 0 4px; border-radius: 4px; font-weight: bold; }
.anchor-link { color: var(--primary-color); text-decoration: underline; font-weight: 500; }

/* 响应式表格样式 */
.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    border-radius: var(--radius);
    border: 1px solid #eee;
    -webkit-overflow-scrolling: touch; /* iOS顺滑滚动 */
    display: block;
}
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 12px 15px; border: 1px solid #eee; text-align: left; }
th { background: var(--primary-light); color: var(--primary-color); font-weight: bold; white-space: nowrap; }
tr:nth-child(even) { background-color: #fcfcfc; }

/* 文中微信订阅框 */
.wx-subscribe-box {
    background: #f0f9f0;
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 20px;
}
.wx-box-img { width: 100px; height: 100px; flex-shrink: 0; }
.wx-box-text h4 { color: var(--primary-color); font-size: 1.2rem; margin-bottom: 8px; }
.wx-box-text p { font-size: 0.95rem; color: #555; margin-bottom: 5px; }
.wx-btn-copy {
    background: var(--accent-color); color: white; border: none;
    padding: 5px 15px; border-radius: 4px; cursor: pointer;
    font-size: 0.9rem; margin-top: 5px;
}

/* 上下篇导航 */
.post-nav {
    margin-top: 40px; border-top: 1px solid #eee; padding-top: 20px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.nav-link {
    font-size: 0.95rem; color: #666; max-width: 48%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-link span { color: #999; margin-right: 5px; }

/* =========================================
   6. 侧边栏与小工具 (Sidebar & Widgets)
   ========================================= */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 1.1rem; font-weight: bold; margin-bottom: 15px;
    padding-left: 10px; border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
}
/* 侧边栏搜索框 */
.search-box { display: flex; gap: 5px; }
.search-input { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 4px; }
.search-btn { background: var(--primary-color); color: #fff; border: none; padding: 0 15px; border-radius: 4px; cursor: pointer; }

/* 侧边栏热门列表 */
.hot-list li {
    padding: 10px 0; border-bottom: 1px dashed #eee;
    font-size: 0.95rem; display: flex; align-items: flex-start;
}
.hot-list li::before {
    content: '●'; color: var(--accent-color);
    font-size: 0.8rem; margin-right: 8px; margin-top: 3px;
}
.hot-list li:last-child { border-bottom: none; }

/* 侧边栏微信 */
.wx-sidebar { text-align: center; }
.wx-sidebar img { width: 150px; height: 150px; margin: 10px auto; border: 1px solid #eee; padding: 5px; cursor: pointer; }
.wx-sidebar p { font-size: 0.85rem; color: var(--text-light); }

/* =========================================
   7. 页脚区域 (Footer)
   ========================================= */
.footer {
    background: #1a1a1a;
    color: #999;
    padding: 50px 0 20px;
    margin-top: 50px;
    text-align: center; /* 【修改】新增：让页脚内容全局居中 */
}

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

/* 【修改】新增 text-align: left; 保护首页复杂布局不被居中影响 */
.footer-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 40px; 
    margin-bottom: 30px; 
    text-align: left; 
}

.footer-title {
    color: var(--white); font-size: 1.1rem; margin-bottom: 20px;
    border-left: 3px solid var(--primary-color); padding-left: 10px;
}
.link-group { display: flex; flex-wrap: wrap; gap: 10px; }
.link-group a {
    font-size: 0.85rem; color: #888; border: 1px solid #333;
    padding: 3px 10px; border-radius: 4px;
}
.link-group a:hover { color: var(--white); border-color: var(--primary-color); }

.footer-bottom {
    text-align: center; border-top: 1px solid #333;
    padding-top: 30px; font-size: 0.85rem;
}
.footer-bottom a { color: #888; margin: 0 10px; }
.footer-bottom a:hover { color: var(--white); }

/* =========================================
   8. 悬浮组件 (Floating Components)
   ========================================= */
/* 左侧客服球 */
.float-cs {
    position: fixed; left: 20px; top: 60%; width: 60px; height: 60px;
    background: var(--primary-color); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 12px; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: floatUpDown 3s ease-in-out infinite; z-index: 1000;
}
@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* PC右侧悬浮 */
.float-right-pc {
    position: fixed; right: 20px; top: 40%;
    background: var(--white); padding: 15px;
    border-radius: 10px; box-shadow: var(--shadow);
    text-align: center; z-index: 1000; border: 1px solid #eee;
}
.float-right-pc img { width: 100px; height: 100px; margin-bottom: 8px; cursor: pointer; }
.float-right-pc .tel { font-weight: bold; color: var(--primary-color); }

/* 手机底部栏 */
.float-mobile-bar {
    display: none;
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--white); height: 65px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1001; align-items: center;
    padding: 0 15px; justify-content: space-between;
}
.mob-wx { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.mob-wx img { width: 45px; height: 45px; border: 1px solid #eee; border-radius: 4px; }
.mob-btn {
    background: var(--primary-color); color: white;
    padding: 8px 15px; border-radius: 20px;
    font-size: 0.9rem; font-weight: bold;
}

/* 模态框 */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 2000;
    justify-content: center; align-items: center;
}
.modal img { max-width: 80%; max-height: 80%; border: 4px solid #fff; border-radius: 10px; }

/* =========================================
   9. 媒体查询 (Media Queries)
   ========================================= */
@media (max-width: 768px) {
    /* 布局调整 */
    .main-wrapper { grid-template-columns: 1fr; }
    .hero-grid { grid-template-columns: repeat(2, 1fr); }
    .advantage-grid { grid-template-columns: repeat(2, 1fr); }
    .article-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }

    /* 文章页优化 */
    .article-container { padding: 15px; } /* 减小内边距 */
    .article-title { font-size: 1.4rem; }
    .wx-subscribe-box { flex-direction: column; text-align: center; }
    .nav-link { max-width: 100%; width: 100%; display: block; }
    
    /* 悬浮组件切换 */
    .float-right-pc { display: none; }
    .float-mobile-bar { display: flex; }
}

@media (max-width: 480px) {
    .logo { font-size: 1.1rem; }
    .main-nav { gap: 8px; }
    .main-nav a { font-size: 0.9rem; padding: 5px 2px; }
}