/* ============ 在线万年历 - 日历特有样式 ============ */

/* 日历卡片头部（参考图片：年下拉 + 月下拉 + 左右箭头 + 今天按钮） */
.calendar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calendar-card-header .date-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.calendar-card-header .form-select {
    min-width: 90px;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.nav-btn:hover {
    background: #8b5cf6;
    color: white;
}

/* 日历网格 */
.calendar-grid {
    margin-top: 10px;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 10px;
}

.calendar-grid-header span {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    padding: 8px 0;
}

.calendar-grid-header span:last-child,
.calendar-grid-header span:nth-child(6) {
    color: #ef4444;
}

.calendar-grid-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 14px;
    padding: 2px;
    min-height: 60px;
}

.calendar-day:hover:not(.empty):not(.other-month) {
    background: #f3e8ff;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.other-month {
    color: #d1d5db;
    cursor: pointer;
}

.calendar-day.other-month .day-label {
    color: #d1d5db;
}

.calendar-day.today {
    border: 2px solid #8b5cf6;
    background: #f3f8ff;
}

.calendar-day.selected {
    border: 2px solid #8b5cf6;
    background: #f3f8ff;
}

.calendar-day.today.selected {
    background: #8b5cf6;
    color: white;
}

.calendar-day.today.selected .day-label,
.calendar-day.today.selected .day-number {
    color: white;
}

.calendar-day.weekend .day-number {
    color: #ef4444;
}

.calendar-day.today.weekend .day-number,
.calendar-day.selected.weekend .day-number {
    color: #ef4444;
}

.calendar-day.today.selected.weekend .day-number {
    color: white;
}

.calendar-day.legal-holiday {
    background: #fef3c7;
}

.calendar-day.legal-holiday .day-number {
    color: #92400e;
}

.calendar-day.traditional-day {
    background: #dbeafe;
}

.calendar-day.traditional-day .day-number {
    color: #1d4ed8;
}

.day-number {
    font-weight: 600;
    font-size: 18px;
    line-height: 1.2;
}

.day-label {
    font-size: 10px;
    text-align: center;
    margin-top: 1px;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6b7280;
}

.day-label.holiday-name {
    color: #92400e;
    font-weight: 500;
}

.day-label.lunar-text {
    color: #6b7280;
}

/* 图例 */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 0;
    padding-top: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.today {
    background: #f3f8ff;
    border: 2px solid #8b5cf6;
}

.legend-color.legal-holiday {
    background: #fef3c7;
}

.legend-color.traditional-day {
    background: #dbeafe;
}

.legend-color.weekend {
    background: #fee2e2;
}

/* 日期详情 */
.date-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-group h4 {
    font-size: 14px;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.detail-group p {
    margin: 5px 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
}

.holiday-tag {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.suit-text {
    color: #166534;
}

.avoid-text {
    color: #991b1b;
}

/* 响应式 */
@media (max-width: 768px) {
    .calendar-card-header {
        gap: 10px;
    }

    .calendar-day {
        font-size: 13px;
        padding: 1px;
        min-height: 48px;
    }

    .day-number {
        font-size: 15px;
    }

    .day-label {
        font-size: 8px;
    }
}
