/* 水平布局覆盖样式 */

/* 修复标题布局问题 */
header {
    padding: 0 !important;
    height: 60px !important; /* 固定高度 */
    display: flex !important;
    flex-direction: row !important;
    background-color: #333 !important;
    position: relative !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: visible !important;
}

/* 网站标题和LOGO区域 */
.header-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important; /* 移除所有外边距 */
    height: 100% !important;
    position: absolute !important; /* 使用绝对定位 */
    left: 0 !important; /* 完全靠左 */
    top: 0 !important;
    z-index: 10 !important;
}

.logo-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    background-color: #333 !important;
}

.logo {
    width: 45px !important; /* 略微减小logo */
    height: 45px !important;
    margin: 0 8px 0 10px !important; /* 调整logo边距 */
    object-fit: contain !important;
}

.title-container {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    height: 100% !important;
    padding-right: 15px !important;
    margin: 0 !important;
    max-width: 280px !important; /* 限制最大宽度 */
}

.title-container h1 {
    display: block !important;
    white-space: nowrap !important;
    font-size: 1.6rem !important; /* 减小标题 */
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    font-weight: bold !important;
    font-family: 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif !important; /* 苹果风字体 */
    background: linear-gradient(90deg, 
        #ff6b6b, 
        #fca3b5, 
        #ffd166, 
        #06d6a0, 
        #1b9aaa, 
        #6a67ce) !important; /* 苹果风渐变色 */
    background-size: 300% 300% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    animation: gradient-animation 6s ease infinite !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    letter-spacing: -0.2px !important; /* 苹果风格紧凑字间距 */
}

.title-container p {
    font-size: 0.85rem !important; /* 减小副标题 */
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    color: #ffd166 !important; /* 明亮的黄色，苹果常用辅助色 */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4) !important;
    letter-spacing: 0.2px !important;
}

/* 优化导航栏 */
nav {
    background-color: transparent !important;
    border-radius: 0 !important;
    flex: 1 !important;
    position: relative !important;
    overflow-x: visible !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin-left: 350px !important; /* 为logo区域预留空间 */
}

nav ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    justify-content: flex-end !important; /* 改回靠右对齐 */
    padding: 0 !important;
    width: auto !important; /* 自适应宽度 */
    background-color: transparent !important; /* 移除背景 */
    border-bottom: none !important; /* 移除底部边框 */
}

nav li {
    flex-shrink: 0 !important;
    margin: 0 2px !important; /* 添加左右间距 */
    border-right: none !important; /* 移除分隔线 */
}

nav li:first-child {
    border-left: none !important; /* 移除第一个项目左侧边框 */
}

nav a {
    padding: 10px 12px !important; /* 调整内边距使导航项更紧凑 */
    font-size: 0.9rem !important;
    border-radius: 4px !important; /* 恢复圆角 */
    transition: all 0.3s ease !important;
    color: #FFFFFF !important;
    display: block !important;
    text-align: center !important;
    position: relative !important;
    font-weight: bold !important;
    white-space: nowrap !important; /* 防止文本换行 */
}

nav a:hover {
    background-color: #3b511a !important;
    color: #FFFFFF !important;
}

nav a.active {
    background-color: #5b8731 !important;
    color: #FFFFFF !important;
}

nav a.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 2px !important;
    background-color: #f7d51d !important;
}

/* 主要内容区域 */
main {
    padding-top: 20px !important; /* 增加顶部内边距 */
    min-height: calc(100vh - 180px) !important; /* 确保内容区域最小高度 */
}

/* 页脚修复 */
footer {
    position: relative !important; /* 确保页脚正常定位 */
    margin-top: 40px !important; /* 增加与内容区域的距离 */
    padding: 20px 0 !important;
    background-color: #333 !important;
    color: #fff !important;
}

.footer-content {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.footer-links {
    margin-bottom: 15px !important;
}

.footer-links a {
    margin: 0 10px !important;
    color: #ddd !important;
}

/* 欢迎标题调整为一行 */
.hero h2 {
    white-space: nowrap !important; /* 强制标题在一行 */
    overflow: visible !important;
    font-size: 2.5rem !important;
    letter-spacing: 2px !important;
    text-align: center !important;
    width: 100% !important;
}

/* 功能卡片优化 */
.feature-cards {
    display: flex !important; 
    flex-wrap: nowrap !important; /* 强制不换行 */
    gap: 5px !important; /* 减小卡片之间的间距 */
    justify-content: space-between !important; /* 从左到右平均分布 */
    padding: 0 !important; /* 完全移除内边距 */
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important; /* 允许占用全宽 */
    overflow-x: visible !important; /* 取消横向滚动 */
    padding-bottom: 0 !important; /* 移除底部内边距 */
}

.feature-card {
    flex: 1 1 0 !important; /* 平均分配空间 */
    max-width: none !important; /* 移除最大宽度限制 */
    min-width: 0 !important; /* 允许卡片根据可用空间收缩 */
    padding: 20px 10px !important; /* 增加上下内边距使卡片更长 */
    font-size: 0.95em !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    border-radius: 8px !important;
    border: 2px solid rgba(91, 135, 49, 0.6) !important; /* 更鲜艳的边框颜色 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important; /* 增强阴影效果 */
    background-color: rgba(255, 255, 255, 0.75) !important; /* 增加背景不透明度 */
    height: 280px !important; /* 增加卡片高度 */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    margin: 0 !important; /* 移除外边距 */
    overflow: hidden !important; /* 防止内容溢出 */
}

.feature-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(91, 135, 49, 0.9) !important; /* 悬停时边框更明显 */
}

.feature-card img {
    width: 60px !important; /* 减小图标尺寸 */
    height: 60px !important;
    margin: 0 auto 10px !important; /* 减小下边距 */
    transition: transform 0.3s ease !important;
}

.feature-card h3 {
    font-size: 1.15rem !important;
    margin-bottom: 8px !important; /* 减小下边距 */
    color: #1e5107 !important;
    white-space: normal !important; /* 允许标题换行 */
    overflow: visible !important; /* 防止标题被截断 */
    text-overflow: initial !important; /* 移除省略号 */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 1) !important;
    font-weight: bold !important;
    letter-spacing: 0.5px !important;
    max-height: 60px !important; /* 限制标题最大高度 */
    line-height: 1.3 !important; /* 调整行高 */
}

.feature-card p {
    font-size: 0.9rem !important; /* 稍微减小字体 */
    margin-bottom: 12px !important;
    line-height: 1.3 !important; /* 减小行高 */
    color: #000000 !important;
    flex-grow: 1 !important; 
    max-height: 100px !important; /* 限制段落最大高度 */
    overflow-y: auto !important; /* 如果内容太多允许滚动 */
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8) !important;
}

.feature-card .button {
    padding: 8px 15px !important; /* 稍微减小按钮 */
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    margin-top: 10px !important; /* 增加顶部边距 */
    background-color: #5b8731 !important;
    color: white !important;
    border: 2px solid #3b511a !important;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.feature-card .button:hover {
    background-color: #3b511a !important; /* 悬停时更深的绿色 */
    transform: translateY(-2px) !important; /* 悬停时轻微上移 */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15) !important; /* 增强阴影 */
}

/* 增加容器宽度确保显示所有卡片 */
.container {
    max-width: 100% !important;
    padding: 0 5px !important; /* 减少容器内边距 */
}

.features .container {
    max-width: 100% !important;
}

/* 优化英雄区域，确保标题在一行 */
.hero {
    padding: 20px 15px !important; /* 减小内边距 */
    text-align: center !important;
    max-width: 100% !important; /* 允许占用全宽 */
    overflow: visible !important;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .feature-card img {
        width: 80px !important;
        height: 80px !important;
    }
    
    .feature-card h3 {
        font-size: 1rem !important;
    }
}

@media (max-width: 992px) {
    .feature-card img {
        width: 70px !important;
        height: 70px !important;
    }
    
    .hero h2 {
        font-size: 2rem !important;
    }
}

@media (max-width: 768px) {
    .feature-card {
        padding: 12px 6px !important;
    }
    
    .feature-card img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .feature-card h3 {
        font-size: 0.9rem !important;
    }
    
    .feature-card p {
        font-size: 0.8rem !important;
    }
    
    .feature-card .button {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }
    
    .hero h2 {
        font-size: 1.8rem !important;
        letter-spacing: 1px !important;
    }
}

@media (max-width: 576px) {
    .feature-card img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .feature-card h3 {
        font-size: 0.8rem !important;
    }
    
    .feature-card p {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }
    
    .feature-card .button {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }
    
    .hero h2 {
        font-size: 1.5rem !important;
        letter-spacing: 0 !important;
    }
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
