/* static/css/calendar.css */

/* 月历导航栏 */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.calendar-nav h2 {
    font-size: 2em;
    color: var(--color-title);
    margin: 0;
}
.calendar-nav-sub {
    text-align: center;
    margin-bottom: 25px;
}
.nav-button-subtle {
    font-family: var(--font-serif);
    color: var(--color-text);
    text-decoration: none;
    margin: 0 15px;
    font-size: 1em;
    padding: 5px 10px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}
.nav-button-subtle:hover {
    color: var(--color-highlight);
    border-bottom-color: var(--color-highlight);
}


/* 月历容器和表格 */
.calendar-container {
    background-color: rgba(255, 255, 255, 0.6);
    padding: 20px;
    border: 1px solid #e9e3d6;
    border-radius: 4px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th, .calendar-table td {
    text-align: left !important;
    padding: 0;
    vertical-align: top;
}

.calendar-table th {
    text-align: center !important;
    padding-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-primary-text);
}

/* 日期单元格 */
.calendar-day {
    border: 1px solid var(--color-border);
    height: 100px; /* 减少高度，因为内容变少了 */
    transition: all 0.3s ease;
    position: relative;
}
.calendar-day:hover {
    background-color: rgba(232, 226, 214, 0.5);
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 单元格链接，撑满整个单元格 */
.calendar-day a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--color-text);
    padding: 6px 8px;
    box-sizing: border-box;
    text-align: left !important;
}


/* 特殊样式 */
.calendar-day.empty {
    background-color: transparent;
    border: none;
}
.weekend .solar-day, .weekend th {
    color: var(--color-ji);
}

/* 当天高亮 */
.calendar-day.today {
    border: 2px solid var(--color-highlight);
    background-color: rgba(201, 55, 86, 0.1);
}
.today .solar-day {
    color: var(--color-highlight);
}

/* 图例 */
.calendar-legend {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}
.calendar-legend span {
    margin: 0 15px;
    display: inline-flex;
    align-items: center;
}
.legend-box {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border-radius: 2px;
    display: inline-block;
}
.today-bg {
    background-color: rgba(201, 55, 86, 0.3);
    border: 1px solid var(--color-highlight);
}
.special-bg {
    background-color: rgba(46, 139, 87, 0.3);
    border: 1px solid var(--color-yi);
}


/* -- 严格左上角对齐布局样式 (简洁版) -- */

/* 单元格内所有内容的容器 */
.cell-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px; /* 减小间距 */
    text-align: left !important;
}

/* 确保所有子元素都严格左对齐 */
.cell-content-wrapper > div {
    text-align: left !important;
    width: 100%;
}


/* 公历日 */
.solar-day {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 3px;
}

/* 农历/节日信息 */
.lunar-info {
    font-size: 13px;
    color: #555;
    line-height: 1.3;
    font-weight: 600;
}
.has-special .lunar-info.special-text {
    color: var(--color-yi);
}
.calendar-day.has-special {
    background-color: rgba(46, 139, 87, 0.1);
}

/* 干支日样式 */
.ganzhi-day-info {
    font-size: 13px;
    color: var(--color-title);
    font-weight: 600;
    line-height: 1.3;
    opacity: 0.9;
}

/* 十二天神信息 */
.tianshen-info {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0.9;
    margin-top: 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .calendar-day {
        height: auto;
        min-height: 95px;
    }
    .calendar-day a {
        padding: 4px 5px;
    }
    .solar-day {
        font-size: 1.2em;
        margin-bottom: 2px;
    }
    .lunar-info,
    .ganzhi-day-info,
    .tianshen-info {
        font-size: 10px;
        line-height: 1.3;
        word-break: break-all;
    }
    .calendar-table th {
        font-size: 0.9em;
    }
}
