* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    width: 100%;
    height: 100vh;
    position: relative;
}

.page {
    display: none;
    width: 100%;
    height: 100%;
}

.page.active {
    display: block;
}

/* 語言切換按鈕 */
.language-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.lang-btn:hover {
    background: #667eea;
    color: white;
}

.lang-btn.active {
    background: #667eea;
    color: white;
}

/* 登入頁面樣式 */
#loginPage {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 350px;
}

.login-card h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.login-form input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-form button {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.login-form button:hover {
    background: #5a6fd8;
}

/* 主頁面樣式 */
header {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #333;
}

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

.user-info .language-switcher {
    margin-bottom: 0;
}

.logout-btn {
    padding: 8px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #ff5252;
}

.main-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 打卡區域 */
.clock-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.time-display {
    margin-bottom: 30px;
}

#currentTime {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

#currentDate {
    font-size: 20px;
    color: #666;
}

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

.clock-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.clock-in {
    background: #4caf50;
    color: white;
}

.clock-in:hover {
    background: #45a049;
}

.clock-out {
    background: #ff9800;
    color: white;
}

.clock-out:hover {
    background: #f57c00;
}

.today-status {
    font-size: 16px;
    color: #666;
    margin-top: 20px;
}

/* 記錄區域 */
.records-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.records-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.filter-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-controls select {
    padding: 10px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 14px;
}

.export-btn {
    padding: 10px 20px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.export-btn:hover {
    background: #1976d2;
}

.records-list {
    max-height: 400px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e1e1e1;
    transition: background 0.3s;
}

.record-item:hover {
    background: #f5f5f5;
}

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

.record-date {
    font-weight: bold;
    color: #333;
}

.record-times {
    display: flex;
    gap: 20px;
}

.record-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.time-label {
    font-size: 12px;
    color: #666;
}

.time-value {
    font-size: 14px;
    font-weight: bold;
}

.clock-in-time {
    color: #4caf50;
}

.clock-out-time {
    color: #ff9800;
}

/* 管理員頁面 */
.admin-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-nav .language-switcher {
    margin-bottom: 0;
    margin-right: 10px;
}

.nav-btn {
    padding: 8px 16px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: #1976d2;
}

.admin-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.employee-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.employee-form input,
.employee-form select {
    padding: 10px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.employee-form button {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.employee-form button:hover {
    background: #45a049;
}

.employees-list,
.admin-records-list {
    max-height: 400px;
    overflow-y: auto;
}

.employee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e1e1e1;
}

.employee-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.employee-actions button {
    padding: 5px 10px;
    margin-left: 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
}

.delete-btn:hover {
    background: #ff5252;
}

.admin-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.admin-filter select,
.admin-filter input {
    padding: 10px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 14px;
}

/* 響應式設計 */
@media (max-width: 768px) {

    .main-content,
    .admin-content {
        padding: 15px;
    }

    .clock-buttons {
        flex-direction: column;
        align-items: center;
    }

    .employee-form {
        flex-direction: column;
    }

    .record-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }

    #currentTime {
        font-size: 36px;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.record-item,
.employee-item {
    animation: fadeIn 0.3s ease-out;
}

/* 狀態指示 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-present {
    background: #4caf50;
}

.status-absent {
    background: #ff6b6b;
}

.status-late {
    background: #ff9800;
}