:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #9C27B0;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #eeeeee;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* 基础样式 */
body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color), #2E7D32);
    color: var(--white);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.header p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* 时间选项卡 */
.time-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.time-tab {
    padding: 8px 20px;
    margin: 5px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--text-light);
    border: 1px solid transparent;
}

.time-tab:hover {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
}

.time-tab.active {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 500;
}

/* 卡片布局 */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* 图表容器 */
.chart-container {
    height: 300px;
    width: 100%;
    min-height: 300px;
}

/* KPI指标 */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.kpi-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.kpi-item:hover {
    transform: translateY(-3px);
}

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

.kpi-label {
    color: var(--text-light);
    font-size: 14px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 600;
    margin: 5px 0;
}

.kpi-change {
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kpi-change .num {
    font-weight: 600;
}

.kpi-change.up .num {
    color: var(--danger-color);
}

.kpi-change.down .num {
    color: var(--primary-color);
}

.kpi-details {
    margin-top: 10px;
    font-size: 13px;
}

.kpi-detail-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    padding: 3px 0;
    border-bottom: 1px dashed var(--border-color);
}

/* 边框颜色 */
.primary-kpi {
    border-left: 4px solid var(--primary-color);
}

.warning-kpi {
    border-left: 4px solid var(--warning-color);
}

.danger-kpi {
    border-left: 4px solid var(--danger-color);
}

.info-kpi {
    border-left: 4px solid var(--info-color);
}

/* 高亮样式 */
.highlight-today {
    color: var(--secondary-color);
    font-size: 28px;
    text-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

.highlight-month {
    color: var(--primary-color);
    font-size: 28px;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.highlight-quarter {
    color: var(--warning-color);
    font-size: 28px;
    text-shadow: 0 0 5px rgba(255, 152, 0, 0.3);
}

.highlight-year {
    color: var(--info-color);
    font-size: 28px;
    text-shadow: 0 0 5px rgba(156, 39, 176, 0.3);
}

/* 详细数据区域 */
.detail-data {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.area-section {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    background-color: var(--white);
}

.area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.area-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--primary-color);
}

.area-total {
    font-weight: 600;
    color: var(--danger-color);
}

.village-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(245, 245, 245, 0.5);
    border-radius: var(--radius-sm);
    transition: background-color 0.3s ease;
}

.village-item:hover {
    background-color: var(--light-gray);
}

.village-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.village-name {
    font-weight: 600;
}

.village-total {
    color: var(--danger-color);
    font-weight: 600;
}

.warning-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.warning-type {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background-color: var(--white);
    border-radius: var(--radius-sm);
    align-items: center;
    transition: all 0.3s ease;
}

.warning-type:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.type-name.provincial {
    color: var(--danger-color);
    font-weight: 600;
}

.type-count {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.today-count {
    color: var(--danger-color);
    font-weight: 600;
    background-color: #FFEBEE;
    padding: 2px 5px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-container {
        grid-template-columns: 1fr;
    }
    
    .time-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-tab {
        margin: 3px 0;
        text-align: center;
    }
    
    .warning-types {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* 省级分析切换按钮 */
.analysis-switch {
    background: var(--danger-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.analysis-switch:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 新增状态样式 */
.sjyj_status-非镇域内预警 {
    background-color: #9C27B0;
    color: white;
}

.sjyj_kpi-非镇域内预警 {
    border-left-color: #9C27B0;
}

/* 提示工具样式 */
.sjyj_tooltip {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sjyj_tooltip:before {
    content: "ℹ️";
    font-size: 14px;
}

/* TOP5村社卡片样式 */
/* TOP5图表容器 */
#topVillagesChart {
    width: 100%;
    height: 300px;
    background-color: #fff;
    border-radius: 4px;
}

/* 加载状态 */
#topVillagesChart.chart-loading {
    opacity: 0.6;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" stroke="%234CAF50" stroke-width="8" fill="none" stroke-dasharray="62.8 62.8"><animateTransform attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1s" repeatCount="indefinite"/></circle></svg>') no-repeat center;
    background-size: 50px;
}

