body {
    display: flex;
    flex-direction: column;
    background-color: #ccc;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

/* 主容器样式，为底部操作栏预留空间 */
.main-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 10px;
    padding-bottom: 80px;
    width: 100%;
    box-sizing: border-box;
}

/* 区块样式 */
.Block {
    width: 600px;
    max-width: calc(100% - 20px); /* 确保在小屏幕上不会溢出 */
    height: 450px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s;
}

/* 区块悬停效果 */
.Block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* 图片容器样式 */
.Block_Img {
    width: 100%;
    height: 350px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* 消息容器 */
.Block_Message_Container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 30px; /* 确保有消息和无消息时高度一致 */
}

/* 设备消息样式 */
.device-message {
    position: absolute;
    bottom: 5px;
    left: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
    z-index: 10;
    max-height: 80px;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: nowrap;
}

/* 无消息时的占位样式 */
.device-message:empty {
    display: none;
}

/* 标题样式 */
.Block_Title {
    padding: 5px 0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    background-color: #f8f8f8;
    flex-shrink: 0;
}

/* 信息区域样式 */
.Block_Info {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* 状态和时间区域 */
.Block_Status_Time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* 状态指示器 */
.Status_Indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #555;
}

/* 状态图标 - 提示灯样式 */
.Status_Icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.5);
    position: relative;
    animation: pulse 2s infinite;
}

/* 离线状态图标样式 */
.Status_Icon_OffLine {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #999999;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* 提示灯脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(76, 175, 80, 1), inset 0 0 4px rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.5);
    }
}

/* 状态文本 */
.Status_Text {
    font-size: 14px;
    font-weight: 500;
}

/* 时间样式 */
.Block_Time {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 离线图片样式 */
.Block_Img_OffLine {
    filter: grayscale(100%);
    opacity: 0.7;
}

/* 按钮容器样式 */
.Block_Buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* 通用按钮样式 */
.Block_Btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

/* 下线按钮样式 */
.Offline_Btn {
    background-color: #f0f0f0;
    color: #333;
}

/* 查看消息按钮样式 */
.view-messages-btn {
    background-color: #28a745;
    color: white;
    transition: background-color 0.2s;
}

.view-messages-btn:hover {
    background-color: #218838;
}

.Offline_Btn:hover {
    background-color: #e0e0e0;
}

/* 查看历史截图按钮样式 */
.view-history-btn {
    background-color: #007bff;
    color: white;
    transition: background-color 0.2s;
}

.view-history-btn:hover {
    background-color: #0069d9;
}

/* 离线按钮样式 */
.Block_Btn_OffLine {
    background-color: #cccccc !important;
    color: #999999 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.Block_Btn_OffLine:hover {
    background-color: #cccccc !important;
    color: #999999 !important;
}