/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #c5a7ee 0%, #bfdff2 100%);
    min-height: 100vh;
    padding: 0;
}

/* 语言切换按钮 */
.language-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.lang-btn.active {
    color: #007AFF;
    font-weight: 600;
}

.lang-btn:hover {
    color: #007AFF;
}

.language-switch span {
    color: #ddd;
    margin: 0 4px;
}

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

/* 应用网格区域 */
.app-grid {
    margin-bottom: 40px;
    padding-top: 40px;
}

.app-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 应用图标容器 */
.app-icon-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* 个人资料App特殊样式 */
.profile-app .app-icon {
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-tooltip {
    width: 350px;
    padding: 24px;
}

.profile-tooltip h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.profile-subtitle {
    font-size: 16px;
    color: #86868b;
    line-height: 1.4;
    margin-bottom: 20px;
    text-align: center;
}

.profile-details {
    text-align: left;
}

.profile-details p {
    font-size: 14px;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.5;
}

.profile-details p:last-child {
    margin-bottom: 0;
}

/* 应用图标 */
.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.app-icon:hover {
    transform: scale(1.1);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 应用名称 */
.app-icon-container::after {
    content: attr(data-app-name);
    font-size: 12px;
    color: #1d1d1f;
    text-align: center;
    font-weight: 500;
    max-width: 80px;
    word-wrap: break-word;
}

/* 应用名称样式 */
.app-name {
    font-size: 12px;
    color: #ffffff;
    text-align: center;
    font-weight: 500;
    max-width: 80px;
    word-wrap: break-word;
    line-height: 1.2;
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 个人资料app名称特殊样式 */
.profile-app .app-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 应用提示框 */
.app-tooltip {
    position: absolute;
    top: 100%;  /* 改为显示在下方 */
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    margin-top: 20px;  /* 改为上方间距 */
}

.app-tooltip::before {  /* 改为向上的箭头 */
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: rgba(255, 255, 255, 0.95);
}

/* 悬停时显示提示框 */
.app-icon-container:hover .app-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 提示框内容样式 */
.app-tooltip h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    text-align: center;
}

.app-tooltip .app-category {
    font-size: 12px;
    color: #007AFF;
    font-weight: 500;
    background: rgba(0, 122, 255, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
    margin: 0 auto 8px;
    text-align: center;
}

.app-tooltip .app-description {
    font-size: 13px;
    color: #86868b;
    line-height: 1.4;
    margin-bottom: 16px;
    text-align: center;
}

/* 按钮样式 */
.app-button, .app-button-red {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.app-button {
    background: #007AFF;
    color: white;
}

.app-button:hover {
    background: #0056CC;
    transform: scale(1.02);
}

.app-button-red {
    background: #FF3B30;
    color: white;
}

.app-button-red:hover {
    background: #D70015;
    transform: scale(1.02);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .app-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 30px;
    }
    
    .app-tooltip {
        width: 280px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .profile-tooltip {
        width: 300px;
    }
}

@media (max-width: 480px) {
    .app-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 20px;
    }
    
    .app-icon {
        width: 70px;
        height: 70px;
    }
    
    .app-tooltip {
        width: 250px;
    }
    
    .profile-tooltip {
        width: 280px;
    }
}