/* ===================== 历史数据面板 ===================== */
.history-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none;
    overflow: hidden;
    max-height: 90vh;
}

.history-panel.show {
    display: block;
}

/* 历史面板头部 */
.history-header {
    padding: 12px 20px;
    background: #1890ff;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-title {
    font-size: 16px;
    font-weight: 600;
}

.history-close {
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.history-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 历史面板主体 */
.history-body {
    padding: 20px;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

/* 历史面板表单 - 核心修改：四个元素同一行 */
.history-form {
  width: 100%;
  margin-bottom: 16px; /* 调整和下方按钮的间距 */
  display: flex;
  flex-wrap: wrap; /* 小屏幕自动换行，避免拥挤 */
  gap: 16px; /* 四个表单元素之间的间距，视觉统一 */
  align-items: flex-end; /* 底部对齐，避免label高度不一致导致错位 */
}

/* 表单组 - 核心修改：分配宽度，实现同一行排列 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1; /* 让四个表单元素自动均分一行宽度 */
    min-width: 140px; /* 小屏幕兜底，不会挤变形，达到最小宽度后换行 */
}

/* 统一输入框/下拉框样式，消除不一致 */
.form-group input, .form-group select {
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    height: 34px; /* 统一高度 */
    box-sizing: border-box; /* 避免padding撑大输入框 */
    width: 100%; /* 强制占满父容器，确保宽度一致 */
}

.form-group input:focus, .form-group select:focus {
    border-color: #1890ff;
}
/* 按钮父容器 */
.btn-container {
  width: 100%; /* 占满整行，确保按钮靠右对齐的基准 */
  margin-bottom: 20px; /* 保留原有按钮的底部间距 */
  display: flex;
  justify-content: flex-end; /* 水平靠右对齐（核心） */
  align-items: center; /* 垂直居中（可选，优化视觉） */
}
/* 查询按钮样式 */
.history-btn {
    padding: 10px 20px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

/* 兼容：清除浮动，避免下方图表受影响 */
.history-result {
    clear: both;
}

.history-btn:hover {
    background: #096dd9;
}

.history-btn:disabled {
    background: #8cc5ff;
    cursor: not-allowed;
}

/* 历史数据结果区 */
.history-result {
    width: 100%;
    height: 300px;
    position: relative; /* 适配无数据提示居中 */
}

/* 历史面板遮罩 */
.history-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.history-mask.show {
    display: block;
}