/* ============================================================
   menu.css — 导航菜单与搜索组件样式
   ============================================================ */

/* ============================================================
   3. 桌面端导航
   ============================================================ */
.navigation {
    display: flex;
    align-items: center;
    position: relative;
}

.navigation__list {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navigation__data {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.navigation__item { display: flex; align-items: center; }

.navigation__link {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: color var(--menu-transition), background var(--menu-transition);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    white-space: nowrap;
    position: relative;
}

.navigation__link:hover { color: var(--color-primary); }
.navigation__link--active { color: var(--color-primary); }

.navigation__link--active::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 14px;
    right: 14px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 3px 3px 0 0;
}

/* ============================================================
   4. 汉堡按钮 + 移动端搜索按钮
   ============================================================ */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background var(--menu-transition);
    flex-shrink: 0;
}
.hamburger:hover { background: var(--color-bg-hover); }
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--menu-transition), opacity var(--menu-transition);
}
.hamburger--active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger--active span:nth-child(2) { opacity: 0; }
.hamburger--active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-search-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.mobile-search-btn:hover,
.mobile-search-btn:focus {
    background: rgba(225, 0, 15, 0.04);
    color: var(--brand-red);
    outline: none;
}
.mobile-search-btn svg { width: 20px; height: 20px; }
@media (max-width: 1023px) {
    .mobile-search-btn { display: inline-flex; }
}

/* ============================================================
   5. 移动端搜索遮罩层
   ============================================================ */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1200;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.mobile-search-overlay--open { display: block; opacity: 1; }
.mobile-search-overlay__inner {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: #fff;
    padding: 16px;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-search-overlay--open .mobile-search-overlay__inner { transform: translateY(0); }
.mobile-search-overlay__form { position: relative; display: flex; align-items: center; }
.mobile-search-overlay__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--color-text-light);
    pointer-events: none;
}
.mobile-search-overlay__input {
    flex: 1;
    height: 48px;
    padding: 0 48px 0 44px;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    background: #f5f7fa;
    color: var(--color-text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.mobile-search-overlay__input::placeholder { color: var(--color-text-light); }
.mobile-search-overlay__input:focus {
    background: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(225, 0, 15, 0.1);
}
.mobile-search-overlay__close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text-light);
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-search-overlay__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}

/* ============================================================
   6. 桌面端搜索框
   ============================================================ */
.nav-search {
    width: 220px;
    transition: width 0.25s ease;
}
.nav-search:focus-within { width: 280px; }
.nav-search .uk-search-input {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 50px;
    padding-left: 20px;
    padding-right: 40px;
    font-size: 0.9rem;
    height: 38px;
    transition: background 0.2s, box-shadow 0.2s;
}
.nav-search .uk-search-input:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(225, 0, 15, 0.15);
}
.nav-search .uk-search-input::placeholder { color: #999; }
.nav-search .uk-search-icon { color: #999; right: 14px; }

/* ============================================================
   10. 桌面端多级下拉面板
   ============================================================ */
.desktop-dropdown {
    display: none;
    position: fixed;
    top: var(--header-height-desktop);
    left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
}
.desktop-dropdown--open { opacity: 1; visibility: visible; display: block; }

.desktop-dropdown__container {
    display: flex;
    height: 100%;
    background: transparent;
    position: relative;
    overflow: visible;
}

.desktop-panel {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    overflow-y: auto;
    padding: 12px 0;
    background: var(--color-bg-white);
    flex-shrink: 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
    will-change: width, opacity;
    border-left: 1px solid var(--color-border);
}
.desktop-panel:first-child { border-left: none; }
.desktop-panel--visible { opacity: 1; overflow-y: auto; }
.desktop-panel--hidden { width: 0; opacity: 0; overflow: hidden; }

.desktop-panel__close-btn {
    display: none;
    position: sticky;
    top: 0;
    right: 0;
    background: var(--color-bg-white);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-text-light);
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
    z-index: 10;
    margin-left: auto;
    float: right;
    line-height: 1;
}
.desktop-panel__close-btn:hover {
    color: var(--color-text);
    background: var(--color-bg-hover);
}

.desktop-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 12px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0;
    position: sticky;
    top: 0;
    background: var(--color-bg-white);
    z-index: 5;
    min-width: max-content;
    height: 48px;
    box-sizing: border-box;
}

.desktop-panel__title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
    font-weight: 600;
    margin: 0;
    padding: 0;
    border: none;
    white-space: nowrap;
}

.desktop-panel[data-depth="0"] .desktop-panel__close-btn { display: block; }

.desktop-panel__list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: max-content;
}

.desktop-panel__item {
    border-radius: 0;
    position: relative;
}

.desktop-panel__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 44px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
    white-space: nowrap;
}
.desktop-panel__link:hover { color: var(--color-primary); }

.desktop-panel__link--has-children::after {
    content: '›';
    font-size: 28px;
    color: var(--color-text-light);
    font-weight: 300;
}

.desktop-panel__link--highlight { border-bottom: 1px solid var(--color-border); }
.desktop-panel__link--highlight::after {
    content: '';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 8px;
    border: 2px solid #777777;
    border-radius: 50%;
    transition: transform 0.25s ease, border-color 0.25s ease;
    background: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
    background-size: 20px 20px;
    background-position: center;
    background-repeat: no-repeat;
    transform: translateX(6px);
}

.desktop-panel__link--parent-active {
    color: var(--color-primary) !important;
    font-weight: 600;
}
.desktop-panel__link--parent-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 2px;
    background: var(--color-primary);
    border-radius: 0 2px 2px 0;
}

.desktop-panel__link--active { color: var(--color-primary); }
.desktop-panel__link--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 2px;
    background: var(--color-primary);
    border-radius: 0 2px 2px 0;
}

/* ============================================================
   11. 移动端菜单
   ============================================================ */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height-mobile);
    left: 0; right: 0; bottom: 0;
    background: var(--color-bg-white);
    z-index: 999;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    margin: 0;
}
.mobile-menu--open { transform: translateX(0); }

.mobile-menu__overlay {
    display: none;
    position: fixed;
    top: var(--header-height-mobile);
    left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    margin: 0;
	pointer-events: none;
}
.mobile-menu__overlay--visible { 
    display: block; opacity: 1; 
	pointer-events: auto;
}

.mobile-menu__container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.mobile-menu__panel {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-white);
    padding: 16px 20px 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
    will-change: transform;
    margin: 0;
    box-sizing: border-box;
}
.mobile-menu__panel--active { transform: translateX(0); z-index: 2; }

.mobile-menu__panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.mobile-menu__back-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    color: var(--color-primary);
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
}
.mobile-menu__back-btn::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-left: 3px solid var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
    transform: rotate(45deg);
    margin-left: 16px;
    margin-right: 6px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.mobile-menu__back-btn:hover { opacity: 0.7; }

.mobile-menu__panel-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.mobile-menu__panel-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.mobile-menu__panel-item {
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.mobile-menu__panel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    border-radius: 8px;
    transition: background 0.2s ease;
    margin: 0;
    box-sizing: border-box;
}
.mobile-menu__panel-link--has-children::after {
    content: '›';
    font-size: 28px;
    color: var(--color-text-light);
    font-weight: 300;
    flex-shrink: 0;
    margin-left: 12px;
}
.mobile-menu__panel-link--highlight::after {
    content: '';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-left: 8px;
    border: 2px solid #777777;
    border-radius: 50%;
    transition: transform 0.25s ease, border-color 0.25s ease;
    background: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
    background-size: 20px 20px;
    background-position: center;
    background-repeat: no-repeat;
    transform: translateX(10px);
}

/* ============================================================
   12. 响应式断点
   ============================================================ */
@media (min-width: 1024px) {
    .navigation { display: flex; }
    .hamburger { display: none; }
    .mobile-menu,
    .mobile-menu__overlay { display: none !important; }
    .desktop-dropdown { display: block; }
}

@media (max-width: 1023px) {
    .navigation { display: none; }
    .hamburger { display: flex; }
    .mobile-menu { display: block; }
    .mobile-menu__overlay { display: block; }
    .desktop-dropdown { display: none !important; }

    .header { height: var(--header-height-mobile); }
    .header__container { padding: 0 16px; }
    .header__logo { font-size: 17px; }
}

@media (max-width: 480px) {
    .header__logo { font-size: 15px; }
    .mobile-menu__panel { padding: 12px 16px 20px; }
    .mobile-menu__panel-link { padding: 12px 14px; font-size: 15px; }
}

@media (min-width: 1024px) and (max-width: 1200px) {
    .nav-search { width: 160px; }
    .nav-search:focus-within { width: 200px; }
    .navigation__link { padding: 8px 10px; font-size: 14px; }
    .lang-selector .lang-btn .lang-label { max-width: 56px; }
}
@media (min-width: 1024px) and (max-width: 1100px) {
    .nav-search { display: none !important; }
}