﻿:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --text-dark: #2c3e50;
    --text-grey: #7f8c8d;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --border-color: #ecf0f1;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 15px; /* 手機版邊距較小 */
    color: var(--text-dark);
    line-height: 1.5;
}

.main-card {
    max-width: 1100px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
}

/* --- 頁面標題 --- */
.page-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.page-title {
    font-size: 1.8rem;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* --- 篩選區域 (RWD 往下排關鍵) --- */
.filter-section {
    display: flex;
    flex-direction: column; /* 預設垂直排列 (手機版) */
    gap: 20px;
    margin-bottom: 40px;
    padding: 25px;
    background-color: #fcfdfe;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* 電腦版 (寬度大於 992px) 時橫向排開 */
@media screen and (min-width: 992px) {
    .filter-section {
        flex-direction: row; /* 橫向排列 */
        align-items: flex-end;
        column-gap: 60px; /* 您要求的 60px 間距 */
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%; /* 手機版佔滿寬度 */
}

/* 電腦版日期寬度稍微加長 */
@media screen and (min-width: 992px) {
    .form-group.date-group {
        flex: 1.5;
    }
}

.form-label {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.form-input {
    padding: 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fff;
    outline: none;
    transition: border-color 0.2s;
}

    .form-input:focus {
        border-color: var(--accent-color);
    }

.date-range-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .date-range-container .form-input {
        flex: 1;
        min-width: 0; /* 防止 input 撐開 container */
    }

/* --- 表格區域 --- */
.table-container {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background-color: #f8f9fa;
    color: var(--text-grey);
    text-align: left;
    padding: 15px 20px;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
}

td {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.market-tag {
    background-color: #eef2f7;
    color: #2c3e50;
    padding: 5px 15px;
    border-radius: 6px;
    font-weight: 700;
    border: 1px solid #dcdfe6;
    display: inline-block;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.item-label {
    font-size: 0.85rem;
    color: var(--text-grey);
    display: block;
}

.item-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
}

.price-text {
    color: #e67e22;
    font-size: 1.25rem;
}

/* --- 手機版表格卡片化 (無捲軸) --- */
@media screen and (max-width: 768px) {
    thead {
        display: none;
    }

    table, tbody, tr, td {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 25px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    }

    td {
        padding: 15px 20px;
        border: none;
        border-bottom: 1px solid #f5f5f5;
    }

        td:last-child {
            border-bottom: none;
            background-color: #fafbfc;
        }

        td::before {
            content: attr(data-label);
            display: block;
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-grey);
            margin-bottom: 8px;
            text-transform: uppercase;
        }

    .page-title {
        font-size: 1.5rem;
    }
}


/* --- Loading 動畫樣式 --- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: var(--text-grey);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3; /* 淺灰底色 */
    border-top: 5px solid var(--accent-color); /* 藍色轉動部分 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 淡入淡出效果 (Vue Transition) */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s;
}

.fade-enter-from, .fade-leave-to {
    opacity: 0;
}