/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.app-header p {
    font-size: 1.2rem;
    color: #666;
}

/* 主内容区域 */
.app-main {
    flex: 1;
    margin-bottom: 20px;
}

/* 卡片容器 */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    justify-items: center;
}

/* 卡片样式 - 恢复原始尺寸 */
.app-card {
    width: 200px; /* 恢复原始尺寸 */
    height: 200px; /* 恢复原始尺寸 */
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px; /* 恢复原始尺寸 */
    padding: 16px; /* 恢复原始尺寸 */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.app-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.app-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.app-card.disabled:hover {
    border-color: #dee2e6;
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-title {
    font-size: 15px; /* 恢复原始尺寸 */
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 8px; /* 恢复原始尺寸 */
}

.card-description {
    font-size: 10px; /* 恢复原始尺寸 */
    color: #666;
    text-align: center;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-button {
    margin-top: auto;
    padding: 8px 16px; /* 恢复原始尺寸 */
    font-size: 12px; /* 恢复原始尺寸 */
    border: none;
    border-radius: 4px; /* 恢复原始尺寸 */
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
    width: 120px; /* 恢复原始尺寸 */
    height: 32px; /* 恢复原始尺寸 */
    align-self: center;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-primary:active {
    background-color: #004085;
}

.btn-disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* 底部样式 */
.app-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    color: #888;
    font-size: 10px; /* 恢复原始尺寸 */
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

/* 加载动画 */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* WebGPU 容器 */
.webgpu-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    z-index: 900;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#webgpuCanvas {
    border: 1px solid #333;
    background-color: #000;
    max-width: 95%;
    max-height: 85%;
}

.btn-close {
    margin-top: 20px;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-close:hover {
    background-color: #0056b3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .app-card {
        width: 160px;
        height: 160px;
        padding: 12px;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 12px;
    }
    
    .card-button {
        width: 100px;
        height: 28px;
        font-size: 10px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .app-container {
        padding: 15px;
    }
    
    .app-card {
        width: 140px;
        height: 140px;
        padding: 10px;
    }
    
    .card-title {
        font-size: 11px;
    }
    
    .card-description {
        font-size: 9px;
    }
    
    .card-button {
        width: 90px;
        height: 26px;
        font-size: 9px;
        padding: 5px 10px;
    }
}