: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;
}

/* ========== 导航栏 ========== */
.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);
    overflow: hidden;
}

.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 {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--primary-bg);
}

.table-hover tbody tr:hover {
    background: var(--primary-bg);
}

/* ========== 按钮 ========== */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.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-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-100);
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-100);
    padding: 1rem 1.5rem;
}

.modal-header .btn-close:focus {
    box-shadow: none;
}

/* ========== 分页 ========== */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: none;
    border-radius: var(--radius) !important;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: #fff;
}

/* ========== 加载动画 ========== */
.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);
}

/* ========== 操作按钮组 ========== */
.action-btns {
    display: flex;
    gap: 0.25rem;
}

.action-btns .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ========== 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);
}

/* ========== 打印优化 ========== */
@media print {
    .plan-modal .modal-header {
        background: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
