﻿/* 自定義複選框 */
.cb {
    display: inline-block;
    position: relative;
}

    .cb input[type="checkbox"] {
        display: none;
    }

    .cb label {
        display: inline-block;
        width: 20px;
        height: 20px;
        background: white;
        border: 2px solid #ddd;
        border-radius: 0px;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
    }

        .cb label:hover {
            border-color: #e67e22;
        }

    .cb input[type="checkbox"]:checked + label {
        background: #e67e22;
        border-color: #e67e22;
    }

        .cb input[type="checkbox"]:checked + label:after {
            content: '✓';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-weight: bold;
            font-size: 14px;
        }

/* 搜尋按鈕 */
.productTB input[type="submit"] {
    background: #e67e22;
    color: white;
    text-shadow: 0 0 0.3em black;
    border: none;
    padding: 10px 20px;
    border-radius: 0px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

    .productTB input[type="submit"]:hover {
        background: #d35400;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(211, 84, 0, 0.3);
    }

/* 布林值顯示 */
.productTB td {
    font-family: 'Courier New', monospace;
}

    .productTB td:contains("v") {
        color: #27ae60;
        font-weight: bold;
    }

    .productTB td:contains("-") {
        color: #bdc3c7;
    }

    /* 錯誤訊息 */
    .productTB td span[style*="red"] {
        color: #e74c3c !important;
        font-weight: bold;
        font-size: 1rem;
        padding: 10px;
        background: #ffeaa7;
        border: 1px solid #e74c3c;
        border-radius: 0px;
        display: inline-block;
    }

    /* 間距顯示特殊格式 */
    .productTB td:nth-child(2) {
        font-family: 'Courier New', monospace;
        font-weight: bold;
        color: #2A2E33;
    }

/* 響應式設計 */
@media (max-width: 1200px) {
    .container {
        padding: 0 15px;
    }

    .productTB {
    }

        .productTB th,
        .productTB td {
            padding: 8px 5px;
        }

            .productTB td img {
                width: 80px;
                height: 80px;
            }
}

@media (max-width: 768px) {
    .all_pad {
        padding: 20px 0;
    }

    .container {
        padding: 0 10px;
    }

    .w3ls_head {
        font-size: 2rem;
        padding: 15px 20px;
    }

    section {
        padding: 20px;
    }

    .productTB {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

        .productTB th,
        .productTB td {
            padding: 6px 3px;
            min-width: 60px;
        }

            .productTB td:first-child {
                min-width: 100px;
                position: sticky;
                left: 0;
                z-index: 1;
                background: #f8f9fa;
            }

        .productTB tr.even td:first-child {
            background: #ecf0f1;
        }

        .productTB tr.trlink:hover td:first-child {
            background: #d5e8f5;
        }

        .productTB td img {
            width: 60px;
            height: 60px;
        }

        .productTB input[type="text"],
        .productTB input[type="number"] {
            width: 40px;
        }

    .cb label {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .w3ls_head {
        font-size: 1.5rem;
        padding: 10px 15px;
    }

    section {
        padding: 15px;
    }

    .productTB {
    }

        .productTB th,
        .productTB td {
            padding: 4px 2px;
        }

            .productTB td img {
                width: 50px;
                height: 50px;
            }

        .productTB input[type="text"],
        .productTB input[type="number"] {
            width: 35px;
            padding: 4px;
        }

        .productTB input[type="submit"] {
            padding: 6px 12px;
        }
}

/* 滾動條樣式 */
.productTB::-webkit-scrollbar {
    height: 8px;
}

.productTB::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.productTB::-webkit-scrollbar-thumb {
    background: #e67e22;
    border-radius: 4px;
}

    .productTB::-webkit-scrollbar-thumb:hover {
        background: #d35400;
    }

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.6s ease-out;
}

/* 載入狀態 */
.loading {
    position: relative;
    pointer-events: none;
}

    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 30px;
        height: 30px;
        margin: -15px 0 0 -15px;
        border: 3px solid #e67e22;
        border-top-color: transparent;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 特殊效果：突出顯示 */
.highlight {
    background: linear-gradient(45deg, #fff3cd, #ffeaa7) !important;
    border-left: 4px solid #e67e22 !important;
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

    .tooltip:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        background: #2A2E33;
        color: white;
        padding: 8px 12px;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 1000;
    }

/* 打印樣式 */
@media print {
    .all_pad {
        background: white;
    }

    .productTB {
        box-shadow: none;
        border: 2px solid #2A2E33;
    }

        .productTB tr.trlink:hover {
            background: transparent !important;
            transform: none;
            box-shadow: none;
        }

        .productTB th a {
            color: white !important;
        }

        .productTB input[type="submit"] {
            display: none;
        }
}
