:root {
    --bg: #f7f6f2;
    --surface: #fff;
    --text: #25221f;
    --muted: #756f68;
    --line: #e8e3dc;
    --brand: #d36b3b;
    --brand2: #b85129;
    --soft: #fff3eb;
    --dark: #2e2a26;
    --ok: #3f7b5d;
    --warn: #b97823;
    --shadow: 0 10px 26px rgba(41, 35, 31, .08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    max-width: 1180px;
    margin: auto;
    padding: 0 20px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.topbar {
    padding: 8px 14px;
    background: var(--dark);
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 76px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    font-size: 20px;
    font-weight: 900;
    white-space: nowrap;
}

.navlinks {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 20px;
    color: #5f5a54;
    font-size: 14px;
}

.navlinks a.active,
.navlinks a:hover {
    color: var(--brand2);
    font-weight: 700;
}

.navlinks a[href="/Faq"] {
    margin-left: auto;
}

.nav-icon-link {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
}

.nav-icon-link img {
    display: block;
    width: 22px;
    height: 22px;
}

.nav-icon-link.active,
.nav-icon-link:hover,
.navlinks .nav-search-toggle:hover,
.navlinks .nav-search-toggle:focus-visible {
    background: var(--soft);
}

.nav-icon-query {
    margin-right: -10px;
}

.navlinks .nav-search-toggle {
    flex: 0 0 36px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.navlinks .nav-login-button,
.navlinks .nav-login-button.active,
.navlinks .nav-login-button:hover,
.navlinks .nav-login-button:focus-visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-left: 2px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #000;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.navlinks .nav-login-button:hover,
.navlinks .nav-login-button:focus-visible {
    background: #242424;
}

.footer {
    margin-top: 50px;
    padding: 34px 0;
    border-top: 1px solid var(--line);
    background: #fff;
    color: #807970;
    font-size: 13px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
}

.footer h4 {
    margin: 0 0 10px;
    color: #4b4641;
}

.footer a {
    display: block;
    margin: 7px 0;
}

.footer .brand {
    color: #000;
}

.footer .footer-grid.footer-grid-expanded {
    grid-template-columns: minmax(235px, 1fr) max-content max-content max-content minmax(270px, auto);
    align-items: start;
    column-gap: 20px;
    row-gap: 24px;
}

.footer-contact {
    scroll-margin-top: 100px;
}

.footer-contact p {
    margin: 7px 0;
    line-height: 1.7;
}

.footer-contact a {
    display: inline;
    margin: 0;
    overflow-wrap: anywhere;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 750;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--brand2);
}

.site-search-dialog {
    width: min(420px, calc(100% - 40px));
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .2);
}

.site-search-dialog::backdrop {
    background: rgba(35, 31, 28, .4);
}

.site-search-dialog h2 {
    margin: 0 36px 22px 0;
    font-size: 24px;
}

.site-search-close {
    position: absolute;
    top: 17px;
    right: 17px;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    place-items: center;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
}

.site-search-close:hover {
    background: var(--soft);
}

.site-search-dialog input {
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #ddd6cf;
    border-radius: 12px;
    background: #fff;
    outline: none;
}

.site-search-dialog input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(211, 107, 59, .12);
}

.site-search-dialog .btn {
    display: block;
    width: 100%;
    margin-top: 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    border: 0;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .footer .footer-grid.footer-grid-expanded {
        grid-template-columns: 1fr max-content max-content max-content;
    }

    .footer-contact {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .nav {
        gap: 12px;
        height: 66px;
    }

    .navlinks:has(.nav-search-toggle) {
        display: flex;
        gap: 10px;
    }

    .navlinks:has(.nav-search-toggle) > a:not(.nav-icon-link):not(.nav-login-button) {
        display: none;
    }

    .navlinks .nav-icon-query {
        margin-right: 0;
    }

    .navlinks .nav-login-button {
        min-height: 36px;
        padding: 7px 11px;
        font-size: 13px;
    }
}

@media (max-width: 650px) {
    .footer .footer-grid.footer-grid-expanded {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .footer-brand,
    .footer-contact {
        grid-column: 1 / -1;
    }

    .footer-contact p {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 14px;
    }
}
