:root {
    /* 主色调 - 现代蓝紫色系 */
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --primary-bg: #eef2ff;
    
    /* 功能色 */
    --success: #10b981;
    --success-light: #d1fae5;
    --info: #06b6d4;
    --info-light: #cffafe;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    
    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* 过渡 */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ========== 基础样式 ========== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.6;
    padding-top: 64px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 禁止整页横向滚动，溢出内容在容器内 table-responsive 滚动 */
    overflow-x: hidden;
    width: 100%;
}
html {
    overflow-x: hidden;
    width: 100%;
}
/* 容器宽度保护 */
.container-fluid {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}
.row {
    margin-left: -7.5px;
    margin-right: -7.5px;
}
[class*="col-"] {
    padding-left: 7.5px;
    padding-right: 7.5px;
}

/* ========== 导航栏 ========== */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
    height: 64px;
    padding: 0 1.5rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.85) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 220px;
}

.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar .dropdown-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.navbar .dropdown-item i {
    width: 1.25rem;
    text-align: center;
    color: var(--gray-400);
}

.navbar .dropdown-item:hover i {
    color: var(--primary);
}

.navbar .dropdown-divider {
    margin: 0.25rem 0;
}

/* 用户头像 */
.navbar .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ========== 卡片 ========== */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
/* 表格卡片 - table-card 保留圆角裁剪 */
.table-card {
    overflow: hidden;
}
/* 表格容器在卡片内时，让卡片不截断表格横向滚动条 */
.card .table-responsive {
    overflow-x: auto !important;
}
/* 卡片body作为表格的直接容器时，允许滚动条可见 */
.card .card-body .table-responsive {
    overflow-x: auto !important;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header h6 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

/* 统计卡片 */
.stat-card {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    border: none;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

/* ========== 全局表格统一样式 ========== */

/* 所有表格容器默认可横向滚动 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 所有表格默认不换行，溢出省略 */
.table {
    margin-bottom: 0;
    width: 100%;
    /* table-layout:auto 让列宽自适应内容。
       列少时表格自然填满容器，不会有横向滚动条；
       列多超宽时 table-responsive 自动产生横向滚动条 */
}

.table thead th {
    background: linear-gradient(180deg, var(--gray-50) 0%, #f0f1f5 100%);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody td {
    padding: 0.3rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.78rem;
    color: var(--gray-700);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 250px;
    line-height: 1.2;
}

/* 特定列覆盖 - 操作列不限制宽度 */
.table tbody td:last-child,
.table tbody td .btn-group {
    white-space: nowrap;
    overflow: visible;
    max-width: none;
    text-overflow: clip;
}

/* 状态/徽标列不限制 */
.table tbody td .badge {
    white-space: nowrap;
    overflow: visible;
    max-width: none;
}

.table tbody tr {
    transition: all 0.15s ease;
}

.table tbody tr:hover {
    background: var(--primary-bg);
}

.table-hover tbody tr:hover {
    background: var(--primary-bg);
}

/* 斑马纹表格 */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(79, 70, 229, 0.02);
}

.table-striped > tbody > tr:nth-of-type(odd):hover {
    background-color: var(--primary-bg);
}

/* 表格行边框 - 更清晰的分隔 */
.table-bordered-custom tbody tr {
    border-bottom: 1px solid var(--gray-200);
}

.table-bordered-custom tbody tr:last-child {
    border-bottom: none;
}

/* 表格卡片容器 */
.table-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-card .table thead th:first-child {
    border-top-left-radius: 0;
}

.table-card .table thead th:last-child {
    border-top-right-radius: 0;
}

/* ====================== 表格操作列 - 统一修复 ====================== */
/* 防止操作列被压缩、按钮溢出 */

/* 操作列最小宽度保底，table-layout:fixed 下不被压到消失 */
.table .action-cell,
.table td:last-child,
.table th:last-child {
    min-width: 130px;
    width: 1%;
    white-space: nowrap;
}

/* 操作列内的按钮组用 flex nowrap 防止换行 */
.table .action-cell .btn-group,
.table td:last-child .btn-group,
.table td .btn-group-compact {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 2px;
}

/* 操作列按钮基础样式 - 紧凑且不溢出 */
.table .action-cell .btn,
.table td:last-child .btn,
.table td .btn-group .btn,
.table td .btn-group-compact .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.3;
}

.table .action-cell .btn i,
.table td:last-child .btn i,
.table td .btn-group .btn i,
.table td .btn-group-compact .btn i {
    font-size: 0.75rem;
    margin-right: 2px;
}

/* 操作列按钮的文字 - 大屏显示、小屏响应式隐藏/显示 */
.table .action-cell .btn .btn-label,
.table td:last-child .btn .btn-label,
.table td .btn-group .btn .btn-label,
.table td .btn-group-compact .btn .btn-label {
    display: inline;
}

/* 当按钮内包含图标+文字时，用 .btn-label 包裹文字部分 */
/* 如果按钮只有图标没有文字，用 title 属性兜底显示文字（由 JS 自动添加 .btn-label） */

/* ====================== 按钮溢出容器 防溢出修复 ====================== */
/* 无论是内联 style="white-space:nowrap" 还是表格内的操作列，确保不溢出父容器 */
.btn-group {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow: visible;
}

.btn-group .btn {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

/* 操作按钮组溢出保护 - 当按钮太多时缩小字号和间距 */
.action-btns {
    display: inline-flex;
    gap: 0.2rem;
    flex-wrap: nowrap;
    max-width: 100%;
}

.action-btns .btn {
    padding: 0.2rem 0.35rem;
    font-size: 0.72rem;
    flex-shrink: 1;
    min-width: 0;
}

/* 按钮图标与文字间距 */
.action-btns .btn i + span,
.action-btns .btn i + .btn-label,
.btn-group .btn i + span,
.btn-group .btn i + .btn-label {
    margin-left: 2px;
}

/* 表格操作列 - 按钮样式 */
.table .action-cell .btn,
.table td:last-child .btn,
.table td .btn-group .btn,
.table td .btn-group-compact .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.3;
}

.table .action-cell .btn i,
.table td:last-child .btn i,
.table td .btn-group .btn i,
.table td .btn-group-compact .btn i {
    font-size: 0.75rem;
    margin-right: 2px;
}

/* ====================== 全局样式：表格内按钮统一 ====================== */
/* 针对所有表格内按钮的通用规则 */
.table td .btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
}

.table td .btn i {
    font-size: 0.75rem;
}

/* 状态/徽标列不限制 */
.table tbody td .badge {
    white-space: nowrap;
    overflow: visible;
    max-width: none;
}

/* ========== 操作按钮组 ========== */
.action-btns {
    display: flex;
    gap: 0.25rem;
}

.action-btns .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ========== 按钮 ========== */
.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    touch-action: manipulation;
    cursor: pointer;
    line-height: 1.4;
}

/* 按钮 loading 状态 */
.btn[data-loading="true"] {
    pointer-events: none;
    opacity: 0.85;
}

/* 按钮无权限隐藏 */
.btn[data-permission][style*="display: none"] {
    display: none !important;
}

/* 移动端触摸友好按钮 */
.touch-friendly.btn,
.touch-friendly .btn,
.btn.touch-friendly {
    min-height: 40px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* 纯图标按钮 aria-label 辅助 */
.btn-icon-only {
    min-width: 36px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    justify-content: center;
}

/* 按钮组紧凑模式 */
.btn-group-compact .btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    margin: 0 1px;
}
.btn-group-compact .btn i {
    font-size: 0.8rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: #fff;
}

.btn-info:hover {
    background: #0891b2;
    border-color: #0891b2;
    color: #fff;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ========== 表单 ========== */
.form-control,
.form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: var(--transition);
    background: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0.375rem;
}

.form-text {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* ========== 徽章 ========== */
.badge {
    font-weight: 500;
    padding: 0.25em 0.65em;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.badge.bg-primary {
    background: var(--primary-bg) !important;
    color: var(--primary);
}

.badge.bg-success {
    background: var(--success-light) !important;
    color: #059669;
}

.badge.bg-warning {
    background: var(--warning-light) !important;
    color: #d97706;
}

.badge.bg-danger {
    background: var(--danger-light) !important;
    color: #dc2626;
}

.badge.bg-info {
    background: var(--info-light) !important;
    color: #0891b2;
}

/* ========== 模态框 ========== */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-100);
    padding: 0.75rem 1rem;
    background: var(--gray-50);
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-100);
    padding: 0.6rem 1rem;
    background: var(--gray-50);
    gap: 0.35rem;
}

.modal-footer .btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.modal-header .btn-close:focus {
    box-shadow: none;
}

/* 模态框内表单统一样式 */
.modal-body .form-control,
.modal-body .form-select {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.modal-body .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.15rem;
}

.modal-body .mb-3 {
    margin-bottom: 0.6rem !important;
}

.modal-body .row.g-3 > [class*="col-"] {
    padding-top: 0.3rem;
}

.modal-body .row.g-3 {
    margin: -0.3rem;
}

/* ====================== 模态框溢出修复 ====================== */
/* 模态框内表格保证不溢出模态框边界 */
.modal-body .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

.modal-body .table-responsive .table {
    min-width: auto;
    width: 100%;
    table-layout: auto;
}

.modal-body .table-responsive .table th,
.modal-body .table-responsive .table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 模态框内按钮组防止溢出 */
.modal-body .btn-group {
    flex-wrap: nowrap;
    max-width: 100%;
}

.modal-body .btn-group .btn {
    padding: 0.2rem 0.35rem;
    font-size: 0.72rem;
    flex-shrink: 0;
}

/* 模态框大尺寸内容保护 */
.modal-dialog-scrollable .modal-body {
    overflow-x: hidden;
}

.modal-dialog .modal-content {
    max-width: 100%;
}

/* 全屏模态框内容防溢出 */
.modal-fullscreen .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
}

/* 模态框内 flex 保护 */
.modal-body .d-flex {
    flex-wrap: wrap;
}

.modal-body .d-flex.gap-2 {
    gap: 0.3rem !important;
}

/* ========== 分页 ========== */
.pagination {
    gap: 0.2rem;
    flex-wrap: wrap;
}

.page-link {
    border: 1px solid transparent;
    border-radius: var(--radius) !important;
    padding: 0.35rem 0.65rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.15s ease;
    min-width: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: var(--gray-300);
    pointer-events: none;
    opacity: 0.6;
}

.page-item .page-link.page-first,
.page-item .page-link.page-prev,
.page-item .page-link.page-next,
.page-item .page-link.page-last {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
}

/* 分页信息栏 */
.pagination-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

/* 分页容器 */
.pagination-wrapper {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ========== 加载动画 ========== */
.spinner-border {
    color: var(--primary);
}

/* ========== 提示消息 ========== */
.alert {
    border: none;
    border-radius: var(--radius);
}

.alert-success {
    background: var(--success-light);
    color: #059669;
}

.alert-danger {
    background: var(--danger-light);
    color: #dc2626;
}

.alert-warning {
    background: var(--warning-light);
    color: #d97706;
}

.alert-info {
    background: var(--info-light);
    color: #0891b2;
}

/* ========== 进度条 ========== */
.progress {
    background: var(--gray-100);
    border-radius: 9999px;
    height: 0.5rem;
}

.progress-bar {
    background: var(--primary);
    border-radius: 9999px;
}

/* ========== 页脚 ========== */
.footer {
    background: #fff !important;
    border-top: 1px solid var(--gray-100) !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.8rem;
}

/* ========== 工具类 ========== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-info { background: var(--info) !important; }

/* 边框颜色卡片 */
.border-left-primary { border-left: 4px solid var(--primary) !important; }
.border-left-success { border-left: 4px solid var(--success) !important; }
.border-left-warning { border-left: 4px solid var(--warning) !important; }
.border-left-info { border-left: 4px solid var(--info) !important; }
.border-left-danger { border-left: 4px solid var(--danger) !important; }

/* 阴影 */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ========== 响应式 ========== */
@media (max-width: 991.98px) {
    body {
        padding-top: 56px;
    }
    
    .navbar {
        height: 56px;
    }
    
    .navbar-collapse {
        background: var(--primary-dark);
        border-radius: 0 0 var(--radius) var(--radius);
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* ========== 自定义滚动条 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* ========== 搜索/筛选栏 ========== */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* 筛选表单紧凑版（用于应收账款/应付账款等页面的筛选区） */
.filter-compact .row.g-3,
.filter-compact.row.g-3 {
    margin: -0.2rem;
}
.filter-compact .row.g-3 > [class*="col-"],
.filter-compact.row.g-3 > [class*="col-"] {
    padding: 0.2rem;
}
.filter-compact .form-label {
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
    font-weight: 500;
}
.filter-compact .form-control,
.filter-compact .form-select {
    padding: 0.25rem 0.4rem;
    font-size: 0.78rem;
}
.filter-compact .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
}
.filter-compact .card-body {
    padding: 0.6rem 0.8rem;
}
.filter-compact .card {
    margin-bottom: 0.6rem !important;
}

/* ========== Toast 通知 ========== */
.toast-container {
    z-index: 9999;
}

.toast {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ========== 仪表盘特殊样式 ========== */
.chart-area {
    position: relative;
    height: 250px;
}

.chart-pie {
    position: relative;
    height: 200px;
}

/* ========== 移动端底部导航 ========== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid var(--gray-200);
        z-index: 1030;
        padding: 0.5rem 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .mobile-bottom-nav .nav-item {
        flex: 1;
        text-align: center;
    }
    
    .mobile-bottom-nav .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.125rem;
        color: var(--gray-400);
        text-decoration: none;
        font-size: 0.65rem;
        padding: 0.25rem 0;
        transition: var(--transition);
    }
    
    .mobile-bottom-nav .nav-link i {
        font-size: 1.25rem;
    }
    
    .mobile-bottom-nav .nav-link.active {
        color: var(--primary);
    }
    
    .mobile-bottom-nav .nav-link:hover {
        color: var(--primary);
    }
    
    body {
        padding-bottom: 60px;
    }
}

/* ========== 计划管理模态框 ========== */
.plan-modal .modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-bottom: none;
    padding: 1rem 1.25rem;
}

.plan-modal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.plan-modal .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.plan-modal .modal-body {
    padding: 1.5rem;
}

.plan-modal .modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 0.875rem 1.25rem;
}

/* ========== 执行项/里程碑表格 ========== */
.execution-table th,
.milestone-table th {
    white-space: nowrap;
    font-size: 0.85rem;
}

.execution-table td,
.milestone-table td {
    vertical-align: middle;
}

/* ========== 详情表格 ========== */
.detail-table td {
    padding: 0.5rem 0.75rem;
    border: none;
}

.detail-table tr + tr td {
    border-top: 1px solid var(--gray-100);
}

/* ========== 计划统计卡片 ========== */
.plan-stat-card {
    border: none;
    border-radius: var(--radius);
    transition: var(--transition);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.plan-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.plan-stat-card .card-body {
    padding: 1.25rem;
}

.plan-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.plan-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.plan-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ========== 计划搜索卡片 ========== */
.plan-search-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.plan-search-card .card-body {
    padding: 1.25rem;
}

.plan-search-card .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 0.375rem;
}

/* ========== 计划表格卡片 ========== */
.plan-table-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.plan-table-card .card-header {
    background: linear-gradient(135deg, var(--gray-50), #fff);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

.plan-table-card .card-header h5 {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.plan-table-card .card-body {
    padding: 0;
}

.plan-table-card .table {
    margin-bottom: 0;
}

.plan-table-card .table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.plan-table-card .table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.plan-table-card .table tbody tr:hover {
    background-color: var(--gray-50);
}

/* ========== 通知系统样式 ========== */
/* 通知铃铛按钮 */
.notification-bell {
    position: relative;
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.notification-bell:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--primary);
    line-height: 1;
}

/* 通知面板 */
.notification-panel {
    position: fixed;
    top: 64px;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: calc(100vh - 64px);
    background: #fff;
    z-index: 1050;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.notification-panel.show {
    transform: translateX(0);
}
.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.notification-panel-header h6 {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.notification-panel-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--gray-100);
    flex-shrink: 0;
}

/* 通知项 */
.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.notification-item:hover {
    background: var(--gray-50);
}
.notification-item.unread {
    background: var(--primary-bg);
}
.notification-item.unread:hover {
    background: #dde4ff;
}
.notification-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.notification-item-content {
    flex: 1;
    min-width: 0;
}
.notification-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-800);
    margin-bottom: 0.2rem;
}
.notification-item-message {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notification-item-time {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}
.notification-item-time a {
    color: var(--primary);
    text-decoration: none;
}
.notification-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 4px;
}

/* 通知遮罩 */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1049;
    display: none;
}
.notification-overlay.show {
    display: block;
}

/* ========== 打印优化 ========== */
@media print {
    .plan-modal .modal-header {
        background: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========== ========== ========== ========== ========== ========== ========== */
/* 2026-06-30 统一溢出修复补丁 */
/* ========== ========== ========== ========== ========== ========== ========== */

/* --- 1. 表格操作列防溢出 --- */
/* 操作列保有最小宽度，避免在 table-layout:fixed 下被压缩消失 */
.table td:last-child {
    min-width: 130px;
    white-space: nowrap;
    overflow: visible;
    max-width: none;
    text-overflow: clip;
}

/* 操作列按钮组不换行 */
.table td:last-child .btn-group,
.table td:last-child > div,
td .action-btns {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 2px;
    max-width: 100%;
}

/* 操作列按钮统一样式 */
.table td:last-child .btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.72rem;
    line-height: 1.3;
    flex-shrink: 0;
    white-space: nowrap;
}

.table td:last-child .btn i {
    font-size: 0.7rem;
    margin-right: 1px;
}

/* --- 2. 模态框溢出修复 --- */
.modal-body {
    overflow-x: hidden;
}

/* 模态框内表格自适应宽度，不强制 min-width */
.modal-body .table-responsive .table {
    min-width: auto;
    width: 100%;
    table-layout: auto;
}

.modal-body .table-responsive .table th,
.modal-body .table-responsive .table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* 模态框内内容保护 */
.modal-body img,
.modal-body video,
.modal-body iframe {
    max-width: 100%;
    height: auto;
}

/* --- 3. 全局按钮文字显示 --- */
/* 让 title 属性作为标签显示在图标后 */
.btn[title]:not(:has(.btn-label)):not(:has(span)):not(:has(strong)) {
    /* 纯图标按钮：通过 JS 自动添加文字标签 */
}

/* .btn-label 类让按钮文字和图标一起显示 */
.btn .btn-label {
    display: inline;
    margin-left: 2px;
}

/* 小屏幕：只显示图标隐藏文字 */
@media (max-width: 767.98px) {
    .table td:last-child .btn .btn-label,
    .table td:last-child .btn span:not(.btn-label-text) {
        display: none;
    }
    
    /* 但保留重要的操作文本 */
    .table td:last-child .btn .btn-label.show-mobile {
        display: inline;
    }
}