/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #212121;
    line-height: 1.6;
    overflow: hidden; /* 移除所有滚动条 */
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 顶部状态栏 */
.header {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time {
    font-size: 14px;
}

.network-status {
    font-size: 8px;
    color: #4CAF50;
}

.records-icon {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.records-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 地图容器 */
.map-container {
    position: relative;
    height: calc(100vh - 52px - 80px - 280px);
    min-height: 150px;
    margin-top: 52px;
    background-color: #e0e0e0;
}

.map {
    width: 100%;
    height: 100%;
}

.location-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.pulse-ring {
    width: 40px;
    height: 40px;
    border: 2px solid #2196F3;
    border-radius: 50%;
    animation: pulse 2s infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.location-dot {
    width: 12px;
    height: 12px;
    background-color: #2196F3;
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 位置信息卡片 */
.location-card {
    /* background: rgba(255, 255, 255, 0.95); */
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin: 16px;
    padding: 16px;
    /* box-shadow: 0 4px 12px rgba(0,0,0,0.1); */
    min-height: 200px;
    display: flex;
    flex-direction: column;
    margin-bottom: 80px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
}

.accuracy-badge {
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.info-item {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.label {
    color: #757575;
    min-width: 70px;
}

.value {
    color: #212121;
    flex: 1;
    word-break: break-word;
}

/* 底部操作栏 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px;
    border-radius: 50%;
    color: #424242;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-btn:hover {
    background: #f5f5f5;
    color: #1976D2;
}

.nav-btn .nav-text {
    font-size: 12px;
    font-weight: 500;
    color: inherit;
    line-height: 1;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.punch-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.punch-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.6);
}

.punch-icon {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

/* 考勤记录页面 */
.records-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.records-header {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
}

.records-header h2 {
    font-size: 18px;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.records-content {
    flex: 1;
    overflow-y: auto;
}

.records-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.action-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background: #1976D2;
}

.action-btn:active {
    background: #1565C0;
}

.records-list {
    padding: 16px;
}

.date-group {
    margin-bottom: 24px;
}

.date-header {
    font-size: 16px;
    font-weight: 600;
    color: #2196F3;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.records-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #2196F3;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.record-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.record-time {
    font-weight: 600;
    color: #212121;
    font-size: 15px;
}

.record-type {
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.record-type.type-clock-in {
    background: #4CAF50;
}

.record-type.type-clock-out {
    background: #FF9800;
}

.record-type.type-out {
    background: #2196F3;
}

.record-type.type-return {
    background: #9C27B0;
}

.record-type.type-default {
    background: #757575;
}

.record-location {
    color: #424242;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-icon {
    font-size: 16px;
}

.record-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #757575;
}

.record-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.record-status.synced {
    background: #E8F5E9;
    color: #4CAF50;
}

.record-status.pending {
    background: #FFF3E0;
    color: #FF9800;
}

.record-accuracy {
    font-family: monospace;
}

.record-photo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
}

.photo-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.photo-thumbnail:hover {
    border-color: #2196F3;
}

.photo-label {
    font-size: 12px;
    color: #757575;
}

/* 照片查看模态框 */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #212121;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #757575;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #212121;
}

.modal-body {
    padding: 16px;
}

.photo-full {
    max-width: 100%;
    max-height: 60vh;
    display: block;
    margin: 0 auto 16px;
    border-radius: 8px;
}

.photo-info {
    background: #fafafa;
    padding: 12px;
    border-radius: 6px;
}

.photo-info p {
    margin: 4px 0;
    font-size: 14px;
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }
    
    .map-container {
        height: calc(100vh - 52px - 70px - 250px);
        min-height: 150px;
    }
    
    .location-card {
        margin: 12px;
        padding: 12px;
        min-height: 180px;
        margin-bottom: 70px;
    }
    
    .footer {
        padding: 12px;
    }
    
    .punch-btn {
        width: 56px;
        height: 56px;
    }
    
    .punch-type-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .punch-type-option {
        min-height: 45px;
        padding: 10px;
    }
}

@media (min-width: 768px) {
    body {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    
    .header, .footer {
        max-width: 768px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 打卡类型选择样式 */
.punch-type-selection {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.punch-type-label {
    font-size: 14px;
    color: #757575;
    margin-bottom: 12px;
    font-weight: 500;
}

.punch-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.punch-type-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 50px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.punch-type-option:hover {
    border-color: #2196F3;
    background: #f8f9ff;
}

.punch-type-option.active {
    border-color: #2196F3;
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

/* 请假页面样式 */
.leave-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.leave-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.leave-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #2196F3;
}

.form-control textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.form-actions .action-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f5f5f5;
}