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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e0 75%, #94a3b8 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
    overflow: auto;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 15px;
    color: #1e40af;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(30, 64, 175, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1e40af;
    text-shadow: none;
}

.subtitle {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 400;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 320px 1fr 280px;
    gap: 20px;
    align-items: start;
    flex: 1;
    margin-bottom: 20px;
}

/* 输入区域样式 */
.input-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.15);
    border: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    height: calc(100vh - 180px);
    overflow: hidden;
}

.input-section:hover {
    border-color: #3b82f6;
    box-shadow: 0 12px 40px rgba(30, 64, 175, 0.2);
}

.input-section h2 {
    color: #1e40af;
    margin: 0 0 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 3px solid #3b82f6;
    padding: 20px 20px 10px 20px;
    flex-shrink: 0;
    text-align: center;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
}

.input-section-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.input-section h3 {
    color: #1e40af;
    margin: 12px 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
    padding-left: 8px;
    border-left: 3px solid #3b82f6;
    line-height: 1.2;
}

.parameter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    align-items: start;
}

.parameter-grid.single-param {
    grid-template-columns: 1fr;
    max-width: 300px;
}

.parameter-group {
    display: flex;
    flex-direction: column;
    min-height: 50px;
    justify-content: flex-start;
}

.parameter-group label {
    font-weight: 500;
    margin-bottom: 4px;
    color: #4a5568;
    font-size: 0.8rem;
    min-height: 20px;
    display: flex;
    align-items: center;
    line-height: 1.2;
}

.parameter-group input {
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.parameter-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.parameter-group small {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
    font-style: italic;
    line-height: 1.2;
}

/* 滑块组样式 */
.slider-group {
    padding: 4px 0;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.slider-group label {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.8rem;
    min-height: 20px;
    line-height: 1.2;
}

.slider-group span {
    display: inline-block;
    margin-top: 4px;
    font-weight: 600;
    color: #1e40af;
    font-size: 0.8rem;
    min-width: 35px;
    text-align: center;
}

.parameter-group input[type="range"] {
    background: transparent;
    border: none;
    padding: 0;
    height: 8px;
    border-radius: 4px;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    margin: 4px 0;
}

.parameter-group input[type="range"]::-webkit-slider-track {
    background: #cbd5e0;
    height: 8px;
    border-radius: 4px;
    border: 1px solid #a0aec0;
}

.parameter-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #ffffff;
    margin-top: -6px;
}

.parameter-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.parameter-group input[type="range"]::-moz-range-track {
    background: #cbd5e0;
    height: 8px;
    border-radius: 4px;
    border: 1px solid #a0aec0;
}

.parameter-group input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.parameter-group input[type="range"]::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* 结果区域样式 */
.results-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.15);
    border: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    height: calc(100vh - 180px);
    overflow: hidden;
}

.results-section:hover {
    border-color: #3b82f6;
    box-shadow: 0 12px 40px rgba(30, 64, 175, 0.2);
}

.results-section h2 {
    color: #1e40af;
    margin: 0 0 0 0;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 3px solid #3b82f6;
    padding: 20px 20px 10px 20px;
    flex-shrink: 0;
    text-align: center;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
}

.results-section-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.result-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.08);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(30, 64, 175, 0.2);
    border-color: #3b82f6;
}

.result-card h3 {
    color: #1e40af;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 6px;
    background: linear-gradient(90deg, #eff6ff, #dbeafe);
    margin: -12px -12px 8px -12px;
    padding: 8px 12px 6px 12px;
    border-radius: 12px 12px 0 0;
    line-height: 1.2;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    font-size: 0.8rem;
    padding: 1px 0;
    line-height: 1.2;
}

.metric .label {
    font-weight: 500;
    color: #475569;
    font-size: 0.8rem;
    flex: 1;
    text-align: left;
    padding-right: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric .value {
    font-weight: 700;
    color: #1e40af;
    font-size: 0.85rem;
    text-align: right;
    min-width: 50px;
    white-space: nowrap;
}

.metric.total {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    padding: 8px;
    border-radius: 6px;
    margin: 8px -6px 0 -6px;
    border-top: 2px solid #3b82f6;
}

.metric.total .label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e40af;
}

.metric.total .value {
    color: #1e40af;
    font-size: 0.9rem;
    font-weight: 800;
    min-width: 60px;
}

/* 状态样式 */
.value.urgent {
    color: #e53e3e !important;
    font-weight: 700;
}


.value.unreachable {
    color: #dc2626 !important;
    font-weight: 700;
    background: #fef2f2;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #fecaca;
}

/* 不可达警告样式 */
.unreachable-warning {
    display: flex;
    align-items: flex-start;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #f87171;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.2);
    animation: warningPulse 2s ease-in-out infinite;
}

.warning-icon {
    font-size: 2rem;
    margin-right: 16px;
    flex-shrink: 0;
    animation: bounce 1s ease-in-out infinite;
}

.warning-content {
    flex: 1;
}

.warning-content h3 {
    color: #dc2626;
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.warning-content p {
    color: #7f1d1d;
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.warning-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border-left: 3px solid #f87171;
}

.detail-label {
    font-weight: 500;
    color: #991b1b;
    font-size: 0.85rem;
}

.detail-value {
    font-weight: 600;
    color: #dc2626;
    font-size: 0.85rem;
    text-align: right;
    max-width: 60%;
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(248, 113, 113, 0.2);
    }
    50% {
        box-shadow: 0 6px 20px rgba(248, 113, 113, 0.4);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* 图表容器 */
.chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 16px 60px 16px;
    margin-bottom: 16px;
    height: 420px;
    max-height: 420px;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.08);
    transition: all 0.3s ease;
    overflow: visible;
}

.chart-container:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.15);
}

.chart-container h3 {
    color: #1e40af;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

/* 模型参数配置样式 */
.model-parameters {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.scenario-selector {
    margin-bottom: 10px;
}

.scenario-selector label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #4a5568;
    font-size: 0.8rem;
    line-height: 1.2;
}

.scenario-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.scenario-btn {
    flex: 1;
    padding: 6px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.05);
    line-height: 1.2;
}

.scenario-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.15);
}

.scenario-btn.active {
    border-color: #1e40af;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.parameter-info {
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    border: 2px solid #0ea5e9;
    font-size: 0.75rem;
    line-height: 1.3;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.parameter-info p {
    margin: 0 0 2px 0;
    color: #0c4a6e;
}

.parameter-info p:last-child {
    margin-bottom: 0;
}

.parameter-info span {
    font-weight: 600;
    color: #0369a1;
}

/* 建议区域样式 */
.recommendations-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.15);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    height: calc(100vh - 180px);
    overflow: hidden;
}

.recommendations-section:hover {
    border-color: #3b82f6;
    box-shadow: 0 12px 40px rgba(30, 64, 175, 0.2);
}

.recommendations-section h2 {
    color: #1e40af;
    margin: 0 0 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 3px solid #3b82f6;
    padding: 20px 20px 8px 20px;
    flex-shrink: 0;
    text-align: center;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
}

.recommendations-section-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 20px 20px;
}

.recommendation {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.3;
}

.recommendation .icon {
    margin-right: 8px;
    font-size: 1rem;
}

.recommendation.warning {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 2px solid #f87171;
    border-left: 4px solid #dc2626;
    color: #7f1d1d;
    border-radius: 8px;
}

.recommendation.suggestion {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #fbbf24;
    border-left: 4px solid #d97706;
    color: #92400e;
    border-radius: 8px;
}

.recommendation.info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #60a5fa;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
    border-radius: 8px;
}

.recommendation.success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #4ade80;
    border-left: 4px solid #16a34a;
    color: #166534;
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 320px 1fr 280px;
        gap: 12px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .chart-container {
        height: 340px;
        max-height: 340px;
        flex-shrink: 0;
        padding: 12px 12px 50px 12px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .input-section,
    .results-section {
        padding: 15px;
    }
    
    .parameter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .chart-container {
        height: 280px;
        max-height: 280px;
        padding: 10px 10px 45px 10px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    body {
        overflow-y: auto;
    }
    
    .container {
        height: auto;
        min-height: 100vh;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .input-section,
    .results-section {
        padding: 12px;
        border-radius: 12px;
    }
    
    .result-card {
        padding: 12px;
    }
    
    .metric {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .chart-container {
        height: 240px;
        max-height: 240px;
        padding: 8px 8px 40px 8px;
        flex-shrink: 0;
    }
}

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

.input-section,
.results-section {
    animation: fadeInUp 0.6s ease-out;
}

.result-card {
    animation: fadeInUp 0.6s ease-out;
}

.result-card:nth-child(2) {
    animation-delay: 0.1s;
}

.result-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
}
