:root {
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Roboto, Helvetica,
        Arial, sans-serif;
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #111111;
    --text-muted: #666666;
    --border: #e8e8e8;
    --brand: #111111;
    --brand-2: #444444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
    --header-h: 64px;
    --content-max: 1120px;
    --radius: 8px;
    --gutter: clamp(16px, 4vw, 32px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding-top: var(--header-h);
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: opacity 0.18s ease;
}

a:hover {
    opacity: 0.7;
}

::selection {
    background: rgba(0, 0, 0, 0.12);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: var(--header-h);
    padding: 0 var(--gutter);
    background-color: transparent;
    border-bottom: 1px solid transparent;
    transition:
        background-color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease,
        backdrop-filter 0.4s ease,
        -webkit-backdrop-filter 0.4s ease;
}

header.is-scrolled {
    background-color: rgba(255, 255, 255, 0.62);
    border-bottom-color: rgba(17, 17, 17, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 1px 0 rgba(17, 17, 17, 0.03),
        0 10px 30px -18px rgba(17, 17, 17, 0.22);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    header.is-scrolled {
        background-color: rgba(255, 255, 255, 0.94);
    }
}

header h1 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text);
    z-index: 102;
}

header h1 a {
    color: var(--text);
}

header .menu {
    display: flex;
    gap: 1.5em;
    margin-left: auto;
    margin-right: 1.5em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1em;
    z-index: 102;
}

.lang-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.18s ease;
}

.lang-toggle:hover {
    background-color: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    margin-right: -8px;
}

.menu-toggle line {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

main {
    flex: 1;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

main[aria-busy="true"] .card {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

main[aria-busy="true"] .card::after {
    content: "";
    display: block;
    margin-top: 1em;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(17, 17, 17, 0.15),
        transparent
    );
    background-size: 200% 100%;
    animation: loading-sweep 1.2s linear infinite;
}

@keyframes loading-sweep {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

body.is-loading main {
    opacity: 0;
    visibility: hidden;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.is-loading .page-loader {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    background: transparent;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

main h2 {
    margin: 0 0 0.5em;
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

main h3 {
    margin: 1.6em 0 0.5em;
    font-size: 1.125rem;
    font-weight: 600;
}

main p {
    margin: 0 0 1em;
    color: var(--text-muted);
    line-height: 1.75;
}

main ul,
main ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
    color: var(--text-muted);
}

main li + li {
    margin-top: 0.35em;
}

.card {
    padding: clamp(18px, 3vw, 28px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.625em 1.25em;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
    color: #ffffff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.18s ease, background 0.18s ease;
}

.btn:hover {
    opacity: 0.85;
}

.btn-outline {
    color: var(--brand);
    background: transparent;
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--surface);
    opacity: 1;
}

footer {
    margin-top: auto;
    padding: 60px 0 30px;
    background-color: var(--bg);
    border-top: 1px solid var(--border);
}

.footer-container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand {
    max-width: 280px;
}

.logo-svg {
    height: auto;
    width: auto;
    display: block;
}

.footer-tagline {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 60px;
    flex: 1;
    max-width: 680px;
}

.footer-column h4 {
    margin: 0 0 20px 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column li {
    margin-bottom: 12px;
}

.footer-column a {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.18s ease;
}

.footer-column a:hover {
    color: var(--text);
}

.footer-social {
    display: flex;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.18s ease;
}

.social-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--text);
    transition: stroke 0.18s ease;
}

.social-icon:hover {
    background-color: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.social-icon:hover svg {
    stroke: var(--bg);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-legal p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-subtext {
    opacity: 0.6;
}

.footer-dots {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background-color: #D32F2F; }
.dot-yellow { background-color: #FBC02D; }
.dot-blue { background-color: #1976D2; }
.dot-green { background-color: #388E3C; }

@media (max-width: 900px) {
    .footer-top {
        flex-direction: column;
        gap: 40px;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    header .menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background-color: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5em;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0.35s ease;
        margin: 0; 
        z-index: 101; 
    }

    header .menu.is-open {
        opacity: 1;
        visibility: visible;
    }

    header .menu a {
        font-size: 1.5rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        color: var(--text);
    }

    .header-actions {
        margin-left: auto;
    }

    .menu-toggle {
        display: block;
    }

    .menu-toggle[aria-expanded="true"] .line-top {
        transform: translateY(3.5px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] .line-bottom {
        transform: translateY(-3.5px) rotate(-45deg);
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 600px) {
    .footer-links {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .footer-dots {
        padding-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}