/* ========================================
   乙梵装饰 - 侧滑菜单样式
   ======================================== */

:root {
    --menu-accent: #333;
}

/* 菜单容器 */
.staggered-menu-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

/* 头部导航栏 */
.sm-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #ffffff;
    z-index: 1001;
    pointer-events: auto;
}

.sm-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 菜单按钮 */
.sm-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #444;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.sm-toggle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sm-toggle-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sm-toggle[data-open="true"] .sm-toggle-icon {
    transform: rotate(180deg);
}

.sm-toggle[data-open="true"] .sm-toggle-icon svg {
    transform: rotate(180deg);
}

/* 右侧按钮 */
.sm-right-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s;
}

.sm-right-btn:active {
    opacity: 0.6;
}

.sm-right-btn svg {
    width: 22px;
    height: 22px;
}

/* 遮罩层 */
.sm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.4s ease;
    z-index: 998;
}

.sm-overlay.active {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

/* 预渲染层（动画用） */
.sm-prelayers {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    pointer-events: none;
    z-index: 999;
}

.sm-prelayer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.sm-prelayer:nth-child(1) {
    background: #f0f0f0;
    transition-delay: 0s;
}

.sm-prelayer:nth-child(2) {
    background: #e8e8e8;
    transition-delay: 0.05s;
}

.staggered-menu-wrapper[data-open="true"] .sm-prelayer {
    transform: translateX(0);
}

/* 菜单面板 */
.sm-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 70px 24px 24px;
    overflow-y: auto;
    z-index: 1000;
    pointer-events: auto;
    transform: translateX(-100%);
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.08s;
}

.staggered-menu-wrapper[data-open="true"] .sm-panel {
    transform: translateX(0);
}

/* 用户信息区域 */
.sm-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.sm-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
}

.sm-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sm-user-info {
    flex: 1;
}

.sm-user-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.sm-user-role {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 菜单列表 */
.sm-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sm-menu-item {
    overflow: hidden;
}

.sm-menu-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
    transform: translateX(-100%);
    opacity: 0;
}

.staggered-menu-wrapper[data-open="true"] .sm-menu-link {
    transform: translateX(0);
    opacity: 1;
}

/* 菜单项动画延迟 */
.sm-menu-item:nth-child(1) .sm-menu-link { transition-delay: 0.1s; }
.sm-menu-item:nth-child(2) .sm-menu-link { transition-delay: 0.15s; }
.sm-menu-item:nth-child(3) .sm-menu-link { transition-delay: 0.2s; }
.sm-menu-item:nth-child(4) .sm-menu-link { transition-delay: 0.25s; }
.sm-menu-item:nth-child(5) .sm-menu-link { transition-delay: 0.3s; }
.sm-menu-item:nth-child(6) .sm-menu-link { transition-delay: 0.35s; }
.sm-menu-item:nth-child(7) .sm-menu-link { transition-delay: 0.4s; }
.sm-menu-item:nth-child(8) .sm-menu-link { transition-delay: 0.45s; }

.sm-menu-link:active {
    background: #f5f5f5;
}

.sm-menu-link.active {
    background: #f0f0f0;
    color: var(--menu-accent);
}

.sm-menu-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
}

.sm-menu-icon svg {
    width: 22px;
    height: 22px;
}

.sm-menu-link.active .sm-menu-icon {
    color: var(--menu-accent);
}

.sm-menu-label {
    flex: 1;
}

.sm-menu-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-menu-arrow {
    color: #ccc;
    font-size: 14px;
}

/* 菜单分组 */
.sm-menu-group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.sm-menu-group-title {
    font-size: 12px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 16px;
}

/* 底部区域 */
.sm-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.sm-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: #333;
    background: transparent;
    border: none;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}

.sm-logout:active {
    background: #f5f5f5;
}

/* 页面内容区域 */
.page-with-menu {
    padding-top: 50px;
    min-height: 100vh;
    background: #ffffff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page-content {
    padding: 16px;
}
