* {
    box-sizing: border-box;
}

:root {
    --home-blue-900: var(--theme-primary-900, #102f46);
    --home-blue-600: var(--theme-primary, #153854);
    --home-blue-500: var(--theme-primary-500, #2f5d7e);
    --home-blue-50: var(--theme-primary-50, #f1f5f8);
    --home-slate-900: #0f172a;
    --home-slate-700: #334155;
    --home-slate-600: #475569;
    --home-slate-500: #64748b;
    --home-slate-200: #e2e8f0;
    --home-white: #ffffff;
    --home-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: var(--home-blue-900);
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
}

.topbar-inner,
.topbar-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-inner {
    min-height: 38px;
    gap: 24px;
}

.topbar-group {
    gap: 18px;
}

.topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.topbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.8);
    flex: 0 0 auto;
}

.topbar-icon svg {
    width: 100%;
    height: 100%;
}

.topbar-group a {
    color: inherit;
    text-decoration: none;
}

.topbar-group a:hover {
    color: var(--theme-primary-300, #8fa9bf);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
    backdrop-filter: blur(18px);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 86px;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 340px;
    height: auto;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.brand-mark img {
    display: block;
    width: min(340px, 100%);
    max-width: 100%;
    height: 52px;
    max-height: none;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #f1f5f9;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--home-slate-900);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.main-nav > a {
    position: relative;
    color: var(--home-slate-600);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-nav > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 3px;
    border-radius: 999px;
    background: var(--home-blue-600);
    transform: scaleX(0);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.main-nav > a:hover {
    color: var(--home-blue-600);
}

.main-nav > a:hover::after {
    transform: scaleX(1);
    opacity: 1;
}

.main-nav > a.is-active {
    color: var(--home-blue-600);
}

.main-nav > a.is-active::after {
    transform: scaleX(1);
    opacity: 1;
}

.language-switcher {
    position: relative;
}

.language-button,
.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.main-nav.is-en {
    gap: 14px;
}

.main-nav.is-en > a {
    font-size: 14px;
}

.main-nav.is-en .language-button {
    min-height: 38px;
    font-size: 14px;
}

.main-nav.is-en .nav-cta {
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 14px;
}

.language-button {
    min-height: 40px;
    padding: 0;
    gap: 6px;
    border-radius: 0;
    background: transparent;
    color: var(--home-slate-600);
    box-shadow: none;
    font-weight: 600;
}

.language-button:hover {
    color: var(--home-blue-600);
    transform: translateY(-2px);
}

.language-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.language-icon svg {
    width: 100%;
    height: 100%;
}

.language-arrow {
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.language-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    display: none;
    min-width: 132px;
    padding: 8px 0;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    background: var(--home-white);
    box-shadow: var(--home-shadow-lg);
}

.language-switcher.is-open .language-menu {
    display: block;
}

.language-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: 0;
    background: transparent;
    color: var(--home-slate-700);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.language-menu button:hover {
    background: #f8fafc;
    color: var(--home-blue-600);
}

.language-menu .is-active {
    background: var(--home-blue-50);
    color: var(--home-blue-600);
    font-weight: 700;
}

.nav-cta {
    min-height: 48px;
    padding: 0 22px;
    border-radius: 16px;
    background: var(--home-blue-600);
    color: var(--home-white);
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(var(--theme-primary-rgb, 21, 56, 84), 0.3);
}

.main-nav > a.nav-cta,
.main-nav > a.nav-cta:hover {
    color: var(--home-white);
}

.nav-cta:hover {
    background: var(--theme-primary-dark, #102f46);
    transform: translateY(-2px);
}

.site-footer {
    margin-top: 56px;
    padding: 56px 0;
    background: var(--home-slate-900);
    color: rgba(255, 255, 255, 0.78);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
}

.footer-brand {
    grid-column: span 2;
}

.footer-brand img {
    display: block;
    height: 42px;
    width: auto;
    margin-bottom: 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    filter: none;
}

.footer-brand p,
.footer-copy,
.footer-copy p,
.footer-copy a {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.8;
}

.footer-copy a {
    text-decoration: none;
}

.payment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.payment-badges span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 700;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links h4 {
    margin: 0 0 6px;
    color: var(--home-white);
    font-size: 18px;
}

.footer-links a,
.footer-button {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
}

.footer-links a:hover,
.footer-button:hover {
    color: var(--home-white);
}

.footer-button {
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.footer-bottom {
    display: block !important;
    text-align: center !important;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.46);
    font-size: 12px;
}

.footer-bottom p {
    margin: 0;
}

.legal-modal[hidden] {
    display: none;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.legal-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
}

.legal-panel {
    position: relative;
    width: min(780px, calc(100% - 24px));
    max-height: 82vh;
    margin: 7vh auto 0;
    padding: 24px 24px 24px 30px;
    overflow: hidden;
    border-radius: 24px;
    background: var(--home-white);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.18);
}

.legal-body {
    max-height: calc(82vh - 48px);
    padding-top: 18px;
    padding-right: 10px;
    overflow: auto;
    scrollbar-gutter: stable;
}

.legal-body::-webkit-scrollbar {
    width: 10px;
}

.legal-body::-webkit-scrollbar-track {
    background: transparent;
}

.legal-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #cbd5e1;
    background-clip: padding-box;
}

.legal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
}

.legal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    cursor: pointer;
}

.legal-panel h3,
.legal-panel h4 {
    margin: 0 0 14px;
    color: var(--home-slate-900);
}

.legal-panel p {
    margin: 0 0 14px;
    color: var(--home-slate-600);
    line-height: 1.8;
}

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

    .footer-brand {
        grid-column: span 2;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 900px) {
    .topbar {
        display: none;
    }

    .menu-toggle {
        display: inline-block;
    }

    .main-nav {
        position: absolute;
        top: calc(100% + 10px);
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 18px;
        border: 1px solid var(--home-slate-200);
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--home-shadow-lg);
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav > a,
    .nav-cta {
        justify-content: center;
    }

    .language-menu {
        position: static;
        margin-top: 10px;
        border-radius: 12px;
        box-shadow: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
    }

    .brand-mark {
        max-width: 250px;
    }

    .brand-mark img {
        height: 40px;
    }

    .legal-panel {
        padding: 22px;
    }

    .legal-body {
        max-height: calc(82vh - 44px);
        padding-top: 20px;
        padding-right: 6px;
    }
}
