body {
    font-family: Arial, sans-serif;
    background-color: #FFE4E1;
    color: #000;
    margin: 28px;
    padding: 0;
}

header {
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 32px;
    margin: 20px 32px;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

h1 {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Rammetto One', cursive;
}

nav ul {
    display: flex;
    list-style-type: none;
    padding: 0;
}

nav ul li {
    margin-right: 40px;
}

nav ul li:last-child {
    margin-right: 0;
}

nav ul li a {
    text-decoration: none;
    color: #8c8c8c;
    font-family: 'Rammetto One', cursive;
    font-size: 16px;
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding-top: 40px;
}

#hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    position: relative;
}

.hero-text {
    font-family: 'Raleway', sans-serif;
    width: 30%;
}

.hero-text h2 {
    font-size: 70px;
    font-weight: lighter;
    line-height: 1.6;
}

.hero-description {
    font-family: 'Raleway', sans-serif;
    line-height: 1.6;
    width: 30%;
    text-align: right;
}

.hero-description h3 {
    font-size: 44px;
    font-weight: lighter;
}

.hero-description p {
    font-weight: lighter;
    font-size: 18px;
}

#bear-container {
    width: 600px;
    height: 600px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#canvas3d {
    width: 100%;
    height: 100%;
    transform: scale(1.5);
    position: relative; /* 確保canvas3d是相對定位 */
    margin: 0 auto; /* 確保容器在螢幕中央 */
}

#circle-text {
    position: absolute;
    top: 50%;
    left: 58%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 100%;
    height: 100%;
}

#circle-text img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

canvas {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.menu-toggle {
    display: none;
}

/* 平板尺寸 (768px - 1024px) */
@media (max-width: 1024px) {
    header {
        padding: 4px 20px;
        margin: 20px 20px;
    }

    nav ul li {
        margin-right: 20px;
    }

    main {
        padding-top: 0px;
    }
    .hero-text h2 {
        font-size: 50px;
    }

    .hero-description h3 {
        font-size: 34px;
    }

    #bear-container {
        width: 400px;
        height: 400px;
    }

    .menu-toggle {
        display: none;
    }
}

/* 保留之前的 CSS，只更新手機部分和添加新的樣式 */

/* 手機尺寸 (小於 768px) */
@media (max-width: 767px) {
    body {
        margin: 14px;
        overflow-x: hidden; /* 禁止橫向捲動 */
    }

    /* 確保內容不會超出螢幕寬度 */
    .container {
        width: 100%;
        box-sizing: border-box; /* 包含內邊距和邊框在內的總寬度 */
    }
    header {
        flex-direction: row;
        justify-content: space-between;
        padding: 2px 24px;
        margin: 14px 16px;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 20px 20px;
    }

    nav.show {
        display: block;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
    }

    nav ul li {
        margin: 10px 0;
    }

    .menu-toggle {
        display: block;
        font-size: 24px;
        cursor: pointer;
    }

    main {
        padding-top: 100px;
    }

    #hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-text, .hero-description {
        width: 80%;
        text-align: center;
        margin-bottom: 20px;
        position: relative;
        z-index: 2;
    }
    .hero-text {
        order: 3;
    }
    .hero-description {
        order: 2;
    }
    /* 這裡是為了讓重新排列hero裡內容順序 */


    .hero-text h2 {
        font-size: 24px;
    }

    .hero-description h3 {
        font-size: 18px;
    }

    #bear-container {
        position: relative;
        width: 100%;
        height: auto;
        margin-left: 0;
        transform: translate(-60%, 0); /* 確保容器在螢幕中央 */
        order: 1;
        box-sizing: border-box; /* 包含內邊距和邊框在內的總寬度 */

    }
    #circle-text {
        top: 50%;
        left: 0%;
        transform: translate(10%, -50%);
        width: 100%;
        height: 100%;
        z-index: 1;
    }

   /* 調整canvas3d的大小以適應較小螢幕 */
   #canvas3d {
    width: 500px; /* 增加寬度 */
    height: 500px; /* 增加高度 */
    left: 0%; /* 確保容器在螢幕中央 */
    object-fit: cover; /* 確保內容填滿容器 */
    overflow: hidden; /* 隱藏超出容器的部分 */
    margin: 0 auto; /* 確保容器在螢幕中央 */
   }
}