:root {
    --color-bg: #ffffff;
    --color-bg-subtle: #f8fafc;
    --color-bg-muted: #f1f5f9;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-soft: #eff6ff;
    --color-accent: #059669;
    --color-accent-soft: #ecfdf5;
    --color-warning: #d97706;
    --color-warning-soft: #fffbeb;
    --color-search: #ff6a00;
    --color-search-hover: #e55f00;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.1);
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

img {
    max-width: 100%;
    display: block;
}

/* Header — Alibaba-style */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.header-shell {
    padding-top: 0.875rem;
}

.header-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
}

.logo-header {
    flex-shrink: 0;
}

.logo-header .logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6a00, #ff8533);
    box-shadow: none;
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #222;
}

.header-search {
    display: flex;
    align-items: stretch;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    border: 2px solid var(--color-search);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.header-search input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 0.7rem 1.125rem;
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--color-text);
    background: transparent;
}

.header-search input:focus {
    outline: none;
}

.header-search input::placeholder {
    color: var(--color-text-muted);
}

.header-search-btn {
    flex-shrink: 0;
    border: none;
    padding: 0 1.5rem;
    background: var(--color-search);
    color: #fff;
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.header-search-btn:hover {
    background: var(--color-search-hover);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.header-action {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 3.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: color 0.15s, background 0.15s;
}

.header-action:hover {
    color: var(--color-search);
    background: #fff7f0;
}

.header-action svg {
    flex-shrink: 0;
}

.header-action-badge {
    position: absolute;
    top: 0.1rem;
    right: 0.25rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--color-search);
    color: #fff;
    font-style: normal;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

.header-subnav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 0 0.75rem;
    overflow-x: auto;
}

.header-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.875rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.header-subnav-link:hover {
    color: var(--color-text);
    background: var(--color-bg-muted);
}

.header-subnav-link.is-active {
    color: var(--color-search);
    background: #fff7f0;
}

.header-subnav-link-accent {
    color: var(--color-search);
}

.header-subnav-link-muted {
    color: var(--color-text-muted);
    margin-left: auto;
}

.header-actions .currency-switcher {
    margin-right: 0.35rem;
    border-color: #e8e8e8;
    background: #fafafa;
}

.header-actions .currency-switcher-btn.is-active {
    color: var(--color-search);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--color-primary), #3b82f6);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a:not(.btn) {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.nav-links a:not(.btn):hover {
    color: var(--color-text);
    background: var(--color-bg-muted);
}

.nav-cta {
    margin-left: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--color-bg-muted);
    border-color: #cbd5e1;
}

.btn-outline {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-bg-muted);
    color: var(--color-text);
}

.btn-white {
    background: #fff;
    color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.btn-white:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
}

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--color-bg-subtle);
    border-top: 1px solid var(--color-border-light);
    padding: 3.5rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2.5rem;
    padding-bottom: 2.5rem;
}

.footer-brand p {
    margin-top: 1rem;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    max-width: 320px;
    line-height: 1.7;
}

.footer-col h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.footer-col a {
    display: block;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.3rem 0;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.container-narrow {
    max-width: 720px;
}

.legal-page {
    padding: 3.5rem 0 5rem;
}

.legal-header {
    margin-bottom: 2rem;
}

.legal-header h1 {
    margin-bottom: 0.35rem;
}

.legal-updated {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

.legal-content {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.75;
}

.legal-content h2 {
    margin: 2rem 0 0.75rem;
    font-size: 1.25rem;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.legal-content p {
    margin: 0 0 1rem;
}

.legal-content ul {
    margin: 0 0 1rem;
    padding-left: 1.35rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content strong {
    color: var(--color-text);
    font-weight: 600;
}

.footer-bottom a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--color-primary);
}

.page-section {
    padding: 5rem 0;
}

.page-section h1 {
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.currency-switcher {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-subtle);
    gap: 0.15rem;
}

.currency-switcher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: background 0.15s, color 0.15s;
}

.currency-switcher-btn:hover {
    color: var(--color-primary);
}

.currency-switcher-btn.is-active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-xs);
}

.dashboard-topbar-actions .currency-switcher {
    margin-right: 0.25rem;
}

.page-section p {
    color: var(--color-text-secondary);
}

/* Flash messages (site-wide) */
.site-messages {
    position: sticky;
    top: 0;
    z-index: 200;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border-light);
}

.messages-wrap {
    padding: 0.75rem 0;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-xs);
}

.alert:last-child {
    margin-bottom: 0;
}

.alert-success {
    background: var(--color-accent-soft);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--color-warning-soft);
    color: #b45309;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--color-primary-soft);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

@media (max-width: 1024px) {
    .header-main {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 0.625rem;
    }

    .header-search {
        grid-column: 1 / -1;
        max-width: none;
    }

    .header-actions {
        justify-self: end;
    }

    .header-action span {
        display: none;
    }

    .header-action {
        min-width: auto;
        padding: 0.45rem;
    }
}

@media (max-width: 768px) {
    .header-shell {
        padding-top: 0.5rem;
    }

    .header-main {
        gap: 0.5rem;
    }

    .logo-header .logo-mark {
        width: 30px;
        height: 30px;
        border-radius: 7px;
    }

    .logo-header .logo-mark svg {
        width: 18px;
        height: 18px;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .header-search {
        border-width: 1.5px;
    }

    .header-search input {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .header-search-btn {
        padding: 0 1rem;
        font-size: 0.8125rem;
    }

    .header-action {
        padding: 0.3rem;
    }

    .header-action svg {
        width: 20px;
        height: 20px;
    }

    .header-subnav {
        padding: 0.375rem 0 0.5rem;
        gap: 0.15rem;
    }

    .header-subnav-link {
        padding: 0.25rem 0.65rem;
        font-size: 0.8125rem;
    }

    .header-actions .currency-switcher {
        display: none;
    }

    .header-subnav-link {
        display: none;
    }

    .header-subnav button.header-subnav-link,
    .header-subnav-link-accent,
    .header-subnav-link-muted {
        display: inline-flex;
    }

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

@media (max-width: 480px) {
    .header-shell {
        padding-top: 0.375rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .header-search input {
        padding: 0.4375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .header-search-btn {
        padding: 0 0.75rem;
        min-width: 2.5rem;
    }

    .header-actions {
        gap: 0.15rem;
    }

    .header-action {
        padding: 0.25rem;
    }

    .header-action svg {
        width: 18px;
        height: 18px;
    }

    .header-subnav {
        padding: 0.25rem 0 0.375rem;
    }

    .header-subnav-link {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
}
