/* Warm, Chinese-first public portal layer. Loaded after the legacy portal theme. */
:root {
    --hx-warm-paper: #f5eee5;
    --hx-warm-surface: #fffaf4;
    --hx-warm-white: #fffdf9;
    --hx-warm-ink: #332d28;
    --hx-warm-muted: #766c62;
    --hx-warm-soft: #a29487;
    --hx-warm-line: #e2d6c8;
    --hx-warm-clay: #d6b59a;
    --hx-warm-accent: #b76049;
    --hx-warm-accent-dark: #91483a;
    --hx-warm-sage: #74806b;
    --hx-warm-shadow: 0 18px 46px rgba(88, 62, 46, .09);
}

.hx-home-body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--hx-warm-paper);
    color: var(--hx-warm-ink);
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.hx-home-body *,
.hx-home-body *::before,
.hx-home-body *::after {
    letter-spacing: 0;
}

.hx-home-body a,
.hx-home-body button,
.hx-home-body input,
.hx-home-body select {
    font-family: inherit;
}

/* The legacy /auth view uses portal-* classes; keep its visual language aligned. */
.portal-body {
    background: var(--hx-warm-paper);
    color: var(--hx-warm-ink);
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.portal-body .portal-topbar {
    border-bottom-color: var(--hx-warm-line);
    background: rgba(255, 253, 249, .94);
}

.portal-body .portal-brand,
.portal-body .portal-brand strong,
.portal-body .portal-login {
    color: var(--hx-warm-ink) !important;
}

.portal-body .portal-brand small,
.portal-body .portal-topbar nav,
.portal-body .portal-copy > p:not(.overline),
.portal-body .verify-intro,
.portal-body .verify-tip,
.portal-body .section-title > span,
.portal-body .portal-strip small,
.portal-body .portal-footer {
    color: var(--hx-warm-muted);
}

.portal-body .verify-panel,
.portal-body .notice-item,
.portal-body .notice-empty {
    border-color: var(--hx-warm-line);
    border-radius: 8px;
    background: var(--hx-warm-surface);
    box-shadow: var(--hx-warm-shadow);
}

.portal-body .verify-panel input,
.portal-body .verify-panel select {
    border-color: var(--hx-warm-line);
    border-radius: 8px;
    background: var(--hx-warm-white);
    color: var(--hx-warm-ink);
}

.portal-body .verify-panel input:focus,
.portal-body .verify-panel select:focus {
    border-color: var(--hx-warm-accent);
    box-shadow: 0 0 0 3px rgba(183, 96, 73, .13);
}

.portal-body .portal-button {
    border-radius: 8px;
    background: var(--hx-warm-accent);
}

.portal-body .portal-button:hover {
    background: var(--hx-warm-accent-dark);
}

.portal-body .portal-trust,
.portal-body .portal-trust svg,
.portal-body .eyebrow,
.portal-body .overline,
.portal-body .notice-date,
.portal-body .portal-topbar nav > a:hover,
.portal-body .portal-topbar nav > a.active {
    color: var(--hx-warm-accent);
}

.portal-body .portal-strip {
    border-color: var(--hx-warm-line);
}

.portal-body .strip-icon {
    border-radius: 8px;
    background: #f2dfd3;
    color: var(--hx-warm-accent);
}

.hx-home-grain {
    opacity: .22;
    background-image: radial-gradient(rgba(145, 96, 67, .18) .7px, transparent .7px);
    background-size: 17px 17px;
}

.hx-home-header {
    border-bottom-color: rgba(226, 214, 200, .9);
    background: rgba(255, 253, 249, .9);
    box-shadow: 0 4px 22px rgba(88, 62, 46, .04);
}

.hx-home-brand,
.hx-home-brand strong,
.hx-home-nav a,
.hx-home-nav a.is-active {
    color: var(--hx-warm-ink);
}

.hx-home-brand small,
.hx-home-nav a:not(.is-active),
.hx-home-lead,
.hx-home-panel-intro,
.hx-home-tip,
.hx-home-section-heading > p,
.hx-home-process-copy > p:not(.hx-home-label),
.hx-home-product > p:not(.hx-home-product-kicker),
.hx-home-notice summary small,
.hx-home-footer-brand p,
.hx-home-footer-column,
.hx-home-copyright {
    color: var(--hx-warm-muted);
}

.hx-home-mark,
.hx-home-brand img {
    border-color: var(--hx-warm-line);
    border-radius: 8px;
    background: var(--hx-warm-white);
    color: var(--hx-warm-accent);
}

.hx-home-nav a:hover,
.hx-home-nav a.is-active,
.hx-home-nav a svg,
.hx-home-text-link,
.hx-home-product-foot a,
.hx-home-cta-link,
.hx-home-footer-column a:hover {
    color: var(--hx-warm-accent);
}

.hx-home-nav-primary,
.hx-home-button-primary,
.hx-home-submit {
    border-color: var(--hx-warm-accent) !important;
    border-radius: 8px !important;
    background: var(--hx-warm-accent) !important;
    box-shadow: 0 10px 22px rgba(183, 96, 73, .2);
}

.hx-home-nav-primary:hover,
.hx-home-button-primary:hover,
.hx-home-submit:hover {
    background: var(--hx-warm-accent-dark) !important;
    box-shadow: 0 14px 28px rgba(145, 72, 58, .22);
}

.hx-home-hero {
    position: relative;
    isolation: isolate;
    padding-top: 92px;
    padding-bottom: 100px;
}

.hx-home-hero::after {
    border-color: rgba(183, 96, 73, .28);
}

.hx-home-hero h1,
.hx-home-section-heading h2,
.hx-home-process h2,
.hx-home-cta h2,
.public-friends-head h2,
.hx-home-feature-grid h3,
.hx-home-product h3,
.hx-home-process-list h3,
.hx-home-footer-column strong {
    color: var(--hx-warm-ink);
    font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
    font-weight: 700;
}

.hx-home-hero h1 {
    max-width: 680px;
    font-size: clamp(36px, 4.8vw, 64px);
    line-height: 1.15;
}

.hx-home-section-heading h2,
.hx-home-process h2,
.hx-home-cta h2 {
    font-size: clamp(27px, 3.5vw, 44px);
    line-height: 1.2;
}

.hx-home-kicker,
.hx-home-label {
    color: var(--hx-warm-accent) !important;
    font-family: inherit;
    font-weight: 700;
}

.hx-home-kicker > span,
.hx-home-live b,
.hx-home-product-status b {
    background: var(--hx-warm-accent);
    box-shadow: 0 0 0 4px rgba(183, 96, 73, .12);
}

.hx-home-trust,
.hx-home-trust svg,
.hx-home-proof-icon,
.hx-home-feature-icon,
.hx-home-process-list article svg,
.hx-home-product-status,
.hx-home-heading-note {
    color: var(--hx-warm-sage);
}

.hx-home-button-secondary {
    border-color: var(--hx-warm-line) !important;
    border-radius: 8px !important;
    color: var(--hx-warm-ink) !important;
    background: var(--hx-warm-surface) !important;
}

.hx-home-button-secondary:hover {
    border-color: var(--hx-warm-clay) !important;
    color: var(--hx-warm-accent) !important;
    background: var(--hx-warm-white) !important;
}

.hx-home-hero-panel,
.hx-home-feature-grid article,
.hx-home-product,
.hx-home-empty,
.public-friend-card,
.hx-home-proofbar,
.hx-home-search,
.hx-home-form input,
.hx-home-form select {
    border-radius: 8px !important;
    border-color: var(--hx-warm-line) !important;
}

.hx-home-hero-panel,
.hx-home-feature-grid article,
.hx-home-product,
.public-friend-card {
    background: var(--hx-warm-surface) !important;
    box-shadow: var(--hx-warm-shadow) !important;
}

.hx-home-hero-panel {
    padding: 30px;
    background: rgba(255, 250, 244, .96) !important;
}

.hx-home-panel-heading h2 {
    color: var(--hx-warm-ink);
    font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
}

.hx-home-form input,
.hx-home-form select,
.hx-home-search input {
    color: var(--hx-warm-ink);
    background: var(--hx-warm-white);
}

.hx-home-form input:focus,
.hx-home-form select:focus,
.hx-home-search:focus-within {
    border-color: var(--hx-warm-accent) !important;
    box-shadow: 0 0 0 3px rgba(183, 96, 73, .13) !important;
}

.hx-home-form input::placeholder,
.hx-home-search input::placeholder {
    color: var(--hx-warm-soft);
}

.hx-home-result {
    border-radius: 8px;
}

.hx-home-proofbar {
    border-color: var(--hx-warm-line);
    background: rgba(255, 253, 249, .68);
}

.hx-home-proofbar > div + div {
    border-left-color: var(--hx-warm-line);
}

.hx-home-section,
.hx-home-process {
    border-color: var(--hx-warm-line);
}

.hx-home-feature-grid article:hover,
.hx-home-product:hover,
.public-friend-card:hover {
    border-color: var(--hx-warm-clay) !important;
    box-shadow: 0 22px 45px rgba(88, 62, 46, .13) !important;
}

.hx-home-feature-icon,
.hx-home-product-icon {
    border-radius: 8px;
    background: #f2dfd3 !important;
    color: var(--hx-warm-accent) !important;
}

.hx-home-feature-grid article > p,
.hx-home-product-kicker,
.hx-home-product-index,
.hx-home-process-list article > span,
.hx-home-notice summary time {
    color: var(--hx-warm-accent);
}

.hx-home-product-foot,
.hx-home-process-list,
.hx-home-process-list article,
.hx-home-notice-list,
.hx-home-notice,
.hx-home-copyright {
    border-color: var(--hx-warm-line);
}

.hx-home-notice summary:hover {
    background: rgba(214, 181, 154, .14);
}

.hx-home-cta {
    background: #3b332e;
}

.hx-home-cta h2,
.hx-home-cta > div > p:not(.hx-home-label) {
    color: var(--hx-warm-white);
}

.hx-home-cta .hx-home-label,
.hx-home-cta-link,
.hx-home-cta-mark {
    color: #e5bd9e;
}

.hx-home-button-light {
    border-radius: 8px !important;
    color: var(--hx-warm-ink) !important;
    background: var(--hx-warm-white) !important;
}

.hx-home-button-light:hover {
    color: var(--hx-warm-white) !important;
    background: var(--hx-warm-accent) !important;
}

.hx-home-footer-column strong {
    color: var(--hx-warm-ink);
}

.hx-mobile-bottom-nav {
    display: none;
}

.home-popup {
    max-height: min(580px, calc(100dvh - 42px));
    border-color: var(--hx-warm-line);
    border-radius: 8px !important;
    background: var(--hx-warm-surface);
}

.home-popup-head,
.home-popup-foot {
    border-color: var(--hx-warm-line);
}

.home-popup-head h2,
.home-popup-body h3,
.home-popup-body h4 {
    color: var(--hx-warm-ink);
    font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
}

.home-popup-body {
    max-height: min(360px, 43dvh);
    color: var(--hx-warm-muted);
}

.home-popup-close,
.home-popup-foot .portal-button {
    border-radius: 8px !important;
    border-color: var(--hx-warm-line);
    color: var(--hx-warm-muted);
    background: var(--hx-warm-white);
}

.home-popup-close:hover,
.home-popup-foot .portal-button:hover {
    border-color: var(--hx-warm-clay);
    color: var(--hx-warm-accent);
    background: #f9eee6;
}

@media (max-width: 760px) {
    .hx-home-body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .portal-body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .hx-home-hero {
        padding-top: 54px;
        padding-bottom: 66px;
    }

    .hx-home-hero h1 {
        font-size: clamp(33px, 10vw, 48px);
        line-height: 1.14;
    }

    .hx-home-hero-panel {
        padding: 23px 19px;
        border-radius: 8px !important;
    }

    .hx-home-section-heading h2,
    .hx-home-process h2,
    .hx-home-cta h2,
    .public-friends-head h2 {
        font-size: clamp(29px, 8.5vw, 38px);
    }

    .hx-home-feature-grid article,
    .hx-home-product,
    .public-friend-card {
        border-radius: 8px !important;
    }

    .hx-mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: 64px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--hx-warm-line);
        background: rgba(255, 253, 249, .96);
        box-shadow: 0 -10px 28px rgba(88, 62, 46, .1);
        backdrop-filter: blur(16px);
    }

    .hx-mobile-bottom-nav a {
        display: flex;
        min-width: 0;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        border-radius: 8px;
        color: var(--hx-warm-soft);
        font-size: 10px;
        font-weight: 700;
        transition: color .2s ease, background-color .2s ease, transform .2s ease;
    }

    .hx-mobile-bottom-nav a svg {
        width: 18px;
        height: 18px;
    }

    .hx-mobile-bottom-nav a.is-active {
        color: var(--hx-warm-accent);
        background: #f8ebe2;
    }

    .hx-mobile-bottom-nav a:active {
        transform: scale(.96);
    }

    .hx-menu-open .hx-mobile-bottom-nav {
        display: none;
    }

    .home-popup {
        max-height: min(70dvh, 520px);
    }

    .home-popup-body {
        max-height: min(280px, 33dvh);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hx-mobile-bottom-nav a {
        transition: none;
    }
}
