.calendar-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    margin: 20px auto;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    min-height: 400px;
  
}

/* Left Side: Calendar Grid */
.calendar-main {
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.calendar-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-nav {
    background: #f0f2f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-nav:hover {
    background: #e4e6e9;
    color: var(--primary-color);
}

.btn-today {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    width: auto;
}

.current-month {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.weekday {
    padding: 10px 0;
}

.weekday.weekend {
    color: #ff6b6b;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day-cell {
    height: 60px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.day-cell:hover {
    background-color: #f0f7ff;
    border-color: #cce5ff;
}

.day-cell.other-month {
    opacity: 0.3;
}

.day-cell.today {
    background-color: #e6f3ff;
    border: 1px solid var(--primary-color);
}

.day-cell.selected {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}

.day-cell.selected .lunar-text,
.day-cell.selected .holiday-text {
    color: rgba(255,255,255,0.9);
}

.solar-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.2;
}

.lunar-text {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.2;
}

.holiday-text {
    font-size: 0.6rem;
    color: #ff6b6b;
    position: absolute;
    top: 1px;
    right: 2px;
}

.work-tag, .rest-tag {
    position: absolute;
    top: 1px;
    left: 1px;
    font-size: 0.6rem;
    padding: 0 2px;
    border-radius: 2px;
    line-height: 1.2;
}

.work-tag {
    background-color: #f5f5f5;
    color: #666;
}

.rest-tag {
    background-color: #ffeff0;
    color: #ff6b6b;
}

/* Right Side: Details */
.calendar-sidebar {
    background: #fcfcfc;
    border-left: 1px solid #eee;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.date-display {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.display-year-month {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 5px;
}

.display-day {
    font-size: 4.5rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
    margin: 10px 0;
}

.display-week {
    font-size: 1.2rem;
    color: #333;
}

.lunar-details {
    flex: 1;
}

.lunar-main {
    text-align: center;
    margin-bottom: 25px;
}

.lunar-date-str {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.ganzhi-str {
    font-size: 1rem;
    color: #666;
}

.almanac-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.almanac-row {
    display: flex;
    gap: 15px;
}

.almanac-label {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.label-yi {
    background-color: #e3f9e5;
    color: #28a745;
    border: 1px solid #c3e6cb;
}

.label-ji {
    background-color: #ffeef0;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}

.almanac-content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    padding-top: 8px;
    color: #333;
}

@media (max-width: 768px) {
    .calendar-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .calendar-sidebar {
        border-left: none;
        border-top: 1px solid #eee;
        padding: 20px;
    }

    .date-display {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .display-day {
        font-size: 3rem;
        margin: 0;
    }
    
    .day-cell {
        height: 50px; /* Fixed height for mobile */
        aspect-ratio: auto;
    }
}
