/* =========================================
   全局基础样式 (电脑和手机通用)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #334155;
    line-height: 1.6;
    background-color: #fff;
    overflow-x: hidden; /* 强制禁止左右滑动 */
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   顶部导航栏 (Header)
   ========================================= */
header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    
    /* 使用 Flexbox 让 Logo 和 导航 分开排列 */
    display: flex;
    justify-content: space-between; /* 关键：一个靠左，一个靠右 */
    align-items: center; /* 关键：垂直居中 */
}

.logo {
    font-size: 1.5rem; /* 电脑端大一点 */
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 25px; /* 链接之间的间距 */
}

.nav-links a {
    font-weight: 500;
    color: #64748b;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: #2563eb; /* 激活时的蓝色 */
    font-weight: 600;
}

/* =========================================
   通用容器与排版
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    font-size: 2.5rem;
    color: #0f172a;
    margin-bottom: 20px;
    line-height: 1.2;
}

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #475569;
}

/* 卡片样式 (用于 Services 和 About 的优势展示) */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 10px;
}

.card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* =========================================
   手机端专用样式 (修复您遇到的问题)
   ========================================= */
@media (max-width: 768px) {
    /* 1. 修复 Header 布局 */
    header {
        padding: 15px 20px; /* 减小内边距 */
        flex-direction: row; /* 保持横向排列 */
        justify-content: space-between;
    }

    /* 2. 强制缩小 Logo，防止太大 */
    .logo {
        font-size: 1.2rem; /* 手机上变小 */
        white-space: nowrap; /* 防止 Logo 换行 */
    }

    /* 3. 调整导航链接，防止挤出屏幕 */
    .nav-links {
        gap: 15px; /* 缩小间距 */
    }

    .nav-links a {
        font-size: 0.9rem; /* 字体稍微变小 */
    }

    /* 4. 内容区域调整 */
    h1 {
        font-size: 1.8rem; /* 标题在手机上不要太大 */
    }
    
    p {
        font-size: 1rem;
    }

    .container {
        padding: 20px;
    }
}