/* 外层包裹 */
.mm-wrapper {
    position: relative;
}

/* 汉堡按钮容器 —— PC 端完全隐藏 */
.mm-toggle-wrap {
    display: none;
}

/* 汉堡按钮本身 */
.mm-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none !important;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    color: #1f2937;
}

.mm-toggle:focus,
.mm-toggle:active,
.mm-toggle:hover {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.mm-toggle-icon {
    width: 24px;
    height: 24px;
}

.mm-icon-close {
    display: none;
}

.mm-wrapper.mm-active .mm-icon-open {
    display: none;
}

.mm-wrapper.mm-active .mm-icon-close {
    display: block;
}

/* 遮罩层 —— PC 端隐藏 */
.mm-overlay {
    display: none;
}

/* ========== 基础菜单栏 ========== */
.mm-bar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
    height: 50px;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
    position: relative;
}

/* 一级菜单项 */
.mm-top-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.mm-top-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s;
}

.mm-top-link:hover {
    text-decoration: none;
}

.mm-link-text {
    white-space: nowrap;
}

/* 下拉箭头 */
.mm-arrow {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    transition: transform 0.2s;
    line-height: 1;
}

.mm-arrow svg {
    width: 12px;
    height: 12px;
    stroke: #6b7280;
    fill: none;
}

.mm-top-item:hover > .mm-top-link .mm-arrow {
    transform: rotate(180deg);
}

/* 下拉面板（二级） */
.mm-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 1000;
    box-sizing: border-box;
}

.mm-top-item:hover > .mm-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 二级菜单项 */
.mm-sub-item {
    position: relative;
}

.mm-sub-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.mm-sub-link:hover {
    background-color: #f3f4f6;
    color: #2563eb;
    text-decoration: none;
}

.mm-sub-link .mm-arrow {
    transform: rotate(-90deg);
}

.mm-sub-item:hover > .mm-sub-link .mm-arrow {
    transform: rotate(-90deg);
}

/* 三级下拉面板 */
.mm-dropdown--sub {
    position: absolute;
    top: 0;
    left: 100%;
    transform: translateX(4px);
}

.mm-sub-item:hover > .mm-dropdown--sub {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ========== 超级菜单（全宽） ========== */
.mm-top-item.mm-has-mega {
    position: static;
}

.mm-dropdown--mega {
    width: 100vw;
    min-width: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

.mm-mega-content {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* ===========================================
   PC 端（> 1024px）—— 强制宽度 100%
   =========================================== */
@media (min-width: 1025px) {
    .mm-bar {
        width: 100% !important;
    }
}

/* ========================================
   移动端（≤ 1024px）—— 汉堡 + 侧滑面板
   ======================================== */
@media (max-width: 1024px) {

    /* 汉堡按钮容器 */
    .mm-toggle-wrap {
        display: flex;
        width: 100%;
    }

    /* 遮罩层 */
    .mm-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mm-wrapper.mm-active .mm-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* 侧边栏面板 */
    .mm-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        background-color: #ffffff;
        border-bottom: none !important;
        border-right: none !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 9999;
        padding: 24px 0 32px;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.12);
    }

    .mm-wrapper.mm-active .mm-bar {
        transform: translateX(0);
    }

    /* 侧栏滚动条 */
    .mm-bar::-webkit-scrollbar {
        width: 3px;
    }
    .mm-bar::-webkit-scrollbar-track {
        background: transparent;
    }
    .mm-bar::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 3px;
    }

    /* ---- 一级项 ---- */
    .mm-top-item {
        flex-direction: column;
        align-items: stretch;
        border-bottom: none;
        margin: 0;
    }

    .mm-top-link {
        padding: 14px 20px !important;
        justify-content: space-between !important;
        white-space: normal !important;
        line-height: 1.5 !important;
        border-radius: 0 !important;
        border-left: 3px solid transparent !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    }

    .mm-top-link:hover {
        background-color: #f7f7f8 !important;
    }

    .mm-top-item + .mm-top-item {
        border-top: 1px solid #f0f0f0;
    }

    /* 箭头过渡 */
    .mm-arrow {
        transition: transform 0.25s ease;
    }

    /* 禁用 hover 展开 */
    .mm-top-item:hover > .mm-dropdown {
        opacity: 0;
        visibility: hidden;
        transform: translateY(4px);
    }

    .mm-top-item:hover > .mm-top-link .mm-arrow {
        transform: none;
    }

    /* 点击展开 */
    .mm-top-item.mm-open > .mm-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        border-radius: 0 !important;
        box-shadow: none !important;
        min-width: 0;
        padding: 4px 0 8px;
        background-color: #fafbfc;
    }

    /* 移动端超级菜单复位 */
    .mm-top-item.mm-has-mega {
        position: relative;
    }

    .mm-top-item.mm-open > .mm-dropdown--mega {
        width: 100%;
        border-radius: 0 !important;
    }

    .mm-top-item.mm-open > .mm-top-link {
        color: #2563eb !important;
        background-color: #eff6ff !important;
        border-left-color: #2563eb !important;
    }

    .mm-top-item.mm-open > .mm-top-link .mm-arrow {
        transform: rotate(180deg);
    }

    .mm-top-item.mm-open > .mm-top-link .mm-arrow svg {
        stroke: #2563eb;
    }

    /* ---- 二级项 ---- */
    .mm-sub-link {
        padding: 12px 20px 12px 36px !important;
        white-space: normal !important;
        line-height: 1.5 !important;
        border-bottom: none !important;
        border-left: 3px solid transparent !important;
        font-size: 14px !important;
        color: #4b5563 !important;
        transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

    .mm-sub-link:hover {
        background-color: #f0f4f8 !important;
        color: #1d4ed8 !important;
    }

    .mm-sub-item:last-child > .mm-sub-link {
        border-bottom: none;
    }

    .mm-sub-item:hover > .mm-sub-link .mm-arrow {
        transform: rotate(-90deg);
    }

    .mm-sub-item:hover > .mm-dropdown--sub {
        opacity: 0;
        visibility: hidden;
    }

    /* 点击展开三级 */
    .mm-sub-item.mm-open > .mm-dropdown--sub {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        border-radius: 0 !important;
        box-shadow: none !important;
        min-width: 0;
        padding: 4px 0 6px;
        background-color: #f3f4f6;
    }

    .mm-sub-item.mm-open > .mm-sub-link {
        color: #2563eb !important;
        background-color: #eff6ff !important;
        border-left-color: #2563eb !important;
    }

    .mm-sub-item.mm-open > .mm-sub-link .mm-arrow {
        transform: rotate(180deg);
    }

    .mm-sub-item.mm-open > .mm-sub-link .mm-arrow svg {
        stroke: #2563eb;
    }

    /* ---- 三级项缩进 ---- */
    .mm-dropdown--sub .mm-sub-link {
        padding-left: 52px !important;
        font-size: 13px !important;
        color: #6b7280 !important;
    }

    .mm-dropdown--sub .mm-sub-link:hover {
        color: #2563eb !important;
        background-color: #eef2f7 !important;
    }
}
