/* ── 日历导航 ── */
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eef2ff;
}

.nav-selects {
    display: flex;
    gap: 0.5rem;
}

.nav-select {
    padding: 0.5rem 0.8rem;
    min-width: 90px;
}

.nav-today {
    margin-left: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ── 当月信息 ── */
.month-info {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fb;
    border-radius: 6px;
}

/* ── 日历网格 ── */
.calendar-grid {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f5f7fa;
    border-bottom: 1px solid #e0e0e0;
}

.cal-head {
    padding: 0.6rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.cal-head.cal-sun { color: #dc2626; }
.cal-head.cal-sat { color: #2563eb; }

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
    padding: 0.5rem 0.3rem;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    cursor: pointer;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.cal-cell:nth-child(7n) {
    border-right: none;
}

.cal-cell:hover {
    background: #f0f4ff;
}

.cal-cell.empty {
    cursor: default;
    background: transparent;
}

.cal-cell.today {
    background: #eef2ff;
    position: relative;
}

.cal-cell.today::after {
    content: '今';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    color: white;
    background: #2563eb;
    border-radius: 3px;
    padding: 0 3px;
    line-height: 1.4;
}

.cal-cell.selected {
    background: #2563eb;
}

.cal-cell.selected .cal-solar,
.cal-cell.selected .cal-lunar {
    color: white;
}

.cal-solar {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.cal-cell:nth-child(7n+1) .cal-solar { color: #dc2626; }
.cal-cell:nth-child(7n) .cal-solar { color: #2563eb; }
.cal-cell.selected .cal-solar { color: white; }

.cal-lunar {
    font-size: 0.7rem;
    color: #999;
    line-height: 1.3;
    margin-top: 2px;
}

.cal-lunar.jieqi {
    color: #059669;
    font-weight: 500;
}

.cal-cell.selected .cal-lunar.jieqi { color: #bbf7d0; }

.cal-cell.other-month .cal-solar { color: #ccc; }
.cal-cell.other-month .cal-lunar { color: #ddd; }

/* ── 日期详情 ── */
.day-detail {
    margin-top: 1.2rem;
    padding: 1rem 1.2rem;
    background: #f8f9fb;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.85rem;
    color: #888;
}

.detail-value {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

/* ── 节气网格 ── */
.jieqi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.jieqi-group {
    background: white;
    border: 1px solid #e8eaf0;
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
}

.jieqi-season {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.8rem;
}

.jieqi-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.jieqi-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: #f0f4ff;
    color: #2563eb;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Mobile ── */
@media (max-width: 900px) {
    .jieqi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .calendar-nav {
        flex-wrap: wrap;
    }

    .nav-selects {
        flex: 1;
    }

    .nav-today {
        margin-left: 0;
    }

    .cal-cell {
        min-height: 48px;
        padding: 0.3rem 0.2rem;
    }

    .cal-solar {
        font-size: 0.85rem;
    }

    .cal-lunar {
        font-size: 0.6rem;
    }

    .jieqi-grid { grid-template-columns: 1fr 1fr; }
}
