/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    /* Color Palette - Light Theme */
    --bg-main: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    
    --primary: #8b5cf6;       /* Violet */
    --primary-glow: rgba(139, 92, 246, 0.3);
    --secondary: #06b6d4;     /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.3);
    
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-dark: #111827;
    
    --border: rgba(0, 0, 0, 0.1);
    
    /* Layout */
    --container-width: 1200px;
    --nav-height: 80px;
    
    /* Transition */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }

.section {
    padding: 100px 0;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    gap: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    opacity: 0;
    z-index: -1;
    transition: var(--transition);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: transparent;
    color: var(--text-main);
    font-weight: 600;
    border-radius: 50px;
    border: 1px solid var(--border);
    cursor: pointer;
    gap: 8px;
}

.btn-secondary:hover {
    border-color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

.btn-block {
    width: 100%;
}

/* =========================================
   2. Navbar
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-list {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-main);
    transition: var(--transition);
}

/* =========================================
   3. Hero Section
   ========================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: var(--nav-height);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--primary);
    animation: float 8s infinite alternate;
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--secondary);
    animation: float 10s infinite alternate-reverse;
}

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

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-visual {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visual-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 160px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.visual-card i {
    font-size: 2.5rem;
}

.visual-card span {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}

.card-1 {
    top: 10%;
    left: 10%;
    color: var(--secondary);
    animation: hoverCard 6s infinite ease-in-out;
}

.card-2 {
    top: 40%;
    right: 5%;
    color: var(--primary);
    width: 180px;
    padding: 30px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    animation: hoverCard 8s infinite ease-in-out 1s;
}

.card-3 {
    bottom: 15%;
    left: 20%;
    color: #f472b6; /* Pink */
    animation: hoverCard 7s infinite ease-in-out 0.5s;
}

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

/* =========================================
   4. About Section
   ========================================= */
.about {
    background-color: var(--bg-main);
}

.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.section-subtitle {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 40px 60px;
    border-radius: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.about-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--secondary), var(--primary));
}

.about-text-box p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.about-text-box strong {
    color: var(--text-main);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* =========================================
   5. Services Section
   ========================================= */
.services {
    background-color: var(--bg-main);
    position: relative;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 40px 30px;
    border-radius: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    group: hover;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.1), transparent 60%);
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover::after {
    opacity: 1;
}

.icon-box {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.8rem;
    color: var(--text-main);
    transition: var(--transition);
}

.service-card:hover .icon-box {
    background: var(--primary);
    color: white;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.highlight-card {
    grid-column: span 1; /* Default */
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

/* =========================================
   6. Feature Works Section
   ========================================= */
.works {
    background-color: var(--bg-main);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    align-items: start; /* Align items to top to handle varying heights */
}

.work-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.work-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.work-image-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.work-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.6s ease;
}

.work-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.work-caption {
    padding: 24px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 2;
}

.work-caption p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 400;
    border-left: 3px solid var(--secondary);
    padding-left: 12px;
    transition: var(--transition);
}

.work-item:hover .work-caption p {
    color: var(--text-main);
}

/* =========================================
   7. Contact Section
   ========================================= */
.contact {
    background-color: var(--bg-main);
    padding-bottom: 120px;
}

.contact-container {
    background: var(--bg-secondary);
    border-radius: 30px;
    padding: 60px;
    border: 1px solid var(--border);
    text-align: center;
}

.contact-header {
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.contact-title {
    font-size: 3rem;
    margin-bottom: 16px;
    background: linear-gradient(to right, #111, #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.contact-card {
    background: var(--bg-main);
    padding: 40px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    box-shadow: 0 10px 30px -10px rgba(6, 182, 212, 0.2);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: var(--transition);
}

.contact-card:hover .icon-wrapper {
    background: var(--secondary);
    color: var(--bg-main);
}

.icon-wrapper i {
    font-size: 1.5rem;
    color: var(--secondary);
    transition: var(--transition);
}

.contact-card:hover .icon-wrapper i {
    color: white;
}

.contact-card h4 {
    font-size: 1.1rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-card p, .contact-card a {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.contact-card a:hover {
    color: var(--secondary);
}

/* =========================================
   8. Footer
   ========================================= */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
    background: var(--bg-main);
}

.footer-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   9. Responsive
   ========================================= */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .hero-content {
        margin: 0 auto;
        padding-top: 40px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        gap: 16px;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-visual {
        height: 400px;
        margin-top: 10px;
    }

    .contact-container {
        padding: 40px;
    }

    .contact-info-grid,
    .info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--bg-main);
        flex-direction: column;
        padding: 40px;
        transition: var(--transition);
        border-top: 1px solid var(--border);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    .about-content {
        padding: 30px;
    }
    
    .contact-title {
        font-size: 2rem;
    }

    /* Reduce section padding on mobile */
    .section {
        padding: 20px 0; /* 再次大幅减小内边距 */
    }

    /* Compact spacing for Services & Contact on mobile */
    .service-card, .contact-card {
        padding: 24px 20px;
    }

    .contact-container {
        padding: 30px 20px;
    }

    .contact-header {
        margin-bottom: 30px;
    }

    .services-grid, .contact-info-grid {
        gap: 16px;
    }

    /* 强制移动端所有 section-header 居中 */
    .section-header {
        text-align: center !important; /* Force center */
        margin-bottom: 30px;
    }

    /* Mobile Hero Visual Fixes */
    .hero-visual {
        height: 450px; /* 增加高度 */
        margin-top: 10px;
        position: relative;
        width: 100%;
    }

    .visual-card {
        width: 140px; /* 稍微缩小宽度 */
        padding: 15px;
    }

    .visual-card i {
        font-size: 2rem;
    }

    /* 重新定位，避免重叠 */
    .card-1 {
        top: 5%;
        left: 5%;
        right: auto;
        transform: none;
        animation: hoverCardMobile 6s infinite ease-in-out;
    }

    .card-2 {
        top: 35%;
        right: 5%;
        left: auto;
        width: 150px;
        transform: none;
        animation: hoverCardMobile 8s infinite ease-in-out 1s;
    }

    .card-3 {
        bottom: 5%;
        left: 15%;
        right: auto;
        transform: none;
        animation: hoverCardMobile 7s infinite ease-in-out 0.5s;
    }

    /* Feature Works Mobile */
    .works-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .work-item img {
        filter: grayscale(0%); /* Always show color on mobile */
    }
}

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