:root {
    --bg-color: #f0f7ff;
    --primary-blue: #2a3f6f;
    --accent-blue: #3d5afe;
    --text-gray: #666;
    --border-radius: 50px;
}

body {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

/* 頁籤樣式 */
.tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 0;
    padding-left: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.tab-list {
    display: flex;
    gap: 40px;
}

.tab {
    font-size: 1.5rem;
    font-weight: bold;
    color: #b0bec5;
    cursor: pointer;
    padding-bottom: 8px;
    position: relative;
    transition: color 0.3s;
}

    .tab.active {
        color: var(--primary-blue);
    }

        .tab.active::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background-color: var(--primary-blue);
            border-radius: 2px;
        }

/* ── 搜尋列 ── */
.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 6px 8px 6px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    gap: 2px;
    flex-shrink: 0;
}

.search-select {
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: #555;
    background: transparent;
    cursor: pointer;
    min-width: 80px;
    padding: 4px 0;
}

.search-divider {
    width: 1px;
    height: 20px;
    background-color: #ddd;
    margin: 0 6px;
    flex-shrink: 0;
}

.search-dropdown {
    position: relative;
}

.search-filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.875rem;
    color: #555;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s;
    white-space: nowrap;
}

    .search-filter-btn:hover {
        background: #f0f0f0;
    }

    .search-filter-btn i {
        font-size: 0.625rem;
        color: #999;
    }

    .search-filter-btn.active-filter {
        color: var(--primary-blue);
        font-weight: bold;
    }

    .search-filter-btn.active-filter i {
        color: var(--primary-blue);
    }

.search-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    z-index: 200;
    min-width: 100px;
    overflow: hidden;
}

    .search-dropdown-menu.open {
        display: block;
    }

.search-dropdown-item {
    padding: 9px 18px;
    font-size: 0.875rem;
    cursor: pointer;
    color: #333;
    transition: background 0.15s;
}

    .search-dropdown-item:hover,
    .search-dropdown-item.selected {
        background: #f0f4ff;
        color: var(--primary-blue);
    }

.search-input-wrap {
    display: flex;
    align-items: center;
    background: #f0f4ff;
    border-radius: 30px;
    padding: 3px 3px 3px 12px;
    margin-left: 4px;
}

.search-text {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    width: 120px;
    color: #333;
}

    .search-text::placeholder {
        color: #bbb;
    }

.search-go-btn {
    border: none;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.3s;
    flex-shrink: 0;
}

    .search-go-btn:hover {
        background: var(--accent-blue);
    }

/* 列表樣式 */
.content-section {
    display: none;
}

    .content-section.active {
        display: block;
    }

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px 30px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.3s;
}

    .card:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    }

/* 左側圖示區 */
.icon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    margin-right: 20px;
}

    .icon-box::before {
        content: "";
        width: 50px;
        height: 50px;
        margin-bottom: 5px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .icon-box.icon-construction::before {
        background-image: url("../image/event/施工.png");
    }

    .icon-box.icon-closed::before {
        background-image: url('../image/event/封閉.png');
    }

    .icon-box.icon-event::before {
        background-image: url('../image/event/事件.png');
    }

    .icon-box.icon-accident::before {
        background-image: url('../image/event/事故.png');
    }

    .icon-box.icon-system::before {
        background-image: url('../image/event/系統.png');
    }

    .icon-box.icon-disaster::before {
        background-image: url('../image/event/防災.png');
    }

    .icon-box.icon-other::before {
        background-image: url('../image/event/其他.png');
    }

    .icon-box.icon-diversion::before {
        background-image: url('../image/event/疏運.png');
    }

    .icon-box.icon-traffic::before {
        background-image: url('../image/event/路況.png');
    }

    .icon-box.icon-control::before {
        background-image: url('../image/event/管制.png');
    }

    .icon-box img {
        display: none;
    }

.label {
    color: white;
    padding: 2px 15px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: bold;
}

.label-construction { background-color: #e67e22; }
.label-closed       { background-color: #455a64; }
.label-event        { background-color: #e91e63; }
.label-accident     { background-color: #c62828; }
.label-system       { background-color: #2196f3; }
.label-disaster     { background-color: #ff9800; }
.label-other        { background-color: #9c27b0; }
.label-diversion    { background-color: #4caf50; }
.label-traffic      { background-color: #00bcd4; }
.label-control      { background-color: #f44336; }

/* 中間文字區 */
.info-content {
    flex-grow: 1;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.title {
    font-size: 1.125rem;
    font-weight: bold;
    color: #333;
    padding-right:20px
}

.timestamp {
    background-color: #888;
    color: white;
    padding: 2px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    width:125px
}

.description {
    font-size: 0.875rem;
    color: var(--text-gray);
    line-height: 1.5;
    word-break: break-word;
    padding-right: 130px;
    max-height: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右側箭頭 */
.arrow {
    position: absolute;
    right: 40px;
    bottom: 9px;
    color: cornflowerblue;
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 0;
    cursor: pointer;
    transition: transform 0.3s, color 0.3s;
}

    .arrow:hover {
        transform: translateX(5px);
        color: cornflowerblue;
    }

.card:hover .arrow {
    transform: translateX(5px);
    color: cornflowerblue;
}

/* 捲動載入區（取代原本的「載入更多」按鈕）：預設隨頁籤顯示/隱藏 */
.list-footer {
    display: none;
}

    .list-footer.active {
        display: block;
    }

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-gray);
    font-size: 0.875rem;
}

    .loading::before {
        content: "";
        display: inline-block;
        width: 16px;
        height: 16px;
        margin-right: 8px;
        vertical-align: -3px;
        border: 2px solid #d5deee;
        border-top-color: var(--primary-blue);
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
    }

@keyframes spin {
    to { transform: rotate(360deg); }
}

.list-end {
    text-align: center;
    padding: 16px;
    color: #aaa;
    font-size: 0.8125rem;
}

/* 捲動觸發用的隱形哨兵元素，不需要有高度 */
.scroll-sentinel {
    height: 1px;
}

.no-result {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 0.9375rem;
}
