html {
    overflow-x: clip;
}
body {
    font-family: "Noto Sans TC", system-ui, sans-serif;
    overflow-x: clip;
}
.mobile-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.25s ease-out,
        visibility 0.25s;
}
.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Native select 完整 reset：
       iOS Safari 對 <select> 有 native chrome（border / border-radius / min-height）會覆蓋 h-full，
       要全部一起重置才能讓 Tailwind 的高度規則生效 */
/* .as-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    display: block;
    height: 100%;
    font-size: inherit;
    line-height: inherit;
} */

/* Custom checkbox */
.cb-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.cb-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}
.cb-box svg {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.cb-native:checked + .cb-box {
    background: #0016a2;
    border-color: #0016a2;
}
.cb-native:checked + .cb-box svg {
    opacity: 1;
}
.cb-native:focus-visible + .cb-box {
    box-shadow: 0 0 0 3px rgba(0, 22, 162, 0.18);
}

/* Cover placeholder gradient（縮圖未提供時） */
.cover {
    background: linear-gradient(160deg, #cdd9ee 0%, #93b1da 100%);
    position: relative;
}
.cover::after {
    content: attr(data-label);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(28, 64, 131, 0.55);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-align: center;
    padding: 8px;
}
.cover.c-2 {
    background: linear-gradient(160deg, #fbf2d8 0%, #e8c982 100%);
}
.cover.c-3 {
    background: linear-gradient(160deg, #e9d5ff 0%, #a78bfa 100%);
}
.cover.c-4 {
    background: linear-gradient(160deg, #d1fae5 0%, #34d399 100%);
}
.cover.c-5 {
    background: linear-gradient(160deg, #fee2e2 0%, #f87171 100%);
}

/* Filter accordion (用 native <details>) */
.filter-group summary {
    list-style: none;
}
.filter-group summary::-webkit-details-marker {
    display: none;
}
.filter-group summary .acc-chev {
    transition: transform 0.2s ease;
}
.filter-group[open] summary .acc-chev {
    transform: rotate(180deg);
}

/* 回頂按鈕 ─ 滾動才顯示 */
.scroll-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
        opacity 0.25s ease,
        visibility 0.25s,
        transform 0.25s ease;
}
.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-highlight {
    background-color: #fff3b0;
    color: #92400e;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Filter drawer（mobile only）— 從右側滑入；padding-top 設 0 讓 sticky drawer header 可貼齊 */
@media (max-width: 1023px) {
    .filter-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(90vw, 400px);
        z-index: 50;
        background: #f9fafb;
        overflow-y: auto;
        padding: 0 16px 16px 16px;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
    }
    .filter-drawer.is-open {
        transform: translateX(0);
    }
}
.filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(17, 24, 39, 0.55);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.25s ease,
        visibility 0.25s;
}
.filter-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}
@media (min-width: 1024px) {
    .filter-backdrop {
        display: none;
    }
}

/* <input type="search" size="1"> 完整 reset（iOS Safari 用）：
       重置所有 native search chrome（border / border-radius / background / margin）
       高度由 Tailwind class 顯式指定（例如 h-14） */
input[type="search"] {
    -webkit-appearance: none;
    min-width: 0;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    background-image: none;
    border: 0;
    border-radius: 0;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    box-sizing: border-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}
