:root {
    --primary-color: #1A5F7A;
    --secondary-color: #159895;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333;
    --border-color: #e4e7ed;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.background-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

.sidebar {
    width: 250px;
    background-color: var(--card-background);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    padding: 20px;
    z-index: 10;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.logo svg {
    margin-bottom: 10px;
}

.logo h1 {
    font-size: 16px;
    color: #1A5F7A;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

.menu ul {
    list-style: none;
}

.menu li {
    margin-bottom: 10px;
    width: 100%; /* 确保列表项占满整个宽度 */
}

.menu a {
    display: block;
    color: #666;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
    width: 100%; /* 确保链接区域覆盖整个区域 */
    text-align: left; /* 保持文字左对齐 */
    cursor: pointer; /* 明确显示可点击 */
}

.menu li.active a, 
.menu a:hover {
    background-color: var(--primary-color);
    color: white;
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    background-color: var(--background-color);
    overflow: auto;
    position: relative;
}

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

.header h2 {
    color: var(--primary-color);
    font-size: 22px;
}

.btn-refresh {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-refresh:hover {
    background-color: var(--secondary-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-item {
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
}

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

.card-header h3 {
    color: var(--primary-color);
    font-size: 16px;
}

.trend {
    font-size: 12px;
    color: green;
}

.trend.up {
    color: #52c41a;
}

.trend.down {
    color: #f5222d;
}

.risk-score {
    font-size: 48px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

.chart {
    height: 250px;
    width: 100%;
}

.key-indicators table {
    width: 100%;
}

.indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.indicator.low {
    background-color: #e6f7ff;
    color: #1890ff;
}

.indicator.medium {
    background-color: #fffbe6;
    color: #faad14;
}

.indicator.high {
    background-color: #fff1f0;
    color: #f5222d;
}

.recent-warnings ul {
    list-style: none;
}

.recent-warnings li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.warning-type {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.warning-type.high {
    background-color: #fff1f0;
    color: #f5222d;
}

.warning-type.medium {
    background-color: #fffbe6;
    color: #faad14;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
