/* 基本樣式 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
}

header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 篩選部分樣式 */
.filters-section {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filters-section h2 {
    margin-top: 0;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: #555;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 篩選按鈕樣式 */
.filter-button {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-button:hover {
    background-color: #e0e0e0;
    border-color: #667eea;
}

.filter-button.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.reset-button {
    padding: 0.6rem 1.2rem;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.reset-button:hover {
    background-color: #ee5a5a;
}

/* 結果部分樣式 */
.results-section {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-section h2 {
    margin-top: 0;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

#results-container {
    width: 100%;
    overflow-x: auto;
}

/* 表格樣式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table thead {
    background-color: #f8f9fa;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #667eea;
    font-weight: 600;
    color: #667eea;
}

.data-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* 圖標單元格樣式 */
.icons-cell {
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.icon {
    max-width: 40px;
    max-height: 40px;
    display: block;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.icon:hover {
    transform: scale(1.1);
}

/* 無資料提示 */
#results-container p {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-size: 1.1rem;
}

/* 調整篩選按鈕的圖標大小 */
.filter-button img {
    max-width: 20px;
    max-height: 20px;
    vertical-align: middle;
}

/* 響應式設計 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    main {
        padding: 1rem;
    }

    .filters-section,
    .results-section {
        padding: 1rem;
    }

    .filter-buttons {
        gap: 0.25rem;
    }

    .filter-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.5rem;
    }

    .icon {
        max-width: 30px;
        max-height: 30px;
    }

    .icon-container {
        min-width: 30px;
        min-height: 30px;
    }

    .reset-button {
        width: 100%;
        padding: 0.6rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }

    header p {
        font-size: 0.8rem;
    }

    main {
        padding: 0.5rem;
    }

    .filters-section,
    .results-section {
        padding: 0.75rem;
        border-radius: 4px;
    }

    .filter-group h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .filter-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem 0.3rem;
    }

    .icon {
        max-width: 25px;
        max-height: 25px;
    }

    .icon-container {
        min-width: 25px;
        min-height: 25px;
    }

    #results-container p {
        padding: 1rem;
        font-size: 0.95rem;
    }
}