/* 2025年现代设计系统 - CSS变量定义 */
:root {
    /* 主色调 - 现代蓝色系 */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* 渐变色 - 现代设计 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #4a90e2 0%, #6a67ce 100%);
    --gradient-success: linear-gradient(135deg, #a8e6cf 0%, #88d8b0 100%);
    --gradient-warning: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    --gradient-danger: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    
    /* 中性色 - 提升对比度 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 语义色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: var(--primary-500);
    
    /* 字体系统 */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    
    /* 字体大小 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* 间距系统 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* 圆角 */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    
    /* 动画 */
    --duration-75: 75ms;
    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;
    --duration-700: 700ms;
    --duration-1000: 1000ms;
    
    /* 过渡 */
    --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 基础重置和现代化 */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gradient-primary);
    min-height: 100vh;
    padding: var(--space-5);
    transition: all var(--duration-300) var(--ease-soft);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 网页标题 - 现代化突出显示 */
.page-title {
    max-width: 1200px;
    margin: 0 auto var(--space-8) auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.page-title h1 {
    font-size: var(--text-5xl);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #dbeafe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.05em;
    line-height: 1.1;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.page-title h1::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.2));
    }
    100% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)) drop-shadow(0 0 30px rgba(59, 130, 246, 0.4));
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .page-title {
        margin-bottom: var(--space-6);
    }
    
    .page-title h1 {
        font-size: var(--text-3xl);
    }
}

@media (max-width: 480px) {
    .page-title {
        margin-bottom: var(--space-4);
    }
    
    .page-title h1 {
        font-size: var(--text-2xl);
    }
    
    .page-title h1::before {
        width: 40px;
        height: 3px;
    }
}
}

/* 主容器 - 现代卡片设计 */
.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.calendar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    z-index: 1;
}

/* 头部 - 现代化设计 */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-8) var(--space-6);
    background: var(--gradient-secondary);
    color: white;
    flex-wrap: wrap;
    gap: var(--space-4);
    position: relative;
    overflow: hidden;
}

.calendar-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.calendar-header h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    letter-spacing: -0.025em;
}

.calendar-header button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 500;
    transition: all var(--duration-200) var(--ease-soft);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-sm);
}

.calendar-header button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.5);
}

.calendar-header button:active {
    transform: translateY(0);
    transition-duration: var(--duration-75);
}

/* 日历网格 - 现代化布局 */
.calendar-grid {
    padding: var(--space-8);
}

/* 星期标题 */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    padding: var(--space-4) 0;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-md);
    color: white;
    position: relative;
    overflow: hidden;
}

.weekdays::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.weekdays .weekend {
    color: #fbbf24;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 日期网格 */
.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-4);
}

/* 日期单元格 - 现代化设计 */
.day {
    min-height: 110px;
    aspect-ratio: 3/2;
    max-height: 160px;
    padding: var(--space-2);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: var(--gray-50);
    position: relative;
    cursor: pointer;
    transition: all var(--duration-300) var(--ease-soft);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    backdrop-filter: blur(10px);
    /* 确保方块独立性 */
    flex-shrink: 0;
    align-self: stretch;
}

.day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--duration-300) var(--ease-soft);
}

.day:hover::before {
    opacity: 1;
}

.day:hover {
    background: var(--primary-50);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-300);
    z-index: 10;
}

/* 周末样式优化 - 直接显示效果 */
.day.saturday,
.day.sunday {
    background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 50%, #fde68a 100%);
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    transform: translateY(-1px);
}

.day.saturday::before,
.day.sunday::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
    animation: weekendGlow 4s ease-in-out infinite;
    z-index: 0;
}

@keyframes weekendGlow {
    0%, 100% {
        opacity: 0.4;
        transform: rotate(0deg);
    }
    50% {
        opacity: 0.7;
        transform: rotate(180deg);
    }
}

/* 周末有事件时的协调样式 */
.day.saturday.has-events,
.day.sunday.has-events {
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8b0 50%, #6ee7b7 100%);
    border: 2px solid var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px) scale(1.01);
}

.day.saturday.has-events::before,
.day.sunday.has-events::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    animation: weekendEventGlow 3s ease-in-out infinite;
}

@keyframes weekendEventGlow {
    0%, 100% {
        opacity: 0.5;
        transform: rotate(0deg) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: rotate(180deg) scale(1.1);
    }
}

/* 周末今天的特殊样式 - 最高优先级 */
.day.saturday.today,
.day.sunday.today {
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), 0 6px 20px rgba(245, 158, 11, 0.4);
    transform: scale(1.05);
    animation: weekendTodayPulse 2s ease-in-out infinite;
}

@keyframes weekendTodayPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), 0 6px 20px rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.8), 0 8px 25px rgba(245, 158, 11, 0.5);
    }
}

.day.saturday.today::before,
.day.sunday.today::before {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
    animation: weekendTodayGlow 3s ease-in-out infinite;
}

@keyframes weekendTodayGlow {
    0%, 100% {
        opacity: 0.7;
        transform: rotate(0deg) scale(1);
    }
    50% {
        opacity: 1;
        transform: rotate(180deg) scale(1.2);
    }
}

/* 当月日期样式 - 突出显示 */
.day.current-month {
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    color: var(--gray-900);
    border: 2px solid var(--primary-200);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    opacity: 1;
    font-weight: 500;
}

/* 今天样式 - 突出显示 */
.day.today {
    background: var(--gradient-secondary);
    color: white;
    font-weight: 700;
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-500);
    transform: scale(1.05);
    z-index: 5;
}

.day.today.current-month {
    background: var(--gradient-secondary);
    color: white;
    font-weight: 700;
    box-shadow: var(--shadow-glow), 0 0 20px rgba(59, 130, 246, 0.4);
    border-color: var(--primary-500);
    transform: scale(1.05);
    z-index: 5;
}

.day.today .lunar-date,
.day.today .holiday {
    color: rgba(255, 255, 255, 0.9);
}

/* 事件状态 - 视觉层次 */
.day.has-events {
    background: var(--gradient-success);
    border: 2px solid var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.day.today.has-events {
    background: var(--gradient-danger);
    border-color: var(--error-color);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

/* 其他月份 - 弱化显示 */
.day.other-month {
    background: linear-gradient(135deg, var(--gray-100) 0%, rgba(243, 244, 246, 0.6) 100%);
    color: var(--gray-400);
    opacity: 0.6;
    border: 1px dashed var(--gray-300);
    border-color: var(--gray-300);
    font-weight: 400;
}

.day.other-month .holiday {
    color: var(--gray-500);
    background: rgba(107, 114, 128, 0.1);
}

.day.other-month.current-month {
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    color: var(--gray-900);
    border: 2px solid var(--primary-200);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    opacity: 1;
    font-weight: 500;
}

/* 日期编号 - 现代化排版 */
.day-number {
    font-size: var(--text-base);
    font-weight: 500;
    margin-bottom: 2px;
    align-self: flex-end;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.1;
}

/* 农历信息 - 细排版 */
.lunar-date {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: 1px;
    font-weight: 400;
    white-space: nowrap; /* 防止农历文字换行 */
    flex-shrink: 1; /* 允许压缩但保持一行 */
    overflow: visible; /* 允许显示完整农历文字 */
    text-overflow: initial; /* 移除省略号 */
    min-width: 0; /* 允许flex项目收缩 */
    line-height: 1.2;
}

/* 农历容器 - 优化布局 */
.lunar-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1px;
    gap: 2px;
    min-width: 0; /* 允许容器收缩 */
    line-height: 1.1;
}

/* 节气样式 - 特殊标记 */
.jieqi {
    font-size: var(--text-sm);
    color: var(--info-color);
    font-weight: 500;
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 3px;
    border-radius: 2px;
    white-space: nowrap;
    border: 1px solid rgba(59, 130, 246, 0.2);
    flex-shrink: 0; /* 节气不收缩，保持完整显示 */
    line-height: 1.1;
}

/* 节假日 - 醒目提示 */
.holiday {
    font-size: var(--text-sm);
    color: var(--error-color);
    font-weight: 500;
    margin-bottom: 1px;
    background: rgba(239, 68, 68, 0.1);
    padding: 1px 3px;
    border-radius: 2px;
    display: inline-block;
    align-self: flex-start;
    border: 1px solid rgba(239, 68, 68, 0.2);
    position: relative;
    overflow: hidden;
    line-height: 1.1;
}

.holiday::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: sweep 2s ease-in-out infinite;
}

@keyframes sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 事件列表 - 现代化设计 */
.events {
    font-size: var(--text-sm);
    color: var(--info-color);
    white-space: normal;
    overflow: hidden;
    margin-top: 6px;
    padding-top: 2px;
    border-top: 1px solid var(--gray-200);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.events a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--duration-200) var(--ease-soft);
    position: relative;
    display: inline-block;
    padding: 1px 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.events a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-500);
    transition: width var(--duration-300) var(--ease-soft);
}

.events a:hover {
    color: var(--primary-700);
    text-decoration: none;
    transform: translateX(2px);
}

.events a:hover::after {
    width: 100%;
}

.event-item {
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    white-space: nowrap;
}

.event-more {
    margin-top: 2px;
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: 500;
}

.event-separator {
    height: 1px;
    background: linear-gradient(90deg, var(--gray-200), var(--gray-300), var(--gray-200));
    margin: 2px 0;
    border-radius: var(--radius-sm);
}

/* 模态框 - 现代化设计 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: modalFadeIn var(--duration-300) var(--ease-soft);
}

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

.modal-content {
    background: var(--gray-50);
    margin: 10% auto;
    padding: var(--space-8);
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-2xl);
    animation: modalSlideIn var(--duration-500) var(--ease-bounce);
    border: 1px solid var(--gray-200);
    backdrop-filter: blur(20px);
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: var(--space-6);
    top: var(--space-4);
    font-size: var(--text-3xl);
    font-weight: 300;
    cursor: pointer;
    color: var(--gray-400);
    transition: all var(--duration-200) var(--ease-soft);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
}

.close:hover {
    color: var(--error-color);
    background: var(--gray-200);
    transform: rotate(90deg) scale(1.1);
}

/* 表单设计 - 现代化 */
#event-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-top: var(--space-6);
}

#event-form label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--text-lg);
    display: block;
    margin-bottom: var(--space-2);
}

#event-form input {
    padding: var(--space-4) var(--space-5);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    transition: all var(--duration-200) var(--ease-soft);
    background: white;
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
}

#event-form input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

#event-form button {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: var(--text-lg);
    font-weight: 600;
    transition: all var(--duration-200) var(--ease-soft);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

#event-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-soft);
}

#event-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#event-form button:hover::before {
    left: 100%;
}

#event-form button:active {
    transform: translateY(0);
    transition-duration: var(--duration-75);
}

/* 响应式设计 - 2025年标准 */
@media (max-width: 768px) {
    :root {
        --text-4xl: 2rem;
        --space-8: 1.5rem;
    }
    
    .calendar-header {
        flex-direction: column;
        text-align: center;
        padding: var(--space-6);
    }
    
    .calendar-header h1 {
        font-size: var(--text-3xl);
        margin-bottom: var(--space-4);
    }
    
    .calendar-header button {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
    
    .calendar-grid {
        padding: var(--space-6);
    }
    
    .day {
        min-height: 90px;
        max-height: 130px;
        padding: var(--space-2);
        border-radius: var(--radius-lg);
        aspect-ratio: 3/2;
    }
    
    .day-number {
        font-size: var(--text-sm);
        margin-bottom: 1px;
    }
    
    .lunar-date {
        font-size: var(--text-xs);
        margin-bottom: 1px;
    }
    
    .lunar-container {
        gap: 1px;
        margin-bottom: 1px;
    }
    
    .jieqi {
        font-size: var(--text-xs);
        padding: 1px 2px;
    }
    
    .holiday {
        font-size: var(--text-xs);
        margin-bottom: 1px;
        padding: 1px 2px;
    }
    
    .events {
        font-size: var(--text-xs);
        margin-top: 1px;
        padding-top: 1px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: var(--space-6);
    }
}

@media (max-width: 480px) {
    :root {
        --space-5: 0.75rem;
        --space-6: 1rem;
    }
    
    body {
        padding: var(--space-3);
    }
    
    .calendar-header {
        padding: var(--space-4);
    }
    
    .calendar-grid {
        padding: var(--space-4);
    }
    
    .days {
        gap: var(--space-2);
    }
    
    .day {
        min-height: 80px;
        padding: var(--space-2);
    }
    
    .day-number {
        font-size: var(--text-base);
    }
    
    .lunar-date {
        font-size: 10px;
    }
    
    .holiday {
        font-size: 9px;
        padding: 1px 2px;
    }
    
    .modal-content {
        margin: 2% auto;
        padding: var(--space-4);
        width: 95%;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: var(--gray-900);
        --gray-100: var(--gray-800);
        --gray-200: var(--gray-700);
        --gray-300: var(--gray-600);
        --gray-400: var(--gray-500);
        --gray-500: var(--gray-400);
        --gray-600: var(--gray-300);
        --gray-700: var(--gray-200);
        --gray-800: var(--gray-100);
        --gray-900: var(--gray-50);
    }
    
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .calendar-container {
        background: rgba(17, 24, 39, 0.95);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .modal-content {
        background: var(--gray-800);
    }
    
    .close {
        background: var(--gray-700);
        border-color: var(--gray-600);
    }
    
    #event-form input {
        background: var(--gray-700);
        border-color: var(--gray-600);
        color: var(--gray-100);
    }
    
    #event-form input:focus {
        border-color: var(--primary-400);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }
}

/* 减少动画支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .calendar-header::before {
        animation: none;
    }
    
    .weekdays::before {
        animation: none;
    }
    
    .day:hover {
        transform: none;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        color: black;
        padding: 0;
    }
    
    .calendar-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .calendar-header {
        background: #f5f5f5;
        color: black;
    }
    
    .day {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .modal {
        display: none !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --primary-500: #0000ff;
        --primary-600: #0000cc;
        --success-color: #008000;
        --error-color: #ff0000;
        --warning-color: #ff8000;
    }
    
    .day {
        border-width: 2px;
    }
    
    .day.today {
        border-width: 3px;
    }
    
    button {
        border: 2px solid currentColor;
    }
}