body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}
.calendar {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    box-sizing: border-box;
    position: relative;
}
.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.weekday {
    text-align: center;
    font-weight: bold;
    color: #666;
    padding: 5px;
}
.day {
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 65px;
}
.day:hover {
    background-color: #f0f0f0;
}
.day-number {
    font-size: 16px;
    margin-bottom: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.today .day-number {
    background-color: #4285f4;
    color: white;
    font-weight: bold;
}
.day-label {
    font-size: 11px;
    margin-top: 2px;
    color: #666;
    padding: 2px 4px;
    border-radius: 10px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.label-happy {
    background-color: #FFD700;
    color: #333;
}
.label-rest {
    background-color: #98FB98;
    color: #333;
}
.label-play {
    background-color: #FF69B4;
    color: white;
}
.label-confused {
    background-color: #87CEFA;
    color: #333;
}
.label-task {
    background-color: #FF6347;
    color: white;
}
.other-month {
    color: #ccc;
}
.other-month .day-label {
    display: none;
}
.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    max-width: 500px;
}
.title {
    color: #333;
    margin: 0;
    text-align: center;
}
.lucky-number {
    background-color: #4285f4;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
    z-index: 10;
    margin-top: 15px;
    display: inline-block;
}
/* 添加或修改以下CSS样式 */

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* 垂直居中对齐 */
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
    gap: 10px;
}

.difficulty-selector {
    display: flex;
    align-items: center; /* 垂直居中对齐 */
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lucky-number {
    background-color: #4285f4;
    color: white;
    padding: 5px 8px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中对齐 */
    justify-content: center; /* 水平居中对齐 */
    white-space: nowrap;
    flex-shrink: 0;
    height: 34px; /* 与其他组件保持一致的高度 */
    margin: 0; /* 移除上边距 */
}

.lucky-number.hidden {
    display: none;
}

.month-toggle-buttons {
    display: flex;
    align-items: center; /* 垂直居中对齐 */
    gap: 5px;
    flex-shrink: 0;
    height: 34px; /* 设置固定高度 */
}

.month-toggle-button {
    padding: 5px 10px;
    border-radius: 20px;
    background-color: #e9e9e9;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    outline: none;
    white-space: nowrap;
    height: 34px; /* 设置固定高度 */
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中对齐 */
    justify-content: center; /* 水平居中对齐 */
}

/* 确保select元素也有相同的高度 */
#difficulty {
    height: 34px;
    display: flex;
    align-items: center;
}

/* 响应式调整 */
@media screen and (max-width: 600px) {
    .controls-container {
        flex-wrap: nowrap;
    }
    
    .difficulty-selector select {
        padding: 5px 8px;
        font-size: 14px;
    }
    
    .lucky-number {
        font-size: 12px;
        padding: 4px 6px;
    }
    
    .month-toggle-button {
        padding: 4px 8px;
        font-size: 14px;
    }
}
.month-toggle-button.active {
    background-color: #4285f4;
    color: white;
}
.hidden {
    display: none;
}
.lucky-number-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin-top: 10px;
}

/* 响应式样式 */
@media screen and (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .title-container {
        margin-bottom: 15px;
    }
    
    .controls-container {
        flex-wrap: nowrap; /* 确保不换行 */
    }
    
    .difficulty-selector select {
        padding: 5px 8px;
        font-size: 14px;
    }
    
    .lucky-number {
        font-size: 12px;
        padding: 4px 6px;
    }
    
    .month-toggle-button {
        padding: 4px 8px;
        font-size: 14px;
    }
    
    .difficulty-selector {
        flex: 0 1 auto;
        min-width: auto;
        font-size: 14px;
    }
    
    .difficulty-selector select {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .difficulty-selector label {
        font-size: 14px;
    }
    
    .month-toggle-buttons {
        flex: 0 1 auto;
    }
    
    .month-toggle-button {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .day {
        min-height: 50px;
    }
    
    .day-label {
        font-size: 10px;
    }
    
    .weekday {
        font-size: 14px;
    }
    
    .calendar {
        padding: 15px;
    }
    
    .calendar-header h2 {
        font-size: 1.2rem;
    }
}

@media screen and (max-width: 450px) {
    .controls-container {
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    .difficulty-selector {
        flex: 0 1 auto;
        font-size: 12px;
    }
    
    .difficulty-selector select {
        padding: 4px 6px;
        font-size: 12px;
    }
    
    .difficulty-selector label {
        font-size: 12px;
    }
    
    .month-toggle-buttons {
        flex: 0 1 auto;
    }
    
    .month-toggle-button {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .title {
        font-size: 1.3rem;
    }
    
    .day {
        min-height: 40px;
        padding: 2px;
    }
    
    .day-number {
        font-size: 14px;
        width: 20px;
        height: 20px;
    }
    
    .day-label {
        font-size: 9px;
        padding: 1px 3px;
    }
}

/* 日历导出 ICS 文件功能实现

我可以帮你在现有的日历应用中添加导出 ICS 文件的功能。ICS 是日历数据的标准格式，可以被大多数日历应用程序（如 Google 日历、Outlook 等）导入。

下面是实现方案：

## 1. 首先，在 CSS 文件中添加导出按钮的样式
```css
/* 魔法期样式 */
.magic-period-container {
    margin: 12px 0;
    padding: 12px;
    background: linear-gradient(135deg, #f8e1ff, #e1f5fe);
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    border: 1px solid #d9a6ff;
}

/* 添加导出按钮样式 */
.export-button {
    background: linear-gradient(to right, #4285f4, #34a853);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    font-size: 14px;
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.export-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.export-button svg {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* 响应式调整 */
@media screen and (max-width: 600px) {
    .export-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .export-button svg {
        width: 14px;
        height: 14px;
    }
}

.magic-period-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.magic-period-inputs label {
    font-weight: bold;
    color: #8a2be2;
    font-size: 0.95em;
    margin-right: 2px;
}

.magic-period-inputs input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #d0b3ff;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.magic-period-inputs input[type="number"]:focus {
    border-color: #8a2be2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.25);
}

.magic-button {
    background: linear-gradient(to right, #9c27b0, #673ab7);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    margin-left: 4px;
}

.magic-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.magic-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 魔法期内的日期样式 */
.magic-period-day {
    background: linear-gradient(135deg, #fcf0ff, #f0f8ff);
    border: 1px dashed #d9a6ff !important;
    box-shadow: 0 0 8px rgba(138, 43, 226, 0.15);
    transform: scale(1.02);
    position: relative;
    z-index: 1;
}

.magic-period-day::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="1" fill="%23d9a6ff" opacity="0.3"/></svg>');
    opacity: 0.3;
    z-index: -1;
}

.magic-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    color: #9c27b0;
    text-shadow: 0 0 5px rgba(255,255,255,0.8);
    animation: sparkle 2s infinite alternate;
}

@keyframes sparkle {
    0% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.9) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1) rotate(15deg);
    }
}

/* 被魔法替换的标签样式 - 移除脉动效果和渐变背景 */
.magic-replaced {
    border: 1px solid #d9a6ff;
    background-color: #fcf0ff !important;
}

/* 魔法期标题样式 */
.magic-period-container h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    color: #8a2be2;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* 移动端适配 */
@media (max-width: 600px) {
    .magic-period-container {
        padding: 8px;
    }
    
    .magic-period-inputs {
        gap: 6px;
    }
    
    .magic-period-inputs label {
        font-size: 0.9em;
    }
    
    .magic-period-inputs input[type="number"] {
        width: 50px;
        padding: 4px 6px;
    }
    
    .magic-button {
        padding: 5px 10px;
        font-size: 0.9em;
    }
    
    .magic-period-container h3 {
        font-size: 1em;
        margin-bottom: 8px;
    }
}
