/* style.css */

/* 基本重置與字體設定 */
:root {
    --primary-color: #005A9C; /* 主色調 (深藍) */
    --secondary-color: #008080; /* 次要色調 (青色) */
    --text-color: #333;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --header-font: 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    --body-font: 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* 標題與頁首 */
.header {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-family: var(--header-font);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 10px;
}

/* 表單容器與內部表單 */
.form-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.query-form {
    display: flex;
    flex-wrap: wrap; /* 在小螢幕上換行 */
    justify-content: center;
    align-items: center;
    gap: 15px; /* 元素間距 */
    width: 100%;
}

.query-form select, .query-form .submit-btn {
    padding: 12px 18px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1; /* 讓元素在空間足夠時平均分配寬度 */
    min-width: 200px; /* 最小寬度 */
}

.query-form select:hover, .query-form .submit-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(0, 90, 156, 0.2);
}

.query-form .submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: bold;
    flex-grow: 0.5; /* 按鈕不需要佔用太多空間 */
}

.query-form .submit-btn:hover {
    background-color: #004170;
}

/* 結果卡片樣式 */
.result-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    overflow: hidden; /* 確保子元素圓角 */
    border-top: 4px solid var(--secondary-color);
}

.card-header {
    background-color: #f8f9fa;
    color: var(--secondary-color);
    padding: 15px 20px;
    font-size: 1.3rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 20px;
}

/* 數據表格的響應式設計 */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* 在小螢幕上啟用水平滾動 */
    -webkit-overflow-scrolling: touch; /* 在 iOS 上流暢滾動 */
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

th, td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

th {
    background-color: #eef7f7; /* 表頭背景色微調 */
    font-weight: bold;
    color: var(--primary-color);
}

/* 針對特定表格的微調 */
.spec-table th, .spec-table td {
    width: 16.66%;
}
.hook-images img {
    max-width: 100px; /* 限制圖片最大寬度 */
    height: auto;
    border-radius: 5px;
    margin-top: 10px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .query-form {
        flex-direction: column; /* 在小螢幕上垂直排列 */
    }
    .query-form select, .query-form .submit-btn {
        width: 100%;
    }
    th, td {
        padding: 8px;
    }
}