/* 物流路径智能规划师页面样式 */

.main-content {
    padding: 80px 20px 40px;
    min-height: 100vh;
    background: #f8fafc;
}

/* 控制面板 */
.control-panel {
    max-width: 1400px;
    margin: 0 auto 30px;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.panel-header h2 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
}

.panel-header i {
    color: #4f46e5;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 25px;
    color: #10b981;
    font-weight: 500;
}

.ai-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

/* 导航栏扩展 */
.nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #4f46e5;
}

.breadcrumb-separator {
    color: #94a3b8;
}

.breadcrumb-current {
    color: #1e293b;
    font-weight: 500;
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.btn-action {
    padding: 10px 20px;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.btn-action.small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* 功能标签 */
.function-tabs {
    display: flex;
    gap: 5px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 12px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #64748b;
}

.tab-btn.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.6);
    color: #1e293b;
}

/* 内容区域 */
.content-area {
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 路径规划布局 */
.planning-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* 地图区域 */
.map-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.map-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
}

.map-controls {
    display: flex;
    gap: 10px;
}

.map-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #475569;
}

.map-btn:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.map-container {
    height: 600px;
    position: relative;
}

/* 地图模拟器 */
.map-simulator {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    overflow: hidden;
}

.map-legend {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #475569;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-color.start {
    background: #f59e0b;
}

.legend-color.destination {
    background: #10b981;
}

.legend-color.route {
    background: #4f46e5;
}

.legend-color.vehicle {
    background: #ef4444;
}

.route-svg {
    width: 100%;
    height: 100%;
}

.center-point {
    fill: #f59e0b;
    stroke: white;
    stroke-width: 3;
}

.destination-point {
    fill: #10b981;
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.destination-point:hover {
    r: 10;
    fill: #059669;
}

.vehicle-point {
    fill: #ef4444;
    stroke: white;
    stroke-width: 2;
}

.route-path {
    stroke-dasharray: 0;
    animation: routeAnimation 3s ease-in-out infinite alternate;
}

@keyframes routeAnimation {
    0% { stroke-dasharray: 0; }
    100% { stroke-dasharray: 10, 5; }
}

.point-label {
    fill: #1e293b;
    font-size: 12px;
    font-weight: 500;
}

.point-label.small {
    font-size: 10px;
}

/* 实时信息 */
.real-time-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 300px;
}

.info-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.info-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1e293b;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-icon.completed {
    background: #10b981;
    color: white;
}

.status-icon.current {
    background: #f59e0b;
    color: white;
}

.status-icon.pending {
    background: #94a3b8;
    color: white;
}

.status-time {
    margin-left: auto;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* 订单区域 */
.orders-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
}

.orders-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px 30px;
}

.order-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s ease;
}

.order-item:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.order-item.priority-high {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.order-item.priority-medium {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.order-item.priority-low {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-id {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.priority-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

.priority-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.priority-badge.low {
    background: #d1fae5;
    color: #059669;
}

.order-details {
    margin-bottom: 15px;
}

.order-details p {
    margin-bottom: 8px;
    color: #475569;
    font-size: 0.9rem;
}

.order-actions {
    display: flex;
    gap: 10px;
}

.btn-assign {
    padding: 8px 16px;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-assign:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

/* 车辆调度布局 */
.dispatch-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.vehicle-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.vehicle-card.available {
    border-left-color: #10b981;
}

.vehicle-card.busy {
    border-left-color: #f59e0b;
}

.vehicle-card.maintenance {
    border-left-color: #ef4444;
}

.vehicle-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.vehicle-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.vehicle-card.available .vehicle-icon {
    background: #10b981;
}

.vehicle-card.busy .vehicle-icon {
    background: #f59e0b;
}

.vehicle-card.maintenance .vehicle-icon {
    background: #ef4444;
}

.vehicle-info h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.vehicle-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.vehicle-status.available {
    background: #d1fae5;
    color: #059669;
}

.vehicle-status.busy {
    background: #fef3c7;
    color: #d97706;
}

.vehicle-status.maintenance {
    background: #fee2e2;
    color: #dc2626;
}

.vehicle-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.detail-row span:first-child {
    color: #64748b;
}

.detail-row span:last-child {
    color: #1e293b;
    font-weight: 500;
}

.fuel-bar {
    width: 60px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.fuel-level {
    height: 100%;
    background: linear-gradient(45deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.vehicle-actions {
    display: flex;
    gap: 10px;
}

.btn-dispatch, .btn-track {
    padding: 10px 20px;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-dispatch:hover, .btn-track:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-disabled {
    padding: 10px 20px;
    background: #94a3b8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: not-allowed;
    flex: 1;
}

.dispatch-stats {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.dispatch-stats h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.dispatch-stats canvas {
    flex: 1;
    min-height: 0;
    height: 300px !important;
    max-height: 300px;
}

/* 时效预测布局 */
.prediction-layout {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.prediction-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.prediction-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.prediction-card:hover {
    background: #f1f5f9;
    transform: translateY(-3px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.card-content h4 {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 8px;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}

.metric-change.positive {
    color: #10b981;
}

.metric-change.negative {
    color: #ef4444;
}

/* 预测表格 */
.prediction-table-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.prediction-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.prediction-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.prediction-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

.prediction-table tr:hover {
    background: #f8fafc;
}

.traffic-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.traffic-status.good {
    background: #d1fae5;
    color: #059669;
}

.traffic-status.medium {
    background: #fef3c7;
    color: #d97706;
}

.traffic-status.bad {
    background: #fee2e2;
    color: #dc2626;
}

.risk-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.risk-badge.low {
    background: #d1fae5;
    color: #059669;
}

.risk-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.risk-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* 数据分析布局 */
.analytics-layout {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
}

.chart-section canvas {
    flex: 1;
    min-height: 0;
    height: 280px !important;
    max-height: 280px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .planning-layout,
    .dispatch-layout {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 80px 10px 20px;
    }
    
    .control-panel {
        padding: 20px;
    }
    
    .function-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .vehicles-grid {
        grid-template-columns: 1fr;
    }
    
    .prediction-cards {
        grid-template-columns: 1fr;
    }
    
    .nav-breadcrumb {
        display: none;
    }
    
    .map-container {
        height: 400px;
    }
    
    .real-time-info {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        margin-top: 20px;
    }
    
    /* 移动端图表优化 */
    .dispatch-stats {
        height: 350px;
    }
    
    .dispatch-stats canvas {
        height: 250px !important;
        max-height: 250px;
    }
    
    .chart-section {
        height: 300px;
    }
    
    .chart-section canvas {
        height: 220px !important;
        max-height: 220px;
    }
}

@media (max-width: 480px) {
    /* 小屏幕图表进一步优化 */
    .dispatch-stats {
        height: 300px;
        padding: 20px;
    }
    
    .dispatch-stats canvas {
        height: 200px !important;
        max-height: 200px;
    }
    
    .chart-section {
        height: 250px;
        padding: 20px;
    }
    
    .chart-section canvas {
        height: 180px !important;
        max-height: 180px;
    }
} 