/* PRRSV监测页面专用样式 */

/* 风险统计 */
.risk-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.risk-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--bg-card);
}

.risk-stat.critical {
    border-left: 3px solid #dc2626;
}

.risk-stat.high {
    border-left: 3px solid #ef4444;
}

.risk-stat.medium {
    border-left: 3px solid #f59e0b;
}

.risk-stat.low {
    border-left: 3px solid #3b82f6;
}

.risk-value {
    font-size: 28px;
    font-weight: 700;
}

.risk-stat.critical .risk-value {
    color: #dc2626;
}

.risk-stat.high .risk-value {
    color: #ef4444;
}

.risk-stat.medium .risk-value {
    color: #f59e0b;
}

.risk-stat.low .risk-value {
    color: #3b82f6;
}

.risk-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 预警指标 */
.warning-indicators {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.indicator-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.indicator-icon {
    font-size: 20px;
    width: 30px;
}

.indicator-name {
    width: 60px;
    font-size: 12px;
    color: var(--text-secondary);
}

.indicator-bar {
    flex: 1;
    display: flex;
    height: 20px;
    background: rgba(16, 185, 129, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: white;
}

.bar-segment.warning {
    background: #f59e0b;
}

.bar-segment.danger {
    background: #ef4444;
}

/* 症状列表 */
.symptom-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.symptom-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
}

.symptom-icon {
    font-size: 16px;
    margin-right: 10px;
}

.symptom-name {
    flex: 1;
    font-size: 13px;
}

.symptom-weight {
    font-size: 11px;
    color: var(--text-muted);
}

/* 多模态视图 */
.thermal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.thermal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}

.thermal-cell:hover {
    transform: scale(1.05);
}

.thermal-cell.normal {
    background: linear-gradient(135deg, #10b981, #059669);
}

.thermal-cell.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    animation: pulse 2s infinite;
}

.thermal-cell.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 1s infinite;
}

.thermal-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 6px;
}

.legend-item.normal::before {
    background: #10b981;
}

.legend-item.warning::before {
    background: #f59e0b;
}

.legend-item.danger::before {
    background: #ef4444;
}

/* 行为视图 */
.behavior-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
}

.behavior-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 30px;
    background: var(--bg-card);
    border-radius: 10px;
}

.behavior-card.warning {
    border: 1px solid #f59e0b;
}

.behavior-card.danger {
    border: 1px solid #ef4444;
}

.behavior-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.behavior-card.warning .behavior-value {
    color: #f59e0b;
}

.behavior-card.danger .behavior-value {
    color: #ef4444;
}

.behavior-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* 风险表格 */
.risk-table {
    overflow-x: auto;
}

.risk-table table {
    width: 100%;
    border-collapse: collapse;
}

.risk-table th,
.risk-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.risk-table th {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.risk-table tr.risk-critical {
    background: rgba(220, 38, 38, 0.1);
}

.risk-table tr.risk-high {
    background: rgba(239, 68, 68, 0.05);
}

.level-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.level-tag.critical {
    background: #dc2626;
    color: white;
}

.level-tag.high {
    background: #ef4444;
    color: white;
}

.level-tag.medium {
    background: #f59e0b;
    color: white;
}

/* 绿色防控方案 */
.formula-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.formula-card h3 {
    font-size: 14px;
    color: #10b981;
    margin-bottom: 12px;
}

.formula-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.formula-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.formula-item.probiotic {
    background: rgba(59, 130, 246, 0.1);
}

.herb-icon {
    font-size: 16px;
    margin-right: 8px;
}

.herb-name {
    flex: 1;
    font-size: 12px;
}

.herb-dosage {
    font-size: 11px;
    color: var(--text-muted);
}

.formula-usage {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 12px;
}

/* 四维协同 */
.dimension-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dimension-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 8px;
}

.dimension-icon {
    font-size: 24px;
    margin-right: 12px;
}

.dimension-content h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.dimension-content p {
    font-size: 11px;
    color: var(--text-muted);
}

.success-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border-radius: 8px;
}

.rate-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.rate-value {
    font-size: 28px;
    font-weight: 700;
    color: #10b981;
}

/* 快速操作 */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.action-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.action-text {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 返回链接 */
.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    margin-right: 16px;
}

.back-link:hover {
    color: var(--accent-primary);
}

/* 按钮样式扩展 */
.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

/* ========== 手机端响应式 ========== */
@media (max-width: 768px) {

    /* 热力图：4列 → 2列 */
    .thermal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 行为统计：允许换行 */
    .behavior-stats {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
    }

    .behavior-card {
        flex: 1 1 40%;
        min-width: 120px;
        padding: 14px 16px;
    }

    /* 风险统计：允许换行 */
    .risk-stats {
        flex-wrap: wrap;
        gap: 10px;
    }

    .risk-stat {
        flex: 1 1 40%;
        min-width: 80px;
    }

    /* 行为数值字号适配 */
    .behavior-value {
        font-size: 24px;
    }

    /* 图表 legend 换行 */
    .thermal-legend {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* 操作按钮 */
    .action-buttons {
        grid-template-columns: 1fr;
    }
}