/* 太原本地水果供应链平台 - 全局样式 (优化版 v2.0) */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: #2e7d32;
    transition: color 0.2s;
}

a:hover {
    color: #1b5e20;
}

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

/* ==================== 加载动画 ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 页面加载动画 */
body > .container,
.section,
.stats-section {
    animation: fadeIn 0.5s ease forwards;
}

/* ==================== 头部导航 ==================== */
.header {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: #fff;
    padding: 0;
    box-shadow: 0 4px 20px rgba(46,125,50,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 15px 20px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.nav a {
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    transform: translateY(-1px);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

/* ==================== 统计区域 ==================== */
.stats-section {
    background: #fff;
    padding: 40px 0;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 25px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(46,125,50,0.15);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
    animation: pulse 2s infinite;
}

.stat-number {
    font-size: 40px;
    font-weight: 700;
    color: #2e7d32;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* ==================== 区块通用 ==================== */
.section {
    padding: 50px 0;
}

.section-alt {
    background: #fff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #2e7d32;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: #1b5e20;
    border-radius: 2px;
}

.section-header h2 {
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(46,125,50,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46,125,50,0.4);
    color: #fff;
}

.btn-link {
    color: #2e7d32;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-small {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 6px;
}

/* ==================== 产品网格 ==================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease forwards;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2e7d32, #ff6b35);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.product-category {
    display: inline-block;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.product-name {
    font-size: 17px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.product-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 0;
    border-top: 1px solid #f5f5f5;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: #ff6b35;
}

.product-price::before {
    content: '¥';
    font-size: 14px;
    margin-right: 2px;
}

.product-stock {
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 12px;
}

.product-supplier {
    font-size: 12px;
    color: #999;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================== 双列布局 ==================== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* ==================== 列表卡片 ==================== */
.list-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.list-item {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.list-item:hover {
    background: #f0f4ff;
}

.list-item:last-child {
    border-bottom: none;
}

.list-info strong {
    display: block;
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.list-tag {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.list-contact {
    font-size: 13px;
    color: #888;
    text-align: right;
    line-height: 1.6;
}

/* ==================== 分类网格 ==================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.category-item {
    background: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.category-name {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.category-count {
    font-size: 13px;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* ==================== 空提示 ==================== */
.empty-tip {
    text-align: center;
    padding: 50px;
    color: #999;
    font-size: 15px;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.empty-tip::before {
    content: '📭';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* ==================== 安装页面 ==================== */
.install-box {
    max-width: 550px;
    margin: 80px auto;
    background: #fff;
    padding: 45px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    text-align: center;
    animation: scaleIn 0.5s ease;
}

.install-box h1 {
    font-size: 26px;
    color: #333;
    margin-bottom: 10px;
}

.install-box h2 {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    font-weight: 400;
}

.install-info {
    text-align: left;
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.install-info ul {
    list-style: none;
    margin-top: 12px;
}

.install-info li {
    padding: 6px 0;
    font-size: 14px;
    color: #555;
}

.result-box {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.result-box.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.result-box.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ==================== 页脚 ==================== */
.footer {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: rgba(255,255,255,0.7);
    padding: 35px 0;
    text-align: center;
    margin-top: 50px;
}

.footer p {
    margin: 5px 0;
    font-size: 14px;
}

.footer-note {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 10px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        margin-top: 15px;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 18px 12px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .two-col {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .section-header h2 {
        font-size: 18px;
    }
    
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .list-contact {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .nav {
        gap: 3px;
    }
    
    .nav a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
}
