/* ========================================
   开源顺风建站 - 全局样式文件
   洗衣凝珠盒风格：浅蓝 + 纯白 + 浅灰
   ======================================== */

/* CSS Reset & 基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 颜色变量 */
:root {
    --primary-blue: #4a9eff;
    --light-blue: #e8f4fc;
    --pure-white: #ffffff;
    --light-gray: #f5f7fa;
    --medium-gray: #909399;
    --dark-gray: #606266;
    --text-primary: #303133;
    --text-secondary: #606266;
    --border-color: #e4e7ed;
    --shadow-light: 0 2px 12px rgba(74, 158, 255, 0.1);
    --shadow-medium: 0 4px 16px rgba(74, 158, 255, 0.15);
    --shadow-heavy: 0 8px 24px rgba(74, 158, 255, 0.2);
}

/* ========================================
   顶部导航栏
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-medium);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-blue);
    background: var(--light-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 移动端菜单 */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 20px;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--pure-white);
        flex-direction: column;
        padding: 20px;
        gap: 4px;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-medium);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4fc 100%);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 2px;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-blue);
    padding-left: 8px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: var(--medium-gray);
    font-size: 14px;
}

/* ========================================
   通用组件
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), #7ebaff);
    border-radius: 2px;
}

.section-title p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), #7ebaff);
    color: var(--pure-white);
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--pure-white);
}

/* 卡片样式 */
.card {
    background: var(--pure-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-in {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

/* 滚动渐入 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 20px;
    }

    .section {
        padding: 60px 0;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .footer-container {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .section-title h2 {
        font-size: 24px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}
