/* 系统架构图样式 - 重新设计 */
.system-architecture {
    width: 100% !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow: visible;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* 平台架构模块标题间距调整 - 与其他模块保持一致 */
.platform-architecture .section-header {
    margin-bottom: 3rem;
}

/* 架构容器 */
.system-architecture .arch-container {
    width: 100% !important;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* 架构层级样式 */
.arch-container .arch-layer {
    width: 100% !important;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 80px;
}

.arch-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.arch-layer:hover::before {
    opacity: 1;
}

.arch-layer:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* 各层级颜色主题 */
.app-layer {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.gateway-layer {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.service-layer {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fed7aa 100%);
}

.data-layer {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.infra-layer {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

/* 层级标题 */
.layer-title {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.layer-title::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

/* 组件容器 */
.arch-layer .layer-components {
    width: 100% !important;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-start;
}

/* 组件卡片 */
.arch-box {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.arch-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.arch-box:hover::before {
    left: 100%;
}

.arch-box:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
}

.arch-box i {
    font-size: 14px;
    color: #3b82f6;
    transition: all 0.2s ease;
}

.arch-box:hover i {
    color: white;
    transform: scale(1.1);
}

/* 技术栈信息区域 */
.tech-stack-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    margin-top: auto;
}

.tech-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    border: 1px solid rgba(226, 232, 240, 0.4);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tech-item::before {
    content: '⚡';
    font-size: 12px;
    color: #3b82f6;
}

.tech-item:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.tech-item strong {
    color: inherit;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .system-architecture {
        padding: 16px;
        /* 移除固定高度限制，允许内容自然展开 */
        max-height: none;
    }
    
    .arch-container {
        gap: 12px;
    }
    
    .arch-layer {
        padding: 12px;
        /* 移除固定最小高度，允许内容自然调整 */
        min-height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .layer-title {
        font-size: 14px;
        min-width: auto;
    }
    
    .layer-components {
        gap: 8px;
        width: 100%;
        /* 确保组件能够换行 */
        flex-wrap: wrap;
    }
    
    .arch-box {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .tech-stack-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .tech-item {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .system-architecture {
        padding: 12px;
        /* 移除固定高度限制，允许内容自然展开 */
        max-height: none;
    }
    
    .arch-layer {
        padding: 10px;
        /* 移除固定最小高度，允许内容自然调整 */
        min-height: auto;
    }
    
    .layer-components {
        gap: 6px;
        /* 在小屏幕上使用列布局，确保所有组件都能显示 */
        flex-direction: column;
    }
    
    .arch-box {
        justify-content: center;
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .arch-box i {
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.arch-layer {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.arch-layer:nth-child(1) { animation-delay: 0.1s; }
.arch-layer:nth-child(2) { animation-delay: 0.2s; }
.arch-layer:nth-child(3) { animation-delay: 0.3s; }
.arch-layer:nth-child(4) { animation-delay: 0.4s; }
.arch-layer:nth-child(5) { animation-delay: 0.5s; }

.tech-stack-info {
    animation: fadeInUp 0.6s ease-out 0.6s forwards;
    opacity: 0;
}