/* ============================================
   ERPNext 现代化UI增强样式 v2
   提供更丰富的色彩、紧凑的布局和美观的视觉效果
   特别注意：保留原有sticky定位和滚动逻辑
   ============================================ */

/* === 全局优化 === */
:root {
    /* 增强的色彩系统 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --info-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    
    /* 增强的背景色 */
    --bg-primary-light: #f8f9ff;
    --bg-secondary-light: #fff5f7;
    --bg-success-light: #f0faff;
    --bg-warning-light: #fffbf0;
    --bg-card-hover: #fafbff;
    
    /* 增强的阴影 */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.15);
    
    /* 更紧凑的间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    
    /* 增强的圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}

/* === 页面容器美化 === */
.page-container {
    background: linear-gradient(180deg, var(--bg-primary-light) 0%, var(--bg-color) 100%);
    min-height: 100vh;
}

.page-head {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%) !important;
    /* 移除backdrop-filter，避免创建新的层叠上下文影响sticky定位 */
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: var(--shadow-soft);
}

.page-head-content {
    padding: 12px 0px !important;
}

.page-title .title-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* === 表单区域美化 === */
/* 注意：不能设置 overflow: hidden，否则会破坏 .form-tabs-list 的 position: sticky 定位 */
.std-form-layout > .form-layout > .form-page {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    /* 不使用 clip-path，因为它会裁剪 awesomplete 下拉菜单等溢出内容 */
}

.form-section {
    margin: 12px 0;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--shadow-medium);
}

.section-head {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    padding: 12px 16px !important;
    font-weight: 600;
    color: #667eea;
}

.section-body {
    padding: 16px !important;
}

/* === 卡片美化 === */
.frappe-card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.frappe-card:hover {
    box-shadow: var(--shadow-medium);
}

/* 注意：不要修改.layout-main-section.frappe-card的overflow属性
   因为它内部有sticky定位的元素（如.form-tabs-list）
   overflow: hidden会破坏sticky定位功能 */
.layout-main-section.frappe-card {
    /* 保持原有的overflow: hidden，只添加视觉增强 */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
}

/* === 列表视图美化 === */
.frappe-list {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

.list-row-container {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.list-row-container:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.002);
}

.list-row {
    padding: 10px 12px !important;
}

/* === 按钮美化 === */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

/* 防止页面容器截断下拉菜单 */
.page-container,
.page-content,
.page-wrapper,
.container,
.layout-main-section {
    overflow: visible !important;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: none;
    color: #5a67d8;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* === 图表过滤器按钮美化（复用 .filter-chart 样式）=== */
/* 用于 user-profile 页面的图表筛选按钮，避免重复造轮子 */
/* 提高选择器优先级 (.btn.btn-secondary 优先级高于 .btn-secondary)，确保覆盖 Frappe 默认样式 */
.chart-filter .btn.btn-secondary,
.chart-filter .btn.btn-default,
.card-options .btn.btn-secondary,
.card-options .btn.btn-default {
    border-radius: var(--radius-sm) !important;
    transition: all 0.3s ease !important;
    box-shadow: var(--shadow-soft) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.18) 100%) !important;
    color: #5a67d8 !important;
    font-weight: 500 !important;
}

.chart-filter .btn.btn-secondary:hover,
.chart-filter .btn.btn-default:hover,
.card-options .btn.btn-secondary:hover,
.card-options .btn.btn-default:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-medium) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.28) 0%, rgba(118, 75, 162, 0.28) 100%) !important;
    color: #4c51bf !important;
}

/* === 输入框美化 === */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

input:focus:not([type="checkbox"]):not([type="radio"]),
textarea:focus,
select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

/* === 导航栏美化 === */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: var(--shadow-strong);
}

.navbar-brand {
    color: white !important;
    font-weight: 700;
}

.navbar-nav > li > a {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
}

.navbar-nav > li > a:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
}

/* 修复顶部导航栏按钮和文字颜色 - 确保帮助和通知图标在白天模式下显示为白色 */
.navbar .nav-link {
    color: white !important;
}

.navbar .nav-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar .nav-link svg {
    --icon-stroke: white !important;
    stroke: white !important;
}

.navbar .nav-link .text-muted {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar .vertical-bar {
    border-right-color: rgba(255, 255, 255, 0.3) !important;
}

/* === 侧边栏美化 === */
.desk-sidebar {
    background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
    border-right: 1px solid rgba(102, 126, 234, 0.1);
}

.standard-sidebar-item {
    border-radius: var(--radius-sm);
    margin: 4px 8px;
}

/* 移除 hover 效果，避免触发"..."按钮下拉菜单显示问题 */
/* .standard-sidebar-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(4px);
} */

.standard-sidebar-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    box-shadow: var(--shadow-soft);
}

/* === 仪表盘小组件美化 === */
.widget-group {
    margin-bottom: 20px;
}

.widget {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.widget:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

/* shortcut 和 links widget 共用相同样式 */
.widget:is(.shortcut-widget-box, .links-widget-box) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget:is(.shortcut-widget-box, .links-widget-box):hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium), var(--shadow-glow);
}

.widget.headline-widget-box {
    background: var(--primary-gradient);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget.headline-widget-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

/* === 表格美化 === */
.datatable {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.datatable .dt-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.datatable .dt-cell {
    border-color: rgba(0, 0, 0, 0.04);
}

.datatable .dt-row:hover .dt-cell {
    background: rgba(102, 126, 234, 0.03);
}

/* === 标签和徽章美化 === */
.indicator-pill {
    border-radius: 20px;
    padding: 4px 12px;
    font-weight: 500;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s ease;
}

/* 当指示器没有文字内容时隐藏阴影 */
.indicator-pill:empty {
    box-shadow: none;
    padding: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.tag {
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* === 时间线美化 === */
.timeline {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* 活动栏背景透明，融入页面底色 */
.new-timeline .activity-title,
.new-timeline .timeline-actions {
    background-color: transparent !important;
}

.timeline-item {
    position: relative;
    padding-left: 24px;
    margin-left: 12px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-gradient);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2), 0 2px 8px rgba(102, 126, 234, 0.3);
    z-index: 1;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -7px;
    top: 20px;
    bottom: -20px;
    width: 2px;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-item:hover {
    transform: translateX(4px);
}

.timeline-item .timeline-content {
    background: white;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
    box-shadow: var(--shadow-medium);
    border-color: rgba(102, 126, 234, 0.2);
}

.timeline-item .activity-title {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.timeline-item .activity-message {
    color: #4a5568;
    line-height: 1.6;
    font-size: 13px;
}

.timeline-item .indicator-pill {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 评论输入框美化 */
.comment-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 251, 255, 0.95) 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(102, 126, 234, 0.15);
    margin-top: 24px;
}

.comment-box .comment-input-header {
    color: #667eea;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
}

.comment-box textarea {
    border-radius: var(--radius-md);
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    background: white;
}

.comment-box textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* === 通知和提示美化 === */
.alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-medium);
}

.alert-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    border-left: 4px solid #4facfe;
}

.alert-success {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1) 0%, rgba(56, 249, 215, 0.1) 100%);
    border-left: 4px solid #43e97b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.1) 0%, rgba(254, 225, 64, 0.1) 100%);
    border-left: 4px solid #fa709a;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(238, 90, 131, 0.1) 100%);
    border-left: 4px solid #ff6b6b;
}

/* === 下拉菜单美化 === */
.dropdown-menu {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-strong);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    margin: 2px 0;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(4px);
}

/* === 工作区编辑按钮 & Widget 控制按钮（样式相同，合并处理） === */
:is(.setting-btn, .btn-edit-workspace, .btn-new-workspace),
.widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #4a5568 !important;
    transition: all 0.3s ease !important;
}

:is(.setting-btn, .btn-edit-workspace, .btn-new-workspace):hover,
.widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button):hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: #2d3748 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

:is(.setting-btn, .btn-edit-workspace, .btn-new-workspace) svg,
.widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button) svg {
    --icon-stroke: #667eea !important;
    stroke: #667eea !important;
    fill: #667eea !important;
}

:is(.setting-btn, .btn-edit-workspace, .btn-new-workspace) span,
.widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button) span {
    color: #4a5568 !important;
}

/* Widget控制按钮的图标字体 */
.widget-control :is(.btn, .btn-default, .edit-button, .move-widget, .show-or-hide-button) i {
    color: #667eea !important;
}

/* 工作区widget编辑按钮的下拉菜单 - 提高z-index避免被截断 */
.dropdown-list {
    z-index: 9999 !important;
    box-shadow: var(--shadow-strong) !important;
    position: absolute !important;
}

/* Widget控制容器允许溢出，防止下拉菜单被截断 */
.widget-control {
    overflow: visible !important;
}

.widget {
    overflow: visible !important;
}

.widget:hover {
    overflow: visible !important;
}

.dropdown-list .dropdown-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
}

/* 右上角标准操作按钮（丢弃、保存等） */
:is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default),
.secondary-action {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #4a5568 !important;
}

:is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default):hover,
.secondary-action:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: #2d3748 !important;
}

:is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default) svg,
.secondary-action svg {
    --icon-stroke: #667eea !important;
    stroke: #667eea !important;
    fill: #667eea !important;
}

:is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default) span,
.secondary-action span {
    color: #4a5568 !important;
}

/* 侧边栏编辑模式按钮 - 白天模式 */
.desk-sidebar .standard-sidebar-section.show-control .desk-sidebar-item :is(.drag-handle, .setting-btn, .duplicate-page, .unhide-workspace-btn) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    color: #4a5568 !important;
}

.desk-sidebar .standard-sidebar-section.show-control .desk-sidebar-item :is(.drag-handle, .setting-btn, .duplicate-page, .unhide-workspace-btn):hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
    color: #2d3748 !important;
}

.desk-sidebar .standard-sidebar-section.show-control .desk-sidebar-item :is(.drag-handle, .setting-btn, .duplicate-page, .unhide-workspace-btn) svg {
    --icon-stroke: #667eea !important;
    stroke: #667eea !important;
    fill: #667eea !important;
}

/* === 模态框美化 === */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-strong);
}

.modal-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* === 搜索和过滤器美化 === */
.page-form {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(250, 251, 255, 0.9) 100%);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    margin: 12px 0;
}

.filter-button {
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* === 进度条美化 === */
.progress {
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: 20px;
    transition: width 0.6s ease;
}

/* === 图表容器美化 === */
.chart-container {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

/* === 图表过滤器按钮美化 === */
.filter-chart {
    border-radius: var(--radius-sm) !important;
    transition: all 0.3s ease !important;
    box-shadow: var(--shadow-soft) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

.filter-chart:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-medium) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
}

.filter-chart svg {
    color: #667eea !important;
    fill: #667eea !important;
}

/* === 图表菜单按钮美化（三个点的按钮）=== */
.chart-menu {
    border-radius: var(--radius-sm) !important;
    transition: all 0.3s ease !important;
    box-shadow: var(--shadow-soft) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    background: white !important;
}

.chart-menu:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-medium) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%) !important;
}

.chart-menu svg {
    color: #667eea !important;
    fill: #667eea !important;
}

/* 表单关联区域的+号按钮样式 - 白天模式 */
.btn.btn-new.btn-secondary.btn-xs.icon-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

.btn.btn-new.btn-secondary.btn-xs.icon-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.btn.btn-new.btn-secondary.btn-xs.icon-btn svg {
    --icon-stroke: #667eea !important;
    stroke: #667eea !important;
    fill: #667eea !important;
}

/* 过滤弹窗中的"清除过滤条件"按钮样式 - 白天模式（"应用筛选"保持原样） */
.filter-popover .filter-action-buttons .btn.btn-secondary,
.filter-popover .filter-action-buttons .btn.btn-default,
.filter-popover .filter-action-buttons .clear-filters {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #4a5568 !important;
    transition: all 0.3s ease !important;
}

.filter-popover .filter-action-buttons .btn.btn-secondary:hover,
.filter-popover .filter-action-buttons .btn.btn-default:hover,
.filter-popover .filter-action-buttons .clear-filters:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: #2d3748 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

/* === 响应式优化 === */
@media (max-width: 768px) {
    .page-container {
        padding: 8px;
    }
    
    .form-section {
        margin: 8px 0;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* === 动画效果 === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.page-container {
    animation: fadeInUp 0.5s ease;
}

.form-section {
    animation: fadeInUp 0.4s ease;
}

.sidebar-item {
    animation: slideInLeft 0.3s ease;
}

/* === 滚动条美化 === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* === 表单标签栏美化 === */
.form-tabs-list {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 251, 255, 0.95) 100%) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
    border-bottom: 2px solid rgba(102, 126, 234, 0.15) !important;
}

.form-tabs-list .form-tabs .nav-item .nav-link {
    color: #6b7280 !important;
    padding: 12px 16px !important;
    margin: 0 4px !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.form-tabs-list .form-tabs .nav-item .nav-link:hover {
    color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.form-tabs-list .form-tabs .nav-item .nav-link.active {
    color: #667eea !important;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    border-bottom: 3px solid #667eea !important;
}

.form-tabs-list .form-tabs .nav-item .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px 3px 0 0;
}

/* === 打印视图优化 === */
@media print {
    .page-container {
        background: white;
    }
    
    .frappe-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* === 日期选择器修复 === */
/* 
 * 修复日期选择器在上方显示时隐藏瞬间向下跳动的问题
 * 根本原因：
 *   1. air-datepicker 隐藏时有 transition 动画（opacity + transform）
 *   2. Frappe 将 position 从 absolute 改为 fixed
 *   3. 向上显示时有 transform: translateY(-8px)
 *   4. 隐藏时先移除 .active 类触发 transition，但 left 有 0.3s 延迟才移到屏幕外
 *   5. 在 transition 期间，position 从 absolute 变为 fixed 导致位置重算产生跳动
 * 
 * 解决方案：覆盖 transition 的 left 延迟，使其立即生效
 */
.datepicker:not(.active) {
    /* 移除 left 的延迟，让 datepicker 立即移到屏幕外，避免 transition 期间的跳动 */
    transition: opacity 0.3s ease, transform 0.3s ease, left 0s 0s !important;
}

/* ============================================
   登录页面美化
   ============================================ */

/* 登录页面背景色 - 与页面头部一致的紫色渐变 */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh;
}

/* 登录页面容器居中 */
.for-login,
.for-forgot,
.for-login-with-email-link,
.for-signup,
.for-email-login {
    .page-card {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
    }
    
    .page-card-head {
        color: #667eea;
    }
    
    .page-card-head h4 {
        color: #ffffff !important;
        font-weight: 700;
    }
}

/* ============================================
   夜间模式适配
   ============================================ */
[data-theme="dark"] {
    :root {
        /* 夜间模式色彩系统 */
        --bg-primary-light: #1a1b2e;
        --bg-secondary-light: #1e1f35;
        --bg-success-light: #1a2332;
        --bg-warning-light: #2a2420;
        --bg-card-hover: #252642;
        
        /* 夜间模式阴影 */
        --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4);
        --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.5);
        --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    
    /* 页面容器 */
    .page-container {
        background: linear-gradient(180deg, #1a1b2e 0%, #0f1020 100%);
    }
    
    .page-head {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
        border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    }
    
    /* 表单区域 */
    .std-form-layout > .form-layout > .form-page {
        background: linear-gradient(135deg, #1e1f35 0%, #252642 100%);
        border: 1px solid rgba(102, 126, 234, 0.25);
    }
    
    .form-section {
        background: #1e1f35;
        border: 1px solid rgba(102, 126, 234, 0.15);
    }
    
    .section-head {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
        border-bottom: 2px solid rgba(102, 126, 234, 0.3);
        color: #a5b4fc;
    }
    
    /* 卡片 */
    .frappe-card {
        background: #1e1f35;
        border: 1px solid rgba(102, 126, 234, 0.15);
    }
    
    /* 列表视图 */
    .frappe-list {
        background: #1e1f35;
    }
    
    .list-row-container {
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .list-row-container:hover {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    }
    
    /* 输入框 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        border: 1.5px solid rgba(102, 126, 234, 0.3);
        background: rgba(30, 31, 53, 0.8);
        color: #e2e8f0;
    }
    
    input:focus:not([type="checkbox"]):not([type="radio"]),
    textarea:focus,
    select:focus {
        background: #252642;
        color: #ffffff;
    }
    
    /* 侧边栏 */
    .desk-sidebar {
        background: linear-gradient(180deg, #1a1b2e 0%, #1e1f35 100%);
        border-right: 1px solid rgba(102, 126, 234, 0.2);
    }
    
    /* 移除夜间模式的 hover 效果 */
    /* .standard-sidebar-item:hover {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    } */
    
    .standard-sidebar-item.selected {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.18) 100%);
        color: #a5b4fc;
    }
    
    /* 仪表盘小组件 */
    .widget {
        background: #1e1f35;
        border: 1px solid rgba(102, 126, 234, 0.15);
    }
    
    .widget.shortcut-widget-box {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    }
    
    .widget.links-widget-box {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    }
    
    .widget.links-widget-box:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.18) 100%);
    }
    
    .widget a {
        color: #a5b4fc !important;
    }
    
    .widget a:hover {
        color: #c7d2fe !important;
    }
    
    /* 夜间模式：统一快捷方式链接颜色，灰色链接与蓝色链接一致 */
    .links-widget-box .link-item .disabled-link,
    .shortcut-widget-box .link-item .disabled-link {
        color: #a5b4fc !important;
    }
    
    .links-widget-box .link-item .disabled-link:hover,
    .shortcut-widget-box .link-item .disabled-link:hover {
        color: #c7d2fe !important;
    }
    
    /* 表格 */
    .datatable .dt-cell {
        border-color: rgba(102, 126, 234, 0.1);
    }
    
    .datatable .dt-cell__content {
        color: #e2e8f0 !important;
    }
    
    .datatable .dt-header .dt-cell__content {
        color: #a5b4fc !important;
    }
    
    .datatable .dt-row:hover .dt-cell {
        background: rgba(102, 126, 234, 0.08);
    }
    
    /* 图表区域 */
    :is(.chart-container, .chart-wrapper, .graph-container) {
        background: #1e1f35 !important;
    }
    
    :is(.chart-container, .chart-wrapper, .graph-container) text {
        fill: #cbd5e1 !important;
        color: #cbd5e1 !important;
    }
    
    :is(.chart-container, .chart-wrapper) .axis text {
        fill: #94a3b8 !important;
    }
    
    /* 图表过滤器按钮夜间模式 */
    .filter-chart {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.4) !important;
    }
    
    .filter-chart:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
        border-color: rgba(102, 126, 234, 0.6) !important;
    }
    
    .filter-chart svg {
        color: #a5b4fc !important;
        fill: #a5b4fc !important;
    }
    
    /* user-profile 图表筛选按钮夜间模式（复用 .filter-chart 夜间样式） */
    .chart-filter .btn.btn-secondary,
    .chart-filter .btn.btn-default,
    .card-options .btn.btn-secondary,
    .card-options .btn.btn-default {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.5) !important;
        color: #c7d2fe !important;
    }
    
    .chart-filter .btn.btn-secondary:hover,
    .chart-filter .btn.btn-default:hover,
    .card-options .btn.btn-secondary:hover,
    .card-options .btn.btn-default:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%) !important;
        border-color: rgba(102, 126, 234, 0.7) !important;
        color: #e0e7ff !important;
    }
    
    /* 图表菜单按钮夜间模式 */
    .chart-menu {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.4) !important;
    }
    
    .chart-menu:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
        border-color: rgba(102, 126, 234, 0.6) !important;
    }
    
    .chart-menu svg {
        color: #a5b4fc !important;
        fill: #a5b4fc !important;
    }
    
    /* 时间线 */
    .timeline {
        background: linear-gradient(135deg, #1e1f35 0%, #252642 100%);
        border: 1px solid rgba(102, 126, 234, 0.2);
    }
    
    /* 时间线项目内容 */
    .timeline-item .timeline-content {
        background: #252642;
        border: 1px solid rgba(102, 126, 234, 0.15);
    }
    
    .timeline-item:hover .timeline-content {
        border-color: rgba(102, 126, 234, 0.3);
    }
    
    .timeline-item .activity-message {
        color: #cbd5e1;
    }
    
    /* 时间线区域按钮（发邮件等）- 夜间模式 */
    .new-timeline .action-btn.btn-secondary,
    .new-timeline .btn.btn-secondary {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.5) !important;
        color: #c7d2fe !important;
    }
    
    .new-timeline .action-btn.btn-secondary:hover,
    .new-timeline .btn.btn-secondary:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%) !important;
        border-color: rgba(102, 126, 234, 0.7) !important;
        color: #e0e7ff !important;
    }
    
    /* 子表"添加一行"按钮区域 - 背景与整体一致 */
    .grid-footer,
    .grid-footer-toolbar,
    .grid-custom-buttons {
        background-color: #1e1f35 !important;
    }
    
    /* 子表"添加一行"按钮 - 夜间模式 */
    .grid-footer .btn.btn-secondary,
    .grid-footer-toolbar .btn.btn-secondary,
    .grid-custom-buttons .btn.btn-secondary,
    .grid-add-row.btn-secondary {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.5) !important;
        color: #c7d2fe !important;
    }
    
    .grid-footer .btn.btn-secondary:hover,
    .grid-footer-toolbar .btn.btn-secondary:hover,
    .grid-custom-buttons .btn.btn-secondary:hover,
    .grid-add-row.btn-secondary:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%) !important;
        border-color: rgba(102, 126, 234, 0.7) !important;
        color: #e0e7ff !important;
    }
    
    /* 评论输入框 */
    .comment-box {
        background: linear-gradient(135deg, rgba(30, 31, 53, 0.95) 0%, rgba(37, 38, 66, 0.95) 100%);
        border: 1px solid rgba(102, 126, 234, 0.25);
    }
    
    .comment-box textarea {
        background: #252642;
        color: #e2e8f0;
    }
    
    /* 报告卡片 */
    :is(.report-card, .workspace-card) {
        background: #252642 !important;
        border: 1px solid rgba(102, 126, 234, 0.2) !important;
    }
    
    :is(.report-card, .workspace-card) a {
        color: #a5b4fc !important;
    }
    
    :is(.report-card, .workspace-card) a:hover {
        color: #c7d2fe !important;
    }
    
    :is(.report-card, .workspace-card) .card-title,
    .widget .widget-title {
        color: #e2e8f0 !important;
    }
    
    /* 下拉菜单 */
    .dropdown-menu {
        background: #1e1f35;
        border: 1px solid rgba(102, 126, 234, 0.2);
    }
    
    .dropdown-item {
        color: #e2e8f0;
    }
    
    .dropdown-item:hover {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
        color: #ffffff;
    }
    
    /* 工作区编辑按钮 & Widget 控制按钮 - 夜间模式 */
    :is(.setting-btn, .btn-edit-workspace, .btn-new-workspace),
    .widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button) {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.4) !important;
        color: #e2e8f0 !important;
    }
    
    :is(.setting-btn, .btn-edit-workspace, .btn-new-workspace):hover,
    .widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button):hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%) !important;
        border-color: rgba(102, 126, 234, 0.6) !important;
        color: #ffffff !important;
    }
    
    :is(.setting-btn, .btn-edit-workspace, .btn-new-workspace) svg,
    .widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button) svg {
        --icon-stroke: #e2e8f0 !important;
        stroke: #e2e8f0 !important;
        fill: #e2e8f0 !important;
    }
    
    :is(.setting-btn, .btn-edit-workspace, .btn-new-workspace) span,
    .widget-control :is(.btn, .btn-default, .btn-secondary, .edit-button, .move-widget, .show-or-hide-button) span {
        color: #e2e8f0 !important;
    }
    
    /* Widget控制按钮的图标字体 - 夜间模式 */
    .widget-control :is(.btn, .btn-default, .edit-button, .move-widget, .show-or-hide-button) i {
        color: #e2e8f0 !important;
    }
    
    /* 侧边栏编辑模式按钮 - 夜间模式 */
    .desk-sidebar .standard-sidebar-section.show-control .desk-sidebar-item :is(.drag-handle, .setting-btn, .duplicate-page, .unhide-workspace-btn) {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
        color: #e2e8f0 !important;
    }
    
    .desk-sidebar .standard-sidebar-section.show-control .desk-sidebar-item :is(.drag-handle, .setting-btn, .duplicate-page, .unhide-workspace-btn):hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%) !important;
        color: #ffffff !important;
    }
    
    .desk-sidebar .standard-sidebar-section.show-control .desk-sidebar-item :is(.drag-handle, .setting-btn, .duplicate-page, .unhide-workspace-btn) svg {
        --icon-stroke: #e2e8f0 !important;
        stroke: #e2e8f0 !important;
        fill: #e2e8f0 !important;
    }
    
    /* 工作区widget编辑按钮的下拉菜单 - 夜间模式只覆盖颜色相关属性 */
    .dropdown-list {
        background: #1e1f35 !important;
        border: 1px solid rgba(102, 126, 234, 0.3) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    }
    
    .dropdown-list .dropdown-item {
        color: #e2e8f0 !important;
    }
    
    .dropdown-list .dropdown-item:hover {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
        color: #ffffff !important;
    }
    
    .dropdown-list .dropdown-item-icon svg {
        --icon-stroke: #a5b4fc !important;
        stroke: #a5b4fc !important;
        fill: #a5b4fc !important;
    }
    
    /* 右上角标准操作按钮（丢弃、保存等）- 夜间模式 */
    :is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default),
    .secondary-action {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.4) !important;
        color: #e2e8f0 !important;
    }
    
    :is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default):hover,
    .secondary-action:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%) !important;
        border-color: rgba(102, 126, 234, 0.6) !important;
        color: #ffffff !important;
    }
    
    :is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default) svg,
    .secondary-action svg {
        --icon-stroke: #e2e8f0 !important;
        stroke: #e2e8f0 !important;
        fill: #e2e8f0 !important;
    }
    
    :is(.standard-actions, .page-actions) :is(.btn-secondary, .btn-default) span,
    .secondary-action span {
        color: #e2e8f0 !important;
    }
    
    /* 模态框 */
    .modal-content {
        background: #1e1f35;
        border: 1px solid rgba(102, 126, 234, 0.2);
    }
    
    .modal-header {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
        border-bottom: 2px solid rgba(102, 126, 234, 0.25);
    }
    
    /* 搜索和过滤器 */
    .page-form {
        background: linear-gradient(135deg, rgba(30, 31, 53, 0.9) 0%, rgba(37, 38, 66, 0.9) 100%);
    }
    
    /* 空状态提示 */
    .empty-state,
    .no-data {
        color: #94a3b8 !important;
    }
    
    /* 分割线 */
    hr,
    .border {
        border-color: rgba(102, 126, 234, 0.2) !important;
    }
    
    /* 代码块 */
    code,
    pre {
        background: #252642 !important;
        color: #a5b4fc !important;
        border: 1px solid rgba(102, 126, 234, 0.2) !important;
    }
    
    /* 滚动条 */
    ::-webkit-scrollbar-track {
        background: rgba(102, 126, 234, 0.1);
    }
    
    /* 表单标签栏 */
    .form-tabs-list {
        background: linear-gradient(135deg, rgba(30, 31, 53, 0.95) 0%, rgba(37, 38, 66, 0.95) 100%) !important;
        border-bottom: 2px solid rgba(102, 126, 234, 0.25) !important;
    }
    
    .form-tabs-list .form-tabs .nav-item .nav-link {
        color: #94a3b8 !important;
    }
    
    .form-tabs-list .form-tabs .nav-item .nav-link:hover {
        color: #a5b4fc !important;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    }
    
    .form-tabs-list .form-tabs .nav-item .nav-link.active {
        color: #a5b4fc !important;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    }
    
    /* 标签页内容 */
    .tab-content {
        background: #1e1f35;
        color: #e2e8f0;
    }
    
    /* 夜间模式登录页面背景色 */
    body {
        background: linear-gradient(135deg, #1a1b2e 0%, #2d1b69 100%) !important;
    }
    
    .for-login,
    .for-forgot,
    .for-login-with-email-link,
    .for-signup,
    .for-email-login {
        .page-card {
            background: rgba(30, 31, 53, 0.95) !important;
            border: 1px solid rgba(102, 126, 234, 0.3) !important;
        }
        
        .page-card-head {
            color: #a5b4fc;
        }
        
        .page-card-head h4 {
            color: #a5b4fc;
        }
    }

    /* 表单关联区域的+号按钮样式 - 夜间模式 */
    .btn.btn-new.btn-secondary.btn-xs.icon-btn {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.4) !important;
    }
    
    .btn.btn-new.btn-secondary.btn-xs.icon-btn:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%) !important;
        border-color: rgba(102, 126, 234, 0.6) !important;
    }
    
    .btn.btn-new.btn-secondary.btn-xs.icon-btn svg {
        --icon-stroke: #a5b4fc !important;
        stroke: #a5b4fc !important;
        fill: #a5b4fc !important;
    }

    /* 过滤弹窗中的"清除过滤条件"按钮样式 - 夜间模式（"应用筛选"保持原样） */
    .filter-popover .filter-action-buttons .btn.btn-secondary,
    .filter-popover .filter-action-buttons .btn.btn-default,
    .filter-popover .filter-action-buttons .clear-filters {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
        border: 1px solid rgba(102, 126, 234, 0.4) !important;
        color: #e2e8f0 !important;
    }
    
    .filter-popover .filter-action-buttons .btn.btn-secondary:hover,
    .filter-popover .filter-action-buttons .btn.btn-default:hover,
    .filter-popover .filter-action-buttons .clear-filters:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%) !important;
        border-color: rgba(102, 126, 234, 0.6) !important;
        color: #ffffff !important;
        transform: translateY(-1px);
        box-shadow: var(--shadow-soft);
    }
}
