.ticket-management {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* 📌 修正：移除這裡重複的 th 定義，統一到 .ticket-table thead th 內 */
/* --- 頁籤 (Tabs) 樣式 --- */

.tabs {
    position: relative;
}

/* 隱藏 Radio Input */
.tabs input[type="radio"] {
    display: none;
}

.radio input, .checkbox input {
     position: absolute; 
     left: unset; 
}

.tab-labels {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

/* 這是未選中狀態的樣式 (預設值) */
.tab-label {
    padding: 10px 10px;
    cursor: pointer;
    font-weight: bold;
    color: #888; /* 未選中時是灰色 */
    background-color: transparent; 
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.3s ease;
}

/* 確保只有當 radio 被選中時，對應的 label 才會應用選中樣式 */
#confirmed-tab:checked ~ .tab-labels .tab-label:nth-child(1),
#pending-tab:checked ~ .tab-labels .tab-label:nth-child(2),
#cancelled-tab:checked ~ .tab-labels .tab-label:nth-child(3) {
    /* 選中狀態樣式 (藍色) */
    color: #3498db;
    border-color: #ddd;
    border-bottom: 3px solid #3498db;
    background-color: #fff;
    margin-bottom: -2px; /* 覆蓋底部的灰色線 */
}

/* 內容區塊的顯示/隱藏 */
.tab-content-container {
    padding-top: 10px;
}

.tabb-content {
    display: none;
}

/* 根據選中的 Radio 顯示對應的內容 */
#confirmed-tab:checked ~ .tab-content-container #confirmed,
#pending-tab:checked ~ .tab-content-container #pending,
#cancelled-tab:checked ~ .tab-content-container #cancelled {
    display: block;
}


/* --- 表格 (Table) 樣式 --- */

.ticket-table {
    width: 99%;
    border-collapse: collapse;
    font-size: 15px;
    table-layout: fixed; /* 建議使用 fixed 模式，讓寬度設定更精準 */
    border-radius: 4px; /* 增加圓角讓外觀更好看 */
    margin: 0 auto;
    overflow: hidden; /* 確保邊框和圓角能夠正確包含內容 */
}

.ticket-table thead th {
    /* 📌 修正：統一設定表頭的樣式 */
    text-align: center;
    background-color: #bee1ed; 
    color: #555;
    font-weight: normal;
}

/* 📌 修正：這裡的 th 應該被上面的 thead th 覆蓋或合併 */
.ticket-table th, .ticket-table td {
    padding: 10px 10px; /* 調整 padding，原程式碼有重複定義 */
    border: 1px solid #eee;    
    /* 📌 新增：單元格右邊框，作為垂直分隔線 */
    overflow: hidden;
    word-wrap: break-word; /* 防止長文字在 fixed 佈局下溢出 */
}

/* 自訂欄位寬度 - 確保總寬度為 100% 或略小於 100% */
/*七欄: 10+20+15+15+10+15+15 = 100% */
.ticket-table .col-id { width: 10%;}
.ticket-table .col-name { width: 23%;}
.ticket-table .col-date { width: 12%;}
.ticket-table .col-location { width: 15%;}
.ticket-table .col-price { width: 10%;}
.ticket-table .col-state { width: 15%;}
.ticket-table .col-options { width: 15%;}
/*八欄: 10+15+15+10+10+15+10+15 = 100% */
.ticket-table .col-id_a { width: 10%;}
.ticket-table .col-name_a { width: 15%;}
.ticket-table .col-date_a { width: 15%;}
.ticket-table .col-location_a { width: 10%;}
.ticket-table .col-price_a { width: 10%;}
.ticket-table .col-state_a { width: 15%;}
.ticket-table .col-timeleft_a{ width: 10%;}
.ticket-table .col-options_a { width: 15%;}

/* 📌 新增：設定雙數行的背景顏色為淺灰色 */
.ticket-table tbody tr:nth-child(even) {
    background-color: #f9f7f7; /* 淺灰色背景 */
}

/* 確保鼠標懸停效果依然適用於奇數行和雙數行 */
.ticket-table tbody tr:hover {
    background-color: #f9f7f7; /* 懸停時使用更明顯的淺灰色 */
}

/* 狀態標籤樣式 */
.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 5px;
    font-size: 14px;
    width: 100%;
    text-align: center;
}

/* 圖片中狀態的顏色定義 (此處未變更) */
.confirmed-status {
    color: #e67e22; 
    border: 1px solid #e67e22;
    background-color: #fef0e7;
}

.pending-status {
    color: #2ecc71; 
    border: 1px solid #2ecc71;
    background-color: #e9f8ed;
}

.processing-status {
    color: #e74c3c; 
    border: 1px solid #e74c3c;
    background-color: #fdecec;
}

.expired-status {
    color: #95a5a6; 
    border: 1px solid #95a5a6;
    background-color: #f0f3f3;
}

.cancelled-status {
    color: #95a5a6; 
    border: 1px solid #95a5a6;
    background-color: #f0f3f3;
}

/* 剩餘時間區塊 (在未完成頁籤中) */
.time-block {
    padding: 2px 0;
    line-height: 1.4;
    font-size: 14px;
}

/* 按鈕樣式 (此處未變更) */
.btnn {
    padding: 8px 12px;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    width: 100%; 
    box-sizing: border-box;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    color: #ff0;
}

.actions {
    display: flex;
    flex-direction: column; 
    gap: 5px; 
}

.img_full{
    position: absolute;
    top: 0;
    left: 0;
}


/* --- 響應式設計 (RWD) for 小螢幕 --- */
@media (max-width: 768px) {
    .ticket-management {
        padding: 15px;
        margin-top: 50px;
    }

    /* 📌 RWD 修正：讓表格在 RWD 模式下也能看到邊框 */
    .ticket-table {
        /* 在 RWD 模式下，給表格增加一些內邊距，將內部 tr 推開，讓外部邊框可見 */
        padding: 5px; 
    }
    
    .ticket-table thead {
        display: none; /* 在小螢幕隱藏表頭 */
    }

    .ticket-table, .ticket-table tbody, .ticket-table tr, .ticket-table td {
        display: block;
        width: 100%;
    }
    
    .ticket-table tr {
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        display: flex;
        flex-direction: column;
    }

    .ticket-table td {
        text-align: left;
        padding-left: 35%;
        position: relative;
        border-bottom: 1px solid #eee;
        border-right: none; /* RWD 模式下不需要垂直邊線 */
    }

    .ticket-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #555;
    }

    .ticket-table td:last-child {
        border-bottom: 0;
    }
    
    .actions {
        flex-direction: row; /* 在 RWD 讓按鈕水平排列 */
        justify-content: space-evenly;
        padding-top: 10px;
    }
    
    .btnn {
        width: 100%;
        flex-grow: 1;
    }
    /*七欄: 10+20+15+15+10+15+15 = 100% */
	.ticket-table .col-id { width: 100%;background-color: #bee1ed;}
	.ticket-table .col-name { width: 100%;}
	.ticket-table .col-date { width: 100%;}
	.ticket-table .col-location { width: 100%;}
	.ticket-table .col-price { width: 100%;}
	.ticket-table .col-state { width: 100%;}
	.ticket-table .col-options { width: 100%;}
	/*八欄: 10+15+15+10+10+15+10+15 = 100% */
	.ticket-table .col-id_a { width: 100%;background-color: #bee1ed;}
	.ticket-table .col-name_a { width: 100%;}
	.ticket-table .col-date_a { width: 100%;}
	.ticket-table .col-location_a { width: 100%;}
	.ticket-table .col-price_a { width: 100%;}
	.ticket-table .col-state_a { width: 100%;}
	.ticket-table .col-timeleft_a{ width: 100%;}
	.ticket-table .col-options_a { width: 100%;}
}

/* --- 跳窗 (Modal/Dialog) 樣式 --- */

.modal {
    border: none;
    border-radius: 8px;
    padding: 0;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: none;
}

.modal[open] {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

.modal::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    padding: 20px;
}

.modal-content h2 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
/* 其他 .warning-text, .input-group, .modal-actions 樣式也要確保存在 */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
.modal-actions .btn {
    width: auto;
    flex-grow: 0;
}

/* 確保分頁容器居中 */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0; /* 調整上下間距 */
}

/* 按鈕基礎樣式 */
.pagination-controls button,
.pagination-controls .page-link {
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    width: 40px; /* 固定的寬度 */
    height: 40px; /* 固定的高度 */
    border-radius: 8px; /* 圓角 */
    margin: 0 5px; /* 按鈕間距 */
    display: flex; /* 確保內容居中 */
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

/* 箭頭按鈕樣式 */
.pagination-controls button {
    padding: 0;
    line-height: 1; /* 調整行高讓箭頭居中 */
}
        
/* 預設按鈕懸停效果 */
.pagination-controls button:not([disabled]):hover,
.pagination-controls .page-link:not(.active):hover {
    border-color: #f88c5f;
    color: #f88c5f;
}

/* 頁碼連結容器 */
.pagination-controls .page-numbers {
    display: flex;
}

/* 當前活動頁碼樣式 (橘色背景) */
.pagination-controls .page-link.active {
    background-color: #f88c5f; /* 橘色背景 */
    color: #fff;
    border-color: #f88c5f;
}

/* 禁用按鈕樣式 */
.pagination-controls button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/*  */
.policy-header p, .policy-list li, .panel-body, .panel-body li{
    font-size: large;
}

.modal-content {
    max-width: 750px;
    max-height: 85vh;
    overflow: hidden;
    padding: 20px;
}
.modal-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}
h3, h4 { margin-top: 20px; }
ul { margin-left: 20px; }