/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 登录页面样式 */
.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 450px;
    margin: 50px auto;
}

.login-box .header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 15px;
}

.login-box h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.login-box p {
    color: #7f8c8d;
}

.tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #ecf0f1;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 16px;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.tab-btn.active {
    color: #3498db;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3498db;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #d35400;
}

.btn-outline {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

.btn-large {
    padding: 18px 30px;
    font-size: 18px;
    font-weight: 600;
}

.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.footer {
    margin-top: 30px;
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
}

/* 员工和管理员页面通用样式 */
.header-bar {
    background: white;
    border-radius: 15px 15px 0 0;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-area i {
    font-size: 28px;
    color: #3498db;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #2c3e50;
}

.dashboard {
    display: flex;
    min-height: calc(100vh - 150px);
    background: white;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    padding: 20px 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    padding: 15px 25px;
    color: #bdc3c7;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background: #34495e;
    color: white;
}

.menu-item.active {
    background: #34495e;
    color: white;
    border-left-color: #3498db;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.page-header h2 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 打卡卡片样式 */
.punch-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

.punch-status {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.status-item {
    text-align: center;
}

.status-label {
    display: block;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 14px;
}

.status-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 16px;
}

.status-badge.punched {
    background: #d4edda;
    color: #155724;
}

.status-badge.not-punched {
    background: #f8d7da;
    color: #721c24;
}

.punch-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.today-record {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.today-record h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-list {
    min-height: 100px;
}

.no-records {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

/* 出勤记录样式 */
.attendance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #3498db;
}

.summary-card h4 {
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 14px;
}

.summary-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

.attendance-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
}

.attendance-table th,
.attendance-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.attendance-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.attendance-table tr:hover {
    background: #f8f9fa;
}

/* 个人信息样式 */
.profile-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    max-width: 500px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.profile-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.profile-info p {
    color: #7f8c8d;
    font-size: 14px;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

.detail-label {
    color: #7f8c8d;
}

.detail-value {
    color: #2c3e50;
    font-weight: 500;
}

/* 管理员样式 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.total-employees { background: #3498db; }
.today-attendance { background: #2ecc71; }
.attendance-rate { background: #9b59b6; }
.late-count { background: #e74c3c; }

.stat-info h3 {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.chart-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 5px;
    color: #7f8c8d;
}

/* 表格样式 */
.employee-table-container,
.attendance-all-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.employee-table,
.attendance-all-table,
.report-table {
    width: 100%;
    border-collapse: collapse;
}

.employee-table th,
.employee-table td,
.attendance-all-table th,
.attendance-all-table td,
.report-table th,
.report-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.employee-table th,
.attendance-all-table th,
.report-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.success-icon {
    color: #2ecc71;
    font-size: 24px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-bar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 0;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .menu-item {
        padding: 15px 20px;
        white-space: nowrap;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .punch-buttons {
        flex-direction: column;
    }
    
    .stats-cards,
    .charts-section {
        grid-template-columns: 1fr;
    }
}