/**
 * 移动端抽屉 v2 ── Hero 渐变 + 快捷宫格 + 极简列表
 * --------------------------------------------------------------
 * 设计目标：
 *   1. 用户身份卡作为视觉焦点（橙色 Hero 渐变）
 *   2. 高频功能（消息/投稿/收藏/VIP）放中间宫格化
 *   3. 顶部主题切换图标化，不再占据大块视觉
 *   4. 菜单列表极简，独立项 hover 高亮，子菜单 accordion
 *
 * 容器: #cscj_modal_menu .cscj-modal-content
 * 兼容 JS 钩子（nav.js / menu-collapse.js）：
 *   - .cscj-modal-menu.show          抽屉开关
 *   - .cscj-mobile-menu              菜单根
 *   - .has-children, .show, .menu-arrow, .sub-nav, .sub-nav-grid, .menu-mode-switch
 */

/* ============================================================
 *  1. 主题变量
 * ============================================================ */
.cscj-modal-menu {
    /* 基础色板 */
    --d-bg:        #f3f5fa;
    --d-card:      #ffffff;
    --d-card-2:    #f7f8fb;
    --d-border:    rgba(15, 23, 42, 0.08);
    --d-divider:   rgba(15, 23, 42, 0.05);
    --d-text:      #111827;
    --d-text-2:    #4b5563;
    --d-text-3:    #9ca3af;

    /* 强调色 */
    --d-accent:        #ff6000;
    --d-accent-2:      #ff8a3d;
    --d-accent-soft:   rgba(255, 96, 0, 0.10);
    --d-accent-on:     #ffffff;
    --d-vip:           #f5a524;
    --d-vip-soft:      rgba(245, 165, 36, 0.14);
    --d-danger:        #ef4444;
    --d-danger-soft:   rgba(239, 68, 68, 0.12);

    /* Hero 渐变（用户卡背景） */
    --d-hero-grad: linear-gradient(135deg, #ff8a3d 0%, #ff6000 60%, #ed4f00 100%);
    --d-hero-glow: radial-gradient(circle at 80% 20%, rgba(255, 220, 180, 0.45), transparent 60%);

    /* 阴影 */
    --d-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --d-shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
    --d-shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.12);
    --d-shadow-hero: 0 14px 30px rgba(255, 96, 0, 0.32);

    /* 圆角与节奏（整体去圆角化，pill 仅留给圆形元素使用） */
    --d-r-sm: 4px;
    --d-r-md: 6px;
    --d-r-lg: 8px;
    --d-r-pill: 999px;
    --d-pad: 16px;
    --d-gap: 14px;
}

body.theme-dark .cscj-modal-menu,
body.dark-theme .cscj-modal-menu {
    --d-bg:        #0d1117;
    --d-card:      #161b22;
    --d-card-2:    #1f242c;
    --d-border:    rgba(148, 163, 184, 0.14);
    --d-divider:   rgba(148, 163, 184, 0.08);
    --d-text:      #e5e7eb;
    --d-text-2:    #9ca3af;
    --d-text-3:    #6b7280;

    --d-accent:        #ff7a2f;
    --d-accent-2:      #ff9c5a;
    --d-accent-soft:   rgba(255, 122, 47, 0.16);
    --d-vip:           #f5b942;
    --d-vip-soft:      rgba(245, 185, 66, 0.18);
    --d-danger-soft:   rgba(239, 68, 68, 0.16);

    --d-hero-grad: linear-gradient(135deg, #f97316 0%, #c2410c 60%, #7c2d12 100%);
    --d-hero-glow: radial-gradient(circle at 80% 20%, rgba(255, 200, 150, 0.18), transparent 60%);

    --d-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
    --d-shadow-md: 0 8px 22px rgba(0, 0, 0, 0.4);
    --d-shadow-lg: 0 18px 36px rgba(0, 0, 0, 0.5);
    --d-shadow-hero: 0 14px 30px rgba(0, 0, 0, 0.55);
}

/* ============================================================
 *  2. 容器、过渡、滚动锁、隐藏父主题浮动元素
 *
 *  布局：
 *    .cscj-modal-menu  ── 顶部从导航栏下方开始，全屏遮罩层
 *    .cscj-modal-content ── 右侧 78%（最大 380px）抽屉本体，从右滑入
 *    导航栏始终保持在抽屉之上；左侧空白点击 → nav.js `e.target === this` 关闭
 * ============================================================ */
.cscj-modal-menu {
    /* 导航栏高度（与 nav.css `.cscj-header { height: 66px }` 一致） */
    --cscj-header-h: 66px;
    position: fixed;
    /* 顶部留出导航栏高度 → 抽屉位于导航栏下方 */
    inset: var(--cscj-header-h) 0 0 0;
    /* 998: 低于 .cscj-header(999)，确保导航栏始终可见、可交互 */
    z-index: 998;
    background: rgba(15, 23, 42, 0);
    color: var(--d-text);
    opacity: 1;
    visibility: hidden;
    transition: background 0.32s ease, visibility 0.32s ease;
    box-sizing: border-box;
}

.cscj-modal-menu.show {
    visibility: visible;
    background: rgba(15, 23, 42, 0.42); /* 遮罩 */
}

body.theme-dark .cscj-modal-menu.show,
body.dark-theme .cscj-modal-menu.show {
    background: rgba(0, 0, 0, 0.55);
}

.cscj-modal-menu *,
.cscj-modal-menu *::before,
.cscj-modal-menu *::after {
    box-sizing: border-box;
}

/* 抽屉本体：右侧 78%（最大 380px），从右滑入 */
.cscj-modal-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 78%;
    max-width: 380px;
    min-width: 280px;
    background: var(--d-bg);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 24px);
    -webkit-overflow-scrolling: touch;
    outline: none;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -16px 0 36px rgba(15, 23, 42, 0.18);
}

.cscj-modal-menu.show .cscj-modal-content {
    transform: translateX(0);
}

body.theme-dark .cscj-modal-content,
body.dark-theme .cscj-modal-content {
    box-shadow: -16px 0 36px rgba(0, 0, 0, 0.5);
}

/* 抽屉打开时（nav.js 给 html/body 加 .cscj-scroll-lock）隐藏父主题浮动 / 底部 tabbar */
html.cscj-scroll-lock .footer-tabbar,
body.cscj-scroll-lock .footer-tabbar,
html.cscj-scroll-lock .float-right,
body.cscj-scroll-lock .float-right,
html.cscj-scroll-lock .mobile-fixed-bar,
body.cscj-scroll-lock .mobile-fixed-bar {
    display: none !important;
}

/* 兼容：保留旧 .menu-mode-switch / .cscj-mobile-mode-switch 为隐藏（避免 nav.css 全局样式干扰） */
.cscj-modal-menu .menu-mode-switch.cscj-mobile-mode-switch {
    display: none !important;
}

/* ============================================================
 *  4. Hero 用户卡（橙色渐变焦点）
 * ============================================================ */
.cscj-drawer-hero {
    position: relative;
    margin: var(--d-pad) var(--d-pad) 0;
    padding: 16px;
    border-radius: var(--d-r-lg);
    background: var(--d-hero-grad);
    color: #ffffff;
    box-shadow: var(--d-shadow-hero);
    overflow: hidden;
    isolation: isolate;
}

.cscj-drawer-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--d-hero-glow);
    pointer-events: none;
    z-index: -1;
}

/* —— 已登录：头像 + 名字 + 积分 + 箭头 —— */
.cscj-drawer-hero__head {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.cscj-drawer-hero__avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cscj-drawer-hero__avatar img,
.cscj-drawer-hero__avatar .avatar {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.cscj-drawer-hero__info {
    flex: 1 1 auto;
    min-width: 0;
}

.cscj-drawer-hero__name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.cscj-drawer-hero__vip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 18px;
    padding: 0 7px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.cscj-drawer-hero__vip i {
    font-size: 10px;
    color: #fff5cc;
}

.cscj-drawer-hero__meta {
    margin: 5px 0 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.3;
}

.cscj-drawer-hero__meta .enter {
    /* 在 2/3 宽度下保证不折行 */
    white-space: nowrap;
}

.cscj-drawer-hero__meta .points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.cscj-drawer-hero__meta .points i {
    font-size: 11px;
    color: #ffd76a;
}

.cscj-drawer-hero__chevron {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* —— 已登录：底部 chip 操作行 —— */
.cscj-drawer-hero__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.18);
}

.cscj-drawer-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    min-width: 26px;
    /* 去圆角化：不再 pill */
    border-radius: var(--d-r-sm);
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1;
}

.cscj-drawer-chip i {
    font-size: 11px;
}

.cscj-drawer-chip:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.cscj-drawer-chip:active {
    transform: scale(0.96);
}

.cscj-drawer-chip.is-primary {
    background: #ffffff;
    color: var(--d-accent);
}

.cscj-drawer-chip.is-primary:hover {
    background: #fff8f0;
    color: var(--d-accent);
}

.cscj-drawer-chip.is-icon {
    width: 26px;
    padding: 0;
}

.cscj-drawer-chip[ed-text] {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    cursor: default;
}

.cscj-drawer-chip.is-logout {
    margin-left: auto;
}

/* —— 未登录：欢迎文案 + 登录/注册 —— */
.cscj-drawer-hero--guest .cscj-drawer-hero__head {
    align-items: flex-start;
}

.cscj-drawer-hero--guest .cscj-drawer-hero__name {
    font-size: 18px;
}

.cscj-drawer-hero--guest .cscj-drawer-hero__sub {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.cscj-drawer-hero--guest .cscj-drawer-hero__actions {
    justify-content: flex-start;
}

.cscj-drawer-hero--guest .cscj-drawer-chip {
    flex: 1 1 0;
    height: 32px;
    font-size: 12.5px;
}

/* ============================================================
 *  5. 快捷宫格（消息/投稿/收藏/VIP）
 * ============================================================ */
.cscj-drawer-quickgrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: var(--d-gap) var(--d-pad) 0;
}

.cscj-drawer-quickgrid__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 4px;
    border-radius: var(--d-r-md);
    background: var(--d-card);
    border: 1px solid var(--d-border);
    box-shadow: var(--d-shadow-sm);
    color: var(--d-text-2);
    text-decoration: none;
    text-align: center;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    position: relative;
}

.cscj-drawer-quickgrid__item:hover {
    background: var(--d-accent-soft);
    border-color: transparent;
    color: var(--d-accent);
}

.cscj-drawer-quickgrid__item:active {
    transform: scale(0.96);
}

.cscj-drawer-quickgrid__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--d-accent-soft);
    color: var(--d-accent);
    font-size: 14px;
    transition: background 0.18s ease, color 0.18s ease;
}

.cscj-drawer-quickgrid__item:hover .cscj-drawer-quickgrid__icon {
    background: var(--d-accent);
    color: var(--d-accent-on);
}

.cscj-drawer-quickgrid__item--vip .cscj-drawer-quickgrid__icon {
    background: var(--d-vip-soft);
    color: var(--d-vip);
}

.cscj-drawer-quickgrid__item--vip:hover .cscj-drawer-quickgrid__icon {
    background: var(--d-vip);
    color: #ffffff;
}

.cscj-drawer-quickgrid__label {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.cscj-drawer-quickgrid__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--d-danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--d-card);
}

/* ============================================================
 *  6. 搜索胶囊
 * ============================================================ */
.cscj-drawer-search {
    margin: var(--d-gap) var(--d-pad) 0;
}

.cscj-drawer-search form {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 4px 0 12px;
    background: var(--d-card);
    border: 1px solid var(--d-border);
    /* 去圆角化：从 pill 改为小圆角 */
    border-radius: var(--d-r-md);
    box-shadow: var(--d-shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cscj-drawer-search form:focus-within {
    border-color: var(--d-accent);
    box-shadow: 0 0 0 3px var(--d-accent-soft);
}

.cscj-drawer-search .icon-search {
    color: var(--d-text-3);
    font-size: 14px;
    margin-right: 8px;
}

.cscj-drawer-search input[type="text"],
.cscj-drawer-search .cscj-txt {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--d-text);
    font-size: 14px;
    line-height: 1;
    padding: 0;
    box-shadow: none;
}

.cscj-drawer-search input[type="text"]::placeholder,
.cscj-drawer-search .cscj-txt::placeholder {
    color: var(--d-text-3);
}

.cscj-drawer-search button[type="submit"],
.cscj-drawer-search .cscj-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 0;
    /* 与搜索框一致的小圆角 */
    border-radius: var(--d-r-sm);
    background: linear-gradient(135deg, var(--d-accent-2), var(--d-accent));
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, filter 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    line-height: 1;
}

.cscj-drawer-search button[type="submit"]:hover,
.cscj-drawer-search .cscj-btn:hover {
    filter: brightness(1.06);
}

.cscj-drawer-search button[type="submit"]:active,
.cscj-drawer-search .cscj-btn:active {
    transform: scale(0.94);
}

.cscj-drawer-search button[type="submit"] i,
.cscj-drawer-search .cscj-btn i {
    font-size: 14px;
}

.cscj-drawer-section.cscj-drawer-translate {
    margin-top: 14px;
}

.cscj-drawer-translate__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cscj-drawer-translate__item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--d-r-md);
    background: var(--d-card);
    border: 1px solid var(--d-border);
    box-shadow: var(--d-shadow-sm);
    color: var(--d-text-2);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cscj-drawer-translate__item:hover,
.cscj-drawer-translate__item.active {
    background: var(--d-accent-soft);
    border-color: transparent;
    color: var(--d-accent);
}

.cscj-drawer-translate__item:active {
    transform: scale(0.96);
}

.cscj-drawer-translate__icon {
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--d-r-sm);
    background: var(--d-card-2);
    color: currentColor;
    overflow: hidden;
}

.cscj-drawer-translate__icon svg,
.cscj-drawer-translate__icon i {
    display: block;
    width: 16px;
    height: 16px;
    margin: 0 !important;
    font-size: 14px;
    line-height: 1;
}

.cscj-drawer-translate__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
 *  7. 分组标题（极简，无大色块）
 * ============================================================ */
.cscj-drawer-section {
    margin: 18px var(--d-pad) 0;
}

.cscj-drawer-section__title {
    margin: 0 0 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.08em;
    color: var(--d-text-3);
    text-transform: uppercase;
}

.cscj-drawer-section__title::before {
    display: none;
}

/* ============================================================
 *  8. 极简菜单列表
 * ============================================================ */
/* 菜单根：去除外层卡片包裹（避免与抽屉底色形成双层背景），菜单项直接平铺 */
.cscj-modal-menu .cscj-mobile-menu,
.cscj-modal-menu .cscj-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.cscj-modal-menu .cscj-mobile-menu ul,
.cscj-modal-menu .cscj-menu-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 菜单项之间用淡色 divider 划分（代替原来的外层卡片） */
.cscj-modal-menu .cscj-mobile-menu .menu-item,
.cscj-modal-menu .cscj-menu-list .menu-item {
    margin: 0;
    position: relative;
}

.cscj-modal-menu .cscj-mobile-menu > .menu-item + .menu-item,
.cscj-modal-menu .cscj-menu-list > .menu-item + .menu-item {
    border-top: 1px solid var(--d-divider);
}

.cscj-modal-menu .cscj-mobile-menu .menu-item > a,
.cscj-modal-menu .cscj-menu-list .menu-item > a,
.cscj-modal-menu .cscj-mobile-menu .menu-item > .link-0,
.cscj-modal-menu .cscj-menu-list .menu-item > .link-0 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--d-r-sm);
    color: var(--d-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    background: transparent;
    transition: background 0.16s ease, color 0.16s ease;
}

.cscj-modal-menu .cscj-mobile-menu .menu-item > a:hover,
.cscj-modal-menu .cscj-menu-list .menu-item > a:hover,
.cscj-modal-menu .cscj-mobile-menu .menu-item > .link-0:hover,
.cscj-modal-menu .cscj-menu-list .menu-item > .link-0:hover {
    background: var(--d-accent-soft);
    color: var(--d-accent);
}

.cscj-modal-menu .cscj-mobile-menu .menu-item > a:active,
.cscj-modal-menu .cscj-menu-list .menu-item > a:active,
.cscj-modal-menu .cscj-mobile-menu .menu-item > .link-0:active,
.cscj-modal-menu .cscj-menu-list .menu-item > .link-0:active {
    background: var(--d-card-2);
}

/* 子菜单触发项右侧留出箭头位 */
.cscj-modal-menu .cscj-mobile-menu .has-children > a,
.cscj-modal-menu .cscj-mobile-menu .has-children > .link-0,
.cscj-modal-menu .cscj-menu-list .has-children > a {
    padding-right: 44px;
}

/* —— 主体（图标 + 文字 + badge） —— */
.cscj-modal-menu .cscj-mobile-menu .menu-item > a > .menu-item-main,
.cscj-modal-menu .cscj-menu-list .menu-item > a > .menu-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.cscj-modal-menu .cscj-mobile-menu .menu-item > a > .menu-item-main > .menu-item-label,
.cscj-modal-menu .cscj-menu-list .menu-item > a > .menu-item-main > .menu-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cscj-modal-menu .cscj-mobile-menu .menu-item > a > .menu-item-main > .menu-item-badges,
.cscj-modal-menu .cscj-menu-list .menu-item > a > .menu-item-main > .menu-item-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.cscj-modal-menu .cscj-mobile-menu .menu-item > a > .menu-item-main > .menu-item-badges > badge,
.cscj-modal-menu .cscj-menu-list .menu-item > a > .menu-item-main > .menu-item-badges > badge {
    margin: 0;
    transform: none;
    padding: 0 7px;
    height: 18px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    background: var(--d-accent-soft);
    color: var(--d-accent);
    box-shadow: none;
    border: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* —— 图标（圆角软方块，与父主题样式独立） —— */
.cscj-modal-menu .cscj-mobile-menu .menu-icon,
.cscj-modal-menu .cscj-menu-list .menu-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--d-card-2) !important;
    color: var(--d-text-2) !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 13px;
    line-height: 1;
    position: relative;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.cscj-modal-menu .cscj-mobile-menu .menu-icon i,
.cscj-modal-menu .cscj-menu-list .menu-icon i {
    line-height: 1;
}

.cscj-modal-menu .cscj-mobile-menu .menu-item > a:hover .menu-icon,
.cscj-modal-menu .cscj-menu-list .menu-item > a:hover .menu-icon {
    background: var(--d-accent) !important;
    color: var(--d-accent-on) !important;
}

/* 红点（菜单图标右上角） */
.cscj-modal-menu .menu-icon badge,
.cscj-modal-menu .mobile-msg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--d-danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 2px solid var(--d-card);
    box-sizing: content-box;
    box-shadow: none;
}

/* ============================================================
 *  9. 子菜单（accordion 列表 + 网格）
 * ============================================================ */
/* 箭头：相对 <li> 顶部固定定位（li 展开后高度变化时箭头不会跑偏到中部） */
.cscj-modal-menu .menu-arrow {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--d-text-3);
    cursor: pointer;
    z-index: 2;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    line-height: 1;
    touch-action: manipulation;
    transition: background 0.18s ease, color 0.18s ease;
    transform: none;
}

.cscj-modal-menu .menu-arrow::after {
    content: '\f107'; /* fa-angle-down */
    font-family: 'FontAwesome';
    font-size: 14px;
    line-height: 1;
    transition: transform 0.3s ease;
    display: inline-block;
    transform: rotate(0deg);
}

.cscj-modal-menu .menu-arrow:hover {
    background: var(--d-card-2);
    color: var(--d-text);
}

.cscj-modal-menu .menu-arrow.open {
    color: var(--d-accent);
    background: var(--d-accent-soft);
}

.cscj-modal-menu .menu-arrow.open::after {
    transform: rotate(180deg);
}

.cscj-modal-menu .menu-arrow:focus-visible {
    outline: 2px solid var(--d-accent);
    outline-offset: 2px;
}

/* —— 列表式子菜单 —— */
.cscj-modal-menu .cscj-mobile-menu .sub-nav {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    background: transparent;
    height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: height 0.3s ease, opacity 0.3s ease;
}

.cscj-modal-menu .cscj-mobile-menu .has-children.show > .sub-nav,
.cscj-modal-menu .cscj-mobile-menu .sub-nav.show {
    display: block;
    height: auto;
    opacity: 1;
    visibility: visible;
    overflow: visible;
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav .menu-item > a,
.cscj-modal-menu .cscj-mobile-menu .sub-nav .menu-item > .link-1 {
    padding-left: 32px;
    font-size: 13.5px;
    color: var(--d-text-2);
    font-weight: 400;
    background: transparent;
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav .menu-item > a:hover,
.cscj-modal-menu .cscj-mobile-menu .sub-nav .menu-item > .link-1:hover {
    color: var(--d-accent);
    background: var(--d-accent-soft);
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav .menu-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 11px;
}

/* 三级菜单 */
.cscj-modal-menu .cscj-mobile-menu .sub-nav .sub-nav .menu-item > a,
.cscj-modal-menu .cscj-mobile-menu .sub-nav .sub-nav .menu-item > .link-1 {
    padding-left: 48px;
    font-size: 13px;
    color: var(--d-text-3);
}

/* —— 网格式子菜单（menu-collapse.js 切到 .sub-nav-grid） —— */
.cscj-modal-menu .cscj-mobile-menu .has-children.show > .sub-nav.sub-nav-grid,
.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid.show {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    height: auto;
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid .menu-item {
    margin: 0;
    border: 0 !important;
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid .menu-item > a {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 10px 4px;
    border-radius: var(--d-r-sm);
    background: var(--d-card-2);
    border: 1px solid var(--d-border);
    font-size: 12px;
    color: var(--d-text);
    font-weight: 500;
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid .menu-item > a:hover {
    background: var(--d-accent-soft);
    border-color: transparent;
    color: var(--d-accent);
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid .menu-item > a:active {
    transform: scale(0.96);
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid .menu-icon {
    margin: 0;
    width: 30px;
    height: 30px;
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid .menu-text {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    color: inherit;
}

.cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid .has-children > .menu-arrow {
    position: absolute;
    right: 4px;
    top: 4px;
    transform: none;
    width: 20px;
    height: 20px;
}

/* —— 子菜单内的列表/网格切换器（menu-collapse.js 注入的） —— */
.cscj-modal-menu .cscj-mobile-menu .menu-mode-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 4px 8px;
    background: transparent;
    border: 0;
    border-bottom: 0;
    position: static;
    box-shadow: none;
}

.cscj-modal-menu .cscj-mobile-menu .menu-mode-switch .switch-btn {
    width: 28px;
    height: 28px;
    min-width: 0;
    padding: 0;
    border-radius: 8px;
    background: var(--d-card-2);
    color: var(--d-text-3);
    border: 1px solid var(--d-border);
    font-size: 11px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cscj-modal-menu .cscj-mobile-menu .menu-mode-switch .switch-btn.active {
    background: var(--d-accent);
    color: var(--d-accent-on);
    border-color: transparent;
}

/* ============================================================
 *  10. senior-submenu（图文/链接列）适配
 * ============================================================ */
.cscj-modal-menu .cscj-mobile-menu .senior-submenu {
    padding: 8px;
    background: transparent;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .graphic-card-items-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .menu-graphic-card-item a {
    display: block;
    padding: 10px;
    background: var(--d-card-2);
    border: 1px solid var(--d-border);
    border-radius: var(--d-r-sm);
    text-align: left;
    color: var(--d-text);
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .menu-graphic-card-item .img-box {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / var(--img-scale, 1);
    border-radius: 8px;
    overflow: hidden;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .menu-graphic-card-item .title {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--d-text);
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .links-columns-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .links-column {
    padding: 10px;
    background: var(--d-card-2);
    border: 1px solid var(--d-border);
    border-radius: var(--d-r-sm);
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .links-column .column-title > a {
    display: block;
    padding: 0 0 6px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--d-text);
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .links-items {
    display: flex;
    flex-direction: column;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .links-items .link-item > a {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--d-divider);
    background: transparent;
    color: var(--d-text-2);
    font-size: 13px;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .links-items .link-item:first-child > a {
    border-top: 0;
    padding-top: 0;
}

.cscj-modal-menu .cscj-mobile-menu .senior-submenu .link-item .icon-hover-show {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.45;
}

/* ============================================================
 *  10.5 Hero 操作行主题切换（与已签到 / 退出 chip 同级）
 *
 *  设计：复用 .cscj-drawer-chip.is-icon 样式，重点是强制覆盖
 *    父主题 .switch-btn 全局污染（白底描边、hover translateY 等）。
 *    白天显示 .theme-light-btn（月亮→点击到夜间），夜间反之。
 * ============================================================ */
.cscj-hero-theme {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

/* Hero 操作行内主题切换按钮：覆盖父主题 .switch-btn 全局样式 */
.cscj-hero-theme .switch-btn {
    /* 重置父主题残留样式 */
    min-width: 0 !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    font: inherit !important;
    line-height: 1 !important;
    /* 采用 chip 风格：白色半透明背景，与橙色 Hero 卡融合 */
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    border-radius: var(--d-r-sm) !important;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease !important;
    -webkit-appearance: none;
    appearance: none;
    transform: none !important;
}

.cscj-hero-theme .switch-btn i {
    font-size: 12px !important;
    line-height: 1;
}

.cscj-hero-theme .switch-btn:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

.cscj-hero-theme .switch-btn:active {
    transform: scale(0.94) !important;
}

.cscj-hero-theme .switch-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* 抑制父主题 ::after tooltip */
.cscj-hero-theme .switch-btn::after,
.cscj-hero-theme .switch-btn::before {
    content: none !important;
    display: none !important;
}

/* 白天模式仅显示月亮（点击切到夜间），夜间反之 */
.cscj-hero-theme .theme-dark-btn {
    display: none !important;
}

body.theme-dark .cscj-hero-theme .theme-light-btn,
body.dark-theme .cscj-hero-theme .theme-light-btn {
    display: none !important;
}

body.theme-dark .cscj-hero-theme .theme-dark-btn,
body.dark-theme .cscj-hero-theme .theme-dark-btn {
    display: inline-flex !important;
    /* 暗色模式下太阳图标用暖黄色 */
    color: #ffd76a !important;
}

body.theme-dark .cscj-hero-theme .theme-dark-btn:hover,
body.dark-theme .cscj-hero-theme .theme-dark-btn:hover {
    background: rgba(255, 215, 106, 0.22) !important;
    color: #ffd76a !important;
}

/* ============================================================
 *  11. 响应式 + 滚动条美化
 * ============================================================ */
@media (max-width: 360px) {
    .cscj-modal-menu {
        --d-pad: 12px;
        --d-gap: 12px;
    }

    .cscj-drawer-hero {
        padding: 14px;
    }

    .cscj-drawer-hero__avatar {
        width: 44px;
        height: 44px;
    }

    .cscj-drawer-hero__name {
        font-size: 15px;
    }

    .cscj-drawer-quickgrid {
        gap: 6px;
    }

    .cscj-drawer-quickgrid__icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .cscj-drawer-quickgrid__label {
        font-size: 11px;
    }

    .cscj-modal-menu .cscj-mobile-menu .has-children.show > .sub-nav.sub-nav-grid,
    .cscj-modal-menu .cscj-mobile-menu .sub-nav.sub-nav-grid.show {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    /* 桌面端不显示抽屉 */
    .cscj-modal-menu {
        display: none;
    }
}

.cscj-modal-content::-webkit-scrollbar { width: 4px; }
.cscj-modal-content::-webkit-scrollbar-thumb {
    background: var(--d-border);
    border-radius: 2px;
}
.cscj-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--d-text-3);
}
