/* 万年历 - HTML5 布局与响应式 */

* {
    box-sizing: border-box;
}

.calendar-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* ========== 顶部长方形区域：日历 + 当日信息 ========== */
.top-section {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

/* 手机端：当日信息移到日历下方 */
@media (max-width: 768px) {
    .top-section {
        flex-direction: column;
    }
    .today-info-panel {
        order: 2;
    }
    .calendar-panel {
        order: 1;
    }
}

/* ---------- 日历控件区域 ---------- */
.calendar-panel {
    flex: 1;
    min-width: 0;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.calendar-header .nav-btn {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #495057;
}

.calendar-header .nav-btn:hover {
    background: #e9ecef;
}

.calendar-title {
    font-size: 18px;
    font-weight: bold;
    color: #212529;
    min-width: 100px;
    text-align: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-days .day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    border: 1px solid transparent;
}

.calendar-days .day-cell.other-month {
    color: #adb5bd;
}

.calendar-days .day-cell.today {
    background: #0d6efd;
    color: #fff;
    font-weight: bold;
}

.calendar-days .day-cell.selected {
    border: 2px solid #0d6efd;
    background: #e7f1ff;
    color: #0d6efd;
}

.calendar-days .day-cell.today.selected {
    background: #0d6efd;
    color: #fff;
}

.calendar-days .day-cell:hover {
    background: #e9ecef;
}

.calendar-days .day-cell .festival {
    font-size: 10px;
    color: #dc3545;
    margin-top: 2px;
    line-height: 1.2;
}

.calendar-days .day-cell.today .festival,
.calendar-days .day-cell.selected .festival {
    color: rgba(255,255,255,0.95);
}

/* ---------- 当日信息区域 ---------- */
.today-info-panel {
    flex: 0 0 260px;
    min-width: 200px;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

    .today-info-panel .today-line1 {
        font-size: 14px;
        color: #fff;
        margin: 0 0 0 0;
        text-align: center;
        background-color: #65bf10;
        height: 30px
    }

.today-info-panel .today-line2 {
    font-size: 60px;
    text-align:center;
    font-weight: bold;
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.2;
    background-color:#ffbb00;
}

    .today-info-panel .today-line3 {
        font-size: 14px;
        color: #000;
        margin: 0 0 12px 0;
        text-align: center;
        font-weight: bold;
    }

    .today-info-panel .today-line4 {
        font-size: 14px;
        color: #000;
        margin: 4px 0;
        font-weight: bold;
        text-align: center;
    }

    .today-info-panel .today-line5 {
        font-size: 14px;
        color: #0faad1;
        margin: 4px 0;
    }

    .today-info-panel .today-line6 {
        font-size: 14px;
        color: #65bf10;
        margin: 4px 0;
    }

    .today-info-panel .today-line7 {
        font-size: 14px;
        color: #ff7800;
        margin: 4px 0;
    }

@media (max-width: 768px) {
    .today-info-panel {
        flex: none;
        width: 100%;
    }
}

/* ========== 详细信息区域 ========== */
.detail-section {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.detail-section h2 {
    font-size: 18px;
    margin: 0 0 16px 0;
    color: #212529;
}

/* 桌面：5 行 2 列 */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(5, auto);
    gap: 12px 24px;
}

.detail-item {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.detail-item .name {
    color: #0094ff;
    min-width: 80px;
}

.detail-item .value {
    color: #212529;
}

/* 手机：10 行 1 列 */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(10, auto);
    }
}
