:root {
    --text-main: #2c2c2e; 
    --text-muted: #8e8e93;
    --ios-blue: #007aff;
    --ios-green: #34c759;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

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

body {
    background-color: #f2f2f7;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* --- 動態漸層背景 --- */
.bg-mesh {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #fdfcfb;
}
.blob {
    position: absolute;
    filter: blur(90px);
    opacity: 0.7;
    animation: float 12s infinite alternate ease-in-out;
}
.blob-1 { width: 50vw; height: 50vw; background: #e0c3fc; top: -10%; left: -10%; }
.blob-2 { width: 60vw; height: 60vw; background: #d4fc79; bottom: -20%; right: -10%; animation-delay: -3s; }
.blob-3 { width: 40vw; height: 40vw; background: #96e6a1; top: 40%; left: 30%; animation-delay: -6s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 550px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* --- 毛玻璃共用樣式 --- */
.glass-panel, .glass-card, .glass-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* --- 音樂開關 (移至底部右側) --- */
.music-toggle {
    position: fixed;
    bottom: 25px; /* 改為底部 */
    right: 25px;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-family: "LXGWMarkerGothic", sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
    z-index: 100;
    transition: transform 0.2s;
}
.music-toggle:active { transform: scale(0.95); }
.music-playing { color: var(--ios-blue); }

/* --- 字體應用 --- */
.date-header, .ios-btn, .glass-btn, .toast-island, .card-footer {
    font-family: "LXGWMarkerGothic", sans-serif;
}
.quote-tw, .main-title {
    font-family: "ChenYuLuoYan", serif;
}
.quote-explain {
    font-family: "FancyFreeFont1", sans-serif;
}

/* --- 頂部日期 --- */
.date-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px 30px;
    border-radius: 20px;
}
.solar {
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: #1c1c1e; 
}
.lunar {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 2px;
}

/* --- 首頁與卡片容器 --- */
.card-area { width: 100%; }
.glass-card {
    border-radius: 30px;
    padding: 40px 30px;
    width: 100%;
    animation: popup 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hidden { display: none !important; }

/* --- 首頁細節 (新標題) --- */
.draw-screen { text-align: center; padding: 60px 30px; }
.main-title {
    font-size: 3.5rem;
    color: #2c2c2e;
    margin-bottom: 40px;
    line-height: 1.4;
    text-shadow: 0px 2px 4px rgba(0,0,0,0.1);
}
.sub-title {
    font-size: 1.8rem;
    color: #555;
}

/* iOS 圓潤大按鈕 */
.ios-btn {
    background-color: var(--text-main);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 2px;
    width: 80%;
}
.ios-btn:hover { background-color: #1c1c1e; transform: scale(1.02); }
.ios-btn:active { transform: scale(0.98); }

/* --- 語錄內容 --- */
.card-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
}

/* 中文語錄 */
.quote-tw {
    font-weight: normal;
    font-size: 2.2rem;
    line-height: 1.6;
    text-align: justify;
    color: #1c1c1e;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 25px 20px;
    border-radius: 16px;
    border-left: 6px solid var(--ios-green); 
}

.quote-en {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-style: italic;
    text-align: justify;
    padding: 0 10px;
}

.quote-explain {
    font-size: 1.25rem;
    line-height: 1.9;
    color: #3a3a3c;
    text-align: justify;
    padding: 0 10px;
}

.divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    width: 80%;
    margin: 0 auto;
}

/* --- 返回首頁按鈕 --- */
.back-home-btn {
    margin-top: 35px;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-main);
}
.back-home-btn:hover { background: rgba(255, 255, 255, 0.7); }

/* --- 牌卡底部：版權與重置 --- */
.card-footer {
    margin-top: 30px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}
.reset-trigger {
    cursor: pointer;
    color: #ff3b30;
    opacity: 0.3; /* 平常很低調 */
    transition: opacity 0.3s ease;
    padding: 0 5px;
}
.reset-trigger:hover {
    opacity: 1; /* 滑鼠移過去才會明顯 */
}

/* --- iOS 動態島提示框 --- */
.toast-island {
    position: fixed;
    top: 30px; 
    background-color: #1c1c1e;
    color: white;
    padding: 12px 25px;
    border-radius: 40px;
    font-size: 1rem;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.toast-island.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes popup {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}