/* 全局样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 20px;
    /* 为查询栏留出空间 */
}



/* 打印时隐藏带有 noprint 类的元素 */
@media print {
    .noprint {
        display: none !important; /* 使用 !important 提高优先级 */
    }
}

/* 查询栏置顶悬浮并居中 */
#search-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #f8f9fa;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
}

#search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    max-width: 1200px;
    /* 限制最大宽度 */
    width: 100%;
    padding: 0 20px;
    /* 左右内边距 */
}

#search-box input,
#search-box select {
    max-width: 100%;
}

/* 手机适配：查询栏内容换行，购物车图标移到右下角 */
@media (max-width: 640px) {
    #search-box {
        padding: 6px 0;
    }
    #search-container {
        padding: 0 10px;
        gap: 6px;
    }
    #cart-icon {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
}

#search-box input,
#search-box select,
#search-box button {
    padding: 5px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#search-box button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

#search-box button:hover {
    background-color: #0056b3;
}

/* 购物车图标悬浮于右上角 */
#cart-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#cart-icon span {
    font-size: 20px;
}

#cart-count {
    margin-left: 5px;
    font-size: 14px;
}

/* 查询结果显示区域 */
#results {
    margin-top: 20px;
    padding: 20px;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
}

#results-table th,
#results-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}

#results-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

#results-table tr:hover {
    background-color: #f1f1f1;
}

#results-table button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

#results-table button:hover {
    background-color: #218838;
}

/* 购物车详情 */
#cart-details {
    position: fixed;
    top: 10%;
    right: 10%;
    width: 80%;
    height: 50%;
    background-color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1000;
    overflow-y: auto;
    display: none;
}

#cart-items {
    max-height: 300px;
    overflow-y: auto;
}

#cart-details button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#cart-details button:hover {
    background-color: #0056b3;
}

#cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

#cart-table th,
#cart-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
}

#cart-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

#cart-table tr:hover {
    background-color: #f1f1f1;
}