/* All in One - 卡片式布局样式 v2.3 (现代化互联网技术服务规范) */

/* ========== 响应式自适应网格 ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
    justify-content: center;
}

/* 中等屏幕优化 */
@media (min-width: 768px) and (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }
}

/* 移动设备优化：单列 */
@media (max-width: 639px) {
    .card-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 0.875rem;
        padding: 0.75rem 0;
    }
}

/* ========== 模块卡片样式 (现代技术服务规范) ========== */
.module-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 320px;
}

/* 移动端卡片优化 */
@media (max-width: 639px) {
    .module-card {
        padding: 1rem;
        max-width: 100%;
    }
}

/* 平板优化 */
@media (min-width: 640px) and (max-width: 768px) {
    .module-card {
        padding: 1.125rem;
    }
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #2563eb;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.module-card:hover::before { 
    transform: scaleX(1); 
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    border-color: #93c5fd;
}

/* 移动端悬浮效果优化（触摸设备） */
@media (hover: none) {
    .module-card:hover {
        transform: none;
        box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06);
    }
    .module-card:hover::before {
        transform: scaleX(0);
    }
}

.module-card:active { 
    transform: translateY(0); 
}

/* ========== 图标容器 ========== */
.card-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    transition: all 0.2s ease;
}

.module-card:hover .card-icon {
    transform: scale(1.05);
    background: #dbeafe;
}

/* 移动端图标优化 */
@media (max-width: 639px) {
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
    }
}

/* ========== 卡片内容 (工整SaaS排版) ========== */
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-weight: 400;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.card-button {
    width: 100%;
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: white;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-button:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25);
}

.module-card:hover .card-button i { 
    transform: translateX(3px); 
    transition: transform 0.2s ease; 
}

/* ========== 视图显隐逻辑控制 ========== */
#welcome-view { display: block; }
#welcome-view.hidden { display: none !important; }
#module-view { display: none; position: relative; min-height: 400px; }
#module-view.active, #module-view:not(.hidden) { display: block; }

/* 欢迎视图居中 */
#welcome-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.welcome-content {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-bottom: 0.5rem;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

/* 移动端标题优化 */
@media (max-width: 639px) {
    .welcome-title {
        font-size: 1.5rem;
    }
}

.welcome-subtitle { 
    font-size: 0.9375rem; 
    color: #64748b; 
    margin-bottom: 1rem; 
}

/* 移动端副标题优化 */
@media (max-width: 639px) {
    .welcome-subtitle {
        font-size: 0.875rem;
    }
}

/* 返回按钮样式 (现代次要按钮风格) */
.back-to-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    margin-bottom: 1rem;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.back-to-home-btn:hover { 
    background: #f8fafc; 
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px); 
}

/* 移动端返回按钮优化 */
@media (max-width: 639px) {
    .back-to-home-btn {
        padding: 0.375rem 0.875rem;
        font-size: 0.8125rem;
    }
}

/* 卡片入场动效 */
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.module-card { animation: cardEnter 0.3s ease-out backwards; }
.module-card:nth-child(1) { animation-delay: 0.03s; }
.module-card:nth-child(2) { animation-delay: 0.06s; }
.module-card:nth-child(3) { animation-delay: 0.09s; }
.module-card:nth-child(4) { animation-delay: 0.12s; }
.module-card:nth-child(5) { animation-delay: 0.15s; }
.module-card:nth-child(6) { animation-delay: 0.18s; }
