/* --- 全局和重置 --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === 浅色模式 (默认) === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #111827;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* 平滑过渡 */
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* --- 模糊背景 --- */
.background-blur {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 450px;
    height: 400px;
    background: radial-gradient(circle,
            rgba(168, 85, 247, 0.4),
            /* 紫色 */
            rgba(59, 130, 246, 0.4)
            /* 蓝色 */
        );
    filter: blur(120px);
    opacity: 0.5;
    z-index: -1;
    border-radius: 50%;
    transition: background 0.5s ease;
}

/* --- 主容器 --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- 1. 导航栏 --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-logo {
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.95rem;
    color: #4b5563;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #111827;
}

.nav-divider {
    width: 1px;
    height: 16px;
    background-color: #e5e7eb;
    transition: background-color 0.3s ease;
}

.nav-icon {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
}

/* --- 2. Hero 区域 --- */
.hero {
    padding: 4.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
}

.hero-content {
    flex: 1;
}

.hero-logo {
    flex-shrink: 0;
    width: 350px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.hero .gradient-text {
    background: linear-gradient(90deg, #A855F7, #3B82F6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero h2 {
    font-size: 3.75rem;
    font-weight: 800;
    color: #111827;
    margin-top: 0.25rem;
    transition: color 0.3s ease;
}

.visits-counter {
    margin-top: 1rem;
    font-size: 1rem;
    color: #6b7280;
    transition: color 0.3s ease;
}

.hero-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 0.75rem;
}

.btn {
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #4338CA;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #3730A3;
}

.btn-secondary {
    background-color: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.btn-secondary:hover {
    background-color: #E5E7EB;
}

/* --- 3. 项目网格 --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-bottom: 5rem;
}

.project-card {
    background: linear-gradient(135deg, 
        rgba(249, 250, 251, 0.95) 0%, 
        rgba(243, 244, 246, 0.95) 100%);
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(120deg, 
        rgba(168, 85, 247, 0.08) 0%, 
        rgba(139, 92, 246, 0.12) 25%,
        rgba(99, 102, 241, 0.15) 50%,
        rgba(59, 130, 246, 0.12) 75%,
        rgba(147, 197, 253, 0.08) 100%);
    filter: blur(8px);
    opacity: 1;
    z-index: 0;
    transition: all 0.4s ease;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(249, 250, 251, 1) 0%,
        rgba(249, 250, 251, 0.9) 30%,
        rgba(249, 250, 251, 0.4) 60%,
        rgba(249, 250, 251, 0) 100%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.project-card:hover::before {
    filter: blur(0px);
    opacity: 0.6;
}

.project-card:hover::after {
    opacity: 0.0
}

.card-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background-color: #E0E7FF;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}

.project-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #111827;
    transition: color 0.3s ease;
}

.project-card p {
    font-size: 0.9rem;
    color: #6B7280;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.card-bg-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center right;
    opacity: 0.3;
    z-index: 0;
    filter: blur(1px);
    transition: all 0.4s ease;
    mask-image: linear-gradient(to left, 
        rgba(0, 0, 0, 1) 20%, 
        rgba(0, 0, 0, 0.8) 50%, 
        rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to left, 
        rgba(0, 0, 0, 1) 20%, 
        rgba(0, 0, 0, 0.8) 50%, 
        rgba(0, 0, 0, 0) 100%);
}

.project-card:hover .card-bg-image {
    opacity: 0.5;
    filter: blur(0px);
}

.project-card h3,
.project-card p,
.card-icon {
    position: relative;
    z-index: 2;
}

/* --- 浮动按钮 --- */
.floating-buttons {
    position: fixed;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
}

.float-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #E5E7EB;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    color: #4B5563;
    transition: all 0.3s ease;
}

.float-btn:hover {
    background-color: #F9FAFB;
}

/* --- 响应式设计 --- */
@media (max-width: 992px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero {
        gap: 2rem;
    }
    
    .hero-logo {
        width: 280px;
        height: 220px;
    }
}

@media (max-width: 768px) {

    /* (响应式样式保持不变) */
    .container {
        padding: 0 1rem;
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-left {
        flex-direction: column;
        gap: 1rem;
    }

    .hero {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-content {
        width: 100%;
    }

    .hero-logo {
        width: 100%;
        max-width: 280px;
        height: 200px;
        padding: 1rem;
        order: -1;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .hero h2 {
        font-size: 2.75rem;
    }

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

    .floating-buttons {
        flex-direction: row;
        bottom: 1rem;
        right: 1rem;
        top: auto;
        transform: none;
    }
}


/* ################################# */
/* ###      深色模式 覆盖      ### */
/* ################################# */

body.dark-mode {
    background-color: #18181B;
    color: #F9FAFB;
}

/* --- 深色模式: 模糊背景 --- */
body.dark-mode .background-blur {
    background: radial-gradient(circle,
            rgba(16, 185, 129, 0.3),
            /* 绿色 */
            rgba(52, 211, 153, 0.3)
            /* 浅绿 */
        );
    opacity: 0.4;
}

/* --- 深色模式: 导航栏 --- */
body.dark-mode .nav-link {
    color: #A0A0A0;
}

body.dark-mode .nav-link:hover {
    color: #FFFFFF;
}

body.dark-mode .nav-divider {
    background-color: #3F3F46;
}

body.dark-mode .nav-icon {
    color: #A0A0A0;
}

/* --- 深色模式: Hero 区域 --- */
body.dark-mode .hero .gradient-text {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #34D399;
    /* 灵感图中的绿色 */
}

body.dark-mode .hero h2 {
    color: #FFFFFF;
}

body.dark-mode .visits-counter {
    color: #A0A0A0;
}

body.dark-mode .btn-primary {
    background-color: #34D399;
    color: #18181B;
}

body.dark-mode .btn-primary:hover {
    background-color: #10B981;
}

body.dark-mode .btn-secondary {
    background-color: #27272A;
    color: #F9FAFB;
    border: 1px solid #3F3F46;
}

body.dark-mode .btn-secondary:hover {
    background-color: #3F3F46;
}

/* --- 深色模式: 项目网格 --- */
body.dark-mode .project-card {
    background: linear-gradient(135deg, 
        rgba(39, 39, 42, 0.95) 0%, 
        rgba(63, 63, 70, 0.95) 100%);
    border: 1px solid #3F3F46;
}

body.dark-mode .project-card::before {
    background: linear-gradient(120deg, 
        rgba(16, 185, 129, 0.08) 0%, 
        rgba(20, 184, 166, 0.10) 25%,
        rgba(34, 211, 238, 0.12) 50%,
        rgba(52, 211, 153, 0.10) 75%,
        rgba(167, 243, 208, 0.08) 100%);
    filter: blur(8px);
    opacity: 1;
}

body.dark-mode .project-card::after {
    background: linear-gradient(90deg, 
        rgba(39, 39, 42, 1) 0%,
        rgba(39, 39, 42, 0.9) 30%,
        rgba(39, 39, 42, 0.4) 60%,
        rgba(39, 39, 42, 0) 100%);
}

body.dark-mode .project-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .project-card:hover::before {
    filter: blur(0px);
    opacity: 0.6;
}

body.dark-mode .project-card:hover::after {
    opacity: 0.7;
}

body.dark-mode .card-icon {
    background-color: #3F3F46;
}

body.dark-mode .project-card h3 {
    color: #FFFFFF;
}

body.dark-mode .project-card p {
    color: #A0A0A0;
}

body.dark-mode .card-bg-image {
    opacity: 0.25;
    filter: blur(1px);
}

body.dark-mode .project-card:hover .card-bg-image {
    opacity: 0.4;
    filter: blur(0px);
}

/* --- 深色模式: 浮动按钮 --- */
body.dark-mode .float-btn {
    border: 1px solid #3F3F46;
    background-color: #27272A;
    color: #A0A0A0;
}

body.dark-mode .float-btn:hover {
    background-color: #3F3F46;
}