* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f4fd 0%, #f4fbff 25%, #fefbf0 50%, #fefcf3 75%, #f4fdf6 100%);
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.logo {
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.title-container {
    text-align: center;
    flex-grow: 1;
    margin: 0 2rem;
}

.title {
    color: #1e293b;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.module {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.module::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #f59e0b);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.module::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.05) 0%, 
        rgba(139, 92, 246, 0.05) 25%, 
        rgba(236, 72, 153, 0.05) 50%, 
        rgba(245, 158, 11, 0.05) 75%, 
        rgba(34, 197, 94, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.module:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.12),
        0 16px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-color: rgba(99, 102, 241, 0.4);
}

.module:hover::before {
    opacity: 1;
}

.module:hover::after {
    opacity: 1;
}

.module-icon-container {
    width: 110px;
    height: 110px;
    background: transparent;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: none;
    border: none;
    transition: all 0.3s ease;
}

.module:hover .module-icon-container {
    background: transparent;
    transform: none;
    box-shadow: none;
    border: none;
}

.module-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.08));
    transition: all 0.3s ease;
    z-index: 1;
    opacity: 0.9;
}

.module:hover .module-icon {
    transform: scale(1.1) translateY(-2px);
    filter: drop-shadow(0 6px 12px rgba(99, 102, 241, 0.25));
    opacity: 1;
}

.module-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
    text-align: center;
    transition: all 0.3s ease;
    line-height: 1.4;
    position: relative;
}

.module:hover .module-title {
    color: #6366f1;
    transform: translateY(-2px);
}

.module-description {
    text-align: center;
    color: #64748b;
    line-height: 1.7;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
}

.module:hover .module-description {
    color: #475569;
}

.module-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.module:hover .module-badge {
    opacity: 1;
    transform: translateY(0);
}



/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    /* 移动端导航菜单样式 */
    .header .title-container {
        order: -1;
        margin: 0;
    }
    
    .header .logo {
        height: 40px;
    }

    .title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    /* 模块卡片适配 */
    .module {
        padding: 1.5rem;
    }
    
    .module-icon {
        width: 80px;
        height: 80px;
    }
    
    .module-title {
        font-size: 1.2rem;
    }
    
    .module-description {
        font-size: 0.9rem;
    }
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        max-width: 100%;
    }
    
    .header {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .header .logo {
        height: 35px;
    }
    
    .title {
        font-size: 1.25rem;
        line-height: 1.2;
    }
    
    .grid {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .module {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .module-icon-container {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }
    
    .module-icon {
        width: 60px;
        height: 60px;
    }
    
    .module-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .module-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* 按钮适配 */
    .iframe-toggle-btn, 
    .iframe-close-btn {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
    
    .iframe-toggle-btn .toggle-icon {
        font-size: 18px;
    }
}

/* iframe模式切换按钮 - 优化性能 */
.iframe-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.3s ease,
                background 0.3s ease;
    z-index: 9999;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    will-change: transform; /* 优化GPU加速 */
    contain: layout style paint; /* 提升渲染性能 */
}

.iframe-toggle-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #5b5ff5, #8a5cf6);
}

.iframe-toggle-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.iframe-toggle-btn .toggle-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.iframe-toggle-btn:hover .toggle-icon {
    transform: rotate(10deg) scale(1.1);
}

/* iframe模式激活状态 */
.iframe-toggle-btn.active {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    animation: pulse 2s infinite;
}

.iframe-toggle-btn.active .toggle-icon {
    animation: bounce 1s infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
    }
    50% { 
        box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* iframe容器样式 */
.iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10000;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease-out;
}

.iframe-container.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 返回主页按钮 - 优化性能 */
.iframe-close-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.3s ease,
                background 0.3s ease,
                box-shadow 0.3s ease;
    z-index: 10001;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    will-change: transform, opacity; /* 优化GPU加速 */
    contain: layout style paint; /* 提升渲染性能 */
}

/* iframe容器激活时显示返回按钮 */
.iframe-container.active .iframe-close-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.iframe-close-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.iframe-close-btn:active {
    transform: translateY(-1px) scale(1.02);
}



/* iframe内容区域 */
.content-iframe {
    flex: 1;
    border: none;
    background: white;
    transition: opacity 0.3s ease;
}

.content-iframe.loading {
    opacity: 0.7;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .iframe-close-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .iframe-toggle-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .iframe-toggle-btn .toggle-icon {
        font-size: 20px;
    }
}