* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* 定義本地端的 Emoji 字型 */
@font-face {
    font-family: 'Noto Color Emoji';
    src: url('../fonts/NotoColorEmoji.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    /* 確保載入時文字不會消失 */
}

body {
    font-family: "微軟正黑體", "新細明體", 'Noto Color Emoji', Arial, Helvetica, sans-serif;
    font-size: 14px;
    margin: 0;
    /* 移除 body 的 margin，讓 flexbox 容器填滿整個畫面 */
    background-color: #C5D6D7;

    /* --- Flexbox 垂直水平置中設定 --- */
    display: flex;
    flex-direction: column;
    /* 讓子元素垂直排列 */
    justify-content: flex-start;
    /* 從頂部開始對齊 */
    align-items: center;
    /* 子元素在交叉軸上(水平)置中 */
    min-height: 100vh;
    /* body 的高度「最少」為視窗高度 */

    /* 如果您希望內容在垂直方向也留白，可以加入 padding */
    padding-top: 20px;
    padding-bottom: 20px;
}

div {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* --- Form General Input & Textarea Styles --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
textarea {
    /* 尺寸與盒模型 */
    width: 100%;
    /* 讓輸入框填滿容器，更易於排版 */
    padding: 8px 8px;
    /* 提供足夠的內部空間 */
    box-sizing: border-box;
    /* 確保 padding 不會影響總寬度 */

    /* 外觀 */
    border: 1px solid #ccc;
    /* 柔和的邊框顏色 */
    border-radius: 6px;
    /* 圓角 */
    background-color: #fff;
    /* 確保背景為白色 */
    font-size: 14px;
    /* 適中的字體大小 */

    /* 過渡效果 */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* --- Input & Textarea Focus State --- */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus {
    border-color: #007bff;
    /* 使用主題色或醒目的顏色 */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    /* 模擬外光暈效果 */
    outline: none;
    /* 移除瀏覽器預設的藍色或黑色外框 */
}

input[type="date"] {
    height: 34px;
    padding: 2px 8px;
}

/* --- Button Styles --- */
button,
input[type="submit"],
input[type="button"] {
    /* 外觀 */
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: #007bff;
    /* 主要操作按鈕的顏色 */
    color: #fff;
    /* 文字顏色 */
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    /* 滑鼠指標變為手形 */

    /* 過渡效果 */
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background-color: #0056b3;
    /* 滑鼠懸停時加深顏色 */
}

button:active,
input[type="submit"]:active,
input[type="button"]:active {
    transform: translateY(1px);
    /* 點擊時輕微下沉 */
}

.button_disa {
    /* 外觀 */
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: #7e7e7e !important;
    /* 主要操作按鈕的顏色 */
    color: #fff;
    /* 文字顏色 */
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    cursor: not-allowed;
    /* 滑鼠指標變為禁止圖示 */

    /* 過渡效果 */
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    /* 點擊失效 */
    pointer-events: none;
    /* 讓元素忽略滑鼠事件 */
}

/* --- Select (Dropdown) Styles --- */
select {
    /* 尺寸與外觀，使其與 input 相似 */
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;

    /* 讓下拉箭頭顯示出來 */
    -webkit-appearance: none;
    /* 移除 Chrome/Safari 的預設樣式 */
    -moz-appearance: none;
    /* 移除 Firefox 的預設樣式 */
    appearance: none;
    /* 標準語法 */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
}

select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

.outDiv {
    /* margin: 0 auto;  此行已由 body 的 flexbox 設定取代 */
    width: 96%;
    max-width: 1500px;
    min-width: 860px;
    min-height: 300px;
    background-color: #FFFFFF;
    padding: 50px 20px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
    behavior: url(/pie/PIE.htc);
    /* IE6, IE7, IE8 */
}

.tb01 {
    margin: 10px 0;
    border: 1px solid #929292;
    width: 100%;
}

.tb01 th,
.tb01 td {
    padding: 5px;
    border: 1px solid #929292;
    text-align: left;
}

.tb01 th {
    font-size: 14px;
    background-color: #82B0D1;
}

/* --- 表格外框容器 --- */
.table-container {
    /* 容器的內距，創造外框與表格之間的空間 */
    border: 2px solid #5D8AA8;
    /* 外框的樣式、寬度和顏色 */
    border-radius: 8px;
    /* 外框的圓角，可以比表格的圓角稍大一些 */
    background-color: #F0F8FF;
    /* 外框內的背景色，可選 */
    margin: 2px auto;
    /* 維持與其他元素的間距 */
    display: table;
    /* 改為 table 讓 margin: auto 生效 */
}

.table-container1 {
    /* 容器的內距，創造外框與表格之間的空間 */
    border: 2px solid #5D8AA8;
    /* 外框的樣式、寬度和顏色 */
    border-radius: 8px;
    /* 外框的圓角，可以比表格的圓角稍大一些 */
    background-color: #F0F8FF;
    /* 外框內的背景色，可選 */
    margin: 0px;
    /* 維持與其他元素的間距 */
    display: table;
    /* 改為 table 讓 margin: auto 生效 */
    width: 100%;
}

.tb02 {
    margin: 10px 0;
    border: 1px solid #929292;
    width: 100%;
    /* 加入表格圓角 */
    border-radius: 8px;
    overflow: hidden;
    /* 確保圓角效果 */
}

.tb02 th,
.tb02 td {
    padding: 6px 2px;
    border: 1px solid #929292;
    text-align: left;
}

.tb02 th {
    font-size: 14px;
    background-color: #b6cbda;
}

/* --- .tb02 表格交錯顏色 --- */
.tb02 tbody tr:nth-child(even) {
    /* 選取奇數行的 tr，並套用背景色 */
    background-color: #D1DBF1;
    /* 這是您 .oddColor 使用的顏色 */
}

/* 確保高亮不受交錯顏色影響 */
.tb02 tr.read-record {
    background-color: #FFFACD !important;
    /* 使用 !important 確保此樣式優先 */
}

.tableEmp {
    border: 0px;
    margin: 0 auto;
}

.tableEmp td {
    border: 0px;
}

.oddColor {
    background-color: #F6FAFC;
}

.evenColor {
    background-color: #D1DBF1;
}

.tbCenter {
    margin: 0 auto;
}

.tCenter {
    text-align: center !important;
}

.tRight {
    text-align: right !important;
}

.tAlignBtm {
    vertical-align: bottom !important;
}

.disInlineB {
    margin: 0 auto;
    display: block;
    text-align: center;
}

.viewIcon {
    cursor: pointer;
}

/* 分頁 按鍵 begin */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 20px 0;
    font-family: Arial, sans-serif;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border: 1px solid #ddd;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 14px;
}

.pagination a:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.pagination .current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    cursor: default;
}

.pagination .disabled {
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
}

.pagination .page-jump {
    margin-left: 15px;
    color: #555;
}

.pagination .page-jump input {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 7px;
}

.pagination .page-jump button {
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.pagination .page-jump button:hover {
    background-color: #0056b3;
}

/* 分頁 按鍵 end */

/* 字型 begin */
.rsF01 {
    font-size: 15px;
    color: #0a3496;
}

.rsF02 {
    font-size: 15px;
    color: #ff0000;
}

.fileFont {
    font-size: 12px;
    color: #4e4e4e;
}

.rFont {
    color: #ff0000;
}

/* 字型 end */

.error {
    border: 2px solid #ff0000 !important;
}

/* 新增通用按鈕 padding */
.btn-small-padding {
    padding: 2px 6px !important;
    /* 使用 !important 來確保覆蓋預設樣式 */
}

/* 新增高亮表格行的樣式 */
.tr-highlight {
    background-color: #feeaba;
}

/* 條碼begin */
.label-container {
    display: inline-block;
    width: 7.5cm;
    height: 7cm;
    margin: 5px;
    border: 1px solid #ccc;
    padding: 0px;
    font-size: 12px;
}

.label-container1 {
    display: inline-block;
    width: 7.4cm;
    height: 6.5cm;
    margin-left: 0.1cm;
    page-break-after: always;
    /* 在每個標籤後強制分頁 */
    margin-bottom: 2mm;
    /* 在每個標籤下方增加 2mm 的間距 */
}

@media print {
    body.qrcodeBody1 {
        margin: 0;
        /* 列印時移除 body 的預設邊距，讓標籤更貼近頁面頂部 */
    }
}

.label-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border: 1px solid #000;
}

.label-table td {
    padding: 1px;
    vertical-align: top;
    border: 1px solid #000;
}

.qr-cell {
    text-align: center;
    vertical-align: middle;
}

.qr-cell img {
    max-width: 1.8cm;
    display: block;
    margin: 6px auto;
}

.delivery-details {
    /* line-height: 1.5;
    font-size: 11px; */
    line-height: 21px;
    font-size: 12px;
}

.delivery-details1 {
    line-height: 1.5;
    font-size: 12px;
}

.underline-box {
    width: 1.2cm;
    border-bottom: 1px solid #000;
    display: inline-block;
    margin: 0 2px;
}

.qrcodeBody {
    display: flex;
    align-items: flex-start;
    text-align: left !important;
    padding-left: 20px;
}

.qrcodeBody1 {
    display: flex;
    align-items: flex-start;
    margin: 0px;
    padding: 0;
    text-align: left !important;
}

/* 條碼end */

/* --- 列印用：強制換頁 --- */
.page-break-after {
    page-break-after: always;
}

/* 公告區 begin */
#maskdiv {
    display: none;
    /* 預設隱藏 */
    position: fixed;
    /* 固定位置，覆蓋整個頁面 */
    z-index: 1000;
    /* 確保在最上層 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* 半透明黑色背景 */
}

#announcement-content {
    background-color: #fffcd1;
    margin: 5% auto;
    /* 距離頂部10%並水平置中 */
    padding: 20px;
    border: 1px solid #888;
    width: 95%;
    max-width: 1024px;
    /* 最大寬度 */
    border-radius: 5px;
    position: relative;
    max-height: 80vh;
    /* 最大高度為視窗高度的 80% */
    overflow-y: auto;
    /* 當內容超出時，顯示垂直捲軸 */
}

/* 公告區關閉按鈕 "X" */
.close-announcement {
    position: absolute;
    /* 相對於 #announcement-content 定位 */
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.close-announcement:hover,
.close-announcement:focus {
    color: #000;
}

/* 公告區 end */

/* --- 公告區清單樣式重設 --- */
#announcement-content ol {
    list-style-type: decimal;
    /* 讓第一層清單顯示數字 (1, 2, 3) */
    padding-left: 2em;
    /* 增加內縮，讓編號有空間顯示 */
}

#announcement-content ol li {
    margin-bottom: 0.75em;
    /* 增加每個清單項目的下間距，提升可讀性 */
}

/* 第二層之後的巢狀清單 */
#announcement-content ol ol {
    list-style-type: lower-alpha;
    /* 讓第二層清單顯示小寫英文字母 (a, b, c) */
    margin-top: 0.5em;
    /* 與父項目之間增加上間距 */
}

.dpn {
    display: none;
}

.upBtn {
    /* 外觀 */
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: #007bff;
    /* 主要操作按鈕的顏色 */
    color: #fff;
    /* 文字顏色 */
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    /* 滑鼠指標變為手形 */

    /* 過渡效果 */
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.upBtn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background-color: #0056b3;
    /* 滑鼠懸停時加深顏色 */
}

.upBtn:active,
input[type="submit"]:active,
input[type="button"]:active {
    transform: translateY(1px);
    /* 點擊時輕微下沉 */
}

.fileIcon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
    cursor: pointer;
}

.wsno {
    white-space: nowrap;
}

.closeAnnouncement {
    cursor: pointer;
    float: right;
    font-weight: bold;
    margin-left: 2px;
}

.msgDiv {
    display: flex;
    flex-direction: row;
    /* 當 display: flex 時，應使用 justify-content 來水平置中子元素 */
    justify-content: center;
    /* 1. 設定一個可以循環的漸層背景，並將其尺寸擴大 */
    background: linear-gradient(-45deg, #ffff00, #faf3cf);
    background-size: 400% 400%;
    /* 2. 應用動畫效果 */
    animation: gradient-animation 15s ease infinite;
    padding: 6px;
    -webkit-border-radius: 5px;
    /* 修正：單位不應重複 */
    -moz-border-radius: 5px;
    border-radius: 5px;
}

/* 3. 定義漸層背景移動的動畫關鍵影格 */
@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* A4 列印 */
.a4-page {
    width: 210mm;
    /* A4 width */
    min-height: 297mm;
    /* A4 height */
    padding: 1mm;
    /* 頁邊距 */
    /* margin: 0 auto; */
    /* 頁面居中 */
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    /* 從頂部開始對齊 */
    gap: 1mm;
    /* 標籤之間的間距 */
    box-sizing: border-box;
}

@media print {
    @page {
        margin: 0;
        size: auto;
    }

    body {
        margin: 0;
    }

    .a4-page {
        page-break-after: always;
    }

    /* 每頁結束時強制分頁 */

    .a4-page:last-child {
        page-break-after: auto;
    }
}

.selectHilight {
    background-color: #fff6a3 !important;
}

.maskDiv01 {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

/* 發票彈出視窗 */
.inv01 {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 600px;
    border-radius: 5px;
}

.inv02 {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.gfmoney {
    padding: 3px;
    color: #888888;
}

.invHistory {
    width: 100%;
    min-height: 100px;
    max-height: 250px;
    overflow: auto;
    border: 1px solid #ccc;
}

.rdonly {
    background-color: #d6d0d0 !important;
    cursor: not-allowed;
}

.myUltitle {
    font-size: 10px;
}

.myUl {
    list-style: none;
    counter-reset: item;
    padding-left: -10px;
    font-size: 11px;
}

.myUl li {
    counter-increment: item;
    margin-left: 1.6em;
    position: relative;
    font-size: 11px;
}

.myUl li::before {
    content: "(" counter(item) ") ";
    position: absolute;
    left: -15px;
}

.tgPass {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
}