* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.data-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-controls button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    min-width: fit-content;
}

#export-data {
    background-color: #27ae60;
}

#export-data:hover {
    background-color: #219a52;
}

#import-data {
    background-color: #9b59b6;
}

#import-data:hover {
    background-color: #8e44ad;
}

.calendar-controls button:hover {
    background-color: #2980b9;
}

#current-month-year {
    font-size: 1.5rem;
    color: #2c3e50;
}

.calendar-wrapper {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

#calendar {
    flex: 1;
    min-width: 600px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-collapse: collapse;
    overflow: hidden;
}

#calendar th,
#calendar td {
    padding: 15px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

#calendar th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
}

#calendar td {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    height: 60px;
    min-width: 60px;
    user-select: none;
    -webkit-user-select: none;
}

#calendar td:active {
    transform: scale(0.95);
}

#calendar td:hover {
    background-color: #ecf0f1;
    transform: scale(1.05);
}

/* 状态颜色 */
.locked {
    background-color: #27ae60;
    color: white;
}

.unlocked {
    background-color: #e74c3c;
    color: white;
}

.locked-ruined {
    background-color: #f39c12;
    color: white;
}

.locked-orgasm {
    background-color: #9b59b6;
    color: white;
}

.unlocked-ruined {
    background-color: #3498db;
    color: white;
}

.unlocked-orgasm {
    background-color: #000;
    color: white;
}

.legend {
    width: 300px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

.legend h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.legend-items {
    margin-bottom: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.color-box {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
}

.statistics,
.monthly-statistics,
.trends {
    margin-top: 20px;
}

.monthly-statistics {
    border-top: 2px solid #ecf0f1;
    padding-top: 20px;
}

.trends {
    border-top: 2px solid #ecf0f1;
    padding-top: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
}

.trend-label {
    font-weight: 500;
    color: #666;
}

.trend-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.stat-value:hover {
    color: #3498db;
}

.trend-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.trend-value:hover {
    color: #e74c3c;
}

/* 添加焦点样式以增强可访问性 */
button:focus,
#calendar td:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #000;
}

#modal-date {
    margin-bottom: 20px;
    color: #2c3e50;
}

.status-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.status-btn {
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    color: white;
}

.status-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.status-btn.clear {
    background-color: #95a5a6;
}

.status-btn.clear:hover {
    background-color: #7f8c8d;
}

/* 加载动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.calendar-wrapper,
.calendar-controls {
    animation: fadeIn 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .calendar-wrapper {
        flex-direction: column;
    }
    
    #calendar {
        min-width: 100%;
    }
    
    .legend {
        width: 100%;
    }
    
    .calendar-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .data-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #calendar td {
        padding: 10px 5px;
        height: 50px;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    #current-month-year {
        font-size: 1.2rem;
    }
    
    #calendar td {
        padding: 8px 3px;
        height: 45px;
        min-width: 45px;
        font-size: 0.9rem;
    }
}

/* 非当月日期的样式 */
.other-month {
    color: #ccc;
    background-color: #f9f9f9;
}

.other-month:hover {
    background-color: #f0f0f0;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #2c3e50;
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
}

/* 响应式页脚 */
@media (max-width: 768px) {
    .footer {
        margin-top: 20px;
        padding: 15px;
        font-size: 0.8rem;
    }
}