/*
 * Deeplus shared design tokens.
 *
 * Component declarations remain in the page styles during the compatibility
 * migration so their existing cascade and responsive order are preserved.
 * New shared component changes should use this file first.
 */
:root {
    --brand-navy: #2d3b6b;
    --brand-lime: #c0e17e;
    --brand-lime-dark: #a8c96a;
    --bg-light: #f8f9fa;
    --text-dark: #1a1a2e;
    --text-muted: #6b7280;
}

/* Shared header sizing. Higher component specificity prevents page CSS drift. */
body #mainHeader .nav-logo {
    display: block;
    width: auto;
    height: 60px;
    max-width: 180px;
    object-fit: contain;
}

/* Shared language switcher. */
body #mainHeader .lang-switch-wrapper {
    position: relative;
    z-index: 80;
}

body #mainHeader .lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 42px;
    min-height: 38px;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transition:
        color 0.25s ease,
        border-color 0.25s ease,
        background-color 0.25s ease,
        transform 0.25s ease;
}

body #mainHeader .lang-toggle:hover,
body #mainHeader .lang-switch-wrapper.active .lang-toggle {
    border-color: rgba(192, 225, 126, 0.65);
    background: rgba(192, 225, 126, 0.14);
    color: var(--brand-lime);
    transform: translateY(-1px);
}

body #mainHeader .lang-toggle svg:last-child {
    transition: transform 0.3s ease;
}

body #mainHeader .lang-switch-wrapper.active .lang-toggle svg:last-child {
    transform: rotate(180deg);
}

body #mainHeader .lang-dropdown {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    left: auto;
    display: block !important;
    width: 144px;
    min-width: 144px;
    padding: 0.45rem;
    overflow: hidden;
    visibility: hidden;
    border: 1px solid rgba(45, 59, 107, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 38px rgba(25, 38, 75, 0.2);
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    pointer-events: none;
    backdrop-filter: blur(12px);
    transition:
        opacity 0.22s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.28s;
}

body #mainHeader .lang-switch-wrapper.active .lang-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition:
        opacity 0.22s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s;
}

body #mainHeader .lang-option {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: var(--brand-navy);
    font-size: 0.875rem;
    line-height: 1.3;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        padding-left 0.2s ease;
}

body #mainHeader .lang-option:hover {
    padding-left: 0.95rem;
    background: rgba(192, 225, 126, 0.2);
    color: #40508d;
}

body #mainHeader .lang-option:first-child {
    background: rgba(96, 109, 173, 0.09);
    font-weight: 600;
}

body #mainHeader .lang-option:first-child::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--brand-lime);
    box-shadow: 0 0 0 3px rgba(192, 225, 126, 0.2);
}

/* Shared footer layout and utilities used by foot.html. */
body footer {
    width: 100%;
    overflow: visible;
}

body footer .container {
    width: 100%;
    max-width: 1400px;
    margin-right: auto;
    margin-left: auto;
}

body footer .grid {
    display: grid;
}

body footer .grid-cols-1 {
    grid-template-columns: minmax(0, 1fr);
}

body footer .gap-12 {
    gap: 3rem;
}

body footer .flex {
    display: flex;
}

body footer .flex-col {
    flex-direction: column;
}

body footer .footer-logo {
    display: block;
    width: auto;
    height: 60px;
    max-width: min(100%, 220px);
    object-fit: contain;
}

body footer .lxtext,
body footer .footer-link,
body footer p,
body footer a {
    overflow-wrap: anywhere;
    word-break: normal;
}

body footer .social-icon-wrapper {
    position: relative;
    flex: 0 0 auto;
    cursor: pointer;
    outline: none;
}

body footer .social-icon-wrapper svg {
    transition: transform 0.25s ease, filter 0.25s ease;
}

body footer .social-icon-wrapper:hover svg,
body footer .social-icon-wrapper.active svg,
body footer .social-icon-wrapper:focus-visible svg {
    transform: translateY(-2px) scale(1.08);
    filter: drop-shadow(0 4px 6px rgba(42, 57, 110, 0.18));
}

body footer .qrcode-popup {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    z-index: 100;
    width: 132px;
    padding: 10px 10px 8px;
    border: 1px solid rgba(42, 57, 110, 0.12);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(20, 31, 65, 0.18);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px) scale(0.96);
    transform-origin: bottom center;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

body footer .qrcode-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    border: 7px solid transparent;
    border-top-color: #fff;
    transform: translateX(-50%);
}

body footer .qrcode-popup img {
    display: block;
    width: 110px;
    height: 110px;
    border-radius: 6px;
    object-fit: contain;
}

body footer .qrcode-popup .label {
    margin-top: 6px;
    color: #2a396e;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

body footer .social-icon-wrapper:hover .qrcode-popup,
body footer .social-icon-wrapper.active .qrcode-popup,
body footer .social-icon-wrapper:focus-within .qrcode-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

@media (min-width: 768px) {
    body footer .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body footer .md\:flex-row {
        flex-direction: row;
    }

    body footer .md\:mt-0 {
        margin-top: 0;
    }
}

@media (max-width: 767px) {
    body #mainHeader .header-inner {
        min-height: 68px;
        padding-right: 0.75rem !important;
        padding-left: 0.75rem !important;
        overflow: visible !important;
    }

    body #mainHeader .nav-logo,
    body #mainHeader.header-nav.scrolled .nav-logo {
        width: auto;
        height: 44px;
        max-width: 132px;
    }

    body #mainHeader #menuToggle {
        transition: color 0.25s ease, transform 0.3s ease;
    }

    body #mainHeader .lang-toggle {
        min-width: 38px;
        min-height: 36px;
        padding: 0.4rem 0.5rem;
    }

    body #mainHeader .lang-dropdown {
        right: -0.25rem;
        width: 136px;
        min-width: 136px;
    }

    body #mainHeader #menuToggle svg {
        transition: transform 0.3s ease;
        transform-origin: center;
    }

    body #mainHeader #menuToggle.active {
        color: var(--brand-lime);
        transform: scale(1.05);
    }

    body #mainHeader #menuToggle.active svg {
        transform: rotate(90deg);
    }

    body #mainHeader #mobileMenu {
        display: block !important;
        max-height: 0;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition:
            max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
            padding 0.35s ease,
            opacity 0.25s ease,
            transform 0.35s ease,
            visibility 0s linear 0.45s;
    }

    body #mainHeader #mobileMenu.active {
        max-height: min(78vh, 680px);
        padding-top: 1rem !important;
        padding-bottom: 1.25rem !important;
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        transition:
            max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
            padding 0.35s ease,
            opacity 0.3s ease 0.05s,
            transform 0.4s ease,
            visibility 0s;
    }

    body #mainHeader #mobileMenu > a,
    body #mainHeader #mobileMenu > div {
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.2s ease, transform 0.25s ease;
    }

    body #mainHeader #mobileMenu.active > a,
    body #mainHeader #mobileMenu.active > div {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.08s;
    }

    body .team-cta-section {
        min-height: 180px !important;
        padding: 1.25rem 0 !important;
        overflow: hidden;
    }

    body .team-cta-section .team-cta-card {
        width: 100%;
        min-height: 150px;
        gap: 1.1rem !important;
        padding: 0 1rem !important;
        align-items: center;
    }

    body .team-cta-section .team-cta-card .cta-image {
        position: relative;
        left: auto !important;
        flex: 0 0 116px !important;
        width: 116px !important;
        height: 116px !important;
        margin: 0 !important;
        border: 3px solid rgba(255, 255, 255, 0.22);
        box-shadow: 0 10px 26px rgba(21, 31, 65, 0.24);
    }

    body .team-cta-section .team-cta-card .cta-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    body .team-cta-section .team-cta-card .cta-content {
        min-width: 0;
        padding: 0 !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    body .team-cta-section .team-cta-card .cta-content h2 {
        margin-bottom: 0.65rem !important;
        font-size: 1rem !important;
        line-height: 1.45 !important;
        letter-spacing: 0.02em !important;
    }

    body .team-cta-section .team-cta-card .cta-content .cta-btn {
        min-height: 34px;
        padding: 0.4rem 0.9rem !important;
        align-self: flex-start !important;
        font-size: 0.76rem !important;
        line-height: 1.2;
        letter-spacing: 0.04em !important;
        border-radius: 4px;
    }

    body .team-cta-section .team-cta-card .cta-content .cta-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    body footer {
        height: auto;
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    body footer .container {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
        overflow: visible !important;
    }

    body footer .grid,
    body footer .grid-cols-1,
    body footer .md\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1.75rem 1.25rem !important;
    }

    body footer .grid > div:first-child {
        grid-column: 1 / -1;
    }

    body footer .mb-12 {
        margin-bottom: 2rem !important;
    }

    body footer .mb-6 {
        margin-bottom: 0.9rem !important;
    }

    body footer .footer-heading {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    body footer .footer-heading::after {
        margin-top: 0.4rem;
    }

    body footer .space-y-3 > * + * {
        margin-top: 0.55rem !important;
    }

    body footer .footer-logo {
        height: 44px;
        max-width: 180px;
    }

    body footer .md\:flex-row {
        flex-direction: column !important;
    }

    body footer .space-x-6 {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
        margin-left: 0;
    }

    body footer .space-x-6 > * + * {
        margin-left: 0 !important;
    }

    body footer .pt-8 {
        padding-top: 1.5rem !important;
    }

    body footer .qrcode-popup {
        left: 0;
        width: 116px;
        padding: 8px 8px 7px;
        transform: translate(0, 8px) scale(0.96);
        transform-origin: bottom left;
    }

    body footer .qrcode-popup::after {
        left: 14px;
        transform: none;
    }

    body footer .qrcode-popup img {
        width: 98px;
        height: 98px;
    }

    body footer .social-icon-wrapper:hover .qrcode-popup,
    body footer .social-icon-wrapper.active .qrcode-popup,
    body footer .social-icon-wrapper:focus-within .qrcode-popup {
        transform: translate(0, 0) scale(1);
    }
}

@media (max-width: 480px) {
    body .team-cta-section {
        min-height: 172px !important;
        padding: 1rem 0 !important;
    }

    body .team-cta-section .team-cta-card {
        min-height: 140px;
        gap: 0.85rem !important;
        padding: 0 0.75rem !important;
    }

    body .team-cta-section .team-cta-card .cta-image {
        flex-basis: 104px !important;
        width: 104px !important;
        height: 104px !important;
    }

    body .team-cta-section .team-cta-card .cta-content h2 {
        font-size: 0.92rem !important;
    }

    body .team-cta-section .team-cta-card .cta-content .cta-btn {
        padding: 0.38rem 0.72rem !important;
        font-size: 0.7rem !important;
    }

    body footer {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    body footer .gap-12 {
        gap: 1.5rem !important;
    }

    body footer .grid,
    body footer .grid-cols-1,
    body footer .md\:grid-cols-4 {
        gap: 1.5rem 1rem !important;
    }
}

/* Unified mobile typography hierarchy. Desktop typography is untouched. */
@media (max-width: 767px) {
    body .hero-title,
    body .banner-heading,
    body .news-banner .banner-heading,
    body .article-header h1,
    body .contact-title h1,
    body .contact-title-box h1,
    body .hero-swiper .text-6xl {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        letter-spacing: 0.02em !important;
    }

    body.page-index .hero-swiper h1.text-6xl {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }

    body .section-heading,
    body .section-heading-news,
    body .abouttitle,
    body .section-title-wrap h2,
    body .solution-section .section-main-title,
    body .tech-cards-section .section-title,
    body .jys-flow .flow-title,
    body .process-intro-title,
    body .social-text h2,
    body .qr-text h3 {
        width: auto !important;
        max-width: 100% !important;
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
        letter-spacing: 0.03em !important;
    }

    body .section-heading .heading-text,
    body .section-heading-news .heading-text,
    body .abouttitle .heading-text {
        font-size: inherit !important;
        line-height: inherit !important;
        white-space: normal !important;
    }

    body .section-heading .heading-arrow,
    body .section-heading-news .heading-arrow,
    body .abouttitle .heading-arrow {
        font-size: 1.5rem !important;
    }

    body .industry-card h3,
    body .news-card-title,
    body .solution-item .item-name,
    body .tech-card-item .card-name,
    body .process-card-name,
    body .mvv-item h3,
    body .recommend-card h3 {
        font-size: 1.05rem !important;
        line-height: 1.45 !important;
        letter-spacing: 0.02em !important;
    }

    body .zp-card-name,
    body .zp-diagram-title {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
    }
}
