
/* ===== 天氣資訊頁 ===== */
.weather-page {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* 查詢工具列 */
.weather-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(44,84,132,0.08);
    padding: 14px 18px;
    margin-bottom: 20px;
}
.weather-toolbar .mark {
    width: 28px;
    height: 28px;
    display: inline-block;
    flex: 0 0 auto;
}
.road-select { max-width: 200px; }
.node-select { max-width: 170px; }
.weather-toolbar .form-select {
    border-radius: 10px;
    border-color: #d8e0ea;
}
.weather-toolbar .form-select:focus {
    border-color: #2c5484;
    box-shadow: 0 0 0 3px rgba(44,84,132,0.15);
}
.toolbar-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
    flex: 0 0 auto;
}

/* 起點/終點膠囊標籤 */
.pt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8125rem;
    letter-spacing: 1px;
    flex: 0 0 auto;
}
.pt-badge.start { background: #d25f6d; }
.pt-badge.end { background: #a1785a; }

/* 提高權重蓋過 bootstrap .btn（頁內 bootstrap link 晚於本 style 載入，透明背景會蓋掉單類別選擇器） */
.weather-toolbar .query-btn {
    background: #006CB9;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 7px 22px;
}
.weather-toolbar .query-btn:hover, .weather-toolbar .query-btn:focus {
    background: #0b5ed7;
    color: #fff;
}

/* 表格卡片 */
.weather-table-container {
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    overflow: auto;
    /* 限高讓捲動發生在表格內（搭配 sticky 表頭，視覺上只捲 tbody） */
    max-height: 62vh;
    box-shadow: 0 2px 12px rgba(44,84,132,0.08);
}
.weather-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}
.weather-table th, .weather-table td {
    padding: 12px 18px;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
}
/* 表頭固定：捲動時停在容器頂端；底線用 box-shadow，sticky 時才不會跟著捲走 */
.weather-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f4f7fb;
    color: #33475c;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: inset 0 -1px 0 #dfe6ee;
}
.weather-table tbody td {
    border-bottom: 1px solid #f0f3f7;
    color: #1f2937;
}
.weather-table tbody tr:last-child td { border-bottom: none; }
.weather-table tbody tr:nth-child(even) { background: #fafcfe; }
.weather-table tbody tr:hover { background: #eef5fc; }

.weather-table .col-name {
    font-weight: 600;
    color: #2c5484;
}
.weather-table .num { text-align: center; }
.weather-table .nodata { color: #b6bfc9; }
.weather-table .wthr_cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.weather-table .wthr_cell .wthr_icon { flex: 0 0 auto; }

.weather-footer {
    text-align: right;
    color: #6b7a89;
    font-size: 0.875rem;
    margin-top: 12px;
}

/* 手機版 */
@media (max-width: 600px) {
    .weather-toolbar { padding: 12px; gap: 8px; }
    .toolbar-divider { display: none; }
    .road-select { max-width: none; flex: 1 1 100%; }
    .node-select { max-width: none; flex: 1 1 120px; }
    .weather-table { font-size: 0.9375rem; }
    .weather-table th, .weather-table td { padding: 10px 12px; }
}

.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #3730a3;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(55,48,163,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}
.back-to-top:hover {
    background: #4338ca;
    transform: translateY(-2px);
}
