.site-component-error {
    padding: 1rem;
    color: #b91c1c;
    background: #fef2f2;
}

/* 共用 header 字型：首頁與內頁(Vue SPA)一致。
   內頁 App.vue 設了全域「微軟正黑體」，此處直接指定於 #site-header 以覆蓋繼承值，
   讓上方橫幅列與導覽選單字型與首頁相同(Inter + Noto Sans TC)。 */
#site-header {
    font-family: Inter, "Noto Sans TC", system-ui, sans-serif;
}

html.font-size-small {
    font-size: 110%;
}

html.font-size-medium {
    font-size: 120%;
}

html.font-size-large {
    font-size: 130%;
}

@media (max-width: 767px) {
    html.font-size-small {
        font-size: 105%;
    }

    html.font-size-medium {
        font-size: 112.5%;
    }

    html.font-size-large {
        font-size: 120%;
    }
}

.font-size-control {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.125rem;
    margin-right: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.font-size-control__button {
    min-width: 1.75rem;
    height: 1.5rem;
    padding: 0 0.55rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.font-size-control__button[data-font-size="small"] {
    font-size: 0.625rem;
}

.font-size-control__button[data-font-size="medium"] {
    font-size: 0.75rem;
}

.font-size-control__button[data-font-size="large"] {
    font-size: 1rem;
}

.font-size-control__button:hover,
.font-size-control__button:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.font-size-control__button.is-active {
    background: #ffbe2e;
    color: #2a3f3a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
}

/* Desktop pill toggle — height matches .font-size-control (1.75rem) */
.motion-control__button {
    position: relative;
    display: inline-block;
    min-width: 4rem;
    height: 1.75rem;
    padding: 0;
    margin-right: 0.5rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: background 200ms ease, box-shadow 200ms ease;
}

.motion-control__button:not(.is-active) {
    background: #4ade80;
    box-shadow: none;
}

.motion-control__button:hover,
.motion-control__button:focus-visible {
    outline: none;
    filter: brightness(1.08);
}

/* Text labels — both always in DOM, fixed positions */
.motion-toggle__label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.motion-toggle__label--on {
    left: 0.6rem;
    color: #14532d;
}

.motion-toggle__label--off {
    right: 0.6rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Hide the label that the thumb is covering */
.motion-control__button.is-active .motion-toggle__label--on {
    opacity: 0;
}

.motion-control__button:not(.is-active) .motion-toggle__label--off {
    opacity: 0;
}

/* Mobile pill toggle */
.motion-control__button--mobile {
    position: relative;
    display: inline-block;
    min-width: 4rem;
    min-height: 2rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: #d1d5db;
    cursor: pointer;
    transition: background 200ms ease;
}

.motion-control__button--mobile:not(.is-active) {
    background: #4ade80;
}

.motion-control__button--mobile .motion-toggle__label--on {
    color: #14532d;
}

.motion-control__button--mobile .motion-toggle__label--off {
    color: #374151;
}

.motion-control__button--mobile.is-active .motion-toggle__label--on {
    opacity: 0;
}

.motion-control__button--mobile:not(.is-active) .motion-toggle__label--off {
    opacity: 0;
}

.motion-control__button--mobile:hover,
.motion-control__button--mobile:focus-visible {
    outline: none;
    filter: brightness(0.97);
}

/* Exempt thumb from global motion-paused transition kill */
html.motion-paused [data-motion-toggle] .motion-toggle__thumb {
    transition-duration: 200ms !important;
}

/* Sliding thumb — shared base */
[data-motion-toggle] {
    position: relative;
}

[data-motion-toggle] .motion-toggle__thumb {
    position: absolute;
    top: 50%;
    left: 0.25rem;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: left 200ms ease;
}

[data-motion-toggle]:not(.is-active) .motion-toggle__thumb {
    left: calc(100% - 1.5rem - 0.25rem);
}

/* Desktop thumb — smaller to match 1.75rem button height */
.motion-control__button .motion-toggle__thumb {
    width: 1.25rem;
    height: 1.25rem;
}

.motion-control__button:not(.is-active) .motion-toggle__thumb {
    left: calc(100% - 1.25rem - 0.25rem);
}

.line-logo {
    filter: none;
    opacity: 0.8;
}

.group:hover .line-logo {
    opacity: 1;
}

#top-bar.top-bar-transparent {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    color: #2a3f3a;
}

#top-bar.top-bar-transparent a,
#top-bar.top-bar-transparent button,
#top-bar.top-bar-transparent span {
    color: #2a3f3a;
}

#top-bar > div > div:first-child > a,
#top-bar > div > div:first-child > a:link,
#top-bar > div > div:first-child > a:visited,
#top-bar > div > div:first-child > a:hover,
#top-bar > div > div:first-child > a:focus,
#top-bar > div > div:first-child > a:active,
#top-bar > div > div:first-child > .relative > button,
#top-bar > div > div:first-child > .relative > button:hover,
#top-bar > div > div:first-child > .relative > button:focus,
#top-bar > div > div:first-child > .relative > button:active,
#top-bar > div > div:first-child > span,
#top-bar > div > div:last-child > a,
#top-bar > div > div:last-child > a:link,
#top-bar > div > div:last-child > a:visited,
#top-bar > div > div:last-child > a:hover,
#top-bar > div > div:last-child > a:focus,
#top-bar > div > div:last-child > a:active {
    color: #ffffff !important;
}

#top-bar > div > div:first-child > .relative > button,
#top-bar > div > div:first-child > .relative > button:hover,
#top-bar > div > div:first-child > .relative > button:focus,
#top-bar > div > div:first-child > .relative > button:active,
#top-bar > div > div:first-child > .relative > button:focus-visible {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#site-header {
    max-width: 100vw;
}

#mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
}

#mobile-menu {
    max-height: calc(100dvh - var(--fixed-header-offset, 64px));
    overscroll-behavior: contain;
}



#mobile-menu input {
    min-width: 0;
}

#mobile-menu .mobile-search-submit {
    min-width: 44px;
    min-height: 44px;
}

/* Nav ul list resets */
#desktop-menu,
.site-mega-menu__list,
.site-mega-menu section ul,
.mobile-nav-list,
.mobile-nav-panel,
.mobile-nav-subpanel {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav-item {
    position: relative;
}

.site-nav-toggle,
.site-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: #2a3f3a;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.site-nav-toggle:hover,
.site-nav-toggle:focus-visible,
.site-nav-toggle[aria-expanded="true"],
.site-nav-link:hover,
.site-nav-link:focus-visible {
    background: #f0f7f4;
    border-color: #9dcbb9;
    color: #2c5046;
    outline: none;
}

.site-nav-toggle__icon {
    width: 1rem;
    height: 1rem;
    transition: transform 180ms ease;
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle__icon {
    transform: rotate(180deg);
}

.site-mega-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 2rem);
    padding: 1rem;
    transform: translateX(-50%);
    border: 1px solid #dceee7;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    z-index: 70;
}

.site-nav-item:nth-of-type(n + 6) .site-mega-menu {
    right: 0;
    left: auto;
    transform: none;
}


.site-mega-menu__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.site-mega-menu__grid--material {
    grid-template-columns: auto auto;
    gap: 1rem;
}

.site-mega-menu__cols-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(7rem, max-content));
}

.site-mega-menu__heading {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0.5rem;
    padding: 0.15rem 0.5rem;
    background: #e8f4ef;
    border-radius: 0.375rem;
    color: #5a7269;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.site-mega-menu__heading::before {
    display: none;
}


.site-mega-menu__list {
    padding-left: 0.85rem;
    border-left: 3px solid #dceee7;
}

.site-mega-menu section {
    padding-left: 0.85rem;
    border-left: 3px solid #dceee7;
}

.site-mega-menu a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #2a3f3a;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

.site-mega-menu a:hover,
.site-mega-menu a:focus-visible {
    background: #f0f7f4;
    color: #2c5046;
    outline: none;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-nav-group {
    border-radius: 0.875rem;
}

.mobile-nav-toggle,
.mobile-nav-subtoggle,
.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem;
    border: 0;
    border-radius: 0.875rem;
    background: transparent;
    color: #2a3f3a;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible,
.mobile-nav-toggle[aria-expanded="true"],
.mobile-nav-subtoggle:hover,
.mobile-nav-subtoggle:focus-visible,
.mobile-nav-subtoggle[aria-expanded="true"],
.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
    background: #f0f7f4;
    color: #2c5046;
    outline: none;
}

.mobile-nav-toggle[aria-expanded="true"] {
    background: #dceee7;
    box-shadow: inset 0 0 0 1px #c2e0d5;
}

.mobile-nav-subtoggle {
    min-height: 2.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    color: #386758;
    font-size: 0.9375rem;
}

.mobile-nav-subtoggle[aria-expanded="true"] {
    background: #f0f7f4;
    box-shadow: inset 3px 0 0 #ffbe2e;
}

.mobile-nav-toggle__label,
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-nav-link {
    justify-content: flex-start;
}

.mobile-nav-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: #f0f7f4;
    color: #386758;
    flex: 0 0 auto;
}

.mobile-nav-toggle__chevron {
    width: 1rem;
    height: 1rem;
    color: #5a7269;
    flex: 0 0 auto;
    transition: transform 180ms ease;
}

.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle__chevron,
.mobile-nav-subtoggle[aria-expanded="true"] .mobile-nav-toggle__chevron {
    transform: rotate(180deg);
}

.mobile-nav-panel {
    display: grid;
    gap: 0.25rem;
    margin: 0 0 0 2.25rem;
    padding: 0 0 0 0.9rem;
    border-left: 3px solid #9dcbb9;
    overflow: hidden;
    max-height: 0;
    transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1),
                padding-top 300ms ease,
                padding-bottom 300ms ease,
                margin-top 300ms ease,
                margin-bottom 300ms ease;
}

.mobile-nav-panel:not(.hidden) {
    max-height: 1000px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.mobile-nav-panel.hidden {
    display: grid;
}

.mobile-nav-subpanel {
    display: grid;
    gap: 0.25rem;
    margin: 0.125rem 0 0.375rem 0.5rem;
    padding-left: 0.95rem;
    border-left: 2px solid #dceee7;
}

.mobile-nav-subpanel.hidden {
    display: none;
}

.mobile-nav-category {
    display: inline-flex;
    align-items: center;
    margin: 0.5rem 0 0.25rem;
    padding: 0.15rem 0.5rem;
    background: #e8f4ef;
    border-radius: 0.375rem;
    color: #5a7269;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.mobile-nav-panel > li:first-child .mobile-nav-category {
    margin-top: 0;
}

html.motion-paused .mobile-nav-panel {
    transition: none;
}

.mobile-nav-panel a,
.mobile-nav-subpanel a {
    position: relative;
    display: block;
    min-height: 2.5rem;
    padding: 0.625rem 0.75rem 0.625rem 1.4rem;
    border-radius: 0.625rem;
    color: #2a3f3a;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
}



.mobile-nav-subpanel a {
    color: #5a7269;
    font-size: 0.9rem;
    font-weight: 600;
}

.mobile-nav-subpanel a::before {
    width: 0.45rem;
    height: 2px;
    border-radius: 999px;
    background: #75a894;
}

.mobile-nav-panel a:hover,
.mobile-nav-panel a:focus-visible,
.mobile-nav-subpanel a:hover,
.mobile-nav-subpanel a:focus-visible {
    background: #f0f7f4;
    color: #2c5046;
    outline: none;
}

@media (min-width: 1024px) and (max-width: 1199px) {
    #desktop-menu {
        gap: 0;
    }

    .site-nav-toggle,
    .site-nav-link {
        padding-right: 0.3rem;
        padding-left: 0.3rem;
        font-size: 0.75rem;
        gap: 0;
    }

    .site-nav-toggle__icon {
        display: none;
    }
}

@media (min-width: 1280px) and (max-width: 1524px) {
    #desktop-menu {
        gap: 0;
    }

    .site-nav-toggle,
    .site-nav-link {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
        font-size: 0.8125rem;
    }

    .site-nav-toggle__icon {
        width: 0.875rem;
        height: 0.875rem;
    }
}

@media (min-width: 1200px) and (max-width: 1279px) {
    #desktop-menu {
        gap: 0;
    }

    .site-nav-toggle,
    .site-nav-link {
        padding-right: 0.45rem;
        padding-left: 0.45rem;
        font-size: 0.8125rem;
    }

    .site-nav-toggle__icon {
        width: 0.875rem;
        height: 0.875rem;
    }
}

.popular-search-keyword {
    padding: 0.375rem 0.75rem;
    border: 0;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.popular-search-keyword:hover,
.popular-search-keyword:focus-visible {
    outline: none;
    transform: translateY(-1px);
}

.popular-search-keyword--sky {
    background: #f0f9ff;
    color: #0284c7;
}

.popular-search-keyword--sky:hover,
.popular-search-keyword--sky:focus-visible {
    background: #0ea5e9;
    color: #ffffff;
}

.popular-search-keyword--sun {
    background: rgba(255, 190, 46, 0.2);
    color: #c2410c;
}

.popular-search-keyword--sun:hover,
.popular-search-keyword--sun:focus-visible {
    background: #ffbe2e;
    color: #2a3f3a;
}

.popular-search-keyword--orange {
    background: #fff7ed;
    color: #c2410c;
}

.popular-search-keyword--orange:hover,
.popular-search-keyword--orange:focus-visible {
    background: #c2410c;
    color: #ffffff;
}

@media (max-width: 767px) {
    #navbar {
        padding-top: 0.375rem;
        padding-bottom: 0.375rem;
    }

    #navbar img {
        max-height: 2.5rem;
    }

    #mobile-menu {
        border-radius: 0 0 1rem 1rem;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
    }

    #mobile-menu > .flex {
        gap: 0.25rem;
        padding: 0.75rem;
    }

    #mobile-menu .mobile-search-block {
        margin-bottom: 0.625rem;
    }

    #mobile-menu .mobile-search-field {
        padding: 0.45rem 0.75rem;
    }

    #mobile-menu .mobile-search-field input {
        font-size: 0.875rem;
    }

    #mobile-menu .mobile-search-submit {
        width: 2.375rem;
        height: 2.375rem;
        min-width: 2.375rem;
        min-height: 2.375rem;
    }

    #mobile-menu #mobile-popular-search-keywords .popular-search-keyword {
        padding: 0.25rem 0.625rem;
        line-height: 1.2;
    }

    #mobile-menu > .flex > button {
        min-height: 2.875rem;
        gap: 0.625rem;
        padding: 0.55rem 0.75rem;
        border-radius: 0.75rem;
    }

    #mobile-menu > .flex > button > div {
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.65rem;
    }

    #mobile-menu > .flex > button span {
        font-size: 0.9375rem;
        line-height: 1.25;
    }

    #mobile-menu .border-t.mt-3 {
        margin-top: 0.625rem;
        padding-top: 0.625rem;
    }

    #mobile-menu .border-t.mt-3 .grid a,
    #mobile-menu .border-t.mt-3 .grid button,
    #mobile-reca-menu a {
        padding: 0.625rem 0.5rem;
        border-radius: 0.75rem;
        line-height: 1.2;
    }

    .font-size-control {
        display: none;
    }
}
