/* ========== 日历页面样式 ========== */
.calendar-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* 日历头部 */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.calendar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.year-select, .month-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.year-select option, .month-select option {
    background: #1e1b2e;
    color: #fff;
}

.year-separator {
    color: #94a3b8;
    font-size: 0.9rem;
}

.nav-arrow {
    width: 36px;
    height: 36px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 50%;
    color: #c4b5fd;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    line-height: 1;
}

.nav-arrow:hover {
    background: rgba(124, 58, 237, 0.3);
}

.today-btn {
    padding: 8px 16px;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 20px;
    color: #c4b5fd;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
}

.today-btn:hover {
    background: rgba(167, 139, 250, 0.3);
}

/* 图例 */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* 星期标题 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday {
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 0;
}

.weekday:first-child, .weekday:last-child {
    color: #ef4444;
}

/* 日历网格 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    min-height: 110px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 6px 8px;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.calendar-day:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.3);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.empty:hover {
    background: transparent;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    background: rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.5);
}

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

.day-number {
    font-size: 0.9rem;
    color: #e2e8f0;
    font-weight: 500;
}

.calendar-day.today .day-number {
    color: #c4b5fd;
    font-weight: 700;
}

.day-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: flex-end;
}

.day-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.day-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.preview-item {
    font-size: 0.68rem;
    line-height: 1.3;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.preview-item.material {
    background: rgba(167, 139, 250, 0.15);
    color: #c4b5fd;
}

.preview-item.album {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
}

.preview-item.birthday {
    background: rgba(244, 114, 182, 0.15);
    color: #f9a8d4;
}

.preview-item.anniversary {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
}

.preview-more {
    font-size: 0.65rem;
    color: #64748b;
    text-align: center;
    padding-top: 2px;
}

.day-dot.material { background: #a78bfa; }
.day-dot.album { background: #60a5fa; }
.day-dot.birthday { background: #f472b6; }
.day-dot.anniversary { background: #34d399; }

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(145deg, #1e1b2e, #2d2a3e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: inherit;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.modal-body {
    padding: 20px 24px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c4b5fd;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title .count {
    background: rgba(167, 139, 250, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #c4b5fd;
}

.event-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid var(--event-color, #a78bfa);
    transition: 0.2s;
}

.event-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.event-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.event-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #94a3b8;
}

.event-link {
    color: #c4b5fd;
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.2s;
}

.event-link:hover {
    text-decoration: underline;
}

.birthday-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(244, 114, 182, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid #f472b6;
}

.birthday-avatar {
    width: 40px;
    height: 40px;
    background: rgba(244, 114, 182, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.birthday-info {
    flex: 1;
}

.birthday-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
}

.birthday-age {
    color: #f472b6;
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 30px 20px;
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .calendar-container {
        padding: 16px;
    }

    .calendar-grid {
        gap: 3px;
    }

    .calendar-day {
        min-height: 90px;
        padding: 4px 6px;
    }

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

    .day-dot {
        width: 5px;
        height: 5px;
    }

    .preview-item {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    .preview-more {
        font-size: 0.58rem;
    }

    .calendar-header {
        gap: 8px;
    }

    .year-select, .month-select {
        padding: 6px 8px;
        font-size: 0.9rem;
    }

    .nav-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    .calendar-legend {
        gap: 12px;
    }

    .legend-item {
        font-size: 0.7rem;
    }

    .modal-content {
        max-height: 85vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 80px;
    }

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

    .day-dot {
        width: 4px;
        height: 4px;
    }

    .preview-item {
        font-size: 0.55rem;
    }

    .preview-more {
        font-size: 0.52rem;
    }

    .calendar-weekdays .weekday {
        font-size: 0.7rem;
    }
}
