/* 基础样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    font-size: 14px;
}


/* 登录页面样式 */

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 400px;
    max-width: 90%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 700;
}

.login-header p {
    color: #7c8ba8;
    font-size: 14px;
}


/* 表单样式 - 优化 */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1a5490;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e8eef5;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #2c3e50;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
    background-color: #f8f9ff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-login:hover {
    background: linear-gradient(135deg, #5568d3 0%, #67408f 100%);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    display: none;
}

.message.show {
    display: block;
}

.message.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.message.success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.message.info {
    background: #e6f3ff;
    color: #1a7acc;
    border: 1px solid #b3d9ff;
}


/* 主控制台样式 */

.dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-section {
    padding: 15px 20px 5px;
    font-size: 12px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: #ffffff;
    border-left-color: #667eea;
}

.main-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #f5f7fa;
}

.page-content {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    min-height: 500px;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.welcome-message h2 {
    margin-bottom: 15px;
    color: #1a7acc;
}


/* 表格样式 - 洁净设计 */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #ffffff;
    border: 1px solid #e8eef5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e8f0f7;
    letter-spacing: 0.2px;
    line-height: 1.5;
}

.data-table th {
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f9 100%);
    font-weight: 700;
    color: #34495e;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f9fafc;
}

.data-table td {
    color: #2c3e50;
    font-size: 13px;
}

.data-table .age-cell {
    font-weight: 500;
    color: #1a7acc;
}


/* 表单样式 */

.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 18px;
    margin-bottom: 12px;
}

.form-col {
    flex: 1;
}

.form-actions {
    text-align: center;
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #d9e8f5;
}


/* 按钮样式 - 简洁设计 */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.3px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #67408f 100%);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #229954 0%, #196f3d 100%);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #d43f2a 0%, #a93226 100%);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #e67e22 0%, #c0761f 100%);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.3);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}


/* 上上中模式 - 简洁严谨 */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d9e8f5;
}

.toolbar h2 {
    color: #1a5490;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.search-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box input {
    padding: 10px 14px;
    border: 1px solid #d9e8f5;
    border-radius: 4px;
    width: 240px;
    background-color: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.08);
}


/* 月份筛选器样式 */

.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #d9e8f5;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 500;
    color: #1a5490;
    font-size: 14px;
}

.filter-group input[type="month"] {
    padding: 8px 12px;
    border: 1px solid #d9e8f5;
    border-radius: 4px;
    width: 160px;
    background-color: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-group input[type="month"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.08);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.2);
    transform: translateY(-1px);
}


/* 模态框样式 - 简洁清爵 */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8f0f7;
}

.modal-header h3 {
    color: #1a5490;
    font-size: 18px;
    font-weight: 600;
}

.close {
    color: #95a5a6;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: #1a5490;
}


/* 卡片样式 */

.card {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8eef5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}


/* 统计卡片详细样式 */

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.stat-month {
    font-size: 12px;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

.stat-content {
    padding: 10px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

#overtimeHours {
    text-align: right;
}

.stat-value-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-unit {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 4px;
}

.stat-card .currency {
    color: #fff;
    font-weight: bold;
}


/* 加载提示样式 */

.loading-hint,
.error-hint {
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.loading-hint {
    background: #e6f3ff;
    color: #1a7acc;
    border: 1px solid #b3d9ff;
}

.error-hint {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}


/* 状态标签 */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}


/* 正常 - 绿色系 */

.badge-success {
    background: #d4edda;
    color: #155724;
}


/* 迟到 - 橙色系 */

.badge-warning {
    background: #ffe8d1;
    color: #d97706;
}


/* 早退 - 黄色系 */

.badge-early {
    background: #fef3c7;
    color: #b45309;
}


/* 旷工 - 红色系 */

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}


/* 请假 - 蓝色系 */

.badge-info {
    background: #cfe4f9;
    color: #0052cc;
}


/* 加班 - 紫色系 */

.badge-leave {
    background: #f3e8ff;
    color: #6d28d9;
}


/* 学历徽章样式 */

.education-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-align: center;
    min-width: 68px;
    height: 28px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
}

.education-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    border-radius: 18px;
}

.education-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.education-badge[style*="background-color: rgb(52, 152, 219)"],
.education-badge[style*="background-color: #3498db"] {
    background-color: #3498db !important;
}

.education-badge[style*="background-color: rgb(22, 160, 133)"],
.education-badge[style*="background-color: #16a085"] {
    background-color: #16a085 !important;
}

.education-badge[style*="background-color: rgb(39, 174, 96)"],
.education-badge[style*="background-color: #27ae60"] {
    background-color: #27ae60 !important;
}

.education-badge[style*="background-color: rgb(142, 68, 173)"],
.education-badge[style*="background-color: #8e44ad"] {
    background-color: #8e44ad !important;
}

.education-badge[style*="background-color: rgb(192, 57, 43)"],
.education-badge[style*="background-color: #c0392b"] {
    background-color: #c0392b !important;
}


/* 根据学历类型应用不同颜色 */

.table-col-birth-date {
    white-space: nowrap;
}


/* 加载动画 */

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading:after {
    content: "加载中...";
    display: inline-block;
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%,
    20% {
        content: "加载中.";
    }
    40% {
        content: "加载中..";
    }
    60%,
    100% {
        content: "加载中...";
    }
}


/* 空状态 */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
}


/* 响应式设计 */

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .toolbar {
        flex-direction: column;
        gap: 15px;
    }
    .search-box {
        width: 100%;
    }
    .search-box input {
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    /* 表格在小屏幕上的优化 */
    .data-table th,
    .data-table td {
        padding: 12px 8px;
        font-size: 12px;
    }
    .education-badge {
        min-width: 60px;
        height: 26px;
        padding: 4px 12px;
        font-size: 11px;
    }
}


/* 图片边框样式 */


/* 所有图片统一边框样式 */

img {
    border: 1.5px solid #b3d9ff;
    border-radius: 8px;
    transition: all 0.3s ease;
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.08);
}


/* 图片悬停效果 */

img:hover {
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
    transform: translateY(-2px);
}


/* 头像图片样式 */

.avatar,
.user-avatar,
.profile-pic {
    border: 2px solid #b3d9ff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.12);
    transition: all 0.3s ease;
}

.avatar:hover,
.user-avatar:hover,
.profile-pic:hover {
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
    transform: scale(1.05);
}


/* 缩略图样式 */

.thumbnail,
.thumb-img {
    border: 1.5px solid #b3d9ff;
    border-radius: 6px;
    padding: 4px;
    background-color: #f0f8ff;
    transition: all 0.3s ease;
}

.thumbnail:hover,
.thumb-img:hover {
    border-color: #4a90e2;
    background-color: #e6f3ff;
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.12);
}


/* 产品图片/大图样式 */

.product-img,
.gallery-img,
.featured-img {
    border: 2px solid #b3d9ff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.1);
    transition: all 0.3s ease;
}

.product-img:hover,
.gallery-img:hover,
.featured-img:hover {
    border-color: #4a90e2;
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.2);
    transform: translateY(-3px);
}


/* 响应式图片边框（小屏幕优化）*/

@media (max-width: 768px) {
    img {
        border-width: 1px;
        border-radius: 6px;
    }
    .avatar,
    .user-avatar,
    .profile-pic {
        border-width: 1.5px;
    }
    .product-img,
    .gallery-img,
    .featured-img {
        border-width: 1.5px;
        border-radius: 8px;
    }
}


/* 打印时移除图片边框阴影 */

@media print {
    img,
    .avatar,
    .user-avatar,
    .profile-pic,
    .thumbnail,
    .thumb-img,
    .product-img,
    .gallery-img,
    .featured-img {
        box-shadow: none;
        border-color: #ccc;
    }
}


/* 动画效果 */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    animation: fadeIn 0.4s ease;
}


/* 按钮不可用态样式 */

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}


/* 提示消息优化 */

.message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    display: none;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.message.error {
    background: #fee;
    color: #c33;
    border: 1.5px solid #fcc;
}

.message.success {
    background: #efe;
    color: #3c3;
    border: 1.5px solid #cfc;
}

.message.info {
    background: #e6f3ff;
    color: #1a7acc;
    border: 1.5px solid #b3d9ff;
}