/* 机械设备企业官网 - 现代化大气设计 */

/* ===== 全局变量 ===== */
:root {
    /* 主色调 - 深蓝色系，专业大气 */
    --primary-color: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #1a365d;
    
    /* 辅助色 - 科技蓝 */
    --accent-color: #3182ce;
    --accent-light: #63b3ed;
    
    /* 中性色 */
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    
    /* 功能色 */
    --success: #48bb78;
    --warning: #ed8936;
    --error: #f56565;
    
    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
}

/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== 顶部导航栏 ===== */
.top-nav {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 0 var(--spacing-md);
    box-shadow: var(--shadow-lg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: 28px;
}

.nav-menu {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
}

.nav-menu a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--accent-color);
    border-radius: var(--radius-sm);
}

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
}

/* ===== 轮播图 ===== */
.carousel {
    margin-top: 70px;
    position: relative;
    overflow: hidden;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.carousel-container {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: var(--spacing-xl) var(--spacing-lg);
    color: white;
}

.carousel-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.carousel-desc {
    font-size: 16px;
    opacity: 0.9;
}

.carousel-dots {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

/* ===== 主要内容区 ===== */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.section {
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: var(--radius-sm);
}

/* ===== 产品卡片 ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.product-info {
    padding: var(--spacing-md);
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
}

.product-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 企业优势 ===== */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.advantage-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.advantage-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.advantage-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-sm);
}

.advantage-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.advantage-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== 案例展示 ===== */
.case-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.case-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.case-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(8px);
}

.case-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.case-content {
    flex: 1;
}

.case-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.case-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.case-location {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== 加载动画 ===== */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm);
    z-index: 999;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.3s ease;
    flex: 1;
}

.nav-item-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--accent-color);
}

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

/* ===== 侧边导航菜单 - 模板风格 ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #2c3e50;
    z-index: 1001;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.3);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    margin: 4px 12px;
    border-radius: 8px;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 28px;
}

.sidebar-item.active {
    color: white;
    background: rgba(255,255,255,0.15);
}

.sidebar-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    background: #e67e22;
    border-radius: 2px;
}

.sidebar-icon {
    font-size: 24px;
    margin-right: 16px;
    width: 32px;
    text-align: center;
}

.sidebar-text {
    font-size: 16px;
    font-weight: 500;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .top-nav {
        height: 60px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .menu-btn {
        display: block;
    }
    
    .carousel {
        height: 250px;
    }
    
    .carousel-title {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .bottom-nav {
        padding: var(--spacing-xs);
    }
    
    .nav-item-icon {
        font-size: 20px;
    }
    
    .nav-item {
        font-size: 10px;
    }
}

@media (min-width: 769px) {
    .menu-btn {
        display: none;
    }
    
    .bottom-nav {
        display: none;
    }
    
    /* 桌面端侧边栏默认不显示 */
    .sidebar {
        left: -280px;
    }
}
