:root {
    --bg: #f7f8fc;
    --bg-light: #eef1f8;
    --box: #ffffff;
    --text: #1f2937;
    --input-border: #e5e7eb;
    --btn: #3b82f6;
    --link: #3b82f6;
    --error: #ef4444;
    --text-gray: #6b7280;
    --card: #ffffff;
    --border: #e5e7eb;
    --tip: #6b7280;
    --head: #4b5563;
    --text2: #4b5563;
    --text3: #6b7280;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --toast-bg: #1f2937;
    --file-link: #3b82f6;
    --card-glass: rgba(255, 255, 255, 0.65);
    --card-glass-border: rgba(255, 255, 255, 0.7);
    --card-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 8px 32px rgba(59,130,246,0.12), 0 2px 8px rgba(59,130,246,0.06);
}

/* 👇 👇 👇 这是关键修复！JS 设置的就是这个 */
html[data-theme="dark"] {
    --bg: #0f172a;
    --bg-light: #1a2540;
    --box: #1e293b;
    --text: #f1f5f9;
    --input-border: #334155;
    --btn: #3b82f6;
    --link: #f1f5f9;
    --error: #f87171;
    --text-gray: #9ca3af;
    --card: #1e293b;
    --border: #334155;
    --tip: #9ca3af;
    --head: #cbd5e1;
    --text2: #d1d5db;
    --text3: #9ca3af;
    --danger: #f87171;
    --success: #34d399;
    --warning: #fbbf24;
    --toast-bg: #1f2937;
    --file-link: #f9fafb;
    --card-glass: rgba(30, 41, 59, 0.75);
    --card-glass-border: rgba(51, 65, 85, 0.6);
    --card-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 1px 4px rgba(0,0,0,0.1);
    --card-shadow-hover: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
}

/* 注意：已移除 @media (prefers-color-scheme: dark) 媒体查询
   主题切换完全由 common.js 中的 data-theme 属性控制，
   不再跟随手机系统主题，避免用户手动切换后又被系统覆盖 */

.dark-mode {
    --bg: #0f172a;
    --bg-light: #1a2540;
    --box: #1e293b;
    --text: #f1f5f9;
    --input-border: #334155;
    --btn: #3b82f6;
    --link: #f1f5f9;
    --error: #f87171;
    --text-gray: #9ca3af;
    --card: #1e293b;
    --border: #334155;
    --tip: #9ca3af;
    --head: #cbd5e1;
    --text2: #d1d5db;
    --text3: #9ca3af;
    --danger: #f87171;
    --success: #34d399;
    --warning: #fbbf24;
    --toast-bg: #1f2937;
    --file-link: #f9fafb;
}

.light-mode {
    --bg: #f7f8fc;
    --bg-light: #eef1f8;
    --box: #ffffff;
    --text: #1f2937;
    --input-border: #e5e7eb;
    --btn: #3b82f6;
    --link: #3b82f6;
    --error: #ef4444;
    --text-gray: #6b7280;
    --card: #ffffff;
    --border: #e5e7eb;
    --tip: #6b7280;
    --head: #4b5563;
    --text2: #4b5563;
    --text3: #6b7280;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --toast-bg: #1f2937;
    --file-link: #3b82f6;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", "Twemoji Mozilla", sans-serif
}

body {
    background: var(--bg);
    color: var(--text);
    padding: 12px;
    max-width: 2000px;
    margin: 0 auto;
    transition: background-color 0.35s ease, color 0.35s ease;
    animation: fadeIn 0.3s ease;
}

/* 全局主题切换平滑过渡 — 让所有元素的颜色/背景/边框同步渐变 */
*, *::before, *::after {
    transition: background-color 0.35s ease, color 0.35s ease,
                border-color 0.35s ease, box-shadow 0.35s ease;
}

.theme-switch {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card-glass);
    border: 1px solid var(--card-glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    z-index: 99;
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
}

.theme-switch:hover {
    transform: scale(1.08);
    box-shadow: var(--card-shadow-hover);
}


/* ==========================================
   头部布局美化
   ========================================== */

/* 头部容器：整体垂直分两行（第一行标题+搜索，第二行菜单） */
.header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* 第一行和菜单行的上下间距，可按需调整 */
    margin-bottom: 24px;
    width: 100%;
    /* 占满父容器，避免居中 */
}

/* 第一行容器：标题+搜索框 同一行，左右分开 */
.header-top {
    display: flex;
    justify-content: space-between;
    /* 核心：左右两端对齐 */
    align-items: center;
    /* 垂直居中，避免高低不齐 */
    width: 100%;
    /* 占满整行，确保左右分开 */
    padding-top: 20px;

}

/* 标题样式：左对齐，消除默认边距 */
.header-title {
    margin: 0;
    font-size: 28px;
    text-align: left;
    /* 强制左对齐，兜底 */
    flex-shrink: 0;
    /* 防止标题被压缩 */
}

/* 搜索框容器：右对齐，保持水平排列 */
.header-search {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    /* 强制右对齐，兜底 */
    flex-shrink: 0;
    /* 防止搜索框被压缩 */
}

/* 搜索框样式优化 */
.header-search input {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    width: 320px;
    /* 固定搜索框宽度，避免挤压标题 */
    font-size: 14px;
}

.header-search button {
    padding: 8px 16px;
    border-radius: 12px;
    background: #3b82f6;
    /* 蓝色按钮，和你截图一致 */
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}


.preview-content .markdown {
    line-height: 1.6;
}

.preview-content .markdown pre {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
}

.preview-content .markdown code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.preview-content .highlight {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
}


/* ==========================================
   导航菜单栏 - 玻璃拟态风格
   ========================================== */

/* 菜单总容器 - 毛玻璃效果 */
.menu-container {
    width: 100%;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 8px 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

/* 通用菜单行 */
.menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

/* 菜单链接 - 玻璃质感 */
.menu a {
    font-size: 13.5px;
    color: var(--text2);
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    gap: 4px;
    border-radius: 10px;
    white-space: nowrap;
    font-weight: 450;
    letter-spacing: 0.01em;
    position: relative;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--btn);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
    text-decoration: none;
    transform: translateY(-1px);
}

/* 管理后台菜单 - 毛玻璃分隔 */
.admin-menu {
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 0 4px;
    margin-top: 4px;
}

.admin-menu a {
    font-size: 13px;
    color: var(--text3);
    font-weight: 400;
}

.admin-menu a:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 导航栏移动端适配 */
@media (max-width: 768px) {
    .menu-container {
        padding: 6px 8px;
        border-radius: 12px;
    }
    .menu a {
        font-size: 14px;
        padding: 10px 14px;
        min-height: 44px;
    }
    .admin-menu a {
        font-size: 13px;
        min-height: 44px;
    }
}

/* 暗色模式 - 玻璃拟态 */
html[data-theme="dark"] .menu-container {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .menu a:hover {
    background: rgba(51, 65, 85, 0.5);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

html[data-theme="dark"] .admin-menu {
    border-top-color: rgba(51, 65, 85, 0.4);
}

html[data-theme="dark"] .admin-menu a:hover {
    background: rgba(51, 65, 85, 0.4);
}

/* ==========================================
   欢迎语
   ========================================== */
.welcome {
    font-size: 25px;
    margin-bottom: 20px;
    line-height: 1.3;
    word-break: break-all;
    padding-bottom: 10px;
}

/* ======================
   用户信息栏
======================= */
.user-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* 头像外层容器 - 微信同款圆形边框遮罩 */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    /* 微信风格：外圈遮边 + 留白感 */
    padding: 2px;
    background: var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 真实头像图片 */
#userAvatarImg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--box);
}

/* 默认头像 - 替换成简约好看样式，代替丑的👤 */
.default-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    /* 简约人形图标，更耐看 */
    content: "👤";
    color: var(--text-gray);
    background: var(--bg);
}

/* 用户名 */
.username {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

/* 退出按钮 */
.logout-btn {
    color: var(--link);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;
}
.logout-btn:hover {
    opacity: 0.8;
}

/* 禁用导航链接（AI 对话功能关闭时） */
a.disabled-nav {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: none;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ==========================================
   全局通用组件样式 — 各页面共享
   ========================================== */

/* 卡片 */
.card {
    background: var(--card-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    border-color: var(--btn);
    box-shadow: var(--card-shadow-hover);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--btn);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--btn);
    color: var(--btn);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* 输入框 */
.input {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
    border-color: var(--btn);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* 表格 */
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap th {
    background: var(--bg);
    color: var(--text2);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
}

.table-wrap td {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.table-wrap tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* 模态框 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: maskFade 0.2s ease;
}

.modal-box {
    background: var(--card-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 28px;
    max-width: 520px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalPop 0.25s ease;
    border: 1px solid var(--card-glass-border);
    box-shadow: var(--card-shadow);
}

/* 大尺寸模态框 - 使用!important覆盖.modal-box的默认宽度 */
.modal-lg {
    max-width: 1200px !important;
    width: 90% !important;
}

@keyframes maskFade {
    from { opacity: 0 }
    to { opacity: 1 }
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) }
    to { opacity: 1; transform: scale(1) }
}

/* 模态框内部滚动条优化 */
.modal-box::-webkit-scrollbar {
    width: 8px;
}

.modal-box::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.modal-box::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.modal-box::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* 暗色主题下的滚动条 */
html[data-theme="dark"] .modal-box::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
}

html[data-theme="dark"] .modal-box::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* 标签/徽章 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.tag-success { background: #d1fae5; color: #059669; }
.tag-warning { background: #fef3c7; color: #d97706; }
.tag-danger  { background: #fee2e2; color: #dc2626; }
.tag-info    { background: #dbeafe; color: #2563eb; }

html[data-theme="dark"] .tag-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
html[data-theme="dark"] .tag-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
html[data-theme="dark"] .tag-danger  { background: rgba(239, 68, 68, 0.15); color: #f87171; }
html[data-theme="dark"] .tag-info    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

/* 页面标题 */
.page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text3);
    font-size: 15px;
}

/* ==============================================
   通知铃铛组件
   ============================================== */
.notify-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
    vertical-align: middle;
}

.notify-bell-icon {
    position: relative;
    cursor: pointer;
    font-size: 18px;
    color: var(--text2);
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    user-select: none;
}

.notify-bell-icon:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--btn);
}

.notify-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

.notify-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 420px;
    background: var(--box, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notify-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.notify-view-all {
    font-size: 12px;
    color: var(--btn);
    text-decoration: none;
    font-weight: 400;
}

.notify-view-all:hover {
    text-decoration: underline;
}

.notify-dropdown-list {
    overflow-y: auto;
    max-height: 360px;
    padding: 4px 0;
}

.notify-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.notify-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.notify-unread {
    background: rgba(59, 130, 246, 0.04);
}

.notify-unread .notify-item-title {
    font-weight: 600;
}

.notify-item-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notify-item-content,
.notify-item-body {
    flex: 1;
    min-width: 0;
}

.notify-item-title {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-all;
}

.notify-item-time {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

.notify-divider {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 11px;
    color: var(--text3);
}

.notify-divider::before,
.notify-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #e5e7eb);
}

.notify-divider span {
    padding: 0 8px;
    white-space: nowrap;
}

.notify-empty,
.notify-loading {
    text-align: center;
    padding: 24px 16px;
    color: var(--text3);
    font-size: 13px;
}

/* ===== Flash 消息 ===== */
.flash-container {
    max-width: 700px;
    margin: 16px auto 0;
    padding: 0 20px;
}

.flash-msg {
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #b45309;
}

html[data-theme="dark"] .flash-warning {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.flash-message,
.flash-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--btn);
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

/* ===== 名称不规范全屏导航遮罩 ===== */
.name-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.name-overlay-box {
    background: var(--card);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    position: relative;
}

.name-overlay-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.name-overlay-box h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 12px;
}

.name-overlay-box p {
    font-size: 15px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 28px;
}

.name-overlay-btn {
    display: inline-block;
    padding: 12px 36px;
    background: var(--btn);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.name-overlay-btn:hover {
    opacity: 0.9;
}

.name-overlay-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    color: var(--text2);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.name-overlay-close:hover {
    color: var(--text);
}

.name-overlay-dismiss {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text2);
    text-decoration: none;
    cursor: pointer;
}
.name-overlay-dismiss:hover {
    color: var(--text);
    text-decoration: underline;
}

/* ==========================================
   移动端导航 - 汉堡菜单 + 底部Tab
   ========================================== */

/* header-top-left: 汉堡按钮 + 标题 */
.header-top-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* 汉堡按钮 - 桌面隐藏 */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 2.5px 0;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* 移动端导航抽屉 - 桌面展开 */
.mobile-nav-drawer {
    display: block;
}

/* 底部Tab栏 - 桌面隐藏 */
.mobile-bottom-tabs {
    display: none;
}

/* ==========================================
   移动端适配 (≤768px)
   ========================================== */
@media (max-width: 768px) {
    /* 汉堡按钮显示 */
    .hamburger-btn {
        display: flex;
    }

    /* header-top 紧凑布局 */
    .header-top {
        padding-top: 10px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .header-title {
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 用户信息紧凑 */
    .user-info {
        gap: 10px;
    }

    .user-info .username {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
    }

    .user-info .logout-btn {
        font-size: 12px;
        padding: 4px 8px;
    }

    /* 导航抽屉 - 默认收起 */
    .mobile-nav-drawer {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .mobile-nav-drawer.open {
        max-height: 80vh;
        overflow-y: auto;
    }

    .mobile-nav-drawer .menu-container {
        margin-top: 0;
    }

    .mobile-nav-drawer .menu a {
        font-size: 15px;
        padding: 12px 16px;
        min-height: 44px;
        width: 100%;
        box-sizing: border-box;
    }

    /* 底部Tab栏 */
    .mobile-bottom-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--card-glass);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--card-glass-border);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    }

    .mobile-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text3);
        font-size: 11px;
        gap: 2px;
        min-width: 56px;
        min-height: 48px;
        padding: 4px 0;
        transition: color 0.2s;
    }

    .mobile-tab i {
        font-size: 20px;
    }

    .mobile-tab.active,
    .mobile-tab:active {
        color: var(--btn);
    }

    /* 主题按钮上移，避免被底部Tab遮挡 */
    .theme-switch {
        bottom: 70px;
    }

    /* 页面内容底部留白，避免被Tab遮挡 */
    body {
        padding-bottom: 60px;
    }

    /* 触摸目标标准化 */
    button, .btn, a.btn, input[type="submit"], input[type="button"] {
        min-height: 44px;
    }

    select, input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea {
        font-size: 16px;
    }

    /* 表格横向滚动 - 通用适配 */
    .table-container, .table-wrap, .table-scroll, .table-wrapper, #testTableWrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    /* 卡片容器全宽 */
    .menu-container, .card, .info-card {
        max-width: 100%;
    }
}

/* 暗色模式 - 移动端元素 */
html[data-theme="dark"] .hamburger-btn:hover {
    background: rgba(51, 65, 85, 0.5);
}

html[data-theme="dark"] .mobile-bottom-tabs {
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}
