body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    /* background-color: #f0f2f5; */
    

    max-width: 100%;
    overflow-x: auto; /* 關鍵屬性：允許水平滾動 */
    white-space: nowrap; /* 防止內容換行 */
    -webkit-overflow-scrolling: touch; /* 平滑滾動，支援行動裝置 */
}
.container {
    /* border: 1px solid red; */
    
    width: fit-content;
    min-width: 1000px; 
    /* 1495?2000?最小寬度，讓container可以與表格一起滾動 */
    /* 以下是關鍵屬性 */
    display: inline-block; /* 使容器寬度適應內容 */
    max-width: none; /* 移除最大寬度限制 */
    /* padding-right: 20px; */

    /* max-width: auto; */
    margin-right: 20px;
    margin-left: 15%;
    margin-top: 70px; /* 新增：預留header高度 */
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: calc(100vh - 100px); /* 新增：設定最小高度，扣除header高度和邊距 */
}



.header {
    position: fixed; /* 新增：固定header在頂部 */
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    z-index: 100; /* 確保header在最上層 */
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}
.user-info {
    display: flex;
    align-items: center;
    margin-right: 50px;
    gap: 20px;
}
.user-role {
    background-color: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #1976d2;
}
.search-box {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
    font-size: 14px;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    /* padding: 12px 0px 12px 10px;  調整表格留白處 */
    /* 調整表格留白處 */
    padding: 12px 10px 12px 10px;  
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    line-height: 1.6; 
}
.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}
.table tr:hover {
    background-color: #f8f9fa;
}

.urgent {
    color: #dc3545;
    font-weight: bold;
}
.normal {
    color: #28a745;
}
.vendor-name {
    font-weight: 500;
}
.vendor-contact {
    font-size: 13px;
    color: #666;
}
.button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.button-primary {
    background-color: #1976d2;
    color: white;
    margin-right: 3px;
}
.button-danger {
    background-color: #dc3545;
    margin-right: 3px;
    color: white;
}
.button-secondary {
    background-color: #6c757d;
    color: white;
}
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}
.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
.action-buttons {
    display: none;
    white-space: normal;
}
[data-role="admin"] .action-buttons {
    display: block;
}

.buttonsBlock {
    display: flex;
    width: 150px;
    justify-content: space-between;
    
}

.quantity-list, .spec-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quantity-list div, .spec-list div {
    padding: 4px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.quantity-list div {
    text-align: center;
}

.pagination {
    /* border: red solid 2px; */
    font-size: 12px;
    /* text-align: center; */
    text-align: left;
    padding: 10px 0px;
  }

  .pageBtn {
    border: none;
    font-size: 12px;
    margin:0px 5px;
    background-color: #f5f5f5;
  }

  .pageBtn:hover{
    cursor: pointer;
    background-color: #98b4d1;
  }


/* 側邊欄樣式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 70px; /* 修改：預留header高度 */
    width: 15%;
    height: calc(100vh - 70px); /* 修改：扣除header高度 */
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);


}



.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    padding: 0;
}

.sidebar-nav .submenu {
    padding-left: 20px;
    list-style: none;
}

.sidebar-nav .submenu li {
    margin: 0px 0;
}

.sidebar-nav .submenu a {
    font-size: 0.9em;
}


.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-nav a:hover {
    background-color: #34495e;
}

.sidebar-nav i {
    margin-right: 10px;
}

/* 主要內容區域樣式 */
.main-content {
    margin-left: 250px;
    padding: 20px;
}



/* 新增頁面 */
.addPage {
    /* border: 1px solid red; */
    padding: 30px 30px 30px 30px;
    height: 100%;
    width: 100%;
    display: block;
}

.addPageColumn {
    /* border: 1px solid red; */
    margin-bottom: 10px;
    padding: 20px;
    width: 500px;
    background-color: #f1ecec;
    border-radius: 10px;
}



.spec-row {
    margin-bottom: 10px;
}

.spec-row span {
    margin-right: 10px;
}

.remove-spec {
    margin-left: 10px;
    padding: 5px 10px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.add-spec-btn {
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}


 .order-list-header {
        width: calc(100% - 5px);

        display: flex;
        justify-content: flex;
        padding: 5px 0px 5px 5px;
        
        margin-top: 5px;
        top: 0;
        /* background-color: whitesmoke; */
        
        /* position: sticky; */

        
    }

  .order-list-header select {
        appearance: none;
        
        padding: 6px 20px 6px 6px;
        border: none;
        /* border-right: 1px solid #eee; */
        background: #f8f8f8;
        box-shadow: 0 1px 5px rgba(0,0,0,0.1);
        border-radius: 5px;
        font-size: 14px;
        color: #333;
        cursor: pointer;
    }

    .select-wrapper {
        position: relative;
        display: inline-block;
        background: #f8f8f8;
        border-right: 1px solid #eee;
        /* border-radius: 30px 0 0 30px; */
    }
        
    .caret-icon {
      position: absolute;
      right: 5px;
      top: 45%;
      transform: translateY(-50%);
      pointer-events: none; /* 不影響選單操作 */
      color: #888; /* 可選擇顏色 */
    }





 .button-reply:hover {
        background-color: #5b71d6;
    }

 .button-reply-batch {
        background-color: #43484d;
        color: white;
        display: block;
        width: 95px;
        height: 100%;
        padding: 5px 5px;
        margin-right: 5px;
    }   

 .icon {
    margin-right: 0.5rem;       /* 加一點右邊間距 */
    vertical-align: middle;     /* 與文字垂直置中對齊 */
    font-size: 1rem;            /* 預設大小 */
    color: inherit;              /* 跟隨文字顏色 */
    }

 .icon-lg {
    margin-right: 0.5rem;
    font-size: 1.5rem;
    vertical-align: middle;
    }

/* 微調圖標位置，使其更好地與文字對齊 */
    nav ul li a .icon {
        vertical-align: -0.125em;   
    }

/* 響應式設計 */
/* @media (max-width: 768px) {
    .header {
        width: 100%;
    }
    .sidebar {
        width: 100%;
        top: 60px;
        height: auto;
        position: relative;
    }
    .container {
        margin-left: 0;
        margin-top: 60px;
    }
} */



.sidebar-nav a.active {
    background-color: #3498db; /* 藍色背景表示活躍狀態 */
    color: white;
    font-weight: bold;
    border-left: 4px solid #2980b9; /* 左側邊框強調 */
}

.sidebar-nav a.active:hover {
    background-color: #2980b9; /* 滑鼠懸停時的深藍色 */
}

/* 為子選單的活躍狀態添加樣式 */
.sidebar-nav .submenu a.active {
    background-color: #34495e; /* 子選單的活躍狀態用深灰色 */
    border-left: 3px solid #3498db;
}

.sidebar-nav .submenu a.active:hover {
    background-color: #2c3e50;
}

/* =========以下為規格文字縮減，懸浮視窗========== */

/* 規格描述樣式優化 */
.spec-description {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
    display: inline-block;
    vertical-align: middle;
}

/* .spec-description:hover {
    white-space: normal;
    word-break: break-word;
    max-width: 300px;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    position: relative;
    border: 1px solid #ddd;
} */

/* 規格欄位寬度限制 */
.table th:nth-child(9), 
.table td:nth-child(9) {
    max-width: 200px;
    min-width: 150px;
}

/* 響應式調整 */
@media (max-width: 1400px) {
    .table th:nth-child(9), 
    .table td:nth-child(9) {
        max-width: 150px;
        min-width: 120px;
    }
    
    .spec-description {
        max-width: 150px;
    }
}

@media (max-width: 1200px) {
    .table th:nth-child(9), 
    .table td:nth-child(9) {
        max-width: 120px;
        min-width: 100px;
    }
    
    .spec-description {
        max-width: 120px;
    }
}