/* =============================================
   员工打卡系统 - 通用样式
   简约商务风格，响应式设计
   ============================================= */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 移动端容器 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 24px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .card {
        padding: 16px;
        border-radius: 8px;
        margin-bottom: 12px;
    }
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

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

.header .user-info span {
    font-size: 14px;
}

@media (max-width: 768px) {
    .header {
        padding: 15px 0;
        margin-bottom: 12px;
    }
    .header h1 {
        font-size: 16px;
    }
    .header .user-info span {
        font-size: 12px;
    }
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.btn-secondary {
    background: #f0f2f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e4e6e9;
}

.btn-outline {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #fff;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .logo h2 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-top: 10px;
}

.login-card .logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 13px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    overflow-x: auto;
}

.nav-tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    color: #667eea;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

@media (max-width: 768px) {
    .nav-tab {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

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

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

/* Toast提示 */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastIn 0.3s ease;
    max-width: 90vw;
}

.toast-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast-error {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.toast-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
}

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

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

td {
    color: #666;
}

tr:hover td {
    background: #fafbfc;
}

@media (max-width: 768px) {
    th, td {
        padding: 8px;
        font-size: 12px;
    }
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff8e1;
    color: #f57f17;
}

.badge-orange {
    background: #fff3e0;
    color: #ff7043;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-secondary {
    background: #f5f5f5;
    color: #757575;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    color: #999;
    font-size: 13px;
    padding: 0 10px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
}

/* 底部导航（移动端） */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    cursor: pointer;
    color: #999;
    font-size: 11px;
    transition: color 0.3s ease;
}

.bottom-nav-item.active {
    color: #667eea;
}

.bottom-nav-item .icon {
    font-size: 20px;
}

/* 底部导航占位 */
.bottom-nav-placeholder {
    height: 70px;
}

/* 打卡页面特有样式 */
.checkin-main {
    text-align: center;
    padding: 30px 20px;
}

.checkin-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.checkin-circle:active {
    transform: scale(0.95);
}

.checkin-circle.disabled {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    cursor: not-allowed;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.checkin-circle .time {
    font-size: 28px;
    font-weight: 600;
}

.checkin-circle .date {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}

.checkin-circle .text {
    font-size: 18px;
    margin-top: 8px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .checkin-circle {
        width: 150px;
        height: 150px;
        margin: 20px auto;
    }
    .checkin-circle .time {
        font-size: 24px;
    }
    .checkin-circle .text {
        font-size: 16px;
    }
}

.location-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.location-info .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.location-info .row:last-child {
    margin-bottom: 0;
}

.location-info .label {
    color: #999;
}

.location-info .value {
    color: #333;
    font-weight: 500;
}

.checkin-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.checkin-type-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.checkin-type-tab.active {
    border-color: #667eea;
    background: #f0f3ff;
    color: #667eea;
}

.checkin-type-tab .type-name {
    font-weight: 600;
    font-size: 15px;
}

.checkin-type-tab .type-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.photo-upload {
    margin: 16px 0;
}

.photo-preview {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 12px;
    aspect-ratio: 4/3;
    background: #f0f0f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview .placeholder {
    color: #999;
    font-size: 13px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card .stat-time {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-card .stat-number {
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 图片预览 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-preview-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
