/* 在线/离线热力图区域 */
.status-heatmap-section {
    background: var(--white-color);
    padding: 20px 24px 28px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 10px 0 30px;
}

.status-heatmap-section h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
}

.heatmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.heatmap-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #555;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-box {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.legend-box.online {
    background: #28a745;
}

.legend-box.offline {
    background: #6c757d;
}

.status-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10px, 12px));
    gap: 4px;
    align-content: start;
    max-height: 140px;
    overflow: hidden;
    /* 保持紧凑 */
    padding: 4px;
}

.status-heatmap .cell {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #e0e0e0;
    position: relative;
    transition: background .2s ease, transform .15s ease;
    cursor: pointer;
}

.status-heatmap .cell.online {
    background: #2ecc5e;
}

.status-heatmap .cell.offline {
    background: #b5bcc3;
}

.status-heatmap .cell.unknown {
    background: #d1d5db;
}

.status-heatmap .cell:hover {
    transform: scale(1.5);
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.status-heatmap .cell:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.status-heatmap-summary {
    margin-top: 14px;
    font-size: 13px;
    color: #555;
}

.status-heatmap-summary strong {
    color: var(--dark-color);
}

/* @media (max-width: 600px) {
    .status-heatmap { max-height: 120px; }
} */

/* 用户详情页 7天*24小时热力图 (7列 x 24行 或按行排列) */
.user-heatmap-section {
    background: var(--white-color);
    padding: 20px 24px 28px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 20px 0 35px;
}

.user-heatmap {
    /* 横向：每天一行 24 小时 */
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.user-heatmap .hour-header {
    /* 顶部小时刻度 */
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #666;
    margin-left: 64px;
    /* 与 day-label 对齐 */
    user-select: none;
}

.user-heatmap .hour-header span {
    width: 18px;
    text-align: center;
}

.user-heatmap .day-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-heatmap .day-label {
    width: 54px;
    font-size: 12px;
    color: #555;
    text-align: right;
    flex-shrink: 0;
}

.user-heatmap .hours-line {
    display: flex;
    gap: 4px;
}

.user-heatmap .cell {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #d1d5db;
    cursor: pointer;
    transition: background .2s, transform .12s;
}

.user-heatmap .cell.online {
    background: #2ecc5e;
}

.user-heatmap .cell.offline {
    background: #b5bcc3;
}

.user-heatmap .cell.current {
    outline: 2px solid var(--primary-color);
}

.user-heatmap .cell:hover {
    transform: scale(1.3);
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.user-heatmap-summary {
    margin-top: 14px;
    font-size: 13px;
    color: #555;
}

.user-heatmap-summary strong {
    color: var(--dark-color);
}

@media (max-width: 700px) {
    .user-heatmap .cell {
        width: 16px;
        height: 16px;
    }

    .user-heatmap .hour-header span {
        width: 16px;
    }
}