/* ==========================================================================
   1. 基础重置与变量定义
   ========================================================================== */
:root {
    --primary-color: #2563eb;      /* 主题蓝 */
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;    /* 辅助灰 */
    --text-color: #334155;         /* 主文字 */
    --text-light: #64748b;         /* 次文字 */
    --bg-light: #f8fafc;           /* 浅色背景 */
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --max-width: 1200px;
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* 全局启用平滑滚动 */
    font-family: var(--font-sans);
    color: var(--text-color);
    line-height: 1.6;
}

body {
    background-color: var(--bg-white);
    padding-top: 70px; /* 为固定导航栏留出空间 */
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 常用版心容器 */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   2. 通用组件样式 (按钮、区块头部)
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--bg-light);
    border-color: var(--text-light);
}

.btn-block {
    display: block;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: #0f172a;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ==========================================================================
   3. 核心区块样式
   ========================================================================== */

/* 导航栏 */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-item {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
}

.nav-item.active {
    border-bottom-color: var(--primary-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

/* Hero 海报区 */
.hero-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    padding: 100px 0 120px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.hero-section h1 {
    font-size: 3.5rem;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 25px;
}

.hero-section p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* 服务项目区 */
.services-section {
    padding: 90px 0;
    background-color: var(--bg-white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    padding: 40px 30px;
    background-color: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #0f172a;
}

.service-card p {
    color: var(--text-light);
}

/* 关于我们区 */
.about-section {
    padding: 90px 0;
    background-color: var(--bg-light);
}

.about-wrapper {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
}

.about-text .subtitle {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.about-text h2 {
    font-size: 2.2rem;
    color: #0f172a;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.about-image {
    flex: 1;
}

.about-image img {
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 联系我们区 */
.contact-section {
    padding: 90px 0;
    background-color: var(--bg-white);
}

.contact-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
}

/* 页脚 */
.footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 40px 0;
    font-size: 0.95rem;
    border-top: 1px solid #1e293b;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a:hover {
    color: white;
}

/* ==========================================================================
   4. 移动端响应式适配 (Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    .navbar {
        height: 60px;
    }
    
    /* 移动端菜单变为下拉抽屉式 */
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        flex-direction: column;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }
    
    .nav-menu.active {
        max-height: 300px;
    }
    
    .nav-item {
        padding: 15px 20px;
        border-bottom: 1px solid var(--bg-light);
        border-left: 4px solid transparent;
    }
    
    .nav-item.active, .nav-item:hover {
        border-bottom-color: var(--bg-light);
        border-left-color: var(--primary-color);
        background-color: var(--bg-light);
    }

    /* 布局微调 */
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        padding: 0 40px;
    }

    .about-wrapper {
        flex-direction: column;
        gap: 40px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}