/* ===================================
   日历视图 - Q萌卡通风格
   =================================== */

/* 日历容器 */
.calendar-section {
    max-width: 700px;
    margin: 0 auto 24px;
    padding: 0 16px;
}

.calendar-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(255, 142, 199, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.03);
    overflow: visible;
    border: 2px solid rgba(255, 142, 199, 0.08);
}

/* 月份导航 */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
    position: relative;
}

.calendar-month-title {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #5a3e6f;
    text-align: center;
    min-width: 140px;
}

.calendar-nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #fff0f6, #f3e5ff);
    color: #ff8ec7;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1.1rem;
    border: 2px solid rgba(255, 142, 199, 0.15);
}

.calendar-nav-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(255, 142, 199, 0.25);
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    color: white;
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

/* 星期标题行 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 10px 16px;
    gap: 4px;
    border-bottom: 2px dashed rgba(255, 142, 199, 0.1);
}

.calendar-weekday {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #b794f6;
    padding: 8px 0;
    text-transform: uppercase;
}

/* 日历网格 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 16px;
    gap: 4px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: visible;
}

.calendar-grid.slide-left {
    animation: slideOutLeft 0.3s ease forwards;
}

.calendar-grid.slide-right {
    animation: slideOutRight 0.3s ease forwards;
}

.calendar-grid.slide-in {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-30px); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

@keyframes slideIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 单个日期格子 */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    padding: 2px;
    min-height: 48px;
}

.calendar-day:hover {
    background: rgba(255, 142, 199, 0.08);
    transform: scale(1.08);
}

.calendar-day.empty {
    pointer-events: none;
}

.calendar-day.today {
    background: linear-gradient(135deg, rgba(255, 142, 199, 0.12), rgba(183, 148, 246, 0.12));
    border: 2px solid rgba(255, 142, 199, 0.35);
    animation: todayPulse 3s ease-in-out infinite;
}

@keyframes todayPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 142, 199, 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(255, 142, 199, 0.05); }
}

.calendar-day.has-memory {
    background: rgba(255, 142, 199, 0.06);
}

.calendar-day.selected {
    background: linear-gradient(135deg, rgba(255, 142, 199, 0.12), rgba(183, 148, 246, 0.12));
    border: 2px solid rgba(255, 142, 199, 0.25);
}

.calendar-day.selected .day-number {
    color: #5a3e6f;
}

/* 日期数字 */
.day-number {
    font-size: 0.7rem;
    font-weight: 700;
    color: #5a3e6f;
    line-height: 1;
}

.calendar-day.empty .day-number {
    color: #e8d5f0;
}

/* 心情 emoji */
.day-moods {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-top: 1px;
}

.day-mood-emoji {
    font-size: 0.6rem;
    line-height: 1;
}

.day-moods.dual {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
}

.day-mood-emoji.lzh-mood {
    filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.4));
}

.day-mood-emoji.lyl-mood {
    filter: drop-shadow(0 0 2px rgba(255, 105, 180, 0.4));
}

.mood-empty {
    display: inline-block;
    opacity: 0.25;
    font-size: 0.5rem;
}

/* 多条日志角标 */
.day-count-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    color: white;
    font-size: 0.5rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(255, 142, 199, 0.3);
}

/* ===================================
   特殊日期样式
   =================================== */
/* 通用特殊日期角标 */
.day-special-badge {
    font-size: 0.5rem;
    line-height: 1;
    position: absolute;
    top: 1px;
    left: 2px;
    z-index: 1;
}

/* 生日 — 他的（加强效果） */
.calendar-day.special-birthday-his {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 197, 253, 0.3));
    border: 2px solid rgba(59, 130, 246, 0.5);
    animation: birthdayPulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.calendar-day.special-birthday-his .day-number {
    color: #3b82f6;
    font-weight: 800;
}

.calendar-day.special-birthday-his .day-special-badge {
    font-size: 0.65rem;
    animation: badgeBounce 1.5s ease-in-out infinite;
}

/* 生日 — 她的（加强效果） */
.calendar-day.special-birthday-her {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.2), rgba(255, 182, 212, 0.3));
    border: 2px solid rgba(255, 105, 180, 0.5);
    animation: birthdayPulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.15);
}

.calendar-day.special-birthday-her .day-number {
    color: #ff69b4;
    font-weight: 800;
}

.calendar-day.special-birthday-her .day-special-badge {
    font-size: 0.65rem;
    animation: badgeBounce 1.5s ease-in-out infinite;
}

@keyframes birthdayPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.15); }
    50% { box-shadow: 0 0 18px rgba(255, 215, 0, 0.35), 0 0 30px rgba(255, 142, 199, 0.1); }
}

@keyframes badgeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 特殊日期在选中状态下保持白色数字 */
.calendar-day.selected.special-birthday-his .day-number,
.calendar-day.selected.special-birthday-her .day-number {
    color: white;
}

/* 月纪念日（每月11号） */
.calendar-day.special-anniversary {
    background: linear-gradient(135deg, rgba(255, 182, 212, 0.18), rgba(183, 148, 246, 0.15));
    border: 2px solid rgba(183, 148, 246, 0.35);
    position: relative;
}

.calendar-day.special-anniversary::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 142, 199, 0.3), rgba(183, 148, 246, 0.3));
    z-index: -1;
    animation: anniversaryGlow 3s ease-in-out infinite;
    opacity: 0;
}

@keyframes anniversaryGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.calendar-day.special-anniversary .day-number {
    color: #8b5cf6;
    font-weight: 800;
}

.calendar-day.special-anniversary .day-special-badge {
    animation: badgeBounce 1.5s ease-in-out infinite;
}

/* ===================================
   日期详情弹窗 - Q萌风格
   =================================== */
.day-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 200, 230, 0.3);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.day-detail-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.day-detail-panel {
    background: white;
    border-radius: 24px;
    max-width: 420px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(255, 142, 199, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 142, 199, 0.1);
}

.day-detail-overlay.active .day-detail-panel {
    transform: translateY(0) scale(1);
}

.day-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.day-detail-date {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #5a3e6f;
}

.day-detail-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #f0e0f6;
    background: #fdf5ff;
    color: #b794f6;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.day-detail-close:hover {
    background: #ff8ec7;
    color: white;
    border-color: #ff8ec7;
    transform: rotate(90deg) scale(1.1);
}

.day-detail-memories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.day-detail-memory-card {
    padding: 14px 18px;
    background: #fdf5ff;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid #ff8ec7;
    border: 2px solid rgba(255, 142, 199, 0.08);
    border-left: 4px solid #ff8ec7;
}

.day-detail-memory-card:hover {
    background: #fff0f6;
    transform: translateX(6px) scale(1.01);
    box-shadow: 0 4px 15px rgba(255, 142, 199, 0.1);
}

.day-detail-memory-title {
    font-weight: 700;
    color: #5a3e6f;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.day-detail-memory-preview {
    font-size: 0.8rem;
    color: #b8a0c8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 弹窗底部"添加新日志"按钮 */
.day-detail-actions {
    text-align: center;
    padding-top: 14px;
    border-top: 2px dashed rgba(255, 142, 199, 0.1);
}

.day-detail-add-btn {
    display: inline-block;
    padding: 10px 28px;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    color: white;
    text-decoration: none;
    border: none;
    outline: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(255, 142, 199, 0.25);
}

.day-detail-add-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 142, 199, 0.35);
}

/* ===================================
   响应式
   =================================== */
@media (max-width: 480px) {
    .calendar-card {
        border-radius: 20px;
    }

    .calendar-header {
        padding: 16px 16px 8px;
    }

    .calendar-month-title {
        font-size: 1.05rem;
    }

    .calendar-grid {
        padding: 4px 8px 12px;
        gap: 2px;
    }

    .calendar-day {
        min-height: 42px;
        border-radius: 10px;
    }

    .day-number {
        font-size: 0.65rem;
    }

    .day-mood-emoji {
        font-size: 0.55rem;
    }

    .day-detail-panel {
        padding: 22px;
    }
}

/* ===== 日期跳转面板 ===== */
.calendar-jump-panel {
    padding: 12px 20px 16px;
    border-top: 1px dashed rgba(255, 142, 199, 0.2);
    animation: calJumpFadeIn 0.2s ease;
}
.calendar-jump-year {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5a3e6f;
}
.calendar-jump-year .calendar-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}
.calendar-jump-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.jump-month-btn {
    padding: 8px 4px;
    border: 1.5px solid rgba(255, 142, 199, 0.15);
    border-radius: 12px;
    background: #fff;
    color: #5a3e6f;
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.jump-month-btn:hover {
    background: #fff5fb;
    border-color: #ff8ec7;
    transform: scale(1.05);
}
.jump-month-btn.active {
    background: linear-gradient(135deg, #ff8ec7, #a78bfa);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(255, 142, 199, 0.3);
}
@keyframes calJumpFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}