/* 苹果安全库存管理系统 - 预测算法页面样式 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 加载动画 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.apple-logo {
    font-size: 48px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-text {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 主应用容器 */
.app-container {
    min-height: 100vh;
    background: #f5f5f7;
}

/* 顶部导航栏 */
.top-navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-button, .dashboard-button, .refresh-button {
    background: none;
    border: none;
    color: #007aff;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-button:hover, .dashboard-button:hover, .refresh-button:hover {
    background: rgba(0, 122, 255, 0.1);
    transform: translateY(-1px);
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
}

/* 主要内容区域 */
.main-content {
    padding: 0 24px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 算法概览区域 */
.overview-section {
    margin-bottom: 24px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.overview-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.overview-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.overview-content {
    flex: 1;
}

.overview-value {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
}

.overview-label {
    font-size: 14px;
    color: #6e6e73;
    font-weight: 500;
    margin-top: 4px;
}

/* 算法控制区域 */
.control-section {
    margin-bottom: 24px;
}

.control-container {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.control-header {
    text-align: center;
    margin-bottom: 24px;
}

.control-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.control-description {
    font-size: 16px;
    color: #6e6e73;
}

.control-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.control-button.primary {
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

.control-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 122, 255, 0.4);
}

.algorithm-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 600px;
}

.control-button {
    background: white;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.control-button:hover {
    border-color: #007aff;
    color: #007aff;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.1);
}

.control-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 运行状态区域 */
.status-section {
    margin-bottom: 24px;
}

.status-container {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.status-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
}

.clear-log-button {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.clear-log-button:hover {
    background: #e9ecef;
    color: #007aff;
}

.status-log {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 14px;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.info {
    color: #17a2b8;
}

.log-entry.success {
    color: #28a745;
}

.log-entry.error {
    color: #dc3545;
}

.log-entry.warning {
    color: #ffc107;
}

.log-entry i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* 算法说明区域 */
.info-section {
    margin-bottom: 24px;
}

.info-container {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.info-header {
    text-align: center;
    margin-bottom: 24px;
}

.info-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
}

.algorithm-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-card {
    padding: 20px;
    border-radius: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.info-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card h4 i {
    color: #007aff;
}

.info-card p {
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.5;
}

/* 提示信息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #17a2b8;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .algorithm-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .top-navbar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .nav-left, .nav-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .main-content {
        padding: 0 16px 16px;
    }
    
    .control-container, .status-container, .info-container {
        padding: 16px;
    }
    
    .algorithm-buttons {
        grid-template-columns: 1fr;
    }
    
    .control-button.primary {
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overview-card, .control-container, .status-container, .info-container {
    animation: fadeInUp 0.6s ease forwards;
}

.overview-card:nth-child(2) { animation-delay: 0.1s; }
.overview-card:nth-child(3) { animation-delay: 0.2s; }
.overview-card:nth-child(4) { animation-delay: 0.3s; } 