/* ===== v2.0 全局样式 — CSS 变量 + 双主题 + 重置 + 动画 + 辅助类 ===== */

/* ---- 核心 CSS 变量（:root = 默认风）---- */
:root {
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-size-base: 14px;
    --font-size-sm: 12px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --line-height: 1.6;

    /* 圆角阶梯 */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* 阴影阶梯 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.18);

    /* 过渡 */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* 间距阶梯 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* 语义色 */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    --color-primary: #3b82f6;

    /* 通用边框色（与 --card-border 一致，供分隔线、滚动条等使用） */
    --border-color: #e2e8f0;

    /* ============================================================
       默认风：浅灰白 + 微纹理 + 纯白卡片 + 深灰蓝主色
       ============================================================ */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    --bg-pattern:
        radial-gradient(ellipse at 20% 20%, rgba(51, 65, 85, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(100, 116, 139, 0.04) 0%, transparent 50%);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-disabled: #cbd5e1;

    --accent-color: #334155;
    --accent-hover: #1e293b;
    --accent-light: rgba(51, 65, 85, 0.1);
    --accent-lighter: rgba(51, 65, 85, 0.06);

    --card-bg: #ffffff;
    --card-bg-hover: #f8fafc;
    --card-border: #e2e8f0;
    --card-border-hover: #cbd5e1;
    --card-shadow: var(--shadow-sm);
    --card-shadow-hover: var(--shadow-md);

    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(226, 232, 240, 0.6);
    --glass-blur: 16px;

    --input-bg: #ffffff;
    --input-bg-hover: #f8fafc;
    --input-border: #e2e8f0;
    --input-border-hover: #cbd5e1;
    --input-focus: #334155;
    --input-ring: rgba(51, 65, 85, 0.12);

    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --sidebar-border: #e2e8f0;
    --sidebar-hover: #f1f5f9;
    --sidebar-active: rgba(51, 65, 85, 0.08);

    --header-bg: rgba(255, 255, 255, 0.9);
    --header-border: #e2e8f0;

    --overlay-bg: rgba(15, 23, 42, 0.4);
    --overlay-blur: 4px;

    --btn-primary-bg: #334155;
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #1e293b;
    --btn-secondary-bg: #f1f5f9;
    --btn-secondary-text: #475569;
    --btn-secondary-hover: #e2e8f0;
    --btn-danger-bg: #ef4444;
    --btn-danger-text: #ffffff;
    --btn-danger-hover: #dc2626;

    /* 中性色系（默认风下用深浅灰/蓝做状态区分，无紫色） */
    --mc-rose: #f1f5f9;
    --mc-rose-dark: #64748b;
    --mc-slate: #f1f5f9;
    --mc-slate-dark: #475569;
    --mc-blue: #dbeafe;
    --mc-blue-dark: #2563eb;
    --mc-green: #d1fae5;
    --mc-green-dark: #059669;
    --mc-yellow: #fef3c7;
    --mc-yellow-dark: #d97706;
    --mc-orange: #ffedd5;
    --mc-orange-dark: #ea580c;
    --mc-teal: #ccfbf1;
    --mc-teal-dark: #0d9488;

    /* 布局尺寸 */
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 64px;
    --header-height: 64px;
    --container-max: 1280px;

    /* 背景特效控制（马卡龙风专属） */
    --bg-blur: 0px;
    --bg-mask-opacity: 0;
}

/* ============================================================
   马卡龙风：柔和渐变 + 毛玻璃 + 多彩点缀
   ============================================================ */
[data-theme="macaron"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 25%, #dbeafe 50%, #d1fae5 75%, #fef3c7 100%);
    --bg-pattern:
        radial-gradient(circle at 10% 20%, rgba(71, 85, 105, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 20% 70%, rgba(245, 158, 11, 0.1) 0%, transparent 40%);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-disabled: #cbd5e1;

    --accent-color: #475569;
    --accent-hover: #334155;
    --accent-light: rgba(71, 85, 105, 0.15);
    --accent-lighter: rgba(71, 85, 105, 0.08);

    --card-bg: rgba(255, 255, 255, 0.75);
    --card-bg-hover: rgba(255, 255, 255, 0.9);
    --card-border: rgba(255, 255, 255, 0.6);
    --card-border-hover: rgba(255, 255, 255, 0.8);
    --card-shadow: 0 4px 16px rgba(71, 85, 105, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(71, 85, 105, 0.15);

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: 20px;

    --input-bg: rgba(255, 255, 255, 0.7);
    --input-bg-hover: rgba(255, 255, 255, 0.85);
    --input-border: rgba(255, 255, 255, 0.6);
    --input-border-hover: rgba(255, 255, 255, 0.8);
    --input-focus: #475569;
    --input-ring: rgba(71, 85, 105, 0.2);

    --sidebar-bg: rgba(255, 255, 255, 0.7);
    --sidebar-border: rgba(255, 255, 255, 0.5);
    --sidebar-hover: rgba(255, 255, 255, 0.5);
    --sidebar-active: rgba(71, 85, 105, 0.15);

    --header-bg: rgba(255, 255, 255, 0.8);
    --header-border: rgba(255, 255, 255, 0.5);

    --overlay-bg: rgba(15, 23, 42, 0.35);
    --overlay-blur: 8px;

    --btn-primary-bg: linear-gradient(135deg, #475569 0%, #334155 100%);
    --btn-primary-text: #ffffff;
    --btn-primary-hover: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    --btn-secondary-bg: rgba(255, 255, 255, 0.6);
    --btn-secondary-text: #475569;
    --btn-secondary-hover: rgba(255, 255, 255, 0.8);
    --btn-danger-bg: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --btn-danger-text: #ffffff;
    --btn-danger-hover: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);

    --bg-blur: 0px;
    --bg-mask-opacity: 0;

    /* 马卡龙风下的通用边框色（半透明白色） */
    --border-color: rgba(255, 255, 255, 0.6);
    --color-primary: #3b82f6;
}

/* ---- 默认风微纹理 ---- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: var(--bg-pattern);
    opacity: 1;
    transition: opacity var(--transition-slow);
}

/* ---- 马卡龙风动态模糊与遮罩 ---- */
[data-theme="macaron"] body::before {
    filter: blur(var(--bg-blur));
}
[data-theme="macaron"] body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: rgba(255, 255, 255, var(--bg-mask-opacity));
    transition: background var(--transition-slow);
}

/* ---- 全局重置 ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--text-primary);
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-slow), color var(--transition-slow);
}

#app {
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

select {
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
}

select option {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* ---- 12 大动画关键帧（全局共用）---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes scaleInBounce {
    0% { opacity: 0; transform: scale(0.8); }
    60% { opacity: 1; transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---- 维护模式遮罩 ---- */
.maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: var(--overlay-bg);
    backdrop-filter: blur(var(--overlay-blur));
    display: none;
    align-items: center;
    justify-content: center;
}

.maintenance-overlay.is-visible {
    display: flex;
    animation: fadeIn var(--transition);
}

.maintenance-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    text-align: center;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--card-border);
    animation: scaleInBounce var(--transition-spring);
}

.maintenance-card svg {
    width: 48px;
    height: 48px;
    color: var(--accent-color);
    margin-bottom: var(--space-4);
}

.maintenance-card h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.maintenance-card p {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    line-height: 1.6;
}

/* ---- 消息角标 ---- */
.msg-btn {
    position: relative;
}

.msg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--color-error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ---- 站点底部 ---- */
.site-footer {
    text-align: center;
    padding: var(--space-6) var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    background: transparent;
}

/* ---- 通用辅助类 ---- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-accent { color: var(--accent-color); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.is-hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

.loading {
    text-align: center;
    padding: var(--space-10);
    color: var(--text-muted);
    animation: pulse 1.5s infinite;
}

.empty {
    text-align: center;
    padding: var(--space-10);
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

.empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-3);
    opacity: 0.4;
}

.page-error {
    text-align: center;
    padding: var(--space-10);
    color: var(--text-muted);
}

/* 单行省略 */
.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 两行省略 */
.ellipsis-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   核心布局：app-layout + sidebar + main-area + header
   ============================================================ */

/* ---- 整体布局 ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---- 侧边栏（默认收缩，悬停展开） ---- */
.sidebar {
    width: var(--sidebar-width-collapsed);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    backdrop-filter: blur(var(--glass-blur));
    padding: var(--space-4) var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-slow);
    z-index: 150;
}

.sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: var(--shadow-lg);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-hover);
    border-radius: 2px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: var(--font-size-base);
    font-weight: 500;
    user-select: none;
    justify-content: center;
    white-space: nowrap;
}

.sidebar:hover .sidebar-item {
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
}

.sidebar-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
}

.sidebar-item.is-active {
    background: var(--sidebar-active);
    color: var(--accent-color);
    font-weight: 600;
}

.sidebar-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

.sidebar:hover .sidebar-item-title {
    display: block;
}

/* ---- 主内容区 ---- */
.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width-collapsed);
}

/* ---- 内容包装器：页面 + 右侧组件区（三栏布局核心） ---- */
.content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

.content-wrapper .page {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* ---- 顶部导航栏 ---- */
.app-header {
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    backdrop-filter: blur(var(--glass-blur));
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all var(--transition-slow);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: color var(--transition);
}

.header-logo:hover {
    color: var(--accent-color);
}

.header-logo svg {
    color: var(--accent-color);
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.header-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
}

/* ---- 页面容器 ---- */
/* 默认 block，通过 is-hidden 类控制隐藏（router.js 先隐藏所有 .page 再显示目标） */
.page {
    display: block;
    flex: 1;
    animation: fadeIn 0.3s ease-out;
}

/* ============================================================
   用户下拉菜单
   ============================================================ */

.user-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.user-trigger:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
}

.user-trigger span:not(.user-avatar) {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
}

.user-trigger svg {
    color: var(--text-muted);
    transition: transform var(--transition);
}

.user-dropdown.is-open .user-trigger svg {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    display: none;
    animation: slideDown 0.2s ease-out;
    z-index: 1000;
}

.user-dropdown.is-open .user-menu {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-base);
    transition: all var(--transition);
}

.user-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ===== 页面切换动画 ===== */
.is-entering {
    animation: pageEnter 0.3s ease-out;
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 马卡龙风色调系统（data-mc-color 属性切换） ===== */
/* 墨蓝（默认） */
[data-theme="macaron"] body[data-mc-color="lavender"] {
    --accent-color: #475569;
    --accent-hover: #334155;
    --accent-light: rgba(71, 85, 105, 0.15);
    --accent-lighter: rgba(71, 85, 105, 0.08);
    --card-shadow: 0 4px 16px rgba(71, 85, 105, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(71, 85, 105, 0.15);
    --input-focus: #475569;
    --input-ring: rgba(71, 85, 105, 0.2);
    --sidebar-active: rgba(71, 85, 105, 0.15);
    --btn-primary-bg: linear-gradient(135deg, #475569 0%, #334155 100%);
    --btn-primary-hover: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}
/* 朱红 */
[data-theme="macaron"] body[data-mc-color="sakura"] {
    --accent-color: #dc2626;
    --accent-hover: #b91c1c;
    --accent-light: rgba(220, 38, 38, 0.15);
    --accent-lighter: rgba(220, 38, 38, 0.08);
    --card-shadow: 0 4px 16px rgba(220, 38, 38, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(220, 38, 38, 0.15);
    --input-focus: #dc2626;
    --input-ring: rgba(220, 38, 38, 0.2);
    --sidebar-active: rgba(220, 38, 38, 0.15);
    --btn-primary-bg: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --btn-primary-hover: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}
/* 薄荷 */
[data-theme="macaron"] body[data-mc-color="mint"] {
    --accent-color: #10b981;
    --accent-hover: #059669;
    --accent-light: rgba(16, 185, 129, 0.15);
    --accent-lighter: rgba(16, 185, 129, 0.08);
    --card-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(16, 185, 129, 0.15);
    --input-focus: #10b981;
    --input-ring: rgba(16, 185, 129, 0.2);
    --sidebar-active: rgba(16, 185, 129, 0.15);
    --btn-primary-bg: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --btn-primary-hover: linear-gradient(135deg, #059669 0%, #0d9488 100%);
}
/* 天空 */
[data-theme="macaron"] body[data-mc-color="sky"] {
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.15);
    --accent-lighter: rgba(59, 130, 246, 0.08);
    --card-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(59, 130, 246, 0.15);
    --input-focus: #3b82f6;
    --input-ring: rgba(59, 130, 246, 0.2);
    --sidebar-active: rgba(59, 130, 246, 0.15);
    --btn-primary-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --btn-primary-hover: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
/* 蜜桃 */
[data-theme="macaron"] body[data-mc-color="peach"] {
    --accent-color: #f97316;
    --accent-hover: #ea580c;
    --accent-light: rgba(249, 115, 22, 0.15);
    --accent-lighter: rgba(249, 115, 22, 0.08);
    --card-shadow: 0 4px 16px rgba(249, 115, 22, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(249, 115, 22, 0.15);
    --input-focus: #f97316;
    --input-ring: rgba(249, 115, 22, 0.2);
    --sidebar-active: rgba(249, 115, 22, 0.15);
    --btn-primary-bg: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
    --btn-primary-hover: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
}
/* 柠檬 */
[data-theme="macaron"] body[data-mc-color="lemon"] {
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --accent-light: rgba(245, 158, 11, 0.15);
    --accent-lighter: rgba(245, 158, 11, 0.08);
    --card-shadow: 0 4px 16px rgba(245, 158, 11, 0.1);
    --card-shadow-hover: 0 8px 24px rgba(245, 158, 11, 0.15);
    --input-focus: #f59e0b;
    --input-ring: rgba(245, 158, 11, 0.2);
    --sidebar-active: rgba(245, 158, 11, 0.15);
    --btn-primary-bg: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --btn-primary-hover: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
}

/* ===== 离线状态条 ===== */
.offline-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 8px 16px;
    background: var(--accent-color);
    color: #fff;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: none;
}

.offline-bar.is-visible {
    display: block;
    animation: offlineBarSlide 0.3s ease-out;
}

@keyframes offlineBarSlide {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.user-menu-item svg {
    flex-shrink: 0;
}

/* ============================================================
   密码输入框 + 单选
   ============================================================ */

.pwd-input-wrap {
    position: relative;
}

.pwd-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.pwd-toggle:hover {
    color: var(--accent-color);
    background: var(--bg-secondary);
}

.login-expire-radio {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.login-expire-radio input[type="radio"] {
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* ============================================================
   响应式：断点 1024px / 768px
   ============================================================ */

@media (max-width: 1024px) {
    .app-header {
        padding: 0 var(--space-4);
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: auto;
        width: 100%;
        flex-direction: row;
        padding: var(--space-2) var(--space-3);
        gap: var(--space-1);
        border-right: none;
        border-top: 1px solid var(--sidebar-border);
        backdrop-filter: blur(var(--glass-blur));
        overflow-x: auto;
        overflow-y: hidden;
        z-index: 100;
    }

    .sidebar > div[style*="flex:1"] {
        display: none;
    }

    .sidebar-item {
        flex-direction: column;
        gap: 2px;
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-sm);
        min-width: 60px;
    }

    .sidebar-item-title {
        display: block;
        font-size: 10px;
    }

    /* 移动端底部导航条：悬停不展开 */
    .sidebar:hover {
        width: 100%;
        box-shadow: none;
    }

    .sidebar:hover .sidebar-item {
        justify-content: center;
        padding: var(--space-2) var(--space-3);
    }

    .main-area {
        padding-bottom: 70px;
        margin-left: 0;
    }

    /* 手机端内容包装器改为纵向（组件区底部滑出） */
    .content-wrapper {
        flex-direction: column;
    }

    .app-header {
        padding: 0 var(--space-4);
        height: 56px;
    }

    .header-logo span {
        display: none;
    }

    .user-trigger > span:not(.user-avatar) {
        display: none;
    }

    .header-left,
    .header-right {
        gap: var(--space-2);
    }
}
