* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===============================
   主卡片容器
   =============================== */
#calendar-card {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, #fffdf6 0%, #fff3d6 100%);
    border-radius: 26px;
    border: 2px solid #f2c94c;
    overflow: hidden;
    box-shadow:
        0 6px 0 #e6b800,
        0 12px 24px rgba(255, 193, 7, 0.35),
        0 24px 48px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

/* ===============================
   導覽列按鈕
   =============================== */
.nav-container {
    display: flex;
    justify-content: space-between;
    background: #8b4513;
    padding: 12px 8px;
    gap: 6px;
}

.nav-btn {
    flex: 1;
    min-height: 48px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fffdf6;
    padding: 0 8px;
}

/* 前一日、後一日按鈕 */
.nav-btn:not(.today-btn):not(.calendar-btn) {
    background: #af4c41;
}

/* 今天按鈕 */
.nav-btn.today-btn {
    background: #d32f2f;
    font-size: 1.05rem;
    flex: 1.2;
}

/* 選擇日期按鈕 */
.nav-btn.calendar-btn {
    background: #795548;
    font-size: 1rem;
    flex: 0.9;
}

/* 互動效果 */
.nav-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.nav-btn:active {
    transform: translateY(1px);
}

/* ===============================
   內容主區
   =============================== */
#content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 25px;
    gap: 15px;
}

.row-primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* ===============================
   文字樣式
   =============================== */
.greeting-text {
    font-size: 1.8rem;
    color: #bf360c;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.solar-date {
    font-size: 1.8rem;
    font-weight: 800;
    color: #4e342e;
    text-align: center;
    line-height: 1.3;
}

.solar-date.holiday-red {
    color: #d32f2f;
}

.holiday-badge {
    background: #d32f2f;
    color: #ffffff;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    border: 3px solid #ffffff;
    display: block;
    margin: 10px auto;
    box-shadow: 0 4px 8px rgba(211,47,47,0.4);
}

.lunar-text {
    font-size: 1.5rem;
    color: #795548;
    background: #fbe9e7;
    padding: 8px 20px;
    border-radius: 25px;
    text-align: center;
}

/* ===============================
   事件標籤
   =============================== */
.event-tag {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    max-width: 350px;
}

.upcoming-tag {
    background: #e3f2fd;
    color: #1565c0;
    border: 2px solid #bbdefb;
    margin-top: 10px;
}

/* 霓虹文字效果 */
.highlight-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow:
        0 0 2px #ff0000,
        0 0 4px #ff0000,
        0 0 6px #ff0080,
        0 0 8px #ff0080;
    letter-spacing: 1px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* ===============================
   語錄區塊
   =============================== */
.quote-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #f2c94c;
    font-style: italic;
    color: #5d4037;
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: center;
    width: 100%;
}

.speak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 10px 24px;
    background-color: #ffffff;
    border: 2px solid #f2c94c;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    color: #bf360c;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.speak-btn:hover {
    background-color: #fff3e0;
    transform: scale(1.05);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

.speak-btn:active {
    transform: scale(0.95);
}

.speak-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* ===============================
   頁腳
   =============================== */
#calendar-card > div:last-child {
    text-align: center;
    padding: 15px;
    background: #8b4513;
    color: #fffdf6;
    font-size: 0.9rem;
}

#calendar-card > div:last-child a {
    color: #fffdf6;
    text-decoration: none;
    font-weight: bold;
}

#calendar-card > div:last-child a:hover {
    text-decoration: underline;
}

/* ===============================
   圖片樣式
   =============================== */
img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    vertical-align: middle;
}

/* ===============================
   月曆彈窗
   =============================== */
#date-picker-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 15px;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: #fffdf6;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border: 3px solid #f2c94c;
}

.calendar-header {
    padding: 20px 15px 10px;
    background: #fff3d6;
    border-bottom: 2px solid #f2c94c;
}

.selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.selector-row .nav-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    background: #5d4037;
    border: none;
    border-radius: 8px;
    font-size: 1.4rem;
    color: #fffcf2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.selector-row .nav-btn:hover {
    background: #8b4513;
    transform: scale(1.08);
}

.selector-row .nav-btn:active {
    transform: scale(0.96);
    background: #4a2c1f;
}

.display-text {
    font-weight: bold;
    color: #1a1a1a;
    font-size: 1.2rem;
    min-width: 100px;
    text-align: center;
}

/* 月曆日期網格 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
    padding: 15px;
}

.weekday-label {
    font-size: 0.9rem;
    color: #8b4513;
    padding: 8px 0;
    font-weight: bold;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.calendar-day:hover {
    background: #fff3e0;
}

.calendar-day.today {
    color: #007bff;
    font-weight: bold;
    border: 2px solid #007bff;
}

.calendar-day.selected {
    background: #f2c94c !important;
    color: #5d4037 !important;
    font-weight: bold;
    box-shadow: 0 0 0 3px #fff inset;
    transform: scale(1.1);
}

.calendar-day.disabled {
    color: #aaa;
    cursor: not-allowed;
}

/* 底部關閉按鈕 */
.calendar-footer {
    margin-top: 15px;
    text-align: center;
    border-top: 1px solid #eee;
    padding: 15px;
}

.close-link {
    color: #795548;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid #f2c94c;
    background: #fff;
    transition: all 0.2s ease;
}

.close-link:hover {
    background: #fff3e0;
    transform: scale(1.05);
}

/* ===============================
   響應式設計
   =============================== */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    #calendar-card {
        border-radius: 22px;
    }
    
    .nav-container {
        padding: 10px 6px;
        gap: 4px;
    }
    
    .nav-btn {
        min-height: 44px;
        font-size: 0.9rem;
        padding: 0 4px;
    }
    
    .nav-btn.today-btn {
        font-size: 0.95rem;
    }
    
    .nav-btn.calendar-btn {
        font-size: 1rem;
    }
    
    #content-area {
        padding: 15px 20px;
        gap: 12px;
    }
    
    .greeting-text {
        font-size: 1.6rem;
    }
    
    .solar-date {
        font-size: 1.6rem;
    }
    
    .holiday-badge {
        width: 70px;
        height: 70px;
        line-height: 70px;
        font-size: 1.1rem;
    }
    
    .lunar-text {
        font-size: 1.3rem;
        padding: 6px 16px;
    }
    
    .event-tag {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    .highlight-text {
        font-size: 1.1rem;
    }
    
    .quote-section {
        font-size: 1rem;
    }
    
    .speak-btn {
        padding: 8px 20px;
        font-size: 0.95rem;
    }
    
    img {
        width: 120px;
        height: 120px;
    }
    
    .modal-content {
        max-width: 360px;
    }
    
    .calendar-grid {
        gap: 4px;
        padding: 12px;
    }
    
    .calendar-day {
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .solar-date {
        font-size: 1.4rem;
    }
    
    .lunar-text {
        font-size: 1.2rem;
    }
    
    .greeting-text {
        font-size: 1.4rem;
    }
    
    .nav-btn {
        font-size: 0.85rem;
        min-height: 40px;
    }
}

