/* 培训报名系统 - 自定义样式 */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #a5b4fc;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* 渐变背景 */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%);
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* 重置和基础样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: #ffffff;
}

/* 前端样式 */

/* 导航栏优化 */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--gray-700) !important;
    transition: color 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

/* 英雄区域优化 */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 100px 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .display-4 {
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-section .btn {
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.hero-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 卡片优化 */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--gray-600);
    line-height: 1.6;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* 按钮优化 */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: none;
    padding: 0.5rem 1.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 页脚优化 */
.footer {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 3rem 0 2rem;
    margin-top: 0;
}

.footer h5 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer p,
.footer span {
    color: var(--gray-100);
}

.footer .text-muted {
    color: var(--gray-400) !important;
}

.footer a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

.footer hr {
    border-color: var(--gray-700);
    margin: 2rem 0;
}

/* 后端样式 */

/* 侧边栏优化 */
.sidebar {
    background: var(--gray-900);
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar .text-white {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar .nav-link {
    color: var(--gray-300) !important;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: var(--gray-800);
    color: white !important;
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background: var(--primary-color);
    color: white !important;
    box-shadow: var(--shadow-md);
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.75rem;
}

/* 主内容区优化 */
.main-content {
    padding: 1.5rem;
    background: var(--gray-100);
    min-height: 100vh;
}

/* 统计卡片优化 */
.stat-card {
    border-left: 4px solid var(--primary-color);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

/* 表格优化 */
.table {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table thead th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
    padding: 1rem;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: var(--gray-200);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* 表单优化 */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.1);
}

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

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* 响应式优化 */

/* 小屏幕设备 (平板和手机) */
@media (max-width: 768px) {
    /* 前端响应式 */
    .hero-section {
        padding: 60px 0;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* 后端响应式 */
    .main-content {
        padding: 1rem;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .mobile-menu-btn {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1060;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50%;
        width: 3rem;
        height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-lg);
        transition: all 0.3s ease;
    }
    
    .mobile-menu-btn:hover {
        transform: scale(1.1);
    }
    
    /* 表格响应式 */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    /* 卡片响应式 */
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    /* 按钮组响应式 */
    .btn-group-sm .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* 统计卡片响应式 */
    .stat-card .card-body {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
}

/* 超小屏幕设备 (手机) */
@media (max-width: 576px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section .display-4 {
        font-size: 1.75rem;
    }
    
    .hero-section .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .footer {
        padding: 2rem 0;
    }
    
    .footer .row {
        text-align: center;
    }
    
    .footer .col-md-6 {
        margin-bottom: 2rem;
    }
    
    /* 后端移动端优化 */
    .main-content {
        padding: 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* 表单响应式 */
    .form-control, .form-select {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* 分页响应式 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-item {
        margin: 0.25rem;
    }
}

/* 中等屏幕设备 (平板) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .card:hover {
        transform: none;
    }
    
    .navbar-nav .nav-link:hover::after {
        width: 0;
    }
    
    /* 禁用悬停效果 */
    .card:hover .card-img-top {
        transform: none;
    }
    
    /* 增加触摸区域 */
    .table tbody tr {
        padding: 0.5rem 0;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--gray-300);
    border-left: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

.tooltip .tooltip-inner {
    background: var(--gray-800);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
}

.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

/* 分页样式 */
.pagination .page-link {
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    margin: 0 0.25rem;
    border-radius: var(--radius-md);
}

.pagination .page-link:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* 动画效果 */

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片悬停动画 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* 按钮悬停动画 */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn-animate:hover::before {
    width: 300px;
    height: 300px;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner-large {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--gray-300);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 页面切换动画 */
.page-transition-enter {
    opacity: 0;
    transform: translateX(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateX(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

/* 通知消息动画 */
.alert-slide {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 表单焦点动画 */
.form-control:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.1);
    }
    50% {
        box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.1);
    }
    100% {
        box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.1);
    }
}

/* 图片懒加载动画 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* 骨架屏加载动画 */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* 缩放动画 */
.scale-in {
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

/* 悬停放大效果 */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* 渐变背景动画 */
.gradient-animate {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}