/* --- CSS 樣式設計 --- */
        @import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');

        :root {
            --bg-color: #8E0E00;
            --bg-gradient: linear-gradient(to bottom, #8E0E00, #1F1C18);
            --gold-color: #FFD700;
            --text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        }

        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: auto; 
            background: var(--bg-gradient);
            font-family: "Microsoft JhengHei", "Heiti TC", sans-serif;
            display: flex;
            flex-direction: column; 
        }
        
        /* 頭部 (20%) */
        .header-section {
            height: 20vh; /* 視窗高度的20% */
            min-height: 150px;
            width: 100%;
            position: relative;
            z-index: 5;
        }
        
        .top-banner {
            width: 100%;
            height: 100%;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .top-banner img {
            width: 50%;      
            height: 150px;
            
        }
.responsive-pic01 {
            max-width: 600px;
            height: auto;
            display: block;
     
        }
.responsive-pic02 {
            max-width: 100%;
            height: 100%;
            display: block;
            margin: 0 auto;
          
        }
        /* 主體 (70%) */
        .main-section {
            height: 70vh; /* 視窗高度的70% */
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 10;
        }
        .main-section2 {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 10;
        }

        /* 尾部 (10%) */
        .footer-section {
            height: 10vh; /* 視窗高度的10% */
            min-height: 80px;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 5;
            background: rgba(142, 14, 0, 0.7);
            color: var(--gold-color);
            font-size: 1.2rem;
            font-weight: bold;
            text-shadow: var(--text-shadow);
            border-top: 2px solid var(--gold-color);
        }

        /* 煙花畫布 */
        canvas {
            position: fixed; 
            top: 0;
            left: 0;
            z-index: 1;
            pointer-events: none;
        }

        /* 主容器 */
       .container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0rem;
    border: 2px solid var(--gold-color);
    border-radius: 15px;
    background: rgba(142, 14, 0, 0.6); /* 半透明紅色背景 */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    max-width: 90%;
    width: 400px;
    min-height: 300px;
    backdrop-filter: blur(5px);
    margin: 0px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直置中內容 */
}

        /* 裝飾性邊角 (中國結風格簡化版) */
        .corner {
            position: absolute;
            width: 20px;
            height: 20px;
            border: 3px solid var(--gold-color);
            transition: all 0.3s ease;
        }
        .top-left { top: -5px; left: -5px; border-right: none; border-bottom: none; }
        .top-right { top: -5px; right: -5px; border-left: none; border-bottom: none; }
        .bottom-left { bottom: -5px; left: -5px; border-right: none; border-top: none; }
        .bottom-right { bottom: -5px; right: -5px; border-left: none; border-top: none; }
        
        /* 標題與祝福語 */
        h1 {
            color: var(--gold-color);
            font-family: 'Ma Shan Zheng', cursive, serif; /* 書法字體 */
            font-size: 2rem;
            margin-bottom: 20px;
            text-shadow: var(--text-shadow);
        }

        .greeting-box {
            min-height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 30px;
        }

        #greeting-text {
            margin-top: 25px;
            color: #fff;
            font-size: 1.8rem;
            font-weight: bold;
            line-height: 1.4;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.5s ease-out;
        }

        #greeting-text.show {
            opacity: 1;
            transform: translateY(0);
            color: var(--gold-color);
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
        }

        /* 按鈕設計 */
        button {
            margin-top: 15px;
            background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
            border: none;
            padding: 15px 20px;
            font-size: 1.2rem;
            border-radius: 50px;
            color: #8E0E00;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            transition: transform 0.1s, box-shadow 0.1s;
            font-family: inherit;
        }

        button:active {
            transform: scale(0.95);
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        }

        button:hover {
            background: #fff;
            color: #d60000;
        }

        /* 語音播放按鈕 */
        #btn-voice {
            margin-top: 0px;
            padding: 15px 20px;
            font-size: 1.1rem;
            background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
            color: #8E0E00;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.5s ease-out;
        }

        #btn-voice.show {
            opacity: 1;
            transform: translateY(0);
        }

        #btn-voice:hover {
            background: #fff;
        }

        #btn-voice:disabled {
            background: linear-gradient(135deg, #808080 0%, #A9A9A9 100%);
            cursor: not-allowed;
            opacity: 0.7;
        }

        /* 左下角GIF動畫 */
        .horse-fixed {
            position: fixed;
            left: 0;
            bottom: 0;
            width: 120px;
            height: 120px;
            z-index: 9999;      /* 確保在最上層 */
            pointer-events: none; /* 不阻擋點擊（可選） */
        }

        /* 手機適配 */
@media (max-width: 768px) {
    .header-section {
        height: 25vh; /* 稍微降低高度 */
        min-height: 100px;
    }
   
    .top-banner img {
        width: 100%;
        height: auto;
        max-height: 180px; /* 限制最大高度 */
    }
    
    .main-section {
        height: 60vh; /* 增加主體高度 */
        padding-top: 20; 
    }
    
      .container {
        width: 85%;
        max-width: 400px;
        min-height: 350px; /* 增加最小高度 */
        padding: 1.5rem 1rem;
        margin: 10px auto; /* 置中並減少外邊距 */
    }
    
    .greeting-box {
        min-height: 100px; /* 增加祝福語區域高度 */
        margin-bottom: 20px;
    }
    
    
    .footer-section {
        height: 10vh;
        min-height: 60px;
        font-size: 1rem;
        padding: 0 10px;
        text-align: center;
    }
    
    h1 { 
        font-size: 1.5rem;
        margin-bottom: 15px; /* 減少標題底部間距 */
    }
    
    #greeting-text { 
        font-size: 2.0rem;
        line-height: 1.5;
    }
    
    .horse-fixed {
        left: 150;
        bottom: 0;
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .header-section {
        min-height: 80px;
        height: 25vh; /* 更小裝置再降低高度 */
    }
    
    .container {
        min-height: 320px; /* 小裝置保持適當高度 */
        padding: 1.2rem 0.8rem;
    }
    
    h1 { 
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    #greeting-text { 
        font-size: 2.0rem;
    }
    
    button {
        padding: 12px 30px;
        font-size: 1.5rem;
    }
}
