/* 基礎重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 100px; /* 增加空間確保不被header覆蓋 */
}

/* 固定頂部Header */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    pointer-events: auto; /* 確保header本身可以點擊 */
}

.fixed-header .header-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 45px;
}

.fixed-header .system-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

.fixed-header .header-status {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    align-items: center;
}

/* 移除 online-users 和 sync-status 樣式 */

/* 整合篩選區 */
.integrated-filter-bar {
    background: white;
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #eee;
    min-height: 56px;
    flex-wrap: nowrap !important; /* 強制水平排列，不換行 */
    overflow-x: auto; /* 如果內容太寬，允許水平滾動 */
    white-space: nowrap; /* 防止文字換行 */
    pointer-events: auto; /* 確保可以點擊 */
    position: relative; /* 確保層級正確 */
}

.filter-buttons {
    display: inline-flex; /* 改為 inline-flex 確保水平排列 */
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0; /* 防止被壓縮 */
    pointer-events: auto; /* 確保可以點擊 */
}

.search-section {
    display: inline-flex; /* 改為 inline-flex 確保水平排列 */
    gap: 0.3rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    min-width: 0; /* 允許收縮 */
}

.action-section {
    display: inline-flex; /* 改為 inline-flex 確保水平排列 */
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0; /* 防止被壓縮 */
}

.search-input {
    padding: 0.3rem 0.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.8rem;
    width: 180px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-clear-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: background-color 0.2s ease;
}

.search-clear-btn:hover {
    background: #ff5252;
}


/* 移除refresh-btn樣式 - 功能已移除 */

/* 商品處理中狀態 */
.processing-by-other {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff3cd;
    color: #856404;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    font-size: 0.85rem;
    font-weight: 500;
}

.processing-by-other .lock-icon {
    font-size: 1rem;
}

.processing-by-other-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 193, 7, 0.9);
    color: #856404;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 10;
}

.processing-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

.processing-status .processing-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 商品鎖定狀態 */
.item-locked {
    opacity: 0.7;
    background: #f8f9fa !important;
    border: 2px dashed #dee2e6 !important;
    position: relative;
}

.item-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(108, 117, 125, 0.1) 10px,
        rgba(108, 117, 125, 0.1) 20px
    );
    pointer-events: none;
    border-radius: inherit;
}

/* 同步狀態動畫 */
/* 移除 sync-status transition 樣式 */

/* 響應式設計 */
@media (max-width: 768px) {
    body {
        padding-top: 120px; /* 在小螢幕上給更多空間 */
    }

    .fixed-header .header-content {
        padding: 0.4rem 1rem;
    }

    .fixed-header .system-title {
        font-size: 1.1rem;
    }

    .integrated-filter-bar {
        flex-wrap: nowrap !important; /* 保持水平排列 */
        padding: 0.3rem 0.5rem; /* 減少padding給更多空間 */
        overflow-x: auto; /* 允許水平滾動 */
    }

    .filter-buttons {
        flex-wrap: nowrap !important; /* 保持水平排列 */
        flex-shrink: 0; /* 防止被壓縮 */
        overflow-x: visible; /* 不需要額外滾動 */
    }

    .search-input {
        width: 90px; /* 減小寬度 */
        font-size: 0.7rem; /* 減小字體 */
    }

    .processing-by-other-indicator {
        position: static;
        margin-top: 0.5rem;
        align-self: flex-start;
    }
}

/* 容器 */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: calc(100vh - 80px);
    background: #fff;
    overflow-x: hidden;
    position: relative;
    /* 移除 z-index，避免阻擋點擊事件 */
}

/* 簡化標題 */
.simple-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.simple-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

/* 篩選器 */
.filter-bar {
    display: flex;
    background: white;
    padding: 1rem;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e9ecef;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 1;
    min-width: 0;
}

.filter-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 16px;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
    pointer-events: auto; /* 確保按鈕可以被點擊 */
    position: relative; /* 確保層級正確 */
    z-index: 10; /* 提高層級 */
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 詳情頁面篩選器 */
.detail-filter-bar {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-filter-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ced4da;
    background: white;
    border-radius: 15px;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.detail-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn:hover {
    background: #f8f9fa;
}

.filter-btn.active:hover {
    background: #5a6fd8;
}

/* 訂單列表 */
.orders-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 1; /* 確保在其他元素之上 */
}

.order-list-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    padding-bottom: 2.5rem; /* 為重複標示預留空間 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid #667eea;
    margin-bottom: 0.5rem;
    position: relative;
    min-height: 80px;
    z-index: 2; /* 確保可以被點擊 */
}

.order-list-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.order-list-item.processing {
    border-left-color: #ffa726;
}

.order-list-item.completed {
    border-left-color: #66bb6a;
}

.order-list-item.partial {
    border-left-color: #ef5350;
}

.order-list-item.order-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
    pointer-events: none; /* 確實禁用點擊事件 */
}

.processing-by-other {
    font-size: 0.8rem;
    color: #ff6b35;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* 重複訂單狀態標示容器 */
.duplicate-indicators {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    flex-direction: row;
    gap: 4px;
    z-index: 1;
    max-width: calc(100% - 12px);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* 重複訂單狀態標示基礎樣式 */
.duplicate-status {
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
    border-width: 1px;
    border-style: solid;
}

/* 已完成狀態 */
.duplicate-status.duplicate-completed {
    color: #2e7d32;
    background: #e8f5e8;
    border-color: #81c784;
}

/* 處理中狀態 */
.duplicate-status.duplicate-processing {
    color: #ef6c00;
    background: #fff3e0;
    border-color: #ffb74d;
}

/* 待處理狀態 */
.duplicate-status.duplicate-pending {
    color: #d32f2f;
    background: #ffebee;
    border-color: #ef5350;
}

/* 檢貨用狀態 */
.duplicate-status.duplicate-picking {
    color: #1565c0;
    background: #e3f2fd;
    border-color: #42a5f5;
}

/* 隱藏全部篩選按鈕 */
#filter-all {
    display: none !important;
}

/* 批次清除按鈕 */
.batch-clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.2);
}

.batch-clear-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.batch-clear-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.2);
}

.order-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative;
    padding-right: 40px; /* 為完成按鈕預留空間 */
}

/* 完成訂單按鈕 */
.complete-order-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #ef5350;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.complete-order-btn:hover {
    background: #e53935;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.complete-order-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.order-list-customer {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.order-list-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.order-list-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-list-summary {
    font-size: 0.9rem;
    color: #6c757d;
}

.order-list-summary .status-icons {
    margin-left: 0.5rem;
    font-weight: 600;
}

.order-list-summary .status-icons .picked {
    color: #28a745;
}

.order-list-summary .status-icons .shortage {
    color: #ffc107;
}

.order-list-summary .status-icons .not-found {
    color: #dc3545;
}

/* 訂單詳細統計區域 */
.order-detail-stats {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid #e9ecef;
}

.order-detail-stats .stats-summary {
    display: flex;
    flex-wrap: nowrap !important; /* 強制水平排列，不換行 */
    gap: 0.5rem;
    align-items: center;
    overflow-x: auto; /* 如果內容太寬，允許水平滾動 */
    white-space: nowrap;
}

.order-detail-stats .stat-item {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    background: white;
    border: 1px solid #dee2e6;
    flex-shrink: 0; /* 防止項目被壓縮 */
    min-width: fit-content;
}

.order-detail-stats .stat-item.picked {
    color: #28a745;
    border-color: #c3e6cb;
    background: #d4edda;
}

.order-detail-stats .stat-item.shortage {
    color: #856404;
    border-color: #ffeeba;
    background: #fff3cd;
}

.order-detail-stats .stat-item.not-found {
    color: #721c24;
    border-color: #f5c6cb;
    background: #f8d7da;
}

.order-detail-stats .stat-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.order-detail-stats .stat-item.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 訂單詳細 */
.order-detail {
    padding: 0;
    background: #f8f9fa;
    min-height: 100vh;
}

.order-content {
    padding: 0.5rem;
    margin-top: 0;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: #5a6268;
}

.detail-title {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}


/* 訂單卡片 */
.order-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.order-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.order-card.processing {
    border-left-color: #ffa726;
}

.order-card.completed {
    border-left-color: #66bb6a;
}

.order-card.partial {
    border-left-color: #ef5350;
}

.order-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.customer-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.order-id {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

/* 備註區塊獨立顯示 */
.order-memo-formatted {
    background: #fff3cd;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #856404;
}

/* 整合客戶資訊和訂單標題 */
.order-header-simple {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.order-header-simple .customer-info-integrated {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #495057;
}

.order-header-simple .customer-phone-display, 
.order-header-simple .customer-email-display {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.order-time-status {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

/* 手機版商品卡片 - 重新設計 */
.item-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    margin: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* FR 商品樣式已移除，使用與一般商品相同的白底灰邊設計 */

.item-card.item-processed {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.item-card.item-picked {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #17a2b8;
    border-width: 3px;
}

.item-card.item-shortage {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    border-width: 3px;
}

.item-card.item-not-found {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
    border-width: 3px;
}

/* 狀態顯示樣式 */
.item-status-info {
    background: rgba(0,0,0,0.1);
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

/* 1. 倉位優先顯示 */
.item-location-priority {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 0rem;
    border-radius: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
    border: 3px solid #0056b3;
}

/* 2. 備註優先顯示 */
.item-remark-priority {
    background: ghostwhite;
    color: #212529;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    border-left: 4px solid #6c757d;
    }

/* 3. 商品名稱與數量 */
.item-name-quantity {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    
}

.item-name-display {
    font-size: 1.4rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-icon-btn {
    background: white;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-icon-btn:hover {
    background: #f8f9fa;
    border-color: #999;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.search-icon-btn:active {
    transform: scale(0.95);
}

.item-style-display {
    background: #fff3e0;
    color: #f57c00;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border: 2px solid #ffb74d;
    text-align: center;
}

.item-quantity-display {
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    border: 3px solid #2196f3;
    width: 200px;
    margin: 0 auto;
}

/* 4. 金額資訊 - 最小化顯示 */
.item-price-section {
    background: #f1f8e9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #2e7d32;
    font-weight: 500;
    text-align: right;
    border: 1px solid #c8e6c9;
    align-self: flex-end;
    margin-top: auto;
}

.total-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1b5e20;
}

/* 舊版商品卡片樣式已移除，改用新的重新排版樣式 */

.shortage-info {
    background: #ffebee;
    padding: 0.5rem;
    border-radius: 6px;
    color: #c62828;
    font-weight: 600;
    margin: 0.5rem 0;
    text-align: center;
}

.item-status-info {
    background: #e8f5e8;
    padding: 0.5rem;
    border-radius: 6px;
    color: #2e7d32;
    font-weight: 600;
    margin: 0.5rem 0;
    text-align: center;
}

.item-actions-mobile {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 調整按鈕大小，適合手機操作 */
.item-actions-mobile .action-btn {
    flex: 1;
    min-height: 44px;
    font-size: 1rem;
    font-weight: 600;
}

.order-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.order-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.pending {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.processing {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.completed {
    background: #e8f5e8;
    color: #388e3c;
}

.status-badge.partial {
    background: #ffebee;
    color: #d32f2f;
}

.processing-info {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 商品列表 */
.items-list {
    padding: 1rem;
}

.item-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.item-row:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
    margin-right: 1rem;
}

.item-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.item-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.item-location {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.btn-pick {
    background: #51cf66;
    color: white;
}

.btn-pick:hover {
    background: #40c057;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(64, 192, 87, 0.3);
}

.btn-shortage {
    background: #ffa726;
    color: white;
}

.btn-shortage:hover {
    background: #ff9800;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.btn-not-found {
    background: #ef5350;
    color: white;
}

.btn-not-found:hover {
    background: #e53935;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(229, 57, 53, 0.3);
}

.btn-picked {
    background: #6c757d;
    color: white;
    cursor: not-allowed;
}

.btn-shortage-marked {
    background: #fd7e14;
    color: white;
    cursor: not-allowed;
}

.btn-not-found-marked {
    background: #dc3545;
    color: white;
    cursor: not-allowed;
}

.btn-reset {
    background: #6c757d;
    color: white;
    margin-left: 0.5rem;
}

.btn-reset:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(90, 98, 104, 0.3);
}

/* 訂單操作按鈕 */
.order-actions {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
}

/* 最上方的取消處理按鍵 */
.order-actions-top {
    padding: -0.5rem;
    background: linear-gradient(135deg, #dc3545 30%, #c82333 70%);
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    transition: all 0.2s ease-out;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    user-select: none;
    will-change: transform, background, box-shadow;
}

.order-actions-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.order-actions-top:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.5) !important;
    border-color: #ffffff !important;
}

.order-actions-top:hover::before {
    left: 100%;
}

.order-actions-top .order-action-btn {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 220px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.order-actions-top .order-action-btn:hover {
    transform: scale(1.02) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

/* 特別針對取消處理按鈕的hover效果 */
.order-actions-top .order-action-btn.btn-cancel-processing:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.05) !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7) !important;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
}

.order-actions-top .order-action-btn:active {
    transform: scale(0.98);
}

/* 取消處理後的狀態 */
.order-actions-top.cancelled {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #ffffff;
    animation: successPulse 0.6s ease-out;
}

.order-actions-top.cancelled .order-action-btn {
    color: white;
    cursor: default;
    pointer-events: none;
}

@keyframes successPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.order-action-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-start-processing {
    background: #667eea;
    color: white;
}

.btn-start-processing:hover {
    background: #5a6fd8;
}

.btn-finish-processing {
    background: #51cf66;
    color: white;
}

.btn-finish-processing:hover {
    background: #40c057;
}

.btn-cancel-processing {
    background: #6c757d;
    color: white;
}

.btn-cancel-processing:hover {
    background: #5a6268;
}

.btn-return-pending {
    background: #2196F3;
    color: white;
}

.btn-return-pending:hover {
    background: #1976D2;
}

/* 載入指示器 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #495057;
}

/* 模態框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 10px;
    padding: 0;
    border-radius: 8px;
    width: calc(100vw - 20px);
    max-width: 400px;
    max-height: calc(100vh - 20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: #f8f9fa;
}

.modal-body {
    padding: 0.75rem 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* 重要：讓 flex 子元素可以縮小 */
}

/* 批次清除簡潔設計 */
.batch-clear-simple {
    padding: 0.5rem;
}

.batch-clear-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.3;
}

.customer-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.customer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff5f5;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #fed7d7;
    margin: 0 0.25rem;
}

.customer-item .count {
    font-weight: 600;
    color: #e53e3e;
    font-size: 0.9rem;
    background: #e53e3e;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.item-info {
    background: #f8f9fa;
    padding: -0.25rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.quantity-input, .picker-input {
    margin-bottom: 1rem;
}

.quantity-input label, .picker-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.quantity-input input, .picker-input input {
    width: 100%;
    padding: 1.25rem;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    transition: border-color 0.2s ease;
    background: #f8f9fa;
}

.quantity-input input:focus, .picker-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    margin-top: auto;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .filter-bar {
        padding: 0.75rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .orders-container {
        padding: 0.75rem;
    }
    
    .order-header {
        padding: 0.75rem;
    }
    
    .items-list {
        padding: 0.75rem;
    }
    
    .item-row {
        padding: 0.5rem 0;
    }
    
    .item-actions {
        gap: 0.25rem;
    }
    
    .action-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        min-width: 50px;
    }
    
    .modal-content {
        width: calc(100vw - 10px);
        max-height: calc(100vh - 10px);
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-header h3 {
        font-size: 0.95rem;
    }
    
    .modal-body {
        padding: 0.5rem;
    }
    
    .modal-actions {
        padding: 0.75rem;
    }
    
    .batch-clear-simple {
        padding: 0.25rem;
    }
    
    .batch-clear-title {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .customer-item {
        padding: 0.5rem;
        margin: 0;
    }
    
    .customer-list {
        gap: 0.375rem;
        max-height: 40vh;
    }
}

/* 動畫效果 */
.order-card {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 狀態變化動畫 */
.status-badge, .action-btn {
    transition: all 0.2s ease;
}

/* 快速導航按鈕 */
.navigation-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

.nav-btn {
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-up {
    background: #28a745;
}

.nav-up:hover {
    background: #218838;
}

.nav-down {
    background: #ffc107;
}

.nav-down:hover {
    background: #e0a800;
}

/* 高亮效果 */
.item-card.highlighted {
    border-color: #ff6b6b !important;
    border-width: 3px !important;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5) !important;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* 儲位高亮效果 */
.item-location-priority.location-highlighted {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    color: white !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.8) !important;
    transform: scale(1.1) !important;
    animation: locationPulse 1s ease-in-out infinite alternate;
}

@keyframes locationPulse {
    from {
        box-shadow: 0 0 25px rgba(255, 107, 107, 0.8);
    }
    to {
        box-shadow: 0 0 35px rgba(255, 107, 107, 1);
    }
}

/* 九宮格數字鍵盤 */
.number-pad {
    margin: 1rem 0;
    user-select: none;
}

.number-pad-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    justify-content: center;
}

.num-btn {
    width: 80px;
    height: 52px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.num-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.num-btn:active {
    background: #dee2e6;
    transform: scale(0.95);
}

.num-btn:nth-child(1), .num-btn:nth-child(2), .num-btn:nth-child(3) {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.num-btn:nth-child(1):hover, .num-btn:nth-child(2):hover, .num-btn:nth-child(3):hover {
    background: #bbdefb;
}

/* 特殊按鈕樣式 */
.number-pad-row:last-child .num-btn:nth-child(1) {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.number-pad-row:last-child .num-btn:nth-child(3) {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

/* 滑動功能樣式 */
.order-list-item.swipeable {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.order-list-item.swipeable.pending::after {
    content: '→ 滑動完成';
    position: absolute;
    right: -100px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-weight: bold;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.order-list-item.swipeable.pending:hover::after {
    opacity: 0.7;
}

.order-list-item.swipeable.completed::before,
.order-list-item.swipeable.partial::before {
    content: '← 滑動重置';
    position: absolute;
    left: -100px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffc107;
    font-weight: bold;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.order-list-item.swipeable.completed:hover::before,
.order-list-item.swipeable.partial:hover::before {
    opacity: 0.7;
}

/* 觸控優化 */
@media (hover: none) {
    .action-btn:hover, .filter-btn:hover, .order-action-btn:hover {
        transform: none;
    }
    
    .action-btn:active, .filter-btn:active, .order-action-btn:active {
        transform: scale(0.95);
    }
    
    .nav-btn:hover {
        transform: none;
    }
    
    .nav-btn:active {
        transform: scale(0.9);
    }
    
    .num-btn:hover {
        background: initial;
        border-color: initial;
    }
    
    .num-btn:active {
        transform: scale(0.9);
    }
}

/* 緊湊標題樣式 */
.compact-header {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 整合式標題佈局 */
.integrated-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 0.6rem 1rem;
    gap: 1rem;
}

.integrated-header .back-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

.integrated-header .back-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.back-icon {
    font-size: 1rem;
    font-weight: bold;
}

.back-text {
    font-size: 0.85rem;
}

.integrated-header .header-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.integrated-header .header-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.integrated-stats {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.stats-compact {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: default;
    white-space: nowrap;
    flex-shrink: 0;
}

.stat-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-item.clickable:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.progress-display-compact {
    font-size: 0.9rem;
    color: #6c757d;
    min-width: 60px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}


.header-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
}

.header-info h2 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
}

.progress-display {
    background: #e3f2fd;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    color: #1565c0;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid #2196f3;
}

/* 檢核模式樣式 */
.verification-mode {
    padding: 1rem;
    background: #f8f9fa;
    min-height: 100vh;
}

.verification-header {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e9ecef;
}

.verification-header h2 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 700;
}

.verification-progress {
    background: #e3f2fd;
    padding: 0.75rem;
    border-radius: 6px;
    color: #1565c0;
    font-weight: 600;
    text-align: center;
    margin-top: 0.5rem;
}

.verification-content {
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

.verification-order-info {
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.verification-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.verification-item-card {
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.verification-item-card.item-verified {
    background: #e8f5e8;
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76,175,80,0.2);
}

.verification-item-info {
    margin-bottom: 0.75rem;
}

.verification-item-info .item-name-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.verification-item-info .item-style-display {
    background: #fff3e0;
    color: #f57c00;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: inline-block;
}

/* 選項與數量分別一行 */
.item-style-quantity-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.item-style-quantity-row .item-style-display {
    background: #fff3e0;
    color: #f57c00;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid #ffb74d;
}

.item-style-quantity-row .item-quantity-display {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    border: 3px solid #2196f3;
    box-shadow: 0 3px 6px rgba(33,150,243,0.3);
}

/* 檢核模式的拿取狀態 - 更清楚顯示 */
.item-processing-status-verification {
    background: #f8f9fa;
    padding: 0.15rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 2px solid #e9ecef;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
}

/* 簡化的價格顯示 */
.item-price-simple {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.item-remark-verification {
    background: #fff3e0;
    color: #e65100;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    border-left: 4px solid #ff9800;
    word-break: break-word;
}

.verification-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-verify {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.btn-verify:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76,175,80,0.3);
}

.btn-verified {
    background: #4caf50;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.8;
    flex: 1;
}

.btn-unverify {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-unverify:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255,152,0,0.3);
}

.verification-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-complete-verification {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.btn-complete-verification:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

/* 檢核中狀態樣式 */
.verifying {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.verifying .status-badge {
    background: #ff9800;
    color: white;
}

/* 檢核統計區域 */
.verification-stats {
    display: flex;
    justify-content: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}




/* 響應式設計 */
@media (max-width: 768px) {
    .verification-stats {
        padding: 0.5rem;
    }
    
    .stats-summary {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .stats-count {
        font-size: 1.1rem;
    }
}

/* 檢核模式中問題商品的特殊樣式 */
.verification-shortage {
    border: 3px solid #ff9800 !important;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2) !important;
    box-shadow: 0 4px 20px rgba(255, 152, 0, 0.3) !important;
    animation: pulseWarning 2s ease-in-out infinite;
}

.verification-not-found {
    border: 3px solid #f44336 !important;
    background: linear-gradient(135deg, #ffebee, #ffcdd2) !important;
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3) !important;
    animation: pulseError 2s ease-in-out infinite;
}

/* 警告橫幅樣式 */
.verification-alert-banner {
    font-weight: bold;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.shortage-banner {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: 2px solid #e65100;
}

.not-found-banner {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: 2px solid #b71c1c;
}

/* 狀態文字特殊樣式 */
.status-shortage-alert {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
    color: white !important;
    padding: 0.8rem !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    text-align: center !important;
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.4) !important;
}

.status-not-found-alert {
    background: linear-gradient(135deg, #f44336, #d32f2f) !important;
    color: white !important;
    padding: 0.8rem !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    text-align: center !important;
    box-shadow: 0 2px 10px rgba(244, 67, 54, 0.4) !important;
}

/* 動畫效果 */
@keyframes pulseWarning {
    0% { 
        box-shadow: 0 4px 20px rgba(255, 152, 0, 0.3);
    }
    50% { 
        box-shadow: 0 8px 30px rgba(255, 152, 0, 0.6);
        transform: translateY(-2px);
    }
    100% { 
        box-shadow: 0 4px 20px rgba(255, 152, 0, 0.3);
    }
}

@keyframes pulseError {
    0% { 
        box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3);
    }
    50% { 
        box-shadow: 0 8px 30px rgba(244, 67, 54, 0.6);
        transform: translateY(-2px);
    }
    100% { 
        box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .verification-customer-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==================== 處理順序切換按鈕樣式 ==================== */

.order-time-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.processing-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem 0.6rem;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

/* 從前開始模式（藍色） */
.processing-mode-btn.mode-forward {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.processing-mode-btn.mode-forward:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.4);
}

/* 從後開始模式（橙色） */
.processing-mode-btn.mode-reverse {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
}

.processing-mode-btn.mode-reverse:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.4);
}

.processing-mode-btn:active {
    transform: scale(0.98);
}

.mode-icon {
    font-size: 1rem;
}

#processing-mode-text {
    font-weight: 700;
    font-size: 0.9rem;
} 