* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header h1 {
    font-size: 20px;
    font-weight: 600;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-right a {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s;
    font-size: 14px;
}
.header-right a:hover {
    background: rgba(255,255,255,0.3);
}
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 15px;
}
.calendar-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-btn:hover {
    background: #667eea;
    color: white;
}
.month-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.calendar-day-header {
    text-align: center;
    padding: 10px 5px;
    font-weight: 600;
    color: #666;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 6px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.calendar-day:hover {
    background: #f5f8ff;
    border-color: #667eea;
}
.calendar-day.other-month {
    background: #fafafa;
    color: #ccc;
}
.calendar-day.today {
    border-color: #667eea;
    border-width: 2px;
}
.calendar-day.has-record {
    background: #e3f2fd;
    border-color: #90caf9;
}
.calendar-day.has-overtime {
    background: #fff3e0;
    border-color: #ffb74d;
}
.calendar-day.has-custom {
    background: #f3e5f5;
    border-color: #ce93d8;
}
.day-number {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}
.record-info {
    width: 100%;
    font-size: 9px;
    line-height: 1.3;
    color: #555;
    word-break: break-all;
}
.record-info .hours {
    display: block;
    font-weight: 500;
}
.record-info .amount {
    color: #2e7d32;
    font-weight: 500;
}
.stats-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}
.custom-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}
.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}
.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}
.stat-value.income {
    color: #2e7d32;
}
.stat-value.overtime {
    color: #ff9800;
}
.stat-value.custom {
    color: #9c27b0;
    font-size: 16px;
}
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
}
.modal {
    background: white;
    border-radius: 15px 15px 0 0;
    padding: 25px;
    /* width: 100%; */
    max-height: 85vh;
    overflow-y: auto;
}
@media screen and (max-width: 768px) {
    .modal {
        width: 100%;
    }
}
.modal h2 {
    margin-bottom: 18px;
    color: #333;
    font-size: 18px;
}
.form-group {
    margin-bottom: 13px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}
.form-group textarea {
    resize: vertical;
    min-height: 60px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.btn-secondary {
    background: #f0f0f0;
    color: #666;
}
.btn-secondary:hover {
    background: #e0e0e0;
}
.btn-danger {
    background: #ef5350;
    color: white;
}
.btn-danger:hover {
    background: #e53935;
}
.existing-records {
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}
.existing-records h3 {
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
}
.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}
.record-item .info {
    flex: 1;
    min-width: 0;
}
.record-item .actions {
    display: flex;
    gap: 6px;
    margin-left: 10px;
}
.record-item .actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.record-item .actions .edit-btn {
    background: #667eea;
    color: white;
}
.record-item .actions .delete-btn {
    background: #ef5350;
    color: white;
}
.no-records {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 10px;
}
.logout-btn {
    background: rgba(239, 83, 80, 0.2);
}
.logout-btn:hover {
    background: rgba(239, 83, 80, 0.3);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .header {
        padding: 12px 15px;
    }
    .header h1 {
        font-size: 16px;
    }
    .header-right a {
        padding: 5px 10px;
        font-size: 12px;
    }
    .container {
        margin: 15px auto;
        padding: 0 12px;
    }
    .calendar-section {
        padding: 15px;
    }
    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .month-title {
        font-size: 16px;
    }
    .calendar-grid {
        gap: 4px;
    }
    .calendar-day-header {
        padding: 8px 3px;
        font-size: 11px;
    }
    .calendar-day {
        padding: 4px;
    }
    .day-number {
        font-size: 12px;
        margin-bottom: 2px;
    }
    .record-info {
        font-size: 8px;
        line-height: 1.2;
    }
    .stats-section {
        padding: 15px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .custom-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-card {
        padding: 12px;
    }
    .stat-label {
        font-size: 11px;
    }
    .stat-value {
        font-size: 18px;
    }
    .stat-value.custom {
        font-size: 14px;
    }
    .modal {
        padding: 20px 15px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 13px;
    }
    .record-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .record-item .actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}

/* 平板适配 */
@media (min-width: 481px) and (max-width: 768px) {
    .header h1 {
        font-size: 18px;
    }
    .calendar-grid {
        gap: 5px;
    }
    .calendar-day {
        padding: 5px;
    }
    .record-info {
        font-size: 8px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
