/**
 * 左侧导航抽屉 - 纯 Material Design 3 样式
 * 覆盖 material-design-3.css 中的非 MD3 样式，实现完整 MD3 规范
 */

/* ===== 抽屉容器 ===== */
#navDrawer.mdc-drawer,
.mdc-drawer#navDrawer {
    background-color: transparent !important;
    left: var(--sanxio-drawer-card-side-inset, 0px) !important;
    width: min(var(--sanxio-drawer-card-width, 360px), calc(100vw - (var(--sanxio-drawer-card-side-inset, 0px) * 2))) !important;
    top: var(--sanxio-drawer-card-block-inset, 10px) !important;
    bottom: var(--sanxio-drawer-card-block-inset, 10px) !important;
    height: auto !important;
    max-height: var(--sanxio-drawer-card-max-height, calc(100dvh - 20px)) !important;
    border-radius: var(--sanxio-drawer-card-radius, 24px) !important;
    overflow: hidden !important;
    border: var(--sanxio-drawer-card-border, 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.12))) !important;
    box-shadow: none !important;
}

:root[data-theme="dark"] #navDrawer.mdc-drawer,
:root.theme-dark #navDrawer.mdc-drawer,
:root[data-theme="dark"] .mdc-drawer#navDrawer,
:root.theme-dark .mdc-drawer#navDrawer {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* ===== 抽屉头部 ===== */
#navDrawer .mdc-drawer__header,
.mdc-drawer#navDrawer .mdc-drawer__header {
    min-height: 64px !important;
    padding: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.12)) !important;
    background-color: var(--md-sys-color-surface, #fef7ff) !important;
}

#navDrawer .mdc-drawer__logo-img,
.mdc-drawer#navDrawer .mdc-drawer__logo-img {
    max-height: 40px !important;
    max-width: 180px !important;
    object-fit: contain !important;
}

#navDrawer .mdc-drawer__close,
.mdc-drawer#navDrawer .mdc-drawer__close {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-radius: 24px !important;
    color: var(--md-sys-color-on-surface-variant, #49454f) !important;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#navDrawer .mdc-drawer__close:hover,
.mdc-drawer#navDrawer .mdc-drawer__close:hover {
    background-color: var(--md-sys-color-surface-container-highest, rgba(0, 0, 0, 0.08)) !important;
    color: var(--md-sys-color-on-surface, #1c1b1f) !important;
}

:root[data-theme="dark"] #navDrawer .mdc-drawer__close:hover,
:root.theme-dark #navDrawer .mdc-drawer__close:hover,
:root[data-theme="dark"] .mdc-drawer#navDrawer .mdc-drawer__close:hover,
:root.theme-dark .mdc-drawer#navDrawer .mdc-drawer__close:hover {
    background-color: var(--md-sys-color-surface-container-highest, rgba(255, 255, 255, 0.08)) !important;
    color: var(--md-sys-color-on-surface, #e6e1e5) !important;
}

/* ===== 内容区 ===== */
#navDrawer .mdc-drawer__content,
.mdc-drawer#navDrawer .mdc-drawer__content {
    padding: 12px !important;
    background-color: var(--md-sys-color-surface, #fef7ff) !important;
}

#navDrawer .mdc-list,
.mdc-drawer#navDrawer .mdc-list {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

/* ===== 列表项 - MD3 规范 ===== */
#navDrawer .mdc-list-item,
.mdc-drawer#navDrawer .mdc-list-item {
    display: flex !important;
    align-items: center !important;
    min-height: 52px !important;
    padding: 0 16px 0 16px !important;
    margin: 0 !important;
    border-radius: 28px !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
    color: var(--md-sys-color-on-surface, #1c1b1f) !important;
    font-family: var(--md-sys-typescale-body-large-font, 'Roboto', sans-serif) !important;
    font-size: var(--md-sys-typescale-body-large-size, 16px) !important;
    font-weight: var(--md-sys-typescale-body-large-weight, 400) !important;
    line-height: var(--md-sys-typescale-body-large-line-height, 24px) !important;
    letter-spacing: var(--md-sys-typescale-body-large-tracking, 0.5px) !important;
    cursor: pointer !important;
    position: relative !important;
    background-color: var(--md-sys-color-surface, #fef7ff) !important;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

:root[data-theme="dark"] #navDrawer .mdc-list-item,
:root.theme-dark #navDrawer .mdc-list-item,
:root[data-theme="dark"] .mdc-drawer#navDrawer .mdc-list-item,
:root.theme-dark .mdc-drawer#navDrawer .mdc-list-item {
    background-color: var(--md-sys-color-surface-container, #211f26) !important;
}

/* 移除所有 ::before 伪元素（左侧竖条等） */
#navDrawer .mdc-list-item::before,
#navDrawer .mdc-list-item--activated::before,
.mdc-drawer#navDrawer .mdc-list-item::before,
.mdc-drawer#navDrawer .mdc-list-item--activated::before {
    display: none !important;
}

/* 图标 - MD3 24px */
#navDrawer .mdc-list-item__graphic,
.mdc-drawer#navDrawer .mdc-list-item__graphic {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    margin-right: 16px !important;
    font-size: 24px !important;
    color: var(--md-sys-color-on-surface-variant, #49454f) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
    flex-shrink: 0 !important;
}

#navDrawer .mdc-list-item__text,
.mdc-drawer#navDrawer .mdc-list-item__text {
    flex: 1 !important;
    font-family: var(--md-sys-typescale-body-large-font, 'Roboto', sans-serif) !important;
    font-size: var(--md-sys-typescale-body-large-size, 16px) !important;
    font-weight: var(--md-sys-typescale-body-large-weight, 400) !important;
    line-height: var(--md-sys-typescale-body-large-line-height, 24px) !important;
}

/* ===== 列表项 hover - MD3 state layer ===== */
#navDrawer .mdc-list-item:hover,
.mdc-drawer#navDrawer .mdc-list-item:hover {
    background-color: var(--md-sys-color-surface-container-high, rgba(0, 0, 0, 0.08)) !important;
}

:root[data-theme="dark"] #navDrawer .mdc-list-item:hover,
:root.theme-dark #navDrawer .mdc-list-item:hover,
:root[data-theme="dark"] .mdc-drawer#navDrawer .mdc-list-item:hover,
:root.theme-dark .mdc-drawer#navDrawer .mdc-list-item:hover {
    background-color: var(--md-sys-color-surface-container-highest, rgba(255, 255, 255, 0.08)) !important;
}

#navDrawer .mdc-list-item:hover .mdc-list-item__graphic,
.mdc-drawer#navDrawer .mdc-list-item:hover .mdc-list-item__graphic {
    color: var(--md-sys-color-on-surface-variant, #49454f) !important;
}

/* ===== 列表项 激活/选中 - MD3 ===== */
#navDrawer .mdc-list-item--activated,
.mdc-drawer#navDrawer .mdc-list-item--activated {
    background-color: color-mix(in srgb, var(--md-sys-color-primary-container, #eaddff) 92%, transparent) !important;
    color: var(--md-sys-color-on-primary-container, #21005d) !important;
    font-weight: 500 !important;
}

:root[data-theme="dark"] #navDrawer .mdc-list-item--activated,
:root.theme-dark #navDrawer .mdc-list-item--activated,
:root[data-theme="dark"] .mdc-drawer#navDrawer .mdc-list-item--activated,
:root.theme-dark .mdc-drawer#navDrawer .mdc-list-item--activated {
    background-color: color-mix(in srgb, var(--md-sys-color-primary-container, #4f378b) 78%, transparent) !important;
    color: var(--md-sys-color-on-primary-container, #eaddff) !important;
}

#navDrawer .mdc-list-item--activated .mdc-list-item__graphic,
.mdc-drawer#navDrawer .mdc-list-item--activated .mdc-list-item__graphic {
    color: inherit !important;
}

:root[data-theme="dark"] #navDrawer .mdc-list-item--activated .mdc-list-item__graphic,
:root.theme-dark #navDrawer .mdc-list-item--activated .mdc-list-item__graphic,
:root[data-theme="dark"] .mdc-drawer#navDrawer .mdc-list-item--activated .mdc-list-item__graphic,
:root.theme-dark .mdc-drawer#navDrawer .mdc-list-item--activated .mdc-list-item__graphic {
    color: inherit !important;
}

/* 激活状态 hover */
#navDrawer .mdc-list-item--activated:hover,
.mdc-drawer#navDrawer .mdc-list-item--activated:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-primary-container, #eaddff) 92%, transparent) !important;
}

:root[data-theme="dark"] #navDrawer .mdc-list-item--activated:hover,
:root.theme-dark #navDrawer .mdc-list-item--activated:hover,
:root[data-theme="dark"] .mdc-drawer#navDrawer .mdc-list-item--activated:hover,
:root.theme-dark .mdc-drawer#navDrawer .mdc-list-item--activated:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-primary-container, #4f378b) 84%, transparent) !important;
}

/* ===== 手机版：保持 28px 圆角，图标 24px ===== */
@media (max-width: 767px) {
    #navDrawer .mdc-drawer__content,
    .mdc-drawer#navDrawer .mdc-drawer__content {
        padding: 10px !important;
    }

    #navDrawer .mdc-list-item,
    .mdc-drawer#navDrawer .mdc-list-item {
        min-height: 50px !important;
        padding: 0 16px !important;
        border-radius: 24px !important;
    }

    #navDrawer .mdc-list,
    .mdc-drawer#navDrawer .mdc-list {
        gap: 0 !important;
    }
    
    #navDrawer .mdc-list-item__graphic,
    .mdc-drawer#navDrawer .mdc-list-item__graphic {
        width: 24px !important;
        height: 24px !important;
        font-size: 24px !important;
        margin-right: 16px !important;
    }
}

/* 右侧侧边栏定位覆盖 */
#navDrawer.mdc-drawer--end,
.mdc-drawer--end#navDrawer {
    left: auto !important;
    right: var(--sanxio-drawer-card-side-inset, 0px) !important;
}
