/**
 * @file
 * Main stylesheet file.
 */

/*****************************************************************************
 * Main elements
 ****************************************************************************/
/* html {
    overflow-y: scroll;
} */

a {
    cursor: pointer;
}

footer svg {
    vertical-align: -.125em;
    fill: currentColor;
    width: 30px;
    height: 30px;
}

/* Main elements end */

/*****************************************************************************
 * 通用组件样式
 ****************************************************************************/
.standout {
    text-transform: uppercase;
    background: linear-gradient(109.6deg, rgba(61, 245, 167, 1) 11.2%, rgba(9, 111, 224, 1) 91.1%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.alert {
    position: relative;
    padding: 1rem 2.5rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.alert-success {
    border-left: 5px solid #28a745;
    background: #f0fff4;
    color: #2b593f;
}

.alert-info {
    border-left: 5px solid #17a2b8;
    background: #e8f7fa;
    color: #215862;
}

.alert-warning {
    border-left: 5px solid #ffc107;
    background: #fff9e6;
    color: #856404;
}

.alert-danger,
.alert-error {
    border-left: 5px solid #dc3545;
    background: #fcebec;
    color: #842029;
}

/* 表格样式增强 */
.employee-table-container {
    overflow-x: auto;
    min-width: 100%;
}

.employee-table {
    min-width: 1200px;
}

.employee-table th,
.employee-table td {
    min-width: 120px;
    width: max-content;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 200px;
}

.employee-table th:last-child,
.employee-table td:last-child {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 10;
    box-shadow: -4px 0 6px rgba(0, 0, 0, 0.1);
}

.employee-table th:last-child {
    background: #f8f9fa;
    z-index: 11;
}

.employee-table td:last-child:hover {
    background: #fff;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;

    /* 移除overflow和white-space样式，保留文本截断 */
    background: white;
    z-index: 2;
}

/* 警告图标装饰 */
.alert::before {
    position: absolute;
    left: 1rem;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.alert-success::before {
    content: "\f058";
}

.alert-info::before {
    content: "\f05a";
}

.alert-warning::before {
    content: "\f071";
}

.alert-danger::before,
.alert-error::before {
    content: "\f06a";
}

/* 关闭按钮样式 */
.alert .btn-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: inherit;
    opacity: 0.8;
}

.alert .btn-close:hover {
    opacity: 1;
    color: inherit;
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

.btn-primary {
    background: linear-gradient(45deg, #0d6efd, #0b5ed7);
    border: none;
    transition: all 0.3s ease;
}

/*****************************************************************************
 * 工具类
 ****************************************************************************/
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

/*****************************************************************************
 * 动画效果
 ****************************************************************************/
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/*****************************************************************************
 * 响应式适配
 ****************************************************************************/
@media (max-width: 768px) {
    .navbar-nav {
        margin-top: 10px;
    }

    .btn {
        width: 100%;
        margin-bottom: 5px;
    }

    .alert {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .alert::before {
        font-size: 1.2rem;
    }
}

/*****************************************************************************
 * 滑动条样式优化
 ****************************************************************************/
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 14px;
    background: linear-gradient(to bottom,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(13, 110, 253, 0.05) 40%,
    rgba(13, 110, 253, 0.1) 100%);
    border-radius: 8px;
    outline: none;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3),
    inset 0 -2px 4px rgba(255, 255, 255, 0.2),
    0 1px 3px rgba(255, 255, 255, 0.1),
    inset 0 0 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    background: linear-gradient(145deg, #0d6efd, #0b5ed7);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    margin-top: -6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    0 0 2px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
    background: linear-gradient(145deg, #0d6efd, #0b5ed7);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    0 0 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    0 0 3px rgba(0, 0, 0, 0.4);
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:active::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    0 0 3px rgba(0, 0, 0, 0.4);
}

/* 移动端优化 */
@media (max-width: 768px) {
    input[type="range"] {
        height: 12px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }
}

/* Container that the modal scrolls within*/
@keyframes pageEnter {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-page-enter {
    animation: pageEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 模态框容器
 * 定位策略：fixed 全屏定位脱离文档流
 * z-index:1050 基于Bootstrap标准层叠顺序（基础模态框层级）
 * overflow控制：保持内容区域滚动，禁用外部滚动
 */
.modal {
    opacity: 1;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999; /* 调整为最高层级 */
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    /* 移除Chrome焦点轮廓，详见Bootstrap#10951 */
    outline: 0;
    /* 禁用iOS滑动回弹效果，修复Safari#158342 */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade {
    transition: opacity 0.15s linear;
}

.fade:not(.show) {
    opacity: 0;
}


/* 新增表格样式 */
.table-fixed {
    table-layout: fixed;
    min-width: 1200px;
}

.sticky-column {
    position: -webkit-sticky !important;
    position: sticky !important;
    right: 0 !important;
    background: #ffffff !important;
    z-index: 1000 !important;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.15) !important;
    min-width: 120px;
    max-width: 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.table-responsive th.sticky-column,
.table-responsive td.sticky-column {
    position: -webkit-sticky !important;
    position: sticky !important;
    right: 0 !important;
    background: #ffffff !important;
    z-index: 1000 !important;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.15) !important;
}

.table-responsive {
    overflow-x: auto;
}

.table-responsive td,
.table-responsive th {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 优化工具提示样式 */
.custom-tooltip .tooltip-inner {
    white-space: pre-wrap;
    max-width: 400px;
    text-align: left;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.2s 0.3s;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .employee-table-container {
        padding-bottom: 15px;
    }

    .sticky-column {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: -1px 0 4px rgba(0, 0, 0, 0.08);
    }
}

/* 模态框层级优化 */
.modal-backdrop {
    z-index: 1040;
}

/* 工具提示动画最终状态 */
.custom-tooltip.show .tooltip-inner {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.tooltip {
    position: absolute;
    transform: translateY(-5px);
}

/* 表格单元格保持单行显示 */
.table-fixed td {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 200px;
}

.custom-tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: rgba(0, 0, 0, 0.8);
}


/* 左侧导航栏优化 */
aside .navbar {
    padding: 1.5rem 1rem;
}

aside .nav-item {
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

aside .nav-link {
    color: #6c757d;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

aside .nav-link:hover {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    transform: translateX(5px);
}

aside .nav-link.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    font-weight: 500;
}

aside .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    min-width: 200px;
}

aside .dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

aside .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

aside .dropdown-item.active {
    background-color: #0d6efd;
    color: white;
}

/* 顶部导航栏优化 */
.navbar-light {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar .dropdown-menu {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: none;
    padding: 0.5rem;
}

.navbar .dropdown-header {
    color: #6c757d;
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.navbar .dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.navbar .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

/* 主内容区优化 */
main {
    background-color: #f8f9fa;
    min-height: calc(100vh - 60px);
    padding: 2rem !important;
}

/* 页脚优化 */
footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    padding: 1.5rem !important;
    color: #6c757d;
}

footer p {
    margin-bottom: 0;
}

.custom-tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: rgba(0, 0, 0, 0.8);
}

/* 侧边栏样式 */
aside.col-lg-3 {
    width: 280px !important;
}

@media (max-width: 991.98px) {
    aside.col-lg-3 {
        width: auto !important;
    }

    .navbar-nav .nav-link span,
    .navbar-nav .nav-link i.fa-chevron-down {
        display: none;
    }

    .navbar-nav .nav-link {
        justify-content: center;
        padding: 0.5rem;
    }

    .navbar-nav .nav-link i:not(.fa-chevron-down) {
        margin: 0;
        font-size: 1.25rem;
    }

    .collapse:not(.show) .nav-link span {
        display: none;
    }

    .collapse.show .nav-link span {
        display: inline;
    }

    .collapse.show .nav-link {
        justify-content: flex-start;
    }

    .collapse.show .nav-link i:not(.fa-chevron-down) {
        margin-right: 0.5rem;
    }
}

.custom-tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: rgba(0, 0, 0, 0.8);
}
