/* 全局设置 */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f9f9f9;
}

a:link, a:visited, a:hover, a:active {
    text-decoration: none;
}

/* 页眉 */
#HeaderContainer {
    display: flex;
    justify-content: space-between; /* 在容器内水平分布内容 */
    align-items: center;            /* 垂直居中 */
    padding: 10px 20px;
    background-color: #007BB8;      /* 背景颜色，可以根据需要调整 */
}

#LogoAndTitle {
    display: flex;
    align-items: center;            /* 使LOGO和标题在垂直方向居中对齐 */
}

#Logo {
    width: 40px;                    /* LOGO的宽度，根据需要调整 */
    height: auto;
}

#Head {
    font-size: 1.5em;
    color: #ffffff;
    margin: 0;
}

#NavBar a {
    margin-left: 20px;
    text-decoration: none;
    color: #ffffff;
    font-size: 1em;
}

#NavBar a:hover {
    text-decoration: underline;
}

/* 结果信息部分 */
#ResultInfo {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #B2D0EA;
    box-sizing: border-box;
    overflow: hidden;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* 响应式表格容器 */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

/* 设置表格宽度和最小宽度 */
.table-responsive table {
    width: 100%;
    min-width: 600px; /* 根据需要调整 */
}

/* 移动设备优化 */
@media screen and (max-width: 768px) {
    th, td {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    /* 在手机上强制表格占满屏幕宽度 */
    table {
        width: 100%;
    }

    /* 隐藏超出屏幕的部分，并允许水平滚动 */
    .table-responsive {
        overflow-x: scroll;
    }
}

/* 当表格内容较少时，让其铺满屏幕 */
.container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh; /* 让容器占满整个屏幕高度 */
}

.container .content-area {
    flex-grow: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.container .content-area table {
    width: 100%;
    min-height: 100px; /* 最小高度，确保小内容时铺满 */
}

/* 搜索表单容器，确保居中显示 */
#SearchFormContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* 搜索表单本身的布局 */
#TruckSearchForm, #SearchForm {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

/* 输入框的通用样式 */
#SearchForm input[type="text"] {
    flex: 1 1 auto;                /* 自适应宽度 */
    max-width: 45%;                /* 最大宽度为45%，使两个输入框并排显示 */
    min-width: 150px;              /* 最小宽度，避免过窄 */
    height: 30px;
    font-size: 16px;
    margin-right: 10px;
    border: 2px solid #007BB8;
    padding: 5px;
    box-sizing: border-box;
    text-align: center;            /* 输入框中的文本居中 */
}

/* 输入框聚焦效果 */
#SearchForm input[type="text"]:focus {
    border-color: #005f8a;         /* 聚焦时的边框颜色 */
    outline: none;                 /* 移除默认的聚焦样式 */
}

/* 提交按钮的样式 */
#SearchForm input[type="submit"] {
    height: 30px;
    font-size: 16px;
    background-color: #007BB8;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 10px;
    text-align: center;            /* 按钮文本居中 */
}

/* 提交按钮的悬停效果 */
#SearchForm input[type="submit"]:hover {
    background-color: #005f8a;     /* 悬停时的按钮颜色 */
}

/* 小屏幕时搜索表单的特殊处理 */
@media (max-width: 768px) {
    #SearchForm {
        flex-wrap: wrap;           /* 小屏幕时允许换行 */
        justify-content: center;   /* 在小屏幕上也保持居中 */
    }

    #SearchForm input[type="text"], #SearchForm input[type="submit"] {
        max-width: 100%;           /* 输入框和按钮宽度占满容器 */
        margin-right: 0;
        margin-bottom: 10px;       /* 添加底部间距 */
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #B2D0EA;
    text-align: center;
    padding: 10px;
}

th {
    background-color: #EDF7FF;
    font-weight: bold;
}

/* 页脚 */
footer {
    margin-top: 50px;
    padding: 20px 0;
    background-color: #f1f1f1;
    text-align: center;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #ddd;
}

/* 导航栏容器 */
#HeaderContainer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #007BB8; /* 修改背景颜色为蓝色 */
    padding: 10px;
}

/* 导航和菜单容器 */
#NavAndMenu {
    display: flex;
    align-items: center;
}

/* 菜单按钮样式 */
#MenuIcon {
    display: none; /* 默认在桌面端隐藏 */
    font-size: 15px;
    cursor: pointer;
    color: white;
    margin-left: 20px;
}

/* 导航菜单样式 */
#NavBar {
    display: flex; /* 默认在桌面端显示为横向菜单 */
    align-items: center;
    justify-content: flex-end;
    background-color: transparent; /* 这里保持导航菜单背景透明，以适应标题背景颜色 */
}

#NavBar a {
    margin-left: 20px;
    text-decoration: none;
    color: #ffffff;
    font-size: 1em;
}

#NavBar a:hover {
    text-decoration: underline;
}

/* 关闭按钮样式 */
#CloseIcon {
    display: none; /* 默认隐藏，只有在移动端展开菜单时才显示 */
    font-size: 36px;
    color: white;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 25px;
}

/* 在小屏幕下显示菜单按钮和关闭按钮 */
@media screen and (max-width: 768px) {
    #NavBar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        width: 0;
        overflow-x: hidden;
        transition: 0.5s;
        background-color: #007BB8; /* 保持移动端菜单背景颜色为蓝色 */
        z-index: 1000;
        flex-direction: column;
        padding-top: 60px;
        display: none; /* 默认隐藏，点击菜单按钮后显示 */
    }

    #NavBar.active {
        width: 150px; /* 展开时的宽度 */
        display: block; /* 移动端显示菜单 */
    }

    #MenuIcon {
        display: block; /* 移动端显示菜单按钮 */
    }

    #NavBar a {
        display: block;
        text-align: center;
        padding: 10px 20px;
        font-size: 18px;
    }

    .hidden {
        display: none;
    }
}

/* 桌面端保持菜单和标题在同一行 */
@media screen and (min-width: 769px) {
    #MenuIcon, #CloseIcon {
        display: none; /* 桌面端隐藏汉堡菜单和关闭按钮 */
    }
}
