* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* 登录页（品牌化） */
.login-wrap {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 50%, #003a8c 100%);
    position: relative;
    overflow: hidden;
}
.login-wrap::before,
.login-wrap::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}
.login-wrap::before { width: 420px; height: 420px; top: -120px; right: -100px; }
.login-wrap::after { width: 320px; height: 320px; bottom: -100px; left: -80px; }
.login-card {
    width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px 28px;
    box-shadow: 0 20px 60px rgba(0, 20, 60, 0.3);
    position: relative;
    z-index: 1;
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo { font-size: 52px; line-height: 1; margin-bottom: 14px; }
.login-title { font-size: 24px; font-weight: 700; color: #1f2937; margin: 0 0 8px; }
.login-subtitle { font-size: 13px; color: #9ca3af; margin: 0; }
.login-input { margin-bottom: 20px; }
.login-alert { margin-bottom: 16px; }
.login-btn { width: 100%; height: 44px; font-size: 16px; letter-spacing: 6px; }
.login-footer { text-align: center; margin-top: 26px; font-size: 12px; color: #c0c4cc; letter-spacing: 1px; }

/* 主应用壳 */
.app-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 用户下拉头像区 */
.user-dropdown {
    color: #fff;
}
.user-dropdown .el-avatar {
    background: #fff;
    color: #1677ff;
}

/* 顶部导航 */
.main-header {
    background: linear-gradient(135deg, #1677ff 0%, #409EFF 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 12px rgba(22, 119, 255, 0.2);
    height: 60px;
    flex-shrink: 0;
    z-index: 1000;
    position: relative;
}

.header-content {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: white;
    letter-spacing: 1px;
}

.logo span {
    font-size: 28px;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 统一顶部按钮样式 */
.header-actions .el-button {
    font-size: 13px;
    padding: 6px 12px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 主容器 */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    background-color: #f5f7fa;
    border-right: 1px solid #e4e7ed;
    overflow-y: auto;
    width: 220px !important;
    flex-shrink: 0;
}

.el-menu {
    border-right: none !important;
    background-color: transparent !important;
    padding: 12px 0;
}

.el-menu-item, .el-sub-menu__title {
    height: 46px !important;
    line-height: 46px !important;
    font-size: 14px;
    margin: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.el-menu-item .el-icon, .el-sub-menu__title .el-icon {
    font-size: 16px;
    width: 20px;
}

.el-menu-item:hover {
    background-color: #ecf5ff !important;
    transform: translateX(2px);
}

.el-menu-item.is-active {
    background-color: #1677ff !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
}

/* 子菜单项 */
.el-menu--inline .el-menu-item {
    height: 40px !important;
    line-height: 40px !important;
    margin: 0 8px;
    font-size: 13px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f5f7fa;
    min-width: 0;
}

/* 数据看板 */
.dashboard {
    padding: 10px;
}

/* 大项目管理布局 */
.big-projects-container {
    padding: 10px;
}

.projects-list-card {
    margin-bottom: 15px;
}

.project-detail-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.filter-bar {
    padding: 10px 0;
    display: flex;
    justify-content: flex-end;
}

.stats-row {
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    background: white;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card.business-stat {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e5e7eb;
}

.stat-card.big-project-stat {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.card-header-title .el-icon {
    font-size: 18px;
}

.stat-item {
    padding: 12px;
    text-align: center;
}

.stat-item-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-item-value {
    font-size: 24px;
    font-weight: 700;
    color: #1677ff;
    margin-bottom: 6px;
}

.stat-item-sub {
    font-size: 12px;
    color: #9ca3af;
}

.stat-value.expense {
    color: #fa8c16;
}

.stat-value.profit {
    color: #52c41a;
}

.stat-sub {
    font-size: 12px;
    color: #606266;
}

.chart-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    background: white;
    overflow: hidden;
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.chart-header .el-icon {
    font-size: 18px;
}

.charts-row {
    margin-bottom: 20px;
}

/* 数据表格 */
.data-table {
    height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.filter-form {
    margin-bottom: 20px;
    padding: 16px;
    background-color: #fafafa;
    border-radius: 6px;
}

.el-table {
    border-radius: 6px;
    overflow: hidden;
}

.el-table th {
    background-color: #f5f7fa !important;
    color: #606266;
    font-weight: 600;
}

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* 批量操作工具栏 */
.batch-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e6f4ff 0%, #f5f7fa 100%);
    border: 1px solid #91caff;
    border-radius: 8px;
}

.batch-count {
    font-size: 14px;
    color: #606266;
    margin-right: 4px;
}

.batch-count b {
    color: #1677ff;
    font-size: 16px;
}

/* 通用样式 */
.el-card {
    border-radius: 12px;
    margin-bottom: 20px;

}

/* 悬浮关闭按钮（右上角） */
.stop-server-float-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.stop-server-float-btn:hover {
    opacity: 1;
}

/* 停止服务确认对话框样式 */
.stop-server-dialog {
    text-align: center;
    padding: 20px;
}

.stop-server-dialog .warning-text {
    font-size: 16px;
    color: #f56c6c;
    margin-bottom: 10px;
    font-weight: bold;
}

.stop-server-dialog .info-text {
    font-size: 14px;
    color: #606266;
    margin-bottom: 20px;
}

/* 已关闭页面 */
.server-stopped-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8e8e8 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.server-stopped-page .stopped-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.server-stopped-page .stopped-title {
    font-size: 24px;
    color: #606266;
    margin-bottom: 10px;
}

.server-stopped-page .stopped-desc {
    font-size: 14px;
    color: #909399;
    margin-bottom: 30px;
}

.server-stopped-page .restart-btn {
    padding: 12px 30px;
    font-size: 16px;
}

.el-button--primary {
    background: linear-gradient(135deg, #1677ff 0%, #409EFF 100%);
    border: none;
}

.el-button--primary:hover {
    opacity: 0.9;
}

/* 对话框 */
.el-dialog {
    border-radius: 12px;
    overflow: hidden;
}

.el-dialog__header {
    background: linear-gradient(135deg, #1677ff 0%, #409EFF 100%);
    color: white;
    padding: 20px;
}

.el-dialog__title {
    color: white;
    font-weight: 600;
}

.el-dialog__headerbtn .el-dialog__close {
    color: white;
}

/* 通用卡片样式 */
.el-card {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    border: none;
    transition: all 0.2s ease;
}

.el-card__header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.el-card__body {
    padding: 16px 20px;
}

/* 表格容器 */
.data-table {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 筛选栏样式 */
.filter-section {
    margin-bottom: 16px;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
}

.filter-header:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.filter-header .el-icon {
    font-size: 16px;
}

.filter-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.filter-icon.is-active {
    transform: rotate(180deg);
}

.filter-form {
    padding: 16px 0 0 0;
    margin-bottom: 0;
}

.filter-form .el-form-item {
    margin-bottom: 0;
    margin-right: 12px;
}

/* 表格样式 */
.el-table {
    border-radius: 8px;
    overflow: hidden;
}

.el-table th.el-table__cell {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 600;
    font-size: 13px;
}

.el-table td.el-table__cell {
    padding: 12px 0;
}

/* 批量操作工具栏 */
.batch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e6f4ff 0%, #f0f5ff 100%);
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #bae6fd;
    animation: slideDown 0.3s ease;
}

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

.batch-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1677ff;
    font-weight: 500;
}

.batch-count b {
    font-size: 16px;
}

.batch-actions {
    display: flex;
    gap: 8px;
}

/* 分页 */
.pagination {
    margin-top: 20px;
    text-align: right;
}

/* 加载状态 */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state .el-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* 表格空状态（带引导操作） */
.table-empty {
    padding: 48px 20px;
    text-align: center;
}
.table-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.table-empty-text {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 16px;
}

/* 页面标题栏 */
.page-header {
    margin-bottom: 16px;
}
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-desc {
    font-size: 13px;
    color: #9ca3af;
    margin: 4px 0 0;
}

/* 响应式 */
@media (max-width: 1200px) {
    .sidebar {
        width: 180px !important;
    }
    
    .stats-row .el-col {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -220px;
        z-index: 999;
        transition: left 0.3s;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .stats-row .el-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .header-actions .el-button {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .logo h1 {
        font-size: 16px;
    }
}

/* ==================== 表格密度：紧凑模式 ==================== */
.density-compact .el-table .el-table__cell {
    padding: 4px 0 !important;
}
.density-compact .el-table .cell {
    line-height: 1.4;
    font-size: 13px;
}
.density-compact .el-table th.el-table__cell {
    padding: 6px 0 !important;
}

/* ==================== 暗色模式 ==================== */
html.dark body {
    background-color: #0f1115;
    color: #cfd3dc;
}

/* Element Plus 暗色变量覆盖 */
html.dark {
    --el-bg-color-page: #0f1115;
    --el-bg-color: #1a1d24;
    --el-bg-color-overlay: #22262f;
    --el-text-color-primary: #e5eaf3;
    --el-text-color-regular: #cfd3dc;
    --el-text-color-secondary: #a3a6ad;
    --el-text-color-placeholder: #6c6e72;
    --el-text-color-disabled: #5a5c60;
    --el-border-color: #3f4249;
    --el-border-color-light: #363940;
    --el-border-color-lighter: #2e3138;
    --el-border-color-extra-light: #26292f;
    --el-fill-color: #2e3138;
    --el-fill-color-light: #26292f;
    --el-fill-color-lighter: #1f2228;
    --el-fill-color-extra-light: #1a1d24;
    --el-fill-color-blank: #1a1d24;
    --el-color-white: #1a1d24;
    --el-color-black: #e5eaf3;
    --el-mask-color: rgba(0, 0, 0, 0.7);
    --el-box-shadow: 0 12px 32px 4px rgba(0, 0, 0, 0.36), 0 8px 20px rgba(0, 0, 0, 0.6);
    --el-box-shadow-light: 0 0 12px rgba(0, 0, 0, 0.6);
    --el-box-shadow-lighter: 0 0 6px rgba(0, 0, 0, 0.5);
    --el-disabled-bg-color: #26292f;
    --el-disabled-text-color: #5a5c60;
    --el-disabled-border-color: #3f4249;
}

/* 业务样式暗色适配 */
html.dark .main-content {
    background-color: #0f1115;
}
html.dark .sidebar {
    background-color: #1a1d24;
    border-right-color: #2e3138;
}
html.dark .el-menu-item {
    color: #cfd3dc;
}
html.dark .el-menu-item:hover {
    background-color: #26292f !important;
}
html.dark .el-sub-menu__title {
    color: #cfd3dc;
}
html.dark .el-sub-menu__title:hover {
    background-color: #26292f !important;
}
html.dark .stat-card,
html.dark .chart-card,
html.dark .data-table,
html.dark .el-card {
    background-color: #1a1d24;
    border-color: #2e3138;
    color: #cfd3dc;
}
html.dark .stat-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
html.dark .stat-card.business-stat {
    background: linear-gradient(135deg, #1a1d24 0%, #1f2228 100%);
}
html.dark .stat-card.big-project-stat {
    background: linear-gradient(135deg, #14202e 0%, #16222e 100%);
    border-color: #1d3a5f;
}
html.dark .chart-card .el-card__header,
html.dark .el-card__header {
    background-color: #1f2228;
    border-bottom-color: #2e3138;
    color: #e5eaf3;
}
html.dark .stat-title {
    color: #a3a6ad;
}
html.dark .stat-item-label {
    color: #a3a6ad;
}
html.dark .stat-item-value {
    color: #4d9fff;
}
html.dark .page-title {
    color: #e5eaf3;
}
html.dark .page-desc {
    color: #6c6e72;
}
html.dark .filter-header {
    background: #1f2228;
    color: #cfd3dc;
}
html.dark .filter-header:hover {
    background: #26292f;
}
html.dark .batch-toolbar {
    background: linear-gradient(135deg, #14202e 0%, #16222e 100%);
    border-color: #1d3a5f;
}
html.dark .batch-count {
    color: #4d9fff;
}
html.dark .table-empty-text {
    color: #6c6e72;
}
html.dark .el-table {
    --el-table-bg-color: #1a1d24;
    --el-table-tr-bg-color: #1a1d24;
    --el-table-header-bg-color: #1f2228;
    --el-table-header-text-color: #e5eaf3;
    --el-table-text-color: #cfd3dc;
    --el-table-border-color: #2e3138;
    --el-table-row-hover-bg-color: #26292f;
    --el-table-striped-bg-color: #1f2228;
}
html.dark .el-pagination {
    --el-pagination-bg-color: #1a1d24;
    --el-pagination-button-bg-color: #1f2228;
    --el-pagination-text-color: #cfd3dc;
    --el-pagination-button-color: #cfd3dc;
}
html.dark .el-dialog {
    --el-dialog-bg-color: #22262f;
}
html.dark .el-loading-mask {
    --el-mask-color: rgba(0, 0, 0, 0.7);
}
