/* 全局样式 */
:root {
    --primary-color: #e74c3c;
    --primary-color-rgb: 231, 76, 60;
    --primary-dark: #c0392b;
    --primary-dark-rgb: 192, 57, 43;
    --primary-light: #ff6b6b;
    --primary-light-rgb: 255, 107, 107;
    --primary-lighter: #fde8e8;
    --secondary-color: #2c3e50;
    --light-color: #f9f9f9;
    --dark-color: #2c3e50;
    --success-color: #2ecc71;
    --info-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --border-radius: 0.625rem;
    --border-radius-lg: 1rem;
    --border-radius-sm: 0.375rem;
    --box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.05);
    --box-shadow-lg: 0 1rem 2.5rem rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: "Microsoft YaHei", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--dark-color);
    line-height: 1.7;
}

/* 导航栏样式 */
.navbar-dark.bg-danger {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    box-shadow: 0 4px 20px rgba(199, 0, 11, 0.25);
    transition: all 0.4s ease;
    padding: 0.6rem 0;
}

.navbar-shrink {
    padding: 0.3rem 0;
    box-shadow: 0 6px 24px rgba(199, 0, 11, 0.35);
}

.navbar-shrink .navbar-brand {
    transform: scale(0.95);
}

.navbar-shrink .nav-link {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.75px;
    font-size: 1.35rem;
    padding: 0.5rem 0;
    transition: var(--transition);
}

/* 导航栏logo自适应样式 */
.navbar-logo {
    width: auto;
    height: auto;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    transition: var(--transition);
}

.navbar-brand-text {
    font-weight: 700;
    letter-spacing: 0.75px;
}

.nav-link {
    font-weight: 500;
    padding: 0.55rem 0.85rem;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    margin: 0 0.15rem;
    white-space: nowrap;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link i {
    display: inline-block;
    width: 1.25rem;
    text-align: center;
    margin-right: 0;
    font-size: 0.93rem;
}

.dropdown .nav-link::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 0.3rem;
    font-size: 0.8rem;
    transition: var(--transition);
}

.dropdown:hover .nav-link::after {
    transform: rotate(180deg);
}

.nav-link-hover {
    position: relative;
    overflow: hidden;
}

.nav-link-hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.nav-link.active::after {
    width: 70%;
}

/* 导航栏下拉菜单 */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.18);
    border-radius: var(--border-radius);
    padding: 0.65rem 0.5rem;
    min-width: 13rem;
    margin-top: 0.5rem;
    transition: all 0.25s ease;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.dropdown {
    position: relative;
}

.dropdown::after {
    content: '';
    position: absolute;
    height: 20px;
    width: 100%;
    bottom: -10px;
    left: 0;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu,
.show-dropdown .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: white;
    transform: rotate(45deg);
    z-index: -1;
    box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.04);
}

.dropdown-menu-end::before {
    left: auto;
    right: 20px;
}

.dropdown-menu-animate {
    animation: dropdown-animation 0.35s ease;
    transform-origin: top center;
}

@keyframes dropdown-animation {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 0.7rem 1.1rem;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    display: block;
}

.dropdown-item i {
    transition: var(--transition);
    width: 1.25rem;
    text-align: center;
}

.dropdown-item:hover {
    background-color: var(--primary-lighter);
    color: var(--primary-color);
    transform: translateX(4px);
}

.dropdown-item:hover i {
    transform: translateX(3px);
}

/* 内容区域 */
.container {
    flex: 1;
}

.content-wrapper {
    background-color: #fff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.content-wrapper::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

/* 页脚 */
.footer {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    padding: 1.5rem 0;
}

.footer a {
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.footer a:hover {
    color: var(--primary-color) !important;
}

/* 卡片样式 */
.card {
    border: none;
    margin-bottom: 1.75rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    background-color: #ffffff;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-weight: 600;
    padding: 1.35rem 1.75rem;
}

.card-header.bg-danger {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: white;
    border-bottom: none;
}

.card-body {
    padding: 1.75rem;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.01);
    border-top: none;
    padding: 1.2rem 1rem;
    white-space: nowrap;
    color: var(--secondary-color);
}

.table td {
    padding: 1.2rem 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.03);
}

.table-hover tbody tr {
    transition: var(--transition);
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--primary-color-rgb, 231, 76, 60), 0.05);
}

.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* 按钮样式 */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
    padding: 0.6rem 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-dark);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark));
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(199, 0, 11, 0.25);
}

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

.btn-outline-danger:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(199, 0, 11, 0.25);
}

.btn-sm {
    padding: 0.3rem 0.85rem;
    font-size: 0.875rem;
}

/* 分页样式 */
.pagination {
    margin-bottom: 0;
    gap: 0.25rem;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(199, 0, 11, 0.25);
}

.page-link {
    color: var(--primary-color);
    border-radius: var(--border-radius-sm);
    margin: 0 0.1rem;
    transition: var(--transition);
    font-weight: 500;
}

.page-link:hover {
    color: var(--primary-dark);
    background-color: var(--primary-lighter);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 表单样式 */
.form-control {
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    font-size: 1rem;
    background-color: #fff;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb, 231, 76, 60), 0.15);
}

.form-select {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb, 231, 76, 60), 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.6rem;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.45em 0.8em;
    border-radius: 30px;
    letter-spacing: 0.3px;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    box-shadow: 0 2px 5px rgba(var(--primary-color-rgb, 231, 76, 60), 0.25);
}

/* 提示框样式 */
.toast {
    opacity: 1;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    backdrop-filter: blur(10px);
    background-color: rgba(33, 37, 41, 0.9) !important;
    color: #fff !important;
    font-weight: 500;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    min-width: 280px;
    max-width: 90vw;
}

.toast-container {
    z-index: 1050;
    width: auto;
}

.toast-body {
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    text-align: center;
    width: 100%;
}

.toast .btn-close-white {
    opacity: 0.8;
}

.toast .btn-close-white:hover {
    opacity: 1;
}

/* 自定义样式 */
.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 4px solid white;
    overflow: hidden;
}

.initials {
    font-size: 40px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 统计卡片 */
.stat-card {
    background-color: #fff;
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--primary-color);
}

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

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.85;
    position: relative;
    z-index: 1;
    color: var(--primary-color);
}

.stat-card .stat-title {
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.75px;
}

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: rgba(var(--primary-color-rgb, 231, 76, 60), 0.07);
    z-index: 0;
}

/* 列表组样式 */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 1.1rem 1.25rem;
    transition: var(--transition);
    border-color: rgba(0, 0, 0, 0.03);
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: rgba(var(--primary-color-rgb, 231, 76, 60), 0.05);
}

.list-group-item-action:hover {
    transform: translateX(4px);
}

/* 欢迎卡片 */
.welcome-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-left: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.welcome-card::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb, 231, 76, 60), 0.1) 0%, rgba(var(--primary-color-rgb, 231, 76, 60), 0) 70%);
    top: -100px;
    right: -50px;
    z-index: 0;
    border-radius: 50%;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state i {
    font-size: 3.5rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.empty-state-text {
    color: #adb5bd;
    font-weight: 500;
    font-size: 1.1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card-body {
        padding: 0.75rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
        padding: 0.3rem 0;
    }

    /* 移动端Logo优化 */
    .navbar-logo {
        max-width: 24px;
        max-height: 24px;
        margin-right: 6px;
    }

    /* 登录页面logo移动端优化 */
    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .login-logo {
        max-width: 40px;
        max-height: 40px;
    }

    .navbar-brand-text {
        font-size: 0.95rem;
    }

    /* 确保折叠菜单不会太靠近logo */
    .navbar-collapse {
        margin-top: 0.5rem;
        max-height: 80vh;
        overflow-y: auto;
        padding-bottom: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0.5rem;
    }

    /* 避免导航菜单项过大 */
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.95rem;
    }

    /* 确保下拉菜单不会被截断 */
    .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: rgba(255, 255, 255, 0.05);
        border: none;
        box-shadow: none;
        padding-left: 1.5rem;
    }

    .dropdown-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.8);
        padding: 0.4rem 1rem;
    }

    .dropdown-menu .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .content-wrapper {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }

    .row [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .form-control,
    .form-select,
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    /* 优化导航栏收缩按钮 */
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.1rem rgba(255, 255, 255, 0.25);
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 375px) {
    .navbar-logo {
        max-width: 20px;
        max-height: 20px;
    }

    /* 超小屏幕登录页面logo优化 */
    .logo-circle {
        width: 60px;
        height: 60px;
    }

    .login-logo {
        max-width: 35px;
        max-height: 35px;
    }

    .navbar-brand-text {
        font-size: 0.85rem;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
    }

    .nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.9rem;
    }
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    overflow: hidden;
    background-color: rgba(33, 37, 41, 0.9) !important;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom: none;
    padding: 1.5rem 1.75rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 1.75rem;
    background-color: rgba(33, 37, 41, 0.9) !important;
}

.modal-body {
    padding: 1.75rem;
    color: #ffffff !important;
    background-color: rgba(33, 37, 41, 0.9) !important;
}

/* 确保弹窗中的所有文本都是白色的 */
.modal-content p,
.modal-content span,
.modal-content div:not(.modal-header),
.modal-content label,
.modal-content ul li,
.modal-content ol li,
.modal-content .form-label,
.modal-content .form-control,
.modal-content .form-select,
.modal-content strong {
    color: #ffffff !important;
}

/* 标签页样式 */
.nav-tabs {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    gap: 0.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.85rem 1.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    background-color: rgba(0, 0, 0, 0.01);
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

/* 进度条样式 */
.progress {
    height: 0.85rem;
    border-radius: var(--border-radius);
    background-color: #f0f0f0;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* 文件上传样式 */
.custom-file-upload {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.custom-file-upload:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* 搜索框样式 */
.search-form {
    position: relative;
    margin-bottom: 1.75rem;
}

.search-form .form-control {
    padding-left: 2.75rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-form .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

/* 过滤器样式 */
.filter-section {
    background-color: #f9fafc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* 通知徽章 */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ffcc00;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(50%, -30%);
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
}

/* 小头像样式 */
.avatar-xs {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-xs .avatar-text {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.avatar-sm {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 3px 12px rgba(var(--primary-color-rgb, 231, 76, 60), 0.25);
}

.avatar-sm .avatar-text {
    font-size: 22px;
    font-weight: 600;
    color: white;
}

.dropdown-user-info {
    background-color: rgba(248, 249, 250, 0.05);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 3px 15px rgba(var(--primary-color-rgb, 231, 76, 60), 0.35);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-5px);
}

.back-to-top i {
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

/* 导航栏图标动画 */
.nav-link:hover i {
    animation: navIconPulse 0.6s ease;
}

@keyframes navIconPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

/* 按钮涟漪效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.7s linear;
    background-color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4.5);
        opacity: 0;
    }
}

/* 卡片悬停效果 */
.card-hover {
    transform: translateY(-7px);
    box-shadow: var(--box-shadow-lg);
    transition: var(--transition);
}

/* 表单输入焦点效果 */
.input-focused .form-control {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb, 231, 76, 60), 0.15);
    border-color: var(--primary-color);
}

.input-focused .form-label {
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
}

/* 懒加载图片 */
img.lazy {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

img.lazy.loaded {
    opacity: 1;
}

/* 强调动画 */
@keyframes emphasis {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.emphasis {
    animation: emphasis 0.6s ease;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(var(--primary-color-rgb, 231, 76, 60), 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1.2s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 表格行动画 */
.table-hover tbody tr:hover {
    animation: rowHighlight 0.4s ease;
}

@keyframes rowHighlight {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(var(--primary-color-rgb, 231, 76, 60), 0.12);
    }

    100% {
        background-color: rgba(var(--primary-color-rgb, 231, 76, 60), 0.05);
    }
}

/* 徽章动画 */
.badge.animate {
    animation: badgePulse 2.5s infinite;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* 页面过渡动画 */
.page-transition {
    animation: pageTransition 0.6s ease;
}

@keyframes pageTransition {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮悬停效果增强 */
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

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

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color-rgb, 231, 76, 60), 0.6);
    border-radius: 10px;
    border: 3px solid #f5f5f5;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 文字选择样式 */
::selection {
    background-color: rgba(var(--primary-color-rgb, 231, 76, 60), 0.25);
    color: var(--primary-color);
}

/* 表单控件焦点动画 */
.form-control:focus,
.form-select:focus {
    animation: formFocus 0.4s ease;
}

@keyframes formFocus {
    0% {
        box-shadow: none;
    }

    100% {
        box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb, 231, 76, 60), 0.15);
    }
}

/* 卡片装饰效果 */
.card-decorated {
    position: relative;
    overflow: hidden;
}

.card-decorated::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

/* 表格底部阴影效果 */
.table-shadow {
    position: relative;
}

.table-shadow::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.05), transparent);
    pointer-events: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* 毛玻璃效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* 高亮搜索结果 */
.highlight {
    background-color: rgba(var(--primary-color-rgb), 0.2);
    padding: 0 0.2rem;
    border-radius: 0.2rem;
    font-weight: 600;
    display: inline-block;
    color: var(--primary-dark);
}

/* 浮动标签 */
.floating-label-container {
    position: relative;
}

label.floating-label {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    transition: all 0.2s ease-out;
    opacity: 0.7;
    pointer-events: none;
    transform-origin: left top;
    z-index: 2;
    padding: 0 0.3rem;
    margin: 0;
}

label.floating-label.active,
input:focus~label.floating-label,
input:not(:placeholder-shown)~label.floating-label,
select:focus~label.floating-label,
select:not([value=""])~label.floating-label {
    transform: translateY(-1.2rem) scale(0.85);
    background-color: white;
    opacity: 1;
    color: var(--primary-color);
    font-weight: 500;
}

.form-control::placeholder {
    color: transparent;
}

.form-control:focus::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

/* 搜索框增强样式 */
.search-icon {
    transition: var(--transition);
    opacity: 0.6;
}

.search-icon-active {
    color: var(--primary-color) !important;
    opacity: 1;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #adb5bd;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.search-clear:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

/* 表格排序增强 */
tbody.sorting {
    opacity: 0.6;
    pointer-events: none;
}

th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: var(--transition);
}

th[data-sort]:hover {
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

th[data-sort]::after {
    content: "\f0dc";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: 0.5rem;
    opacity: 0.3;
    font-size: 0.8rem;
    display: inline-block;
    transition: var(--transition);
}

th[data-sort][data-order="asc"]::after {
    content: "\f0de";
    opacity: 0.9;
    color: var(--primary-color);
}

th[data-sort][data-order="desc"]::after {
    content: "\f0dd";
    opacity: 0.9;
    color: var(--primary-color);
}

/* Flatpickr 样式定制 */
.flatpickr-calendar {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    border: none;
}

.flatpickr-day.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.flatpickr-day.selected:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.flatpickr-day:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

.flatpickr-day.today {
    border-color: var(--primary-color);
}

/* SweetAlert2 定制样式 */
.swal2-popup {
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--box-shadow-lg);
}

.swal2-title {
    color: var(--dark-color);
    font-weight: 600;
    font-family: "Noto Sans SC", sans-serif;
}

.swal2-content {
    color: var(--secondary-color);
    font-family: "Noto Sans SC", sans-serif;
}

.swal2-icon {
    border-color: var(--primary-color);
}

.swal2-icon.swal2-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

/* 表单控件焦点状态增强 */
.focused-field {
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.15);
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(var(--primary-color-rgb), 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1.2s ease-in-out infinite;
}

/* 显示回到顶部按钮 */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 标签页优化 */
.nav-tabs .nav-link {
    position: relative;
    overflow: hidden;
}

.nav-tabs .nav-link::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-tabs .nav-link:hover::before {
    transform: scaleX(0.3);
}

.nav-tabs .nav-link.active::before {
    transform: scaleX(1);
}

/* 页面容器内动画 */
.content-wrapper>.row>[class*="col-"] {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-wrapper>.row>[class*="col-"]:nth-child(1) {
    animation-delay: 0.1s;
}

.content-wrapper>.row>[class*="col-"]:nth-child(2) {
    animation-delay: 0.2s;
}

.content-wrapper>.row>[class*="col-"]:nth-child(3) {
    animation-delay: 0.3s;
}

.content-wrapper>.row>[class*="col-"]:nth-child(4) {
    animation-delay: 0.4s;
}

.content-wrapper>.row>[class*="col-"]:nth-child(n+5) {
    animation-delay: 0.5s;
}

/* 表单组样式增强 */
.form-group {
    position: relative;
    margin-bottom: 1.75rem;
}

.form-group::after {
    content: "";
    position: absolute;
    bottom: -0.75rem;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
    opacity: 0;
}

.form-group:hover::after {
    width: 30%;
    opacity: 0.5;
}

.input-focused.form-group::after {
    width: 100%;
    opacity: 1;
}

/* 模态框提升 */
.modal {
    backdrop-filter: blur(5px);
}

.modal-content {
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color-rgb), 0.6);
    border-radius: 10px;
    border: 3px solid #f5f5f5;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 按钮额外效果 */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: all 0s;
}

.btn:hover::after {
    left: 100%;
    transition: all 0.8s ease;
}

/* 通知徽章动画优化 */
.notification-badge {
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% {
        transform: translate(50%, -30%) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.7);
    }

    70% {
        transform: translate(50%, -30%) scale(1.1);
        box-shadow: 0 0 0 8px rgba(255, 204, 0, 0);
    }

    100% {
        transform: translate(50%, -30%) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 204, 0, 0);
    }
}

/* 磨砂玻璃效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* 登录页面logo样式优化 */
.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(199, 0, 11, 0.3);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.login-logo {
    width: auto;
    height: auto;
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
    transition: var(--transition);
}

/* 添加媒体查询防止被覆盖 */
@media print,
screen and (min-width: 10px) {
    .table-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .modal-body {
        color: #ffffff !important;
        background-color: rgba(33, 37, 41, 0.9) !important;
    }

    .modal-content {
        background-color: rgba(33, 37, 41, 0.9) !important;
    }

    .modal-footer {
        background-color: rgba(33, 37, 41, 0.9) !important;
    }

    .modal-content p,
    .modal-content span,
    .modal-content div:not(.modal-header),
    .modal-content label,
    .modal-content ul li,
    .modal-content ol li,
    .modal-content strong {
        color: #ffffff !important;
    }
}

/* 模态框中的输入框样式调整 */
.modal-content .form-control,
.modal-content .form-select {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.modal-content .form-control:focus,
.modal-content .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.modal-content .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* 模态框中的按钮样式调整 */
.modal-content .btn-secondary {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.modal-content .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* 模态框中的表格样式调整 */
.modal-content .table {
    color: #ffffff !important;
}

.modal-content .table th {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.modal-content .table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.modal-content .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}