.calendar-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 36px;
    padding: 1.2rem 1rem 1.5rem 1rem;
    box-shadow: 0 15px 30px rgba(233, 30, 99, 0.2);
    border: 1px solid rgba(233, 30, 99, 0.25);
    transition: all 0.3s ease;
    min-height: calc(100vh - 148px);
}

.calendar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.8rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
}

.calendar-nav button {
    background: #e91e63;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(233, 30, 99, 0.3);
}

.calendar-nav button:hover {
    background: #c2185b;
    transform: scale(1.05);
}

.year-month {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e91e63;
    background: rgba(255, 255, 255, 0.6);
    padding: 0 1rem;
    border-radius: 40px;
    min-width: 220px;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-btn {
    background: linear-gradient(135deg, #d16fef, #e91e63);
    color: #fff;
    width: auto !important;
    margin-right: 20px;
    border-radius: 35px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.4) !important;
    box-shadow: 0 5px 12px rgba(138, 60, 199, 0.3);
    outline: none !important;
    transition: all 0.2s ease;
}

.today-btn:hover {
    transform: translateY(-1px);    
    box-shadow: 0 8px 18px rgba(138, 60, 199, 0.45);
}

.today-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(138, 60, 199, 0.35);
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 0.8rem;
    text-align: center;
}

.weekday {
    font-weight: 700;
    padding: 0.6rem 0;
    background: rgba(233, 30, 99, 0.15);
    border-radius: 50px;
    color: #6a0dad;
    font-size: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(60px, 1fr);
    gap: 10px;
    min-height: 0;
}

/* 灵活格子高度，适应不同分辨率 */
.calendar-day {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 24px;
    padding: 0.6rem 0.4rem 0.5rem 0.4rem;
    min-height: 104.18px;
    height: auto;
    overflow-y: auto;
    transition: all 0.25s ease;
    border: 1px solid rgba(233, 30, 99, 0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    scrollbar-width: thin;
}

.calendar-day::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.calendar-day::-webkit-scrollbar-thumb {
    background: #e91e63;
    border-radius: 4px;
}

.calendar-day:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.96);
    border-color: #e91e63;
    box-shadow: 0 8px 18px rgba(233, 30, 99, 0.2);
}

.day-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #6a0dad;
    margin-bottom: 5px;
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: rgba(233, 30, 99, 0.1);
    border-radius: 26px;
    margin-left: 3px;
    flex-shrink: 0;
}

.today .day-number {
    background: #e91e63;
    color: white;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.4);
}

.other-month .day-number {
    opacity: 0.55;
    color: #b38faa;
}

/* 日程徽章样式：支持滚动文本 */
.event-badge {
    font-size: 0.65rem;
    background: rgba(233, 30, 99, 0.2);
    border-radius: 18px;
    margin: 3px 3px 2px 3px;
    color: #c2185b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    white-space: nowrap;
    overflow: hidden;
    width: calc(100% - 6px);
    max-width: 100%;
}

.event-badge .time-icon {
    flex-shrink: 0;
    font-size: 0.6rem;
}

.event-badge .scroll-wrapper {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
}

.event-badge .scroll-text {
    display: inline-block;
    white-space: nowrap;
    transition: none;
    will-change: transform;
}

.event-badge.scrolling .scroll-text {
    animation: scrollMarquee 5s linear infinite;
}

@keyframes scrollMarquee {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(calc(-1 * var(--scroll-distance, 30px)));
    }

    100% {
        transform: translateX(0);
    }
}

.more-events {
    font-size: 0.65rem;
    color: #e91e63;
    font-weight: 600;
    margin-top: 2px;
    margin-left: 5px;
    background: rgba(233, 30, 99, 0.1);
    border-radius: 18px;
    padding: 2px 6px;
    width: fit-content;
    flex-shrink: 0;
}

/* 移动端只显示日程数量，隐藏具体标题 */
@media (max-width: 910px) {
    .calendar-day {
        height: 85px;
        /* 缩小高度 */
        overflow: visible;
        justify-content: center;
        text-align: center;
    }

    .event-badge,
    .more-events {
        display: none;
        /* 隐藏所有日程标题和更多提示 */
    }

    .calendar-day::after {
        content: attr(data-event-count);
        display: block;
        font-size: 0.75rem;
        color: #e91e63;
        background: rgba(233, 30, 99, 0.15);
        border-radius: 26px;
        padding: 3px 6px;
        margin-top: 5px;
        font-weight: 600;
        text-align: center;
    }

    /* 如果没有日程，不显示计数 */
    .calendar-day[data-event-count="0"]::after {
        content: "🐾";
        background: transparent;
        color: #c2a0b5;
        font-size: 0.7rem;
    }

    .day-number {
        margin: 0 auto;
        font-size: 1.1rem;
        width: 28px;
        height: 28px;
        line-height: 28px;
    }
}

/* 日程列表模态框 ———— 隐藏滚动条但保留滚动功能 */
.event-list {
    margin: 1.2rem 0;
    max-height: 55vh;
    /* overflow-y: auto;    暂时没有用到这个类了 不要删除小心bug */
    scrollbar-width: none;
    /* Firefox 隐藏滚动条 */
    -ms-overflow-style: none;
    /* IE/Edge 隐藏滚动条 */
}

.event-list::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari 隐藏滚动条 */
}

.schedule-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2200;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.schedule-modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 48px;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem 1.8rem;
    box-shadow: 0 30px 50px rgba(233, 30, 99, 0.3);
    border: 1px solid rgba(233, 30, 99, 0.3);
    animation: modalPop 0.3s ease;
}

.modal-card h3 {
    font-size: 1.9rem;
    color: #e91e63;
    margin-bottom: 0.5rem;
    border-left: 5px solid #e91e63;
    padding-left: 1rem;
}

.modal-date {
    color: #6a0dad;
    font-weight: 600;
    margin: 0.5rem 0 1.2rem 0;
    font-size: 1.1rem;
    background: #fce4ec;
    display: inline-block;
    padding: 0.2rem 1rem;
    border-radius: 40px;
}

.event-item {
    background: rgba(233, 30, 99, 0.08);
    border-radius: 28px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.event-item:hover {
    background: rgba(233, 30, 99, 0.18);
    border-color: rgba(233, 30, 99, 0.4);
    transform: scale(1.01);
}

.event-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e91e63;
    background: rgba(233, 30, 99, 0.15);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    margin-right: 8px;
}

.event-title {
    font-weight: 700;
    color: #e91e63;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.event-desc-preview {
    font-size: 0.85rem;
    color: #6a0dad;
    margin-top: 6px;
    opacity: 0.8;
}

.empty-events {
    text-align: center;
    color: #b38faa;
    padding: 1.5rem;
    font-style: italic;
}

.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2300;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.detail-modal.active {
    visibility: visible;
    opacity: 1;
}

.detail-card {
    background: #fffef7;
    border-radius: 56px;
    max-width: 500px;
    width: 85%;
    padding: 2rem 2rem 1.8rem;
    box-shadow: 0 25px 45px rgba(233, 30, 99, 0.35);
    border: 1px solid #f8bbd0;
    position: relative;
    animation: modalPop 0.3s ease;
}

.detail-card h4 {
    font-size: 1.8rem;
    color: #e91e63;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.detail-time {
    display: inline-block;
    background: #e91e6310;
    border-radius: 40px;
    padding: 0.2rem 1rem;
    font-size: 0.9rem;
    color: #e91e63;
    font-weight: 600;
    margin-bottom: 1rem;
}

.detail-date {
    display: inline-block;
    background: #fce4ec;
    border-radius: 40px;
    padding: 0.2rem 1rem;
    font-size: 0.9rem;
    color: #6a0dad;
    margin-left: 8px;
}

.detail-description {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #4a4a4a;
    background: rgba(233, 30, 99, 0.05);
    padding: 1rem 1.2rem;
    border-radius: 32px;
    margin: 1rem 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.close-detail-btn,
.close-modal-btn {
    background: #e91e63;
    border: none;
    padding: 0.6rem 1.6rem;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.close-detail-btn:hover,
.close-modal-btn:hover {
    background: #c2185b;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.loading-tip {
    text-align: center;
    padding: 2rem;
    color: #e91e63;
    font-size: 1.2rem;
}

@media (max-width: 720px) {
    .calendar-grid {
        gap: 6px;
    }

    .weekday {
        font-size: 0.85rem;
    }

    .year-month {
        font-size: 1.3rem;
        width: auto;
        min-width: 160px;
        max-width: 200px;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    .detail-card h4 {
        font-size: 1.4rem;
    }
}
