* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 全新、专业的色彩体系 */
    --primary-color: #4f46e5;      /* 主色调 - 深紫罗兰色 */
    --primary-dark: #4338ca;       /* 主色调深色 */
    --primary-light: #6366f1;      /* 主色调浅色 */
    --primary-bg: #eef2ff;         /* 主色调背景 */

    /* 侧边栏颜色 (改为白色主题) */
    --sidebar-bg: #ffffff;         /* 侧边栏背景 - 白色 */
    --sidebar-item-hover: #f3f4f6; /* 菜单项悬停背景 - 浅灰色 */
    --sidebar-item-active: #eef2ff;/* 菜单项激活背景 - 浅紫色 */
    --sidebar-text-primary: #111827;       /* 侧边栏主要文字 - 深灰色 */
    --sidebar-text-secondary: #4b5563;     /* 侧边栏次要文字 - 中灰色 */
    --sidebar-border-color: #e5e7eb;       /* 侧边栏边框颜色 - 浅灰色 */

    /* 主内容区颜色 */
    --main-bg: #f9fafb;           /* 页面背景色 */
    --main-card-bg: #ffffff;
    --main-text-primary: #1f2937;   /* 主内容区主要文字 - 深灰色 */
    --main-text-secondary: #6b7280; /* 主内容区次要文字 - 中灰色 */
    --main-border-color: #e5e7eb;     /* 主内容区边框颜色 */

    --text-accent: var(--primary-light); /* 强调文字颜色 */

    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --header-height: 64px;
    --sidebar-width: 256px;
    --sidebar-collapsed-width: 72px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--main-bg);
    color: var(--main-text-primary);
    line-height: 1.6;
}

.login-page {
    min-height: 100vh;
    background: #ffffff;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    width: 100%;
}

.login-side {
    flex: 0 0 auto;
    height: 100vh;
    aspect-ratio: 2 / 3;
    width: auto;
    background-color: #1f62ff;
    background-image: url('login-side.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.login-side-inner {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-side-logo {
    font-size: 38px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 42px;
}

.login-side-visual {
    width: 360px;
    height: 240px;
    border-radius: 18px;
    border: 2px dashed rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
}

.login-side-visual-tip {
    font-size: 26px;
    font-weight: 700;
}

.login-side-visual-size {
    margin-top: 8px;
    font-size: 16px;
    opacity: 0.95;
}

.login-side-slogan {
    margin-top: 40px;
    font-size: 44px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 2px;
}

.login-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 360px;
}

.login-title {
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: 0.5px;
}

.login-subtitle {
    margin-top: 10px;
    margin-bottom: 28px;
    color: #9ca3af;
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 8px;
}

.login-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.login-input {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    padding: 0 11px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.login-error {
    min-height: 20px;
    color: #dc2626;
    font-size: 12px;
}

.login-submit {
    margin-top: 6px;
    height: 40px;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    background: #2f76ff;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.login-submit:hover {
    background: #1f62ff;
}

.login-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

@media (max-width: 1100px) {
    .login-side {
        aspect-ratio: 2 / 3;
    }
}

@media (max-width: 900px) {
    .login-side {
        display: none;
    }

    .login-main {
        padding: 30px 20px;
    }
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏样式 (全新设计) ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text-primary);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-right: 1px solid var(--sidebar-border-color);
}

/* 初始加载时禁止动画，防止闪烁 */
.sidebar.no-transition,
.sidebar.no-transition *,
.main-wrapper.no-transition {
    transition: none !important;
}

/* 折叠状态样式 (支持 .collapsed 类或全局 .sidebar-collapsed-active) */
.sidebar.collapsed,
html.sidebar-collapsed-active .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .menu-link > span:not(.icon),
.sidebar.collapsed .title,
.sidebar.collapsed .arrow,
html.sidebar-collapsed-active .sidebar .menu-link > span:not(.icon),
html.sidebar-collapsed-active .sidebar .title,
html.sidebar-collapsed-active .sidebar .arrow {
    display: none;
}

/* 侧边栏折叠后的图标布局优化 */
.sidebar.collapsed .menu-link,
html.sidebar-collapsed-active .sidebar .menu-link {
    padding: 8px 0;
    justify-content: center;
}

.sidebar.collapsed .menu,
html.sidebar-collapsed-active .sidebar .menu {
    padding: 16px 8px;
}

.sidebar.collapsed .menu-header,
html.sidebar-collapsed-active .sidebar .menu-header {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .logo-icon,
html.sidebar-collapsed-active .sidebar .logo-icon {
    margin-right: 0;
}

.sidebar.collapsed .menu-link,
html.sidebar-collapsed-active .sidebar .menu-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .icon,
html.sidebar-collapsed-active .sidebar .icon {
    margin-right: 0;
}

.sidebar.collapsed .submenu,
html.sidebar-collapsed-active .sidebar .submenu {
    display: none !important;
}

/* 菜单标题 */
.menu-header {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: var(--header-height);
    flex-shrink: 0;
    border-bottom: 1px solid var(--sidebar-border-color);
}

.menu-header .logo-icon {
    margin-right: 12px;
    font-size: 1.75rem;
    color: var(--primary-light);
}

.menu-header .title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 菜单列表 */
.menu {
    list-style: none;
    padding: 16px;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

/* 菜单项 */
.menu-item {
    margin-bottom: 4px;
}

.menu-item.active {
    background: transparent; /* 移除父元素的激活背景 */
    border-left: none;
}

/* 菜单链接 */
.menu-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--sidebar-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    padding: 12px 16px;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.menu-link:hover {
    background-color: var(--sidebar-item-hover);
    color: var(--sidebar-text-primary);
}

.menu-item.active > .menu-link {
    background-color: var(--primary-bg); /* 使用更柔和且明显的浅紫色 */
    color: var(--primary-color);
    font-weight: 600;
}

/* 菜单项图标 (仅在折叠时展示首字) */
.menu-item .icon {
    display: none; /* 默认展开时不显示首字图标 */
    width: 32px;
    height: 32px;
    border-radius: 50%; /* 圆形图标 */
    background-color: var(--sidebar-item-hover);
    color: var(--sidebar-text-secondary);
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    flex-shrink: 0;
}

/* 侧边栏折叠时的图标展示 */
.sidebar.collapsed .menu-item .icon {
    display: flex; /* 折叠时显示 */
    margin-right: 0;
}

/* 悬停与激活状态下的图标美化 */
.menu-link:hover .icon,
.menu-item.active > .menu-link .icon {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
}

/* 箭头图标 */
.arrow {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 0.9rem;
}

.arrow.rotated {
    transform: rotate(180deg);
}

/* 子菜单 (全新设计) */
.submenu {
    list-style: none;
    padding-left: 0;
    margin: 8px 0 12px 0;
    position: relative;

    /* 平滑动画效果 */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

/* 视觉引导线 (已移除，改为点状设计) */
.submenu::before {
    display: none;
}

.submenu.show {
    max-height: 500px; /* 确保有足够空间展开 */
}

.submenu li {
    /* 移除旧的 li 样式 */
}

.submenu a {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sidebar-text-secondary);
    text-decoration: none;
    padding: 10px 16px 10px 56px; /* 精确控制缩进 */
    position: relative;
    transition: color 0.2s;
}

.submenu a:hover,
.submenu a.active {
    color: var(--primary-color);
}

/* 子菜单项前的点 (点状设计) */
.submenu a::before {
    content: '';
    position: absolute;
    left: 32px; /* 侧边对齐 */
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #d1d5db; /* 默认浅灰色 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 rgba(79, 70, 229, 0); /* 初始无发光 */
}

.submenu a:hover::before,
.submenu a.active::before {
    background-color: var(--primary-color);
    transform: translateY(-50%) scale(1.5);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.6); /* 激活时发光更明显 */
    opacity: 1;
}

/* 确保 active 状态下的文字也变色 */
.submenu a.active {
    color: var(--primary-color);
}

/* ========== 主内容包装器 ========== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
}

.main-wrapper.sidebar-collapsed,
html.sidebar-collapsed-active .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* ========== 顶部栏样式 ========== */
.top-header {
    height: var(--header-height);
    background: var(--main-card-bg);
    border-bottom: 1px solid var(--main-border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ========== 多标签页 Tab Bar ========== */
.page-tabs-container {
    height: 40px;
    background: var(--main-card-bg);
    border-bottom: 1px solid var(--main-border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 4px;
    position: sticky;
    top: var(--header-height);
    z-index: 99;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.page-tabs-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tab-nav-item-page {
    height: 32px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    border: 1px solid var(--main-border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--main-text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-nav-item-page:hover {
    background: #e5e7eb;
    color: var(--main-text-primary);
}

.tab-nav-item-page.active {
    background: #fff;
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-bottom-color: transparent;
    font-weight: 500;
}

.tab-close-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #9ca3af;
    transition: all 0.2s;
}

.tab-close-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* 隐藏原有的面包屑 */
.breadcrumb {
    display: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--main-text-secondary);
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: var(--main-bg);
}

html.sidebar-collapsed-active .sidebar,
.sidebar.collapsed {
    width: var(--sidebar-width) !important;
}

html.sidebar-collapsed-active .main-wrapper,
.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-width) !important;
    width: calc(100vw - var(--sidebar-width)) !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-action {
    position: relative;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
    position: relative;
    color: var(--main-text-secondary);
}

.icon-btn:hover {
    background: var(--main-bg);
}

.icon-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary-color);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.user-profile:hover {
    background: var(--main-bg);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: var(--main-text-primary);
}

.dropdown-arrow {
    font-size: 10px;
    color: var(--main-text-secondary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--main-text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--main-bg);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    padding: 0;
    margin: 4px 0;
}

.header-right {
    position: relative;
}

.profile-card-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card-modal.show {
    display: flex;
    opacity: 1;
}

.profile-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 750px;
    max-width: 95vw;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.profile-card-modal.show .profile-card {
    transform: scale(1);
}

.profile-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.profile-card-title {
    font-size: 18px;
    font-weight: 600;
}

.profile-card-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.profile-card-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.profile-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.profile-card-left {
    padding: 24px;
    border-right: 1px solid #e5e7eb;
}

.profile-card-right {
    padding: 24px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.profile-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 12px;
    cursor: pointer;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    font-weight: 600;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-avatar-wrapper:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-wrapper:hover .profile-avatar-large {
    transform: scale(1.05);
}

.profile-avatar-overlay-text {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.profile-avatar-name {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-info-label {
    font-size: 13px;
    color: #6b7280;
    width: 60px;
    flex-shrink: 0;
}

.profile-info-value {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
}

.profile-password-section {
    margin-bottom: 20px;
}

.profile-password-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.profile-password-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
}

.profile-password-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #111827;
    font-family: monospace;
    letter-spacing: 2px;
}

.profile-password-input:focus {
    outline: none;
}

.profile-password-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s;
}

.profile-password-toggle:hover {
    background: #e5e7eb;
    color: #111827;
}

.profile-change-password-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.profile-change-password-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.password-edit-form {
    display: none;
}

.password-edit-form.show {
    display: block;
}

.password-edit-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.password-edit-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-edit-actions {
    display: flex;
    gap: 8px;
}

.password-edit-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.password-edit-btn.cancel {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.password-edit-btn.cancel:hover {
    background: #e5e7eb;
}

.password-edit-btn.save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.password-edit-btn.save:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.avatar-cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999999;
}

.avatar-cropper-container {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 500px;
    max-width: 95vw;
}

.avatar-cropper-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    text-align: center;
}

.avatar-cropper-area {
    position: relative;
    width: 100%;
    height: 350px;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.avatar-cropper-image {
    position: absolute;
    max-width: none;
    max-height: none;
    cursor: move;
    user-select: none;
}

.avatar-cropper-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.avatar-cropper-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.avatar-cropper-zoom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-cropper-zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.avatar-cropper-zoom-btn:hover {
    background: #f3f4f6;
    border-color: #667eea;
}

.avatar-cropper-zoom-slider {
    width: 150px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
}

.avatar-cropper-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.avatar-cropper-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.avatar-cropper-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-cropper-btn.cancel {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.avatar-cropper-btn.cancel:hover {
    background: #e5e7eb;
}

.avatar-cropper-btn.confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.avatar-cropper-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========== 主内容区样式 ==========*/
.main-content {
    flex: 1;
    padding: 24px;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--main-card-bg);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    color: #fff;
}

.stat-blue .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-green .stat-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.stat-orange .stat-icon {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.stat-purple .stat-icon {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--main-text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--main-text-secondary);
    margin-top: 4px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.trend-up {
    color: #10b981;
    background: #e6f8f2;
}

.trend-down {
    color: #ef4444;
    background: #fee2e2;
}

/* ========== 区块通用样式 ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--main-text-primary);
}

.section-actions {
    display: flex;
    gap: 8px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-text:hover {
    background: var(--primary-bg);
}

/* ========== 快捷操作区 ========== */
.quick-actions {
    background: var(--main-card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.action-card:hover {
    background: var(--main-bg);
    border-color: var(--main-border-color);
    transform: translateY(-2px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.action-blue {
    background: #e0f2fe;
    color: #0ea5e9;
}

.action-green {
    background: #dcfce7;
    color: #22c55e;
}

.action-orange {
    background: #ffedd5;
    color: #f97316;
}

.action-purple {
    background: #f3e8ff;
    color: #a855f7;
}

.action-cyan {
    background: #cffafe;
    color: #06b6d4;
}

.action-pink {
    background: #fce7f3;
    color: #ec4899;
}

.action-text {
    font-size: 13px;
    color: var(--main-text-primary);
    text-align: center;
}

/* ========== 数据表格 ========== */
.data-section {
    background: var(--main-card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: visible;
    position: relative;
    z-index: 1;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--main-border-color);
}

.data-table th {
    font-size: 13px;
    font-weight: 600;
    color: var(--main-text-secondary);
    background: var(--main-bg);
}

.data-table td {
    font-size: 14px;
    color: var(--main-text-primary);
}

.data-table tbody tr:hover {
    background: var(--main-bg);
}

.detail-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    display: none;
    justify-content: flex-end;
    z-index: 3000;
}

.detail-drawer-overlay.show {
    display: flex;
}

.detail-drawer-panel {
    width: 94vw;
    height: 100vh;
    background: #fff;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.detail-drawer-overlay.show .detail-drawer-panel {
    transform: translateX(0);
}

.detail-drawer-header {
    height: 52px;
    border-bottom: 1px solid var(--main-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.detail-drawer-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--main-text-primary);
}

.detail-drawer-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}

.detail-drawer-frame {
    border: none;
    width: 100%;
    height: calc(100vh - 52px);
}

body.drawer-embed .sidebar {
    display: none !important;
}

body.drawer-embed .top-header,
body.drawer-embed .page-tabs-container {
    display: none !important;
}

body.drawer-embed .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
}

body.drawer-embed .main-content {
    padding-top: 12px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-link:hover {
    background: var(--primary-bg);
}

.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-warning {
    background: #fffbeb;
    color: #f59e0b;
}

.status-info {
    background: #eff6ff;
    color: #3b82f6;
}

.status-success {
    background: #f0fdf4;
    color: #16a34a;
}

.status-danger {
    background: #fef2f2;
    color: #dc2626;
}

/* ========== 客户卡片 ========== */
.client-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.client-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--main-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.client-card:hover {
    background: #fff;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.client-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.client-blue {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.client-green {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.client-orange {
    background: linear-gradient(135deg, #fb923c, #f97316);
}

.client-purple {
    background: linear-gradient(135deg, #c084fc, #a855f7);
}

.client-cyan {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
}

.client-pink {
    background: linear-gradient(135deg, #f472b6, #ec4899);
}

.client-info {
    flex: 1;
    min-width: 0;
}

.client-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--main-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-type {
    font-size: 12px;
    color: var(--main-text-secondary);
    margin-top: 2px;
}

.client-stats {
    text-align: right;
}

.client-case {
    font-size: 12px;
    color: var(--main-text-secondary);
    background: var(--primary-bg);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ========== 图表区域 ========== */
.charts-section {
    margin-bottom: 24px;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-card {
    background: var(--main-card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.chart-header {
    margin-bottom: 16px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--main-text-primary);
}

.chart-content {
    min-height: 250px;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.chart-placeholder-pie {
    justify-content: center;
}

.chart-placeholder-bar {
    justify-content: stretch;
}

/* 饼图样式 */
.pie-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(#4a90e2 0% 25%, #48bb78 25% 50%, #ed8936 50% 75%, #9f7aea 75% 100%);
}

.pie-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: polygon(50% 50%, 100% 0, 100% 100%); /* 扇形 */
    transform-origin: 50% 50%;
}

.chart-legend {
    margin-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--main-text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* 柱状图样式 */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    width: 100%;
    padding: 20px 10px;
    gap: 10px;
}

.bar-item {
    flex: 1;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 20px;
    transition: all 0.3s;
}

.bar-item:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--main-text-secondary);
    white-space: nowrap;
}

.archive-folder-tree {
    display: grid;
    gap: 14px;
}

.archive-customer-folder {
    border: 1px solid var(--main-border-color);
    border-radius: 10px;
    background: #fff;
    padding: 14px;
}

.archive-folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.archive-folder-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--main-text-primary);
}

.archive-folder-meta {
    font-size: 12px;
    color: var(--main-text-secondary);
}

.archive-fixed-subfolders {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.archive-fixed-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: #4b5563;
}

.archive-case-folder-list {
    display: grid;
    gap: 8px;
}

.archive-case-folder-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.archive-case-folder-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.archive-case-folder-desc {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.case-archive-page .main-content {
    padding: 18px 20px 20px;
    background: #f5f7fb;
}

.case-archive-page .stats-grid {
    gap: 12px;
    margin-bottom: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.case-archive-page .stat-card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
}

.case-archive-page .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.case-archive-page .stat-value {
    font-size: 22px;
}

.case-archive-page .stat-label {
    font-size: 12px;
}

.case-archive-page .data-section {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    border-radius: 12px;
    padding: 14px;
}

.case-archive-page .section-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef2f7;
}

.case-archive-page .section-title {
    font-size: 16px;
}

.archive-filter-bar {
    display: flex;
    gap: 0;
    align-items: center;
    margin-bottom: 12px;
}

.archive-filter-bar .filter-input {
    width: 100%;
    max-width: none;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.archive-search-wrap {
    width: 100%;
    position: relative;
}

.archive-search-wrap .filter-input {
    height: 36px;
    padding: 0 42px 0 12px;
    border-radius: 10px;
    font-size: 14px;
}

.archive-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 0;
    padding: 0;
}

.archive-search-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.archive-search-btn::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 5px;
    width: 7px;
    height: 7px;
    border: 1.5px solid rgba(71, 85, 105, 0.85);
    border-radius: 50%;
}

.archive-search-btn::after {
    content: '';
    position: absolute;
    left: 13px;
    top: 13px;
    width: 5px;
    height: 1.5px;
    background: rgba(71, 85, 105, 0.85);
    transform: rotate(45deg);
    border-radius: 2px;
}

.case-archive-page .archive-folder-tree {
    gap: 10px;
}

.case-archive-page .archive-customer-folder {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    padding: 12px;
}

.case-archive-page .archive-folder-header {
    margin-bottom: 8px;
}

.case-archive-page .archive-folder-title {
    font-size: 14px;
}

.case-archive-page .archive-folder-meta {
    font-size: 11px;
}

.case-archive-page .archive-fixed-subfolders {
    margin-bottom: 8px;
}

.case-archive-page .archive-fixed-item {
    background: #f8fafc;
    border-color: #e5e7eb;
    font-size: 11px;
    padding: 3px 8px;
}

.case-archive-page .archive-case-folder-list {
    gap: 6px;
}

.case-archive-page .archive-case-folder-item {
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    padding: 8px 10px;
}

.case-archive-page .archive-case-folder-name {
    font-size: 12px;
}

.case-archive-page .archive-case-folder-desc {
    font-size: 11px;
    margin-top: 3px;
}

.archive-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.archive-nav-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px;
    min-height: 840px;
}

.archive-side-tree {
    margin-top: 8px;
    max-height: 792px;
    overflow: auto;
    padding-right: 2px;
}

.archive-tree-customer + .archive-tree-customer {
    margin-top: 4px;
}

.archive-tree-customer-btn {
    width: 100%;
    border: none;
    background: #ffffff;
    border-radius: 8px;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1f2937;
    cursor: pointer;
    padding: 0 10px;
    text-align: left;
}

.archive-tree-customer-btn:hover {
    background: #eef2ff;
}

.archive-tree-arrow {
    font-size: 11px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.archive-tree-arrow.collapsed {
    transform: rotate(-90deg);
}

.archive-tree-customer-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-tree-submenu {
    margin-left: 18px;
    margin-top: 6px;
    display: grid;
    gap: 5px;
}

.archive-tree-submenu.collapsed {
    display: none;
}

.archive-tree-subitem {
    border: none;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    padding: 7px 9px;
    font-size: 12px;
    color: #4b5563;
    cursor: pointer;
}

.archive-tree-subitem:hover {
    background: #eef2ff;
    color: #1d4ed8;
}

.archive-tree-subitem.active {
    background: #e8efff;
    color: #1d4ed8;
    font-weight: 600;
}

.archive-tree-case-group {
    display: grid;
    gap: 4px;
}

.archive-tree-case-btn {
    border: none;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    padding: 6px 8px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-tree-case-btn:hover {
    background: #eef2ff;
}

.archive-tree-case-submenu {
    margin-left: 18px;
    display: grid;
    gap: 4px;
}

.archive-tree-case-submenu.collapsed {
    display: none;
}

.archive-tree-subitem-level3 {
    font-size: 11px;
    color: #6b7280;
    padding: 6px 8px;
}

.archive-preview-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    min-height: 840px;
    padding: 12px;
}

.archive-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef2f7;
}

.archive-preview-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.archive-preview-meta {
    font-size: 12px;
    color: #6b7280;
}

.archive-preview-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.archive-upload-btn {
    height: 28px;
    border-radius: 7px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    padding: 0 10px;
    font-size: 12px;
    cursor: pointer;
}

.archive-upload-btn:hover {
    background: #e0e7ff;
}

.archive-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.archive-file-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
}

.archive-file-thumb {
    height: 84px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2ff 0%, #eff6ff 100%);
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.archive-file-thumb-ext {
    display: inline-flex;
    width: fit-content;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
}

.archive-file-thumb-line {
    height: 6px;
    border-radius: 999px;
    background: #bfdbfe;
}

.archive-file-thumb-line.short {
    width: 62%;
}

.archive-file-preview-link {
    text-decoration: none;
    display: block;
}

.archive-file-preview-link.disabled {
    cursor: default;
}

.archive-file-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.archive-file-name {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    min-height: 32px;
    word-break: break-all;
    white-space: normal;
}

.archive-file-meta {
    margin-top: 5px;
    font-size: 11px;
    color: #6b7280;
}

.archive-file-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.archive-file-download-btn {
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 6px;
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
    cursor: pointer;
}

.archive-file-download-btn:hover {
    background: #e0e7ff;
}

.archive-empty-state {
    text-align: center;
    color: #6b7280;
    padding: 28px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #f8fafc;
}

.admin-panel-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-org-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: 280px minmax(0, 1fr);
    position: relative;
    z-index: 1;
    overflow: visible;
}

.admin-org-tree-card {
    padding: 12px;
    overflow: visible;
    position: relative;
    z-index: 1;
    max-height: none;
    height: auto;
    min-height: 600px;
}

.admin-org-tree {
    max-height: none;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.admin-org-company,
.admin-org-node {
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: #1f2937;
    cursor: pointer;
}

.admin-org-company,
.admin-org-node.department-node {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-org-company {
    justify-content: space-between;
}

.admin-org-company-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-org-company-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.admin-org-more-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.admin-org-more-btn:hover {
    background: #e5e7eb;
}

.admin-org-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 104px;
    display: none;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    padding: 4px;
    z-index: 2147483647;
}

.admin-org-more-menu.show {
    display: flex;
}

.admin-org-more-item {
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 6px 8px;
    text-align: left;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
}

.admin-org-more-item:hover {
    background: #f3f4f6;
}

.admin-org-inline-input {
    width: 100%;
    min-width: 120px;
    height: 30px;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    background: #ffffff;
    padding: 0 8px;
    font-size: 13px;
    color: #1f2937;
}

.admin-org-inline-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16);
}

.admin-org-inline-input.company-input {
    min-width: 160px;
}

.admin-org-toggle {
    width: 14px;
    font-size: 11px;
    color: #6b7280;
    transition: transform 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-org-toggle.collapsed {
    transform: rotate(-90deg);
}

.admin-org-toggle-placeholder {
    width: 14px;
    display: inline-block;
}

.admin-org-company {
    margin-bottom: 8px;
    background: #f3f4f6;
    font-weight: 600;
}

.admin-org-company.active,
.admin-org-node.active {
    background: #e8efff;
    color: #1d4ed8;
}

.admin-org-department-list,
.admin-org-employee-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-org-department-list {
    padding-left: 0;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.admin-org-department-list.collapsed {
    max-height: 0;
}

.admin-org-branch + .admin-org-branch {
    margin-top: 6px;
}

.admin-org-branch {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-org-branch.has-children {
    flex-wrap: wrap;
}

.admin-org-branch.has-children > .admin-org-node,
.admin-org-branch.has-children > .admin-org-dept-actions {
    width: auto;
}

.admin-org-branch.has-children > ul {
    flex-basis: 100%;
    margin-top: 8px;
}

.admin-org-branch .admin-org-node {
    flex: 1;
}

.admin-org-dept-actions {
    position: relative;
}

.admin-org-dept-actions .admin-org-more-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 4px;
}

.admin-org-dept-actions .admin-org-more-btn:hover {
    background: #e5e7eb;
}

.admin-org-dept-actions .admin-org-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    display: none;
    flex-direction: column;
    min-width: 120px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    padding: 4px;
    z-index: 2147483647;
}

.admin-org-company-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    display: none;
    flex-direction: column;
    min-width: 104px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    padding: 4px;
    z-index: 2147483647;
}

.admin-org-company-menu.show {
    display: flex;
}

.admin-org-empty {
    font-size: 12px;
    color: #9ca3af;
    padding: 6px 10px;
}

.admin-employee-card {
    min-height: 520px;
    position: static;
    z-index: 0;
}

.admin-employee-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.admin-employee-profile {
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    padding: 12px;
    font-size: 13px;
    color: #374151;
}

.admin-employee-profile-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.admin-employee-profile-line + .admin-employee-profile-line {
    margin-top: 4px;
}

.table-empty-cell {
    text-align: center;
    color: #9ca3af;
    padding: 20px 0;
}

.admin-entry-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-entry-card {
    border: 1px solid var(--main-border-color);
    border-radius: 12px;
    background: #ffffff;
    padding: 20px;
    color: inherit;
    text-decoration: none;
}

.admin-entry-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.admin-entry-card p {
    color: #6b7280;
    font-size: 13px;
}

.admin-action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-action-btn {
    min-width: 128px;
}

.admin-inline-add-btn {
    min-width: 92px;
    height: 32px;
    padding: 0 14px;
}

.admin-card {
    border: 1px solid var(--main-border-color);
    border-radius: 12px;
    background: #ffffff;
    padding: 16px;
}

.admin-form-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-table-wrap {
    max-height: 280px;
    overflow: auto;
}

.admin-permission-page .admin-table-wrap {
    max-height: 560px;
}

.btn-primary {
    height: 36px;
    border-radius: 8px;
    border: none;
    color: #ffffff;
    background: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 10px 0 14px;
}

.permission-layout-card {
    padding: 10px;
}

.permission-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 12px;
    min-height: 780px;
}

.permission-role-pane,
.permission-config-pane {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px;
}

.permission-role-table-wrap {
    max-height: 720px;
}

.permission-role-table-wrap tbody tr {
    cursor: pointer;
}

.permission-role-pane .section-title {
    font-size: 15px;
}

.permission-role-pane .data-table {
    table-layout: fixed;
}

.permission-role-pane .data-table th,
.permission-role-pane .data-table td {
    padding: 10px 12px;
    font-size: 13px;
}

.permission-role-pane .data-table th:nth-child(1),
.permission-role-pane .data-table td:nth-child(1) {
    width: 46%;
}

.permission-role-pane .data-table th:nth-child(2),
.permission-role-pane .data-table td:nth-child(2) {
    width: 16%;
    white-space: nowrap;
}

.permission-role-pane .data-table th:nth-child(3),
.permission-role-pane .data-table td:nth-child(3) {
    width: 38%;
    white-space: nowrap;
}

.permission-tabbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 8px;
}

.permission-tab {
    height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    padding: 0 12px;
    font-size: 12px;
}

.permission-tab.active {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.permission-tab-description {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 10px;
}

.permission-data-grid {
    display: grid;
    gap: 10px;
}

.permission-data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px dashed #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    gap: 12px;
}

.permission-data-title {
    color: #111827;
    font-weight: 600;
    font-size: 13px;
}

.permission-data-options {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.permission-empty-state {
    border: 1px dashed #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
}

.permission-group-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: 680px;
    overflow: auto;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    padding: 10px;
}

.permission-group-block {
    border: 1px dashed #e5e7eb;
    border-radius: 6px;
    padding: 8px;
}

.permission-group-title {
    font-size: 12px;
    color: #2563eb;
    margin-bottom: 8px;
    font-weight: 600;
}

.permission-group-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
}

.permission-save-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

.permission-save-row .btn-primary {
    min-width: 70px;
}

.admin-permission-page .admin-action-btn {
    min-width: auto;
}

.admin-permission-page .admin-action-bar .btn-primary,
.admin-permission-page .permission-save-row .btn-primary {
    min-width: auto;
    width: auto;
    padding: 0 14px;
    white-space: nowrap;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    box-shadow: none;
    font-weight: 700;
}

.admin-permission-page .admin-action-bar .btn-primary:hover,
.admin-permission-page .permission-save-row .btn-primary:hover {
    background: #ffffff;
    color: #111827;
}

.admin-permission-page .admin-action-bar .btn-primary:disabled,
.admin-permission-page .permission-save-row .btn-primary:disabled {
    color: #9ca3af;
    background: #ffffff;
    border-color: #e5e7eb;
}

@media (max-width: 1280px) {
    .permission-layout {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .permission-group-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .permission-layout {
        grid-template-columns: 1fr;
    }

    .permission-role-table-wrap {
        max-height: 260px;
    }

    .permission-group-items {
        grid-template-columns: 1fr;
    }
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.admin-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.admin-switch {
    position: relative;
    display: inline-flex;
    width: 34px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
}

.admin-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #d1d5db;
    transition: 0.2s;
}

.admin-switch-slider::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.admin-switch input:checked + .admin-switch-slider {
    background: #4f46e5;
}

.admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(14px);
}

.admin-switch-label {
    font-size: 12px;
    color: #4b5563;
}

.active-row {
    background: #eef3ff;
}

.permission-hidden {
    opacity: 0.45;
}

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    padding: 16px;
}

.admin-modal-overlay.show {
    display: flex;
}

.admin-modal {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 18px;
}

.admin-modal-lg {
    max-width: 680px;
}

.admin-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.admin-modal-head h3 {
    font-size: 18px;
    margin: 0;
}

.admin-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #f3f4f6;
    color: #374151;
    font-size: 18px;
    line-height: 1;
}

.admin-modal-department {
    max-width: 760px;
    overflow: hidden;
    padding: 0;
}

.admin-modal-department .admin-modal-head {
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f7;
}

.admin-modal-department .admin-modal-head h3 {
    color: #111827;
}

.admin-modal-department .admin-modal-close {
    background: #f3f4f6;
    color: #374151;
}

.admin-modal-department .admin-modal-body {
    padding: 14px 18px 14px;
}

.admin-modal-body {
    padding: 16px 18px 18px;
}

.admin-modal-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.admin-form-field {
    display: grid;
    gap: 6px;
}

.admin-form-field label {
    font-size: 12px;
    color: #4b5563;
}

.admin-modal-department .admin-form-field .filter-input,
.admin-modal-department .admin-form-field .filter-select {
    width: 100%;
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
    line-height: 36px;
    background: #ffffff;
}

.admin-modal-department .admin-form-field .filter-select {
    padding-right: 28px;
}

.admin-modal-employee-edit {
    max-width: 920px;
    padding: 0;
    overflow: hidden;
}

.employee-edit-body {
    padding: 16px 18px 14px;
}

.admin-modal-employee-create {
    max-width: 760px;
    padding: 0;
    overflow: hidden;
}

.admin-modal-overlay#employeeModal {
    z-index: 99998;
}

.admin-modal-employee-create .admin-modal-head {
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f7;
}

.employee-create-body {
    padding: 14px 18px 14px;
}

.employee-create-form {
    margin: 0;
}

.employee-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.employee-create-field {
    display: grid;
    gap: 6px;
}

.employee-create-field label {
    font-size: 13px;
    color: #374151;
}

.employee-create-field .filter-input,
.employee-create-field .filter-select {
    width: 100%;
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
    line-height: 36px;
    background: #ffffff;
}

.employee-create-field .filter-select {
    padding-right: 28px;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap .filter-input {
    padding-right: 38px;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.password-toggle-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.employee-create-field .req {
    color: #ef4444;
    margin-right: 4px;
}

.employee-create-field-full {
    grid-column: 1 / -1;
}

.employee-create-footer {
    border-top: 1px solid #e5e7eb;
    margin-top: 14px;
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.employee-create-footer .btn-secondary,
.employee-create-footer .btn-primary {
    min-width: 92px;
    height: 36px;
    padding: 0 18px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    font-weight: 600;
}

.employee-create-footer .btn-secondary:hover,
.employee-create-footer .btn-primary:hover {
    background: #f9fafb;
}

.employee-edit-form {
    margin: 0;
}

.employee-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.employee-edit-field {
    display: grid;
    gap: 6px;
}

.employee-edit-field label {
    font-size: 13px;
    color: #374151;
}

#editEmployeePosition,
#editEmployeeRole {
    min-height: 36px;
    height: 36px;
}

#employeePosition,
#employeeRole {
    min-height: 36px;
    height: 36px;
}

.employee-create-field .filter-input[readonly] {
    background: #f8fafc;
    color: #6b7280;
    cursor: not-allowed;
}

.employee-edit-field .req {
    color: #ef4444;
    margin-right: 4px;
}

.employee-edit-field-full {
    grid-column: 1 / -1;
}

.employee-edit-status-row {
    align-content: end;
}

.employee-status-group {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 36px;
}

.employee-edit-footer {
    border-top: 1px solid #e5e7eb;
    margin-top: 14px;
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-secondary {
    height: 36px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    padding: 0 18px;
    cursor: pointer;
    font-size: 13px;
}

.admin-department-page .main-content {
    padding: 18px 20px 20px;
    background: #f5f7fb;
}

.admin-department-page .stats-grid {
    gap: 12px;
    margin-bottom: 14px;
}

.admin-department-page .stat-card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
}

.admin-department-page .stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

.admin-department-page .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.admin-department-page .stat-value {
    font-size: 22px;
}

.admin-department-page .stat-label {
    font-size: 12px;
}

.admin-department-page .data-section {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 14px;
}

.admin-department-page .admin-org-layout {
    gap: 12px;
}

.admin-department-page .admin-card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    border-radius: 12px;
    padding: 12px;
}

@media (max-width: 760px) {
    .employee-create-grid {
        grid-template-columns: 1fr;
    }
}

.admin-department-page .section-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef2f7;
}

.admin-department-page .section-title {
    font-size: 16px;
}

.admin-department-page .admin-inline-add-btn {
    min-width: auto;
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.admin-department-page .admin-org-tree {
    max-height: none;
    height: auto;
    overflow: visible;
    padding-right: 4px;
}

.admin-department-page .admin-org-tree.menu-open {
    overflow: visible;
}

.admin-department-page .admin-org-company,
.admin-department-page .admin-org-node {
    border-radius: 7px;
}

.admin-department-page .admin-employee-meta {
    margin-bottom: 8px;
    font-size: 12px;
}

.admin-department-page .admin-table-wrap {
    max-height: 420px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
}

.admin-department-page .data-table th,
.admin-department-page .data-table td {
    padding: 10px 12px;
}

.admin-department-page .data-table th {
    font-size: 12px;
    background: #f8fafc;
}

.admin-department-page .data-table td {
    font-size: 13px;
}

.admin-department-page .btn-link {
    padding: 4px 6px;
    font-size: 12px;
}

.employee-edit-page-content {
    background: #f5f7fb;
}

.employee-edit-page-card {
    max-width: 760px;
}

.employee-edit-page-form {
    margin: 0;
}

.employee-edit-section-title {
    font-size: 24px;
    margin-bottom: 16px;
    color: #1f2937;
}

.employee-edit-page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.employee-edit-page-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--main-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--main-border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--main-text-secondary);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-panel-grid {
        grid-template-columns: 1fr;
    }
    .admin-org-layout {
        grid-template-columns: 1fr;
    }
    .admin-entry-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .client-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .archive-layout {
        grid-template-columns: 1fr;
    }
    .archive-nav-panel,
    .archive-preview-panel {
        min-height: auto;
    }
    .archive-side-tree {
        max-height: 300px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .menu-toggle {
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        color: var(--main-text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        transition: background 0.2s;
    }

    .menu-toggle:hover {
        background: var(--main-bg);
    }
    
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .client-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .client-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* ========== 新仪表盘样式 ========== */
.dashboard-content {
    background: #f5f7fb;
    padding: 16px;
}

.dashboard-top-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.top-stat-card {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: white;
}

.top-stat-card.highlight {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.top-stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.top-stat-value {
    font-size: 24px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dashboard-row .chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-action-btn {
    padding: 4px 12px;
    font-size: 11px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    color: #374151;
}

.pie-chart-container {
    display: flex;
    align-items: center;
    gap: 24px;
}

.pie-chart-new {
    position: relative;
    width: 160px;
    height: 160px;
}

.pie-chart-new svg {
    width: 100%;
    height: 100%;
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item-new {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table td {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    font-size: 12px;
    text-align: center;
}

.gauge-chart {
    position: relative;
    height: 140px;
}

.gauge-chart svg {
    width: 100%;
    height: 100%;
}

.gauge-value {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.gauge-labels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 12px;
    color: #6b7280;
}

.gauge-numbers {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.gauge-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.gauge-btn {
    padding: 6px 16px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.stat-info-grid {
    display: grid;
    gap: 12px;
}

.stat-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-info-label {
    font-size: 12px;
    color: #6b7280;
}

.stat-info-value {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.stat-info-percent {
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
}

.bar-chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 20px;
    padding: 0 20px;
}

.bar-item-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.bar-fill {
    width: 60px;
    border-radius: 8px 8px 0 0;
    transition: height 0.3s;
}

.bar-fill.bar-blue {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
}

.bar-fill.bar-green {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.bar-fill.bar-cyan {
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
}

.bar-fill.bar-orange {
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
}

.bar-label-new {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.bar-value {
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 4px;
}

.bar-percent {
    font-size: 11px;
    color: #3b82f6;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.side-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.side-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.side-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-action-small {
    font-size: 11px;
    color: #6b7280;
}

.side-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.side-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.side-stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.side-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.side-action {
    margin-top: 12px;
    text-align: center;
}

.side-action-btn {
    padding: 6px 20px;
    font-size: 12px;
    border: none;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.progress-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.progress-label {
    color: #6b7280;
}

.progress-value {
    font-weight: 600;
    color: #1f2937;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-fill.progress-cyan {
    background: #06b6d4;
}

.icon-row {
    display: flex;
    gap: 12px;
}

.icon-box {
    flex: 1;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

.icon-box.icon-orange {
    background: #fff7ed;
}

.icon-text {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.booking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.booking-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.booking-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.booking-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.booking-table {
    overflow-x: auto;
}

.data-table-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.data-table-mini th,
.data-table-mini td {
    padding: 8px 6px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.data-table-mini th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.bottom-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.bottom-stat-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
}

.bottom-stat-item {
    text-align: center;
    color: white;
}

.bottom-stat-item.highlight {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 8px;
}

.bottom-stat-label {
    font-size: 12px;
    opacity: 0.9;
    display: block;
}

.bottom-stat-sub {
    font-size: 11px;
    opacity: 0.8;
    display: block;
}

.bottom-stat-value {
    font-size: 22px;
    font-weight: 700;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bottom-left,
.bottom-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bottom-chart-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.bottom-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.bottom-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.bottom-chart-actions {
    display: flex;
    gap: 8px;
}

.stat-cards-row {
    display: flex;
    gap: 12px;
}

.stat-card-mini {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-icon-mini {
    width: 40px;
    height: 40px;
    background: #e0e7ff;
    border-radius: 8px;
}

.stat-info-mini {
    flex: 1;
}

.stat-value-mini {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.stat-label-mini {
    font-size: 12px;
    color: #6b7280;
}

.line-chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 12px;
    padding: 0 10px;
}

.line-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.line-bar {
    width: 32px;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
}

.line-bar.line-green {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.line-bar.line-cyan {
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
}

.line-bar.line-blue {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

.line-bar.line-orange {
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
}

.line-label {
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}

.line-value {
    font-size: 10px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 2px;
}

.line-percent {
    font-size: 10px;
    color: #3b82f6;
}

.donut-chart {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.donut-chart svg {
    width: 100%;
    height: 100%;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-value {
    font-size: 14px;
    color: #6b7280;
}

.donut-sub {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
}
