/* ===== style.css — 主日历样式 ===== */
* { box-sizing: border-box; font-family: system-ui, sans-serif; margin: 0; padding: 0; }
body {
    background: #f5efe6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    gap: 20px;
}
.app {
    max-width: 680px;
    width: 100%;
    background: #ffffff;
    backdrop-filter: blur(2px);
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    padding: 18px 14px 24px;
    transition: all 0.1s;
}
.header { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 12px 4px; border-bottom: 2px solid #dacbb8; flex-wrap: wrap; gap: 6px; }
.title { font-size: 1.8rem; font-weight: 600; color: #4a3728; letter-spacing: 1px; }
.sub { font-size: 0.85rem; color: #7a6556; background: #ede3d8; padding: 4px 14px; border-radius: 40px; white-space: nowrap; }

.year-nav { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 8px 0; gap: 8px; flex-wrap: wrap; }
.nav-btn { background: #e8dccc; border: none; width: 44px; height: 44px; border-radius: 30px; font-size: 1.6rem; color: #4f3b2b; cursor: pointer; transition: 0.12s; display: flex; justify-content: center; align-items: center; font-weight: 300; box-shadow: 0 2px 6px rgba(0,0,0,0.02); flex-shrink: 0; }
.nav-btn:active { background: #d2c0ad; transform: scale(0.92); }
.year-input-area { display: flex; align-items: center; gap: 6px; background: #f5ede4; padding: 2px 8px 2px 14px; border-radius: 60px; flex-wrap: wrap; }
.year-input-area input { width: 72px; border: none; background: transparent; font-size: 1.2rem; font-weight: 600; color: #3b2c1f; padding: 6px 0; outline: none; text-align: center; }
.year-input-area input:focus { border-bottom: 2px solid #b28d70; }
.year-input-area button { background: #dacbb8; border: none; border-radius: 40px; padding: 6px 14px; font-weight: 500; color: #2f231b; cursor: pointer; font-size: 0.85rem; transition: 0.1s; }
.year-input-area button:active { background: #bfaa95; transform: scale(0.94); }

.month-nav { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 10px 0; gap: 6px; flex-wrap: wrap; }
.month-nav-center { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.month-label { font-size: 1.3rem; font-weight: 600; color: #3b2c1f; background: #efe7dd; padding: 6px 18px; border-radius: 60px; min-width: 120px; text-align: center; }
.today-btn { background: #b28d70; border: none; border-radius: 40px; padding: 6px 16px; font-weight: 500; color: #fff; cursor: pointer; font-size: 0.9rem; transition: 0.12s; }
.today-btn:active { background: #8f6f56; transform: scale(0.92); }

.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 500; color: #7d6653; font-size: 0.8rem; margin: 10px 0 6px 0; background: #f5ede4; padding: 6px 0; border-radius: 30px; }

.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #fcf8f3; padding: 6px 4px; border-radius: 28px; }
.day-card {
    background: #fffbf7; border-radius: 16px; padding: 6px 2px 4px; text-align: center; cursor: pointer;
    border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 68px; overflow: hidden; transition: 0.08s ease;
}
.day-card:active { background: #ecdfd1; transform: scale(0.95); }
.day-card.selected { border-color: #b28d70; background: #f3e9df; box-shadow: 0 0 0 2px #dacbb8; }
.day-card.empty { background: transparent; border: 2px solid transparent; cursor: default; pointer-events: none; }
.day-card .tian-date { font-size: 0.8rem; font-weight: 500; color: #4f3a28; background: #f3e9df; padding: 1px 8px; border-radius: 30px; display: inline-block; margin-bottom: 2px; white-space: nowrap; }
.day-card .huang-date { font-size: 1.05rem; font-weight: 550; color: #5a3f2b; background: #f4ede6; padding: 1px 8px; border-radius: 30px; white-space: nowrap; }

.selected-popup {
    margin-top: 16px; background: #e2d4c6; border-radius: 40px; padding: 12px 14px; color: #2d2018;
    font-weight: 500; text-align: center; font-size: 0.95rem; border: 1px solid #d4c0ae;
    box-shadow: inset 0 2px 6px rgba(255,255,255,0.5); min-height: 80px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.selected-popup .line { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; align-items: center; }
.selected-popup .line span { background: #f7eee6; padding: 2px 16px; border-radius: 40px; white-space: nowrap; }
.selected-popup .jiazhi { background: #dacbb8; color: #2f231b; padding: 2px 16px; border-radius: 40px; font-size: 0.9rem; }
.selected-popup .climate { background: #d4c0ae; color: #1f1610; padding: 2px 16px; border-radius: 40px; font-size: 0.9rem; display: inline-block; }
.selected-popup .climate-sub { font-size: 0.85rem; background: #e8dccc; padding: 2px 14px; border-radius: 40px; color: #2d1f16; }

.legend { display: flex; justify-content: center; gap: 24px; margin-top: 12px; font-size: 0.7rem; color: #6a5a4b; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 12px; }
.dot.tian { background: #bfa58b; }
.dot.huang { background: #b28d70; }

/* ===== 响应式精细调校 ===== */
@media (max-width: 560px) {
    .app { padding: 14px 8px 18px; border-radius: 32px; }
    .title { font-size: 1.5rem; }
    .sub { font-size: 0.75rem; padding: 3px 10px; }
    .day-card { min-height: 58px; padding: 4px 1px; }
    .day-card .tian-date { font-size: 0.7rem; padding: 0 6px; }
    .day-card .huang-date { font-size: 0.9rem; padding: 0 6px; }
    .month-label { font-size: 1.1rem; padding: 4px 14px; min-width: 90px; }
    .year-input-area input { width: 56px; font-size: 1rem; }
    .selected-popup .line { flex-direction: column; gap: 4px; }
    .selected-popup .line span { white-space: normal; }
    .month-nav-center { gap: 4px; }
    .today-btn { padding: 4px 12px; font-size: 0.8rem; }
    .nav-btn { width: 38px; height: 38px; font-size: 1.4rem; }
}
@media (max-width: 400px) {
    .day-card { min-height: 50px; }
    .day-card .tian-date { font-size: 0.6rem; }
    .day-card .huang-date { font-size: 0.8rem; }
    .weekdays { font-size: 0.65rem; padding: 4px 0; }
    .year-input-area input { width: 48px; font-size: 0.9rem; }
    .month-label { font-size: 0.95rem; min-width: 70px; padding: 4px 8px; }
}