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

body {
    font-family: Arial, sans-serif;
    line-height: 1.2;
    color: #333;
    background-color: #f4f4f4;
}

a, a:visited {
    text-decoration: none;
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px;
}

header {
    background-color: #333;
    color: white;
    padding: 5px 0;
    margin-bottom: 10px;
    border-radius: 4px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-title {
    font-size: 24px;
    font-weight: bold;
}

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

.user-info a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    background-color: #555;
    border-radius: 4px;
}

.user-info a:hover {
    background-color: #666;
}

.calendar-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calendar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-title {
    text-align: center;
    color: #333;
    margin: 0;
    font-size: 20px;
    white-space: nowrap;
}

/* 公历日期 */
.solar-date {
    color: #333;
}

/* 干支日期 */
.ganzhi-date {
    color: #999;
    font-weight: normal;
    font-size: 12px;
}

/* 备注表单头部 */
.note-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.note-form-header h3 {
    margin: 0;
    font-size: 16px;
}

/* 备注日期显示 */
.note-date-display {
    font-size: 14px;
    color: #666;
    padding: 5px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.calendar-nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.nav-btn:hover {
    background-color: #0069d9;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #f2f3f4;
    border-bottom: 1px solid #dee2e6;
}

.weekday {
    padding: 12px;
    text-align: center;
    font-weight: bold;
    color: #6c757d;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #dee2e6;
}

.calendar-day {
    position: relative;
    padding: 5px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.today {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
}

.calendar-day.selected {
    background-color: #f3e5f5;
    border: 2px solid #9c27b0;
}

.calendar-day.other-month {
    background-color: #f8f9fa;
    color: #6c757d;
}

.day-number {
    font-size: 18px;
    font-weight: bold;
}

.lunar-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 3px;
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.festival {
    font-size: 10px;
    color: #dc3545;
    font-weight: bold;
    display: block;

    background-color: #fff3f3;
    padding: 1px 3px;
    border-radius: 2px;
}

.holiday-mark {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    font-size: 9px;
    color: white;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2px;
    background: linear-gradient(45deg, transparent 50%, #28a745 50%);
    background-size: 20px 20px;
    background-position: top right;
    background-repeat: no-repeat;
}

.holiday-mark::before {
    content: '休';
}

.workday-mark {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    font-size: 9px;
    color: #333;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2px;
    background: linear-gradient(45deg, transparent 50%, #ffc107 50%);
    background-size: 20px 20px;
    background-position: top right;
    background-repeat: no-repeat;
}

.workday-mark::before {
    content: '班';
}

.term {
    font-size: 10px;
    color: #007bff;
    font-weight: bold;
}

.festival {
    font-size: 10px;
    color: #dc3545;
    font-weight: bold;
}

/* 法定假日名称样式 */
.holiday-name {
    font-size: 10px;
    color: #28a745;
    font-weight: bold;
}

/* 周末样式 */
.calendar-day.saturday, .calendar-day.sunday {
    background-color: #e8f5e8;
}

.loading {
    grid-column: 1 / -1;
    padding: 100px;
    text-align: center;
    color: #6c757d;
}

.note-form {
    margin-top: 10px;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

footer {
    text-align: center;           
    padding: 10px;          
    color: white;
    border-radius: 8px;
}

footer p {
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .calendar-container {
        padding: 10px;
    }
    
    .calendar-header-row {
        flex-direction: column;
        align-items: center;
    }
    
    .calendar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-btn {
        margin-bottom: 5px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 5px;
    }
    
    .day-number {
        font-size: 16px;
    }
    
    .lunar-date, .holiday, .term, .note {
        font-size: 9px;
    }

    .note {
        color: #ff9800;
        padding: 1px 3px;
        background-color: rgba(255, 152, 0, 0.1);
        border-radius: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 90%;
        margin-top: 2px;
    }
}

/* 年月选择器样式 */
.year-month-selector {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.selector-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

.selector-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.selector-body {
    margin-bottom: 20px;
}

.year-selector, .month-selector {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.year-selector label, .month-selector label {
    width: 60px;
    font-weight: bold;
    color: #333;
}

.year-selector select, .month-selector select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.year-selector select:focus, .month-selector select:focus {
    outline: none;
    border-color: #007bff;
}

.selector-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-btn, .cancel-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.confirm-btn {
    background-color: #007bff;
    color: white;
}

.confirm-btn:hover {
    background-color: #0069d9;
}

.cancel-btn {
    background-color: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

/* 备注样式 */
.note {
    color: #ff9800;
    padding: 1px 3px;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    margin-top: 2px;
    font-size: 9px;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
    min-width: 200px;
    text-align: center;
}

.notification.show {
    transform: translateX(-50%) translateY(100px);
    opacity: 1;
}

.notification.success {
    background-color: #4caf50;
}

.notification.error {
    background-color: #f44336;
}

.notification.info {
    background-color: #2196f3;
}