/**
 * Sidebar navigation — phone drill-down · tablet/desktop accordion
 */
.site-sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    background: #fff;
}

.site-sidebar-nav__toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    height: 56px;
    padding: 0 12px 0 8px;
    border-bottom: 1px solid #eef2f1;
    background: #fff;
}

.site-sidebar-nav__back,
.site-sidebar-nav__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.site-sidebar-nav__back:hover,
.site-sidebar-nav__back:focus-visible,
.site-sidebar-nav__close:hover,
.site-sidebar-nav__close:focus-visible {
    background: rgba(0, 133, 111, 0.08);
    color: #00856f;
}

.site-sidebar-nav__back[hidden] {
    display: none;
}

.site-sidebar-nav__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: #111827;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-sidebar-nav__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.site-sidebar-nav__list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.site-sidebar-nav__item {
    margin: 0;
}

.site-sidebar-nav__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    color: #1f2937;
    text-align: left;
    text-decoration: none;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.site-sidebar-nav__row:hover,
.site-sidebar-nav__row:focus-visible {
    color: #00856f;
    background: rgba(0, 133, 111, 0.04);
}

.site-sidebar-nav__item.is-open > .site-sidebar-nav__row--btn {
    color: #00856f;
    font-weight: 600;
}

.site-sidebar-nav__link-text {
    flex: 1;
    min-width: 0;
}

.site-sidebar-nav__chevron,
.site-sidebar-nav__arrow {
    flex-shrink: 0;
    color: #9ca3af;
    transition: color 0.2s ease, transform 0.25s ease;
}

.site-sidebar-nav__item.is-open .site-sidebar-nav__chevron {
    color: #00856f;
    transform: rotate(90deg);
}

.site-sidebar-nav__row:hover .site-sidebar-nav__arrow,
.site-sidebar-nav__row:focus-visible .site-sidebar-nav__arrow {
    color: #00856f;
    transform: translateX(2px);
}

.site-sidebar-nav__panel {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: min(58vh, 420px);
    background: #f7faf9;
    border-top: 1px solid #eef2f1;
    -webkit-overflow-scrolling: touch;
}

.site-sidebar-nav__panel[hidden] {
    display: none;
}

/* Phone: full-screen sub-panel drill-down */
@media (max-width: 767px) {
    .site-sidebar-nav.is-subview .site-sidebar-nav__list > .site-sidebar-nav__item:not(.is-open) {
        display: none;
    }

    .site-sidebar-nav.is-subview .site-sidebar-nav__lang {
        display: none;
    }

    .site-sidebar-nav.is-subview .site-sidebar-nav__item.is-open > .site-sidebar-nav__row--btn {
        display: none;
    }

    .site-sidebar-nav.is-subview .site-sidebar-nav__item.is-open > .site-sidebar-nav__panel {
        max-height: none;
        flex: 1;
        background: #fff;
        border-top: none;
        animation: siteSidebarSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .site-sidebar-nav.is-subview .site-sidebar-nav__body {
        overflow-y: auto;
    }
}

@keyframes siteSidebarSlideIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tablet / desktop sidebar: inline accordion */
@media (min-width: 768px) {
    .site-sidebar-nav__back {
        display: none !important;
    }

    .site-sidebar-nav__panel {
        max-height: none;
    }
}

.site-sidebar-nav__hero {
    margin: 16px 16px 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0faf8 0%, #f7faf9 100%);
    border: 1px solid rgba(0, 133, 111, 0.12);
    border-radius: 12px;
}

.site-sidebar-nav__hero-tagline {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.55;
    color: #4b5563;
}

.site-sidebar-nav__hero-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #00856f;
    text-decoration: none;
}

.site-sidebar-nav__hero-link:hover,
.site-sidebar-nav__hero-link:focus-visible {
    text-decoration: underline;
}

.site-sidebar-nav__section {
    margin: 0;
    padding: 8px 0 0;
}

.site-sidebar-nav__section-title {
    margin: 0;
    padding: 12px 20px 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #00856f;
}

.site-sidebar-nav__sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-sidebar-nav__sublist li {
    margin: 0;
}

.site-sidebar-nav__sublink {
    display: block;
    padding: 12px 20px 12px 24px;
    font-size: 15px;
    line-height: 1.45;
    color: #374151;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.site-sidebar-nav__sublink:hover,
.site-sidebar-nav__sublink:focus-visible {
    color: #00856f;
    background: rgba(0, 133, 111, 0.06);
    border-left-color: #00856f;
}

.site-sidebar-nav__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0 12px 8px;
}

.site-sidebar-nav__grid-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 88px;
    padding: 10px 6px;
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.site-sidebar-nav__grid-link:hover,
.site-sidebar-nav__grid-link:focus-visible {
    background: rgba(0, 133, 111, 0.06);
    border-color: rgba(0, 133, 111, 0.15);
    transform: translateY(-1px);
}

.site-sidebar-nav__grid-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.site-sidebar-nav__grid-icon img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.site-sidebar-nav__grid-label {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    color: #374151;
    text-align: center;
    word-break: break-word;
}

.site-sidebar-nav__grid-link:hover .site-sidebar-nav__grid-label,
.site-sidebar-nav__grid-link:focus-visible .site-sidebar-nav__grid-label {
    color: #00856f;
}

.site-sidebar-nav__footer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 12px 16px 0;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #00856f;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(0, 133, 111, 0.18);
    border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.site-sidebar-nav__footer-link:hover,
.site-sidebar-nav__footer-link:focus-visible {
    background: rgba(0, 133, 111, 0.06);
    border-color: rgba(0, 133, 111, 0.35);
}

.site-sidebar-nav__auth {
    margin-top: auto;
    padding: 12px 20px 0;
}

.site-sidebar-nav__login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: #00856f;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.site-sidebar-nav__login-btn:hover,
.site-sidebar-nav__login-btn:focus-visible {
    background: #006b59;
}

.site-sidebar-nav__lang {
    margin-top: 0;
    padding: 16px 20px 20px;
    border-top: 1px solid #eef2f1;
}

.site-sidebar-nav__lang-label {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
}

.site-sidebar-nav__lang-options {
    display: flex;
    gap: 8px;
}

.site-sidebar-nav__lang-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-sidebar-nav__lang-btn.is-active,
.site-sidebar-nav__lang-btn:hover,
.site-sidebar-nav__lang-btn:focus-visible {
    color: #00856f;
    background: rgba(0, 133, 111, 0.08);
    border-color: rgba(0, 133, 111, 0.25);
}

/* Legacy sidebar shell overrides when structured nav is present */
.side-menu .menu-outer:has([data-site-sidebar-nav]) .navigation,
.side-menu .menu-outer.has-structured-nav .navigation {
    display: none;
}

.info-group:has([data-site-sidebar-nav]) .upper-box,
.info-group:has([data-site-sidebar-nav]) .widget-heading,
.info-group.has-structured-nav .upper-box,
.info-group.has-structured-nav .widget-heading {
    display: none !important;
}

.info-group:has([data-site-sidebar-nav]) .sidebar-textwidget,
.info-group.has-structured-nav .sidebar-textwidget {
    padding: 0;
    height: 100%;
    box-sizing: border-box;
}

.info-group:has([data-site-sidebar-nav]) .xs-sidebar-widget,
.info-group.has-structured-nav .xs-sidebar-widget {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    left: 0 !important;
    right: auto;
    transform: translateX(-105%);
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease, visibility 0.28s ease;
}

.info-group.isActive:has([data-site-sidebar-nav]) .xs-sidebar-widget,
.info-group.has-structured-nav.isActive .xs-sidebar-widget {
    transform: translateX(0);
    pointer-events: auto;
    z-index: 999999;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease, visibility 0.28s ease;
}

.info-group.isActive:has([data-site-sidebar-nav]) .xs-overlay,
.info-group.has-structured-nav.isActive .xs-overlay {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    opacity: 1;
    visibility: visible;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
    z-index: 999998;
}

.info-group:has([data-site-sidebar-nav]) .sidebar-widget-container,
.info-group.has-structured-nav .sidebar-widget-container {
    top: 0;
    opacity: 1;
    visibility: visible;
    height: 100%;
}

.info-group:has([data-site-sidebar-nav]) .content-inner {
    height: 100%;
}

.info-group:has([data-site-sidebar-nav]) .side-menu-box {
    margin: 0;
}

.info-group:has([data-site-sidebar-nav]) .side-menu,
.info-group:has([data-site-sidebar-nav]) .side-menu .menu-outer {
    width: 100%;
}

/* ── Phone: full-screen menu (not iPad) ── */
@media (max-width: 767px) {
    .info-group:has([data-site-sidebar-nav]) .info-box,
    .info-group.has-structured-nav .info-box {
        display: none !important;
    }

    .info-group:has([data-site-sidebar-nav]) .xs-sidebar-widget,
    .info-group.has-structured-nav .xs-sidebar-widget {
        top: 0;
        bottom: 0;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: 100dvh;
        height: -webkit-fill-available;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none;
        border-radius: 0;
        box-sizing: border-box;
    }

    .info-group.isActive:has([data-site-sidebar-nav]) .xs-overlay,
    .info-group.has-structured-nav.isActive .xs-overlay {
        display: none !important;
    }

    .info-group:has([data-site-sidebar-nav]) .sidebar-textwidget,
    .info-group.has-structured-nav .sidebar-textwidget {
        width: 100%;
        height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .info-group:has([data-site-sidebar-nav]) .sidebar-widget-container,
    .info-group.has-structured-nav .sidebar-widget-container {
        height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .info-group:has([data-site-sidebar-nav]) .content-inner,
    .info-group.has-structured-nav .content-inner {
        min-height: 100%;
    }

    .site-sidebar-nav {
        height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .site-sidebar-nav__toolbar {
        padding: env(safe-area-inset-top, 0) max(12px, env(safe-area-inset-right, 0)) 0 max(16px, env(safe-area-inset-left, 0));
        min-height: calc(56px + env(safe-area-inset-top, 0px));
    }

    .site-sidebar-nav__lang {
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
        padding-left: max(0px, env(safe-area-inset-left, 0px));
        padding-right: max(0px, env(safe-area-inset-right, 0px));
    }
}

/* ── iPad (图二): wider drawer + contact block ── */
@media (min-width: 768px) and (max-width: 991px) {
    .info-group:has([data-site-sidebar-nav]) .info-box {
        display: block !important;
    }

    .info-group:has([data-site-sidebar-nav]) .sidebar-widget-container {
        top: 0;
        opacity: 1;
        visibility: visible;
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .info-group:has([data-site-sidebar-nav]) .content-inner {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .info-group:has([data-site-sidebar-nav]) .side-menu-box {
        flex: 0 0 auto;
        min-height: 0;
        overflow: visible;
    }

    .info-group:has([data-site-sidebar-nav]) .side-menu,
    .info-group:has([data-site-sidebar-nav]) .side-menu .menu-box,
    .info-group:has([data-site-sidebar-nav]) .side-menu .menu-outer {
        height: auto;
        overflow: visible !important;
    }

    .info-group:has([data-site-sidebar-nav]) .side-menu .mCustomScrollBox,
    .info-group:has([data-site-sidebar-nav]) .side-menu .mCSB_container {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .info-group:has([data-site-sidebar-nav]) .xs-sidebar-widget,
    .info-group.has-structured-nav .xs-sidebar-widget {
        width: min(100vw, 420px);
        max-width: min(100vw, 420px);
        height: 100dvh;
        max-height: 100dvh;
    }

    .info-group:has([data-site-sidebar-nav]) .info-box {
        flex-shrink: 0;
        padding: 28px 20px 32px !important;
    }

    .sidebar-info-contents .content-inner .info-box h3 {
        padding-left: 40px;
    }

    .sidebar-info-contents .content-inner .info-box h3::before {
        left: 4px;
    }

    .sidebar-info-contents .content-inner .info-box .info-list li {
        padding-left: 36px;
    }

    .sidebar-info-contents .content-inner .info-box .info-list li i {
        left: 4px;
    }

    .site-sidebar-nav__toolbar {
        padding: 0 16px;
    }

    .site-sidebar-nav__lang {
        display: none;
    }
}

/* ── Desktop (图三): sidebar via nav icon, contact visible ── */
@media (min-width: 992px) {
    .info-group:has([data-site-sidebar-nav]) .info-box {
        display: block !important;
        flex-shrink: 0;
        padding: 28px 20px 32px !important;
    }

    .info-group:has([data-site-sidebar-nav]) .sidebar-widget-container {
        top: 0;
        opacity: 1;
        visibility: visible;
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .info-group:has([data-site-sidebar-nav]) .content-inner {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .info-group:has([data-site-sidebar-nav]) .side-menu-box {
        flex: 0 0 auto;
        min-height: 0;
        overflow: visible;
    }

    .info-group:has([data-site-sidebar-nav]) .side-menu,
    .info-group:has([data-site-sidebar-nav]) .side-menu .menu-box,
    .info-group:has([data-site-sidebar-nav]) .side-menu .menu-outer {
        height: auto;
        overflow: visible !important;
    }

    .info-group:has([data-site-sidebar-nav]) .side-menu .mCustomScrollBox,
    .info-group:has([data-site-sidebar-nav]) .side-menu .mCSB_container {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .info-group:has([data-site-sidebar-nav]) .sidebar-textwidget {
        padding: 0;
    }

    .info-group:has([data-site-sidebar-nav]) .xs-sidebar-widget {
        width: min(100vw, 400px);
        max-width: min(100vw, 400px);
        overflow-x: hidden;
        overflow-y: auto;
    }

    .sidebar-info-contents .content-inner .info-box h3 {
        padding-left: 40px;
    }

    .sidebar-info-contents .content-inner .info-box h3::before {
        left: 4px;
    }

    .sidebar-info-contents .content-inner .info-box .info-list li {
        padding-left: 36px;
    }

    .sidebar-info-contents .content-inner .info-box .info-list li i {
        left: 4px;
    }

    .site-sidebar-nav__toolbar {
        padding: 0 16px;
    }

    .site-sidebar-nav__lang {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-sidebar-nav.is-subview .site-sidebar-nav__item.is-open > .site-sidebar-nav__panel {
        animation: none;
    }

    .site-sidebar-nav__grid-link:hover,
    .site-sidebar-nav__grid-link:focus-visible {
        transform: none;
    }
}
