        /* 整合所有 CSS 樣式 */
        :root {
            --calendar-blue: #005bac;
            --calendar-red: #d32f2f;
            --calendar-border: #e0e0e0;
            --gold-text: #b07d3a;
            --blue-primary: #1a73e8;
            --blue-dark: #0d47a1;
            --red-primary: #d93025;
            --red-light: #ffebee;
            --red-text: #c62828;
            --holiday-bg: #fff5f5;
            --holiday-border: #fecaca;
            --text-dark: #1e293b;
            --text-light: #64748b;
            --card-bg: rgba(255, 255, 255, 0.95);
            --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
            --safe-padding: 16px;
        }

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

        body {
            font-family: "Microsoft JhengHei", "Heiti TC", "Noto Sans TC", sans-serif;
            background: #f4f4f4;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
            padding: var(--safe-padding);
            color: var(--text-dark);
        }

        .wrapper {
            width: 100%;
            max-width: 1000px;
            margin: 0 auto;
        }

        .separator {
            width: 100%;
            height: 1px;
            background: linear-gradient(to right, transparent, #ccc, transparent);
            margin: 40px 0;
        }
      /* --- 時鐘樣式 --- */
 .clock-container {
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            padding: 1px 1px;
            background: rgba(20, 20, 35, 0.75);
            border-radius: 1px;
            backdrop-filter: blur(2px);
            border: 1px solid rgba(100, 100, 255, 0.12);
            box-shadow: 
                0 1px 3px rgba(0,0,0,0.6),
                inset 0 0 2px rgba(80, 80, 255, 0.08);
        }

        #timeDisplay {
            font-family: 'Courier New', Courier, monospace;
            font-size: 2rem;
            font-weight: bold;
            letter-spacing: 4px;
            color: #e0e0ff;
            text-shadow: 
                0 0 10px #a0a0ff,
                0 0 25px #8080ff,
                0 0 40px #6060cc;
            display: flex;
            align-items: center;
            gap: 2px;
        }

        .colon {
            color: #a0a0ff;
            animation: blink 1.2s infinite step-end;
            width: 10px;
            text-align: center;
        }

        .digit-group {
            display: inline-flex;
            position: relative;
        }

        .second {
            color: #ff80ab;
            text-shadow: 
                0 0 2px #ff80ab,
                0 0 4px #ff4081;
        }

        /* 秒數跳動感 */
        .second span {
            display: inline-block;
            transition: all 0.18s ease-out;
        }

        .second span.jump {
            transform: scale(1.18);
            opacity: 0.85;
        }

        @keyframes blink {
            50% { opacity: 0.3; }
        }

        /* 響應式調整 */
        @media (max-width: 600px) {
            #timeDisplay {
                font-size: 2rem;
                letter-spacing: 3px;
            }
            .clock-container {
                padding: 16px 28px;
            }
        }

        /* 支援系統亮色模式 */
        @media (prefers-color-scheme: light) {
              .clock-container {
                background: rgba(255, 255, 255, 0.75);
                border: 1px solid rgba(100, 100, 255, 0.18);
                box-shadow: 
                    0 10px 30px rgba(0,0,0,0.15),
                    inset 0 0 20px rgba(100,100,255,0.05);
            }
            #timeDisplay {
                color: #2a2a5f;
                text-shadow: 
                    0 0 8px #c0c0ff,
                    0 0 16px #a0a0ff;
            }
            .colon {
                color: #6060cc;
            }
            .second {
                color: #d81b60;
                text-shadow: 0 0 10px #ff80ab;
            }
        }
        /* --- 日曆部分樣式 --- */
        #calendar-card {
            width: 100%;
            max-width: 400px;
            background: white;
            border: 1px solid var(--calendar-border);
            position: relative;
            padding-bottom: 16px;
            border-radius: 2px;
            box-shadow: 
                0 4px 10px #3c2a20aa,
                0 12px 40px #4a2f1fee,
                0 6px 20px #5a3a2acc,
                inset 0 -4px 10px rgba(60, 42, 32, 0.18);
            overflow: hidden;
            margin: 0 auto 30px;
        }

        #calendar-card::before {
            content: "";
            position: absolute;
            inset: 10px -14px -24px 10px;
            background: #fbfaf8;
            border: 1px solid var(--calendar-border);
            border-top-color: #e8e3dd;
            border-left-color: #f0e9e2;
            z-index: -1;
            border-radius: 5px;
            box-shadow: 
                0 20px 60px #3c2a20cc,
                10px 0 30px #4a2f1f99,
                -4px 0 24px #3c2a2044;
            transform: rotate(2.2deg) skewX(-2.8deg) translateY(5px);
        }

        #calendar-card::after {
            content: "";
            position: absolute;
            inset: 20px -24px -36px 20px;
            background: #f4f1ed;
            border: 1px solid var(--calendar-border);
            border-top-color: #dad2c8;
            border-left-color: #e4dcd2;
            z-index: -2;
            border-radius: 5px;
            box-shadow: 
                0 28px 90px #35251acc,
                14px 0 50px #442c1fee,
                -8px 0 40px #3c2a2088;
            transform: rotate(4.5deg) skewX(-4.2deg) translateY(10px);
        }

        .calendar-top {
            height: 45px;
            background: linear-gradient(to bottom, #d32f2f, #b71c1c);
            position: relative;
            z-index: 10;
            border-radius: 4px 4px 0 0;
            box-shadow: inset 0 -2px 5px rgba(0,0,0,0.2);
        }

        .calendar-top::before, .calendar-top::after {
            content: '';
            position: absolute;
            top: 10px;
            width: 12px;
            height: 12px;
            background: #444;
            border-radius: 50%;
            box-shadow: inset 0 2px 2px rgba(0,0,0,0.5);
        }
        .calendar-top::before { left: 20%; }
        .calendar-top::after { right: 20%; }

        .calendar-main {
            padding: 20px;
            display: grid;
            grid-template-columns: 1fr 2fr 1fr;
            text-align: center;
            align-items: start;
        }

        .side-left {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            color: var(--calendar-blue);
            font-weight: bold;
        }
        .roc-year { font-size: 1.1rem; margin-bottom: 10px; white-space: nowrap; }
        .lunar-vertical {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin-top: 5px;
            padding-left: 5px;
        }

        .date-center {
            font-size: 10rem;
            font-weight: 900;
            color: var(--calendar-blue);
            line-height: 0.9;
        }
        .date-center.holiday { color: var(--calendar-red); }

        .side-right {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }
        .west-year-box {
            border: 2px solid var(--calendar-blue);
            border-radius: 4px;
            padding: 3px 6px;
            text-align: center;
            margin-bottom: 15px;
        }
        .west-year { font-size: 0.9rem; color: var(--calendar-blue); border-bottom: 1px solid var(--calendar-blue); }
        .west-month { font-size: 1.6rem; font-weight: 900; color: var(--calendar-blue); }
        .west-month-en { font-size: 0.8rem; color: var(--calendar-blue); font-weight: bold; }

        .select-btn {
            background: #fff;
            border: 1px solid var(--gold-text);
            color: var(--gold-text);
            padding: 5px 10px;
            font-size: 0.9rem;
            cursor: pointer;
            border-radius: 4px;
            font-weight: bold;
        }

        .nav-section {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px;
            margin-bottom: 15px;
        }
        .nav-arrow {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            color: var(--calendar-blue);
            font-size: 0.85rem;
            font-weight: bold;
            background: none; border: none;
            flex: 1;
        }

        .weekday-banner {
            background: var(--calendar-blue);
            color: white;
            padding: 8px 30px;
            font-size: 2.2rem;
            font-weight: bold;
            border-radius: 5px;
            min-width: 160px;
            text-align: center;
            flex: 2.5;
            cursor: pointer;
        }
        .weekday-banner.holiday { background: var(--calendar-red); }

        .info-box {
            margin: 0 15px;
            border: 2px solid var(--calendar-red);
            border-radius: 10px;
            padding: 15px;
            background: #fffdf6;
            text-align: center;
        }
        .lunar-detail {
            color: #8b4513;
            font-size: 1.1rem;
            background: #ffebf0;
            display: inline-block;
            padding: 3px 15px;
            border-radius: 20px;
            margin-bottom: 10px;
            font-weight: bold;
        }
        .event-tag {
            display: block;
            background: #e3f2fd;
            color: #1976d2;
            padding: 6px;
            border-radius: 5px;
            font-size: 0.95rem;
            margin-bottom: 8px;
            font-weight: bold;
        }
        .vacation-tag { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
        .greeting-tag { background: #f3e5f5; color: #7b1fa2; border: 1px solid #e1bee7; }
        .upcoming-tag { background: #e8f5e8; color: #2e7d32; border: 1px solid #c8e6c9; }

        .quote-area {
            font-size: 0.95rem;
            line-height: 1.6;
            color: #444;
            border-top: 1px dashed #ccc;
            padding-top: 10px;
            font-style: italic;
        }
        .speak-btn {
            margin-top: 8px;
            padding: 6px 16px;
            border-radius: 20px;
            border: 1px solid #ddd;
            background: white;
            cursor: pointer;
            font-weight: bold;
            color: #666;
            font-style: normal;
        }

        .lunar-vertical img {
            width: 80px;
            height: auto;
            margin: 2px 0;
        }

        /* Modal 彈窗 */
        #date-picker-modal {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center;
        }
        .modal-content { 
            background: white; padding: 20px; border-radius: 15px; width: 90%; max-width: 340px; 
        }
        .modal-header-row {
            display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
            background: #f0f0f0; padding: 5px 10px; border-radius: 8px;
        }
        .modal-header-row button {
            background: var(--calendar-blue); color: white; border: none; 
            width: 35px; height: 35px; border-radius: 4px; cursor: pointer; font-size: 1.2rem;
        }
        .modal-header-row span { font-weight: bold; font-size: 1.1rem; min-width: 100px; text-align: center; }

        .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; margin-top: 10px; }
        .weekday-head { font-weight: bold; color: #999; font-size: 0.8rem; padding-bottom: 5px; }
        .calendar-day { padding: 8px 0; cursor: pointer; border-radius: 5px; font-size: 0.95rem; }
        .calendar-day.selected { background: var(--calendar-blue); color: white; font-weight: bold; }
        .calendar-day.today { border: 1px solid var(--calendar-blue); color: var(--calendar-blue); }

        .footer-link { text-align: center; font-size: 0.8rem; margin-top: 15px; }
        .footer-link a { color: #aaa; text-decoration: none; }

        /* --- 天氣部分樣式 --- */
        .tabs-container {
            background: white;
            border-radius: 20px;
            padding: 10px;
            margin-bottom: 20px;
            box-shadow: var(--shadow-sm);
            display: flex;
        }

        .tab {
            flex: 1;
            padding: 14px 10px;
            text-align: center;
            font-weight: 700;
            font-size: 0.95rem;
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            color: var(--text-light);
            background: transparent;
            border: none;
            outline: none;
            position: relative;
            overflow: hidden;
        }

        .tab.active {
            background: var(--blue-primary);
            color: white;
            box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
        }

        .tab.active::after {
            content: '';
            position: absolute;
            top: 4px;
            right: 8px;
            font-size: 0.6rem;
            font-weight: 400;
            opacity: 0.9;
        }

        .tab:not(.active):hover {
            background: #f1f5f9;
            color: var(--blue-primary);
        }

        .tab-limit-info {
            font-size: 0.7rem;
            font-weight: 400;
            margin-top: 2px;
            opacity: 0.8;
        }

        /* Header 部分 */
        .header {
            background: linear-gradient(135deg, var(--blue-dark), var(--blue-primary));
            border-radius: 24px;
            padding: 30px;
            color: white;
            box-shadow: 0 10px 20px rgba(26, 115, 232, 0.2);
            margin-bottom: 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            overflow: hidden;
        }

        .header::after {
            content: ''; position: absolute; top: -50%; right: -10%; width: 250px; height: 250px;
            background: rgba(255,255,255,0.1); border-radius: 50%;
        }

        .location-title { 
            font-size: 1.5rem; 
            font-weight: 700; 
            opacity: 0.95; 
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .location-icon {
            background: rgba(255,255,255,0.2);
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .update-time { 
            font-size: 0.85rem; 
            opacity: 0.8; 
            margin-bottom: 15px; 
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .update-badge {
            background: rgba(255,255,255,0.2);
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.75rem;
        }

        .current-temp { 
            font-size: 4rem; 
            font-weight: 800; 
            line-height: 1; 
            margin: 10px 0; 
            text-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

        .weather-details { 
            font-size: 0.95rem; 
            background: rgba(0,0,0,0.15); 
            padding: 6px 12px; 
            border-radius: 12px; 
            display: inline-block;
            backdrop-filter: blur(4px);
        }

        .header-icon { text-align: right; }
        .weather-emoji { 
            font-size: clamp(3.5rem, 10vw, 5.5rem); 
            margin-bottom: 5px; 
            filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
            animation: float 3s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-5px); }
        }

        .weather-text { font-size: 1.25rem; font-weight: 700; }

        /* 區塊標題 */
        .section-title {
            font-size: 1.15rem;
            font-weight: 700;
            margin: 28px 0 16px;
            display: flex;
            align-items: center;
            color: #334155;
        }
        .section-title::before {
            content: ''; 
            width: 4px; 
            height: 18px; 
            background: var(--blue-primary); 
            margin-right: 10px; 
            border-radius: 4px;
        }

        /* 七日預報橫向捲動 */
        .forecast-container {
            margin: 0 -10px;
            padding: 5px 10px 15px;
            overflow-x: auto;
            display: flex;
            gap: 12px;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
        }
        
        .forecast-container::-webkit-scrollbar { height: 6px; }
        .forecast-container::-webkit-scrollbar-thumb { 
            background: linear-gradient(90deg, var(--blue-primary), var(--blue-dark));
            border-radius: 10px; 
        }

        .day-card {
            min-width: 115px;
            flex: 0 0 auto;
            background: white;
            padding: 16px 12px;
            border-radius: 20px;
            text-align: center;
            box-shadow: var(--shadow-sm);
            scroll-snap-align: start;
            border: 1px solid rgba(255,255,255,0.8);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .day-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        }

        .day-card.today { 
            border: 2px solid var(--blue-primary); 
            background: #f0f7ff;
            box-shadow: 0 6px 12px rgba(26, 115, 232, 0.2);
        }

        .day-card.holiday {
            background: var(--holiday-bg);
            border: 2px solid var(--holiday-border);
            color: var(--red-text);
        }

        .day-card.holiday .day-name {
            color: var(--red-text);
            font-weight: 800;
        }

        .day-card.holiday .day-date {
            color: var(--red-text);
            opacity: 0.9;
        }

        .day-card.holiday .temp-range .t-max,
        .day-card.holiday .temp-range .t-min {
            color: var(--red-text);
        }

        .day-card.holiday .day-rain {
            background: #fee2e2;
            color: #dc2626;
        }

        .holiday-badge {
            position: absolute;
            top: 8px;
            right: 8px;
            background: var(--red-primary);
            color: white;
            font-size: 0.6rem;
            padding: 2px 6px;
            border-radius: 8px;
            font-weight: 700;
        }

        .day-date { 
            font-size: 0.85rem; 
            color: var(--text-light); 
            font-weight: 500;
        }
        
        .day-name { 
            font-size: 1rem; 
            font-weight: 700; 
            margin: 4px 0; 
        }
        
        .day-icon { 
            font-size: 2.2rem; 
            margin: 10px 0; 
        }
        
        .day-rain { 
            font-size: 0.8rem; 
            color: var(--blue-primary); 
            font-weight: 700; 
            background: #e0f2fe; 
            padding: 2px 8px; 
            border-radius: 10px; 
            display: inline-block;
        }
        
        .temp-range { 
            margin-top: 10px; 
            font-weight: 700; 
            font-size: 0.95rem; 
        }
        
        .t-max { color: var(--red-primary); }
        .t-min { color: var(--blue-primary); }

        /* 圖表區塊 */
        .chart-box {
            background: white;
            border-radius: 24px;
            padding: 20px;
            box-shadow: var(--shadow-sm);
            height: 300px;
        }

        /* 空氣品質優化 */
        .air-card {
            background: white;
            border-radius: 24px;
            overflow: hidden;
            box-shadow: var(--shadow-lg);
            transition: all 0.3s ease;
        }

        .air-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 20px rgba(0,0,0,0.15);
        }

        .air-header { 
            padding: 20px; 
            display: flex; 
            align-items: center; 
            gap: 15px; 
        }
        
        .air-aqi-box { 
            background: rgba(0,0,0,0.1); 
            padding: 10px; 
            border-radius: 16px; 
            text-align: center; 
            min-width: 80px; 
            backdrop-filter: blur(4px);
            transition: all 0.3s ease;
        }

        .air-aqi-box:hover {
            transform: scale(1.05);
        }
        
        .aqi-val { 
            font-size: 2.2rem; 
            font-weight: 800; 
            line-height: 1; 
        }
        
        .aqi-label { 
            font-size: 0.75rem; 
            font-weight: 700; 
        }
        
        .air-info-text { flex: 1; }
        
        .air-site { 
            font-size: 1.1rem; 
            font-weight: 700; 
            margin-bottom: 2px; 
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .air-msg { 
            font-size: 1.5rem; 
            opacity: 0.9; 
            line-height: 1.6; 
        }

        .air-details { 
            display: grid; 
            grid-template-columns: repeat(3, 1fr); 
            background: #f8fafc; 
            border-top: 1px solid #f1f5f9;
        }
        
        .detail-item { 
            padding: 15px 10px; 
            text-align: center; 
            border-right: 1px solid #f1f5f9; 
            transition: all 0.2s ease;
        }
        
        .detail-item:hover {
            background: #f1f5f9;
        }
        
        .detail-item:last-child { border-right: none; }
        
        .dt-label { 
            font-size: 0.7rem; 
            color: var(--text-light); 
            display: block; 
            margin-bottom: 4px; 
        }
        
        .dt-val { 
            font-size: 1.1rem; 
            font-weight: 700; 
        }
        
        .dt-unit { 
            font-size: 0.65rem; 
            color: var(--text-light); 
            margin-left: 2px; 
        }

        .weather-footer { 
            padding: 40px 0; 
            text-align: center; 
            font-size: 0.8rem; 
            color: var(--text-light); 
            margin-top: 30px;
            border-top: 1px solid #e2e8f0;
        }
        
        .weather-footer a { 
            color: var(--blue-primary); 
            text-decoration: none; 
            font-weight: 500;
        }

        .weather-footer a:hover {
            text-decoration: underline;
        }

        .info-badge {
            display: inline-block;
            background: #e0f2fe;
            color: var(--blue-primary);
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            margin: 5px 0;
            font-weight: 500;
        }

        /* --- 響應式設計 --- */
        @media (max-width: 480px) {
            body {
                padding: 8px;
            }
            
            #calendar-card {
                border-radius: 22px;
            }
            
            .nav-section {
                padding: 0 6px;
                gap: 4px;
            }
            
            .nav-arrow {
                min-height: 44px;
                font-size: 0.9rem;
                padding: 0 4px;
            }
            
            .date-center {
                font-size: 8rem;
            }
            
            .lunar-vertical img {
                width: 70px;
                height: auto;
            }
            
            .modal-content {
                max-width: 360px;
            }
            
            .calendar-grid {
                gap: 4px;
                padding: 12px;
            }
            
            .calendar-day {
                font-size: 0.9rem;
            }
            
            .current-temp {
                font-size: 3rem;
            }
            
            .weather-emoji {
                font-size: 3rem;
            }
            
            .header {
                padding: 20px;
            }
        }

        @media (min-width: 768px) or (orientation: landscape) {
            .header { padding: 40px; }
            .forecast-container { 
                overflow-x: visible; 
                display: grid; 
                grid-template-columns: repeat(7, 1fr); 
                gap: 10px;
            }
            .day-card { 
                min-width: unset; 
                padding: 18px 12px;
            }
            .air-header { padding: 30px; }
            .aqi-val { font-size: 3rem; }
            .detail-item { padding: 20px; }
            .tab { padding: 16px 12px; }
        }

        @media (max-width: 360px) {
            .date-center {
                font-size: 7rem;
            }
            
            .nav-arrow {
                font-size: 0.85rem;
                min-height: 40px;
            }
            
            .lunar-vertical img {
                width: 60px;
            }
            
            .current-temp {
                font-size: 2.5rem;
            }
        }

        .fade-in {
            animation: fadeIn 0.5s ease-out;
        }

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

