/* 敏感性分析样式 */

/* 配置区域 */
.sensitivity-config {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.config-header {
    margin-bottom: 1rem;
}

.config-header h5 {
    margin: 0;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-group label {
    font-weight: 500;
    color: #475569;
    font-size: 0.875rem;
}

.config-group select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
}

.custom-config {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.custom-config h6 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
}

.param-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

.config-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
    margin-top: 1rem;
}

/* 结果区域 */
.sensitivity-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 分析摘要 */
.analysis-summary h5 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-card.highlight {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.card-icon {
    font-size: 1.5rem;
    color: #6b7280;
    flex-shrink: 0;
}

.summary-card.highlight .card-icon {
    color: #d97706;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.card-detail {
    font-size: 0.75rem;
    color: #6b7280;
}

/* 图表区域 */
.sensitivity-charts {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-controls label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.chart-controls select {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* 数据表格 */
.sensitivity-table {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.table-header h5 {
    margin: 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

.sensitivity-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.sensitivity-table th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.sensitivity-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.sensitivity-table tr:hover {
    background: #f9fafb;
}

/* 数值样式 */
.positive {
    color: #059669;
}

.negative {
    color: #dc2626;
}

/* 影响程度徽章 */
.impact-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.impact-低 .impact-badge {
    background: #d1fae5;
    color: #065f46;
}

.impact-中 .impact-badge {
    background: #fef3c7;
    color: #92400e;
}

.impact-高 .impact-badge {
    background: #fee2e2;
    color: #991b1b;
}

/* 风险评估 */
.risk-assessment h5 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.risk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.risk-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.risk-card.risk-低 {
    border-left: 4px solid #10b981;
}

.risk-card.risk-中 {
    border-left: 4px solid #f59e0b;
}

.risk-card.risk-高 {
    border-left: 4px solid #ef4444;
}

.risk-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.risk-低 .risk-icon {
    color: #10b981;
}

.risk-中 .risk-icon {
    color: #f59e0b;
}

.risk-高 .risk-icon {
    color: #ef4444;
}

.risk-content {
    flex: 1;
    min-width: 0;
}

.risk-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.risk-level {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.risk-低 .risk-level {
    color: #10b981;
}

.risk-中 .risk-level {
    color: #f59e0b;
}

.risk-高 .risk-level {
    color: #ef4444;
}

.risk-description,
.risk-metric {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .param-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .chart-controls > * {
        width: 100%;
    }
    
    .summary-grid,
    .risk-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sensitivity-results > * {
    animation: fadeInUp 0.5s ease forwards;
}

.sensitivity-results > *:nth-child(2) {
    animation-delay: 0.1s;
}

.sensitivity-results > *:nth-child(3) {
    animation-delay: 0.2s;
}

.sensitivity-results > *:nth-child(4) {
    animation-delay: 0.3s;
}


/* 
 * 需要添加到 sensitivity-analysis.css 文件末尾的新样式
 * 支持管辖区敏感性分析功能
 */

/* ===== 分层摘要区域 ===== */
.summary-section {
    margin-bottom: 1.5rem;
}

.summary-section h6 {
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.global-summary {
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.jurisdiction-summary {
    padding: 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    border: 1px solid #dcfce7;
}

/* ===== 管辖区敏感性分析容器 ===== */
.jurisdiction-sensitivity-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e2e8f0;
}

.jurisdiction-analysis-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.jurisdiction-analysis-header h5 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.jurisdiction-analysis-header .section-description {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* ===== 管辖区列表样式 ===== */
.jurisdiction-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.jurisdiction-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jurisdiction-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jurisdiction-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

.test-count {
    color: #6b7280;
    font-size: 0.8rem;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* ===== 管辖区特定的摘要卡片样式 ===== */
.summary-card.jurisdiction {
    border-left: 3px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.summary-card.jurisdiction .card-icon {
    color: #059669;
}

.summary-card.jurisdiction.highlight {
    border-left-color: #059669;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.summary-card.jurisdiction.highlight .card-icon {
    color: #047857;
}

/* ===== 增强的图表下拉框样式 ===== */
.chart-controls select optgroup {
    font-weight: 600;
    color: #374151;
    font-style: normal;
}

.chart-controls select option {
    padding: 0.5rem;
    color: #6b7280;
}

/* ===== 自定义配置增强 ===== */
.jurisdiction-analysis-options {
    margin-top: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid #e2e8f0;
    background: #f9fafb;
    border-radius: 0 6px 6px 0;
    padding: 0.75rem 0 0.75rem 1rem;
}

.jurisdiction-analysis-options h6 {
    margin: 0 0 0.5rem 0;
    color: #059669;
    font-size: 0.875rem;
    font-weight: 600;
}

.jurisdiction-analysis-options .checkbox-item {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.jurisdiction-analysis-options .checkbox-item input[type="checkbox"] {
    accent-color: #10b981;
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
    .jurisdiction-list {
        grid-template-columns: 1fr;
    }
    
    .jurisdiction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
    }
    
    .test-count {
        align-self: flex-end;
    }
    
    .jurisdiction-analysis-header h5 {
        font-size: 1.1rem;
    }
    
    .jurisdiction-analysis-header .section-description {
        font-size: 0.85rem;
    }
    
    .summary-section h6 {
        font-size: 0.9rem;
    }
}

/* ===== 动画增强 ===== */
.jurisdiction-sensitivity-section {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jurisdiction-item {
    animation: slideInFromLeft 0.5s ease forwards;
    opacity: 0;
}

.jurisdiction-item:nth-child(1) { animation-delay: 0.1s; }
.jurisdiction-item:nth-child(2) { animation-delay: 0.2s; }
.jurisdiction-item:nth-child(3) { animation-delay: 0.3s; }
.jurisdiction-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== 打印样式 ===== */
@media print {
    .jurisdiction-sensitivity-section {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .jurisdiction-item {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .summary-section {
        page-break-inside: avoid;
    }
}