/* 全局变量与基础样式 */
:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --highlight: #e94560;
    --light: #f5f5f5;
    --dark: #0f0f1a;
    --text: #e0e0e0;
    --card-bg: #1e2a3a;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --radius: 12px;
    --transition: 0.3s ease;
    --glass-bg: rgba(30, 42, 58, 0.6);
    --glass-border: rgba(255,255,255,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary);
    color: var(--text);
    line-height: 1.7;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

a {
    color: var(--highlight);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #ff6b81;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.4rem;
}

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

.section {
    padding: 80px 0;
    position: relative;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(233,69,96,0.05), transparent);
    transition: left 0.6s ease;
}

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

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    background: #23324a;
}

/* 毛玻璃效果 */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* 网格布局 */
.grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 30px;
}

.grid-2 {
    grid-template-columns: repeat(2,1fr);
}

.grid-3 {
    grid-template-columns: repeat(3,1fr);
}

.grid-4 {
    grid-template-columns: repeat(4,1fr);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background: var(--highlight);
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    background: #c73e54;
    transform: scale(1.02);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--highlight);
    color: var(--highlight);
}

.btn-outline:hover {
    background: var(--highlight);
    color: #fff;
}

.tag {
    display: inline-block;
    background: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0 6px 6px 0;
}

/* 头部导航 */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(26,26,46,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 15px 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.logo span {
    color: var(--highlight);
}

.nav {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav a {
    color: var(--text);
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition), color var(--transition);
}

.nav a:hover {
    border-bottom-color: var(--highlight);
    color: #fff;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.menu-toggle:hover {
    transform: rotate(90deg);
}

/* Hero 区域 - 渐变背景与动画 */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(233,69,96,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(15,52,96,0.2) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(10%, 10%);
    }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
    animation: fadeInUp 1s ease;
}

.hero .btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1.2s ease;
}

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

/* About 区域 */
.about {
    background: var(--secondary);
}

/* Products 区域 */
.products {
    background: var(--primary);
}

.product-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Services 区域 */
.services {
    background: var(--secondary);
}

/* Advantages 区域 */
.advantages {
    background: var(--primary);
}

.advantage-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--highlight);
    opacity: 0.8;
    transition: opacity var(--transition);
}

.card:hover .advantage-number {
    opacity: 1;
}

/* Testimonials 区域 */
.testimonials {
    background: var(--secondary);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 15px;
    position: relative;
    padding-left: 20px;
}

.testimonial-text::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -5px;
    font-size: 2rem;
    color: var(--highlight);
    opacity: 0.5;
}

.testimonial-author {
    font-weight: 600;
    color: var(--highlight);
}

/* Case Studies 区域 */
.case-studies {
    background: var(--primary);
}

/* Insights 区域 */
.insights {
    background: var(--secondary);
}

.insight-card .date {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 8px;
}

.insight-card h3 {
    margin-bottom: 10px;
}

.insight-card a {
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    position: relative;
}

.insight-card a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--highlight);
    transition: width 0.3s ease;
}

.insight-card a:hover::after {
    width: 100%;
}

/* FAQ 区域 */
.faq {
    background: var(--primary);
}

.faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    transition: background 0.3s;
}

.faq-item:hover {
    background: rgba(255,255,255,0.02);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    user-select: none;
}

.faq-question .icon {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s, opacity 0.3s;
    padding-top: 0;
    opacity: 0;
}

.faq-answer.open {
    max-height: 300px;
    padding-top: 15px;
    opacity: 1;
}

.faq-question.active .icon {
    transform: rotate(45deg);
}

/* HowTo 区域 */
.howto {
    background: var(--secondary);
}

.howto-step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: flex-start;
    transition: transform 0.3s;
}

.howto-step:hover {
    transform: translateX(8px);
}

.step-number {
    background: var(--highlight);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.howto-step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(233,69,96,0.4);
}

/* Contact 区域 */
.contact {
    background: var(--primary);
}

.contact-info p {
    margin-bottom: 10px;
}

/* Footer 区域 */
.footer {
    background: var(--dark);
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 30px;
}

.footer h4 {
    margin-bottom: 15px;
    color: #fff;
}

.footer a {
    display: block;
    margin-bottom: 8px;
    opacity: 0.8;
    transition: opacity var(--transition), padding-left 0.3s;
}

.footer a:hover {
    opacity: 1;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 30px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-bottom a {
    display: inline;
    margin: 0 8px;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--highlight);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    z-index: 999;
    box-shadow: var(--shadow);
    transition: transform 0.3s, background 0.3s;
}

.back-to-top.visible {
    display: flex;
    animation: fadeInUp 0.4s ease;
}

.back-to-top:hover {
    transform: scale(1.1);
    background: #c73e54;
}

/* 暗色模式切换按钮 */
.dark-toggle {
    background: none;
    border: 2px solid var(--text);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.dark-toggle:hover {
    background: var(--text);
    color: var(--primary);
}

/* 滚动高亮 */
.scroll-highlight {
    transition: background 0.5s;
}

.scroll-highlight.active {
    background: rgba(233,69,96,0.1);
}

/* 滚动动画 - 使用 Intersection Observer 配合 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .nav {
        display: none;
        flex-direction: column;
        gap: 10px;
        background: var(--primary);
        padding: 20px;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    }

    .nav.open {
        display: flex;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .footer .container {
        grid-template-columns: 1fr 1fr;
    }

    .section {
        padding: 60px 0;
    }

    .card {
        padding: 20px;
    }

    .hero {
        padding: 100px 0 60px;
    }
}

@media (max-width: 480px) {
    .footer .container {
        grid-template-columns: 1fr;
    }

    .hero .btn-group {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* 暗色模式增强 - 默认已暗色，这里提供一些额外细节 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #1a1a2e;
        --secondary: #16213e;
        --accent: #0f3460;
        --highlight: #e94560;
        --light: #f5f5f5;
        --dark: #0f0f1a;
        --text: #e0e0e0;
        --card-bg: #1e2a3a;
    }
}

/* 平滑滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--highlight);
}