/* -------------------- 導覽列 -------------------- */
nav {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 99;
}

.main-nav-outer {
    height: 88px;
    background-color: hsl(60, 100%, 99%, 1);
    /* border: red 1px solid; */
    position: relative;

    transition: background-color .8s ease;
}

.nav-bgc-color-modify {
    background-color: hsl(60, 100%, 99%, .7);
}


.main-nav {
    /* background-color: hsl(60, 100%, 99%, .7); */
    display: flex;
    /* display: none; */
    justify-content: center;
    align-items: center;

    position: relative; /* 讓 search-icon 定位 */

    height: 88px;
}

/* ----- 左邊 ----- */
.main-nav-left {
    flex-basis: 100%;
    display: inline-flex;
    justify-content: flex-end;
    gap: clamp(36px, calc(72/1200 * 100vw), 72px);
}

.main-nav-left > li{
    /* border: 1px solid red; */
    padding: 12px 0;
    font-size: var(--H6-size);
    color: var(--ftc-black);
    font-family: var(--eng-font);
    text-align: center;

    position: relative; /* 讓次標絕對定位*/

    display: inline-flex; /* 讓次選單可以置中 */
    justify-content: center;
}

.main-nav-left > li > a{
    /* border: 1px solid red; */
    display: block;
    text-decoration: none;
    color: var(--ftc-black);
}

/* --- 左邊次導覽欄 --- */
.main-nav-left .sub-nav {
    background-color: #fff;
    position: absolute;
    top: 100%;

    width: 120px;
    text-align: center;

    border: 0.5px solid var(--ftc-100);

    display: none;
}

.main-nav-left .sub-nav li {
    text-align: center;
    position: relative; /* 讓偽元素底線絕對定位用 */
}

.main-nav-left .sub-nav li a {
    display: block;
    /* border: 1px solid green; */
    text-decoration: none;
    color: var(--ftc-black);
    font-family: "Noto Serif TC";
    line-height: 2; /* 撐高高度 */
    padding: 4px 0;

    transition-property: all; /* fw 和 color*/
    transition-duration: 0.6s;
    transition-timing-function: ease;
}

/* ----- 右邊 ----- */
.main-nav-right {
    /* border: 1px solid blue; */
    flex-basis: 100%;
    display: inline-flex;
    justify-content: flex-start;
    gap: clamp(36px, calc(72/1200 * 100vw), 72px);
}

.main-nav-right > li{
    padding: 12px 0;
    font-size: var(--H6-size);
    color: var(--ftc-black);
    font-family: var(--eng-font);
    text-align: center;

    position: relative; /* 讓次標絕對定位*/

    display: inline-flex; /* 讓次選單可以置中 */
    justify-content: center;
}

.main-nav-right > li > a{
    display: block;
    text-decoration: none;
    color: var(--ftc-black);
}

/* --- 右邊次導覽欄 --- */
.main-nav-right .sub-nav {
    background-color: #fff;
    position: absolute;
    top: 100%;

    width: 120px;
    text-align: center;

    border: 0.5px solid var(--ftc-100);

    display: none;
}

.main-nav-right .sub-nav li {
    text-align: center;
    position: relative; /* 讓偽元素底線絕對定位用 */
}

.main-nav-right .sub-nav li a {
    display: block;
    /* border: 1px solid green; */
    text-decoration: none;
    color: var(--ftc-black);
    font-family: "Noto Serif TC";
    line-height: 2; /* 撐高高度 */
    padding: 4px 0;

    transition-property: all; /* fw 和 color*/
    transition-duration: 0.6s;
    transition-timing-function: ease;
}

/* ----- 中間 logo ----- */
.nav-logo {
    display: block;
    margin: 0 72px;

    scale: 1;

    transition-property: scale;
    transition-duration: 0.5s;
    transition-timing-function: ease;
}

/* ----- 隱藏 logo ----- */
.nav-logo-outer {
    display: block;
    width: 72px;

    scale: 1;

    transition-property: scale;
    transition-duration: 0.5s;
    transition-timing-function: ease;

    display: none;
}
.nav-logo-outer:hover {
    scale: 1.05;
}

/* ----- 最右邊 search-icon ----- */
.main-nav > i {
    font-size: 16px;
    color: var(--bdc-pink);
    display: block;
    height: 20px;
    
    /* 垂直置中 */
    position: absolute;
    top: 0;
    bottom: 0;
    right: 2%;
    margin: auto;

    cursor: pointer;

    transition: all .5s ease;
}

/* 新增隱藏搜尋框 */
/* .search-container {
    position: absolute;
    top: 80%;
    right: 2%;

    display: none;
}
.search-input {
    padding: 12px;
    border: none;
    border-radius: 5px;
    width: 300px;
    font-family: "Noto Serif TC";
    box-shadow: 0 0 14px hsla(0, 0%, 0%, .13);
    font-size: var(--p-size);
}

.search-input:focus {
    outline: none;
} */

/* top 搜尋框 */
.top-search {
    /* border: 1px solid red; */
    background-color: var(--ftc-black);

    display: none;
}
.top-search > div {
    width: 85%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    /* border: 1px solid green; */
    /* gap: 16px; */
    font-size: var(--H5-size);
    color: var(--bdc-white);
}

.top-search > div > i {
    cursor: pointer;
}

.top-search input {
    padding: 16px;
    display: block;
    background-color: var(--ftc-black);
    border: none;
    color: var(--bdc-white);
    font-size: var(--H5-size);
    /* border: 1px solid red; */
    width: 100%;
}

.top-search input:focus{
    outline: none;
}

/* 打叉叉取消 */
/* .cancel-bar1, .cancel-bar2 {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    width: 16px;
    height: 2px;
    background-color: var(--bdc-pink);
    border-radius: 16px;
}
.cancel-bar1 {
    transform: rotate(45deg);
}
.cancel-bar2 {
    transform: rotate(-45deg);
} */

/* 漢堡選單 */
.main-nav-outer .fa-bars {
    display: none;
    color: var(--bdc-pink);
    font-size: 20px;
    cursor: pointer;
}

/* 搜尋的 hover 效果 */
.main-nav > i:hover {
    color: #fb6956;
}


/* -------------------- 偽元素分隔線 -------------------- */
/* --- 導覽欄 hover 底線 --- */
/* -- 左邊 -- */
.main-nav-left > li::after {
    content: "";
    display: inline-block;
    width: 100%;
    height: 1.5px;
    background-color: var(--bdc-pink);
    position: absolute;
    top: 94%;
    left: -120%;

    transition-property: left;
    transition-duration: 0.5s;
    transition-timing-function: ease;
}

.main-nav-left > li:nth-child(2):after {
    display: none;
}

.main-nav-left > li:nth-child(2n-1) { /* 把底線遮住 */
    overflow: hidden;
}

/* -- 右邊 -- */
.main-nav-right > li::after {
    content: "";
    display: inline-block;
    width: 100%;
    height: 1.5px;
    background-color: var(--bdc-pink);
    position: absolute;
    top: 94%;
    left: -120%;

    transition-property: left;
    transition-duration: 0.5s;
    transition-timing-function: ease;
}

.main-nav-right > li:nth-child(3):after {
    display: none;
}

.main-nav-right > li:nth-child(-n+2) { /* 把底線遮住 */
    overflow: hidden;
}


/* --- 次導覽欄底線 --- */
/* -- 左邊 -- */
.main-nav-left .sub-nav li::after { /* 次標分隔線 */
    content: "";
    display: inline-block;
    width: 100px;
    height: 0.5px;
    background-color: var(--ftc-300);
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin: auto;
}

.main-nav-left .sub-nav li:last-child::after {
    display: none;
}

/* -- 右邊 -- */
.main-nav-right .sub-nav li::after { /* 次標分隔線 */
    content: "";
    display: inline-block;
    width: 100px;
    height: 0.5px;
    background-color: var(--ftc-300);
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin: auto;
}

.main-nav-right .sub-nav li:last-child::after {
    display: none;
}

/* ----- active 狀態 ----- */
li.active-now, li > a.active-now, .sub-nav li > a.active-now{
    color: var(--bdc-pink);
    /* font-weight: bold; */
}



/* -------------------- hover 效果 -------------------- */
/* --- 底線滑動 --- */
.main-nav-left > li:hover::after {
    left: 0;
}

.main-nav-right > li:hover::after {
    left: 0;
}


/* --- 出現次導覽列 --- */
.main-nav-left > li:hover .sub-nav {
    display: block;
}

.main-nav-right > li:hover .sub-nav {
    display: block;
}


/* --- 次導覽列顏色變色 --- */
.sub-nav li:hover a {
    color: var(--bdc-pink);
    font-weight: bold;
}


/* --- Logo 變大 --- */
.nav-logo:hover {
    scale: 1.05;
}


/* 文字放大效果 */
.main-nav > ul > li {
    scale: 1;
    
    transition-property: scale;
    transition-duration: 0.5s;
    transition-timing-function: ease;
}
.main-nav > ul > li:hover {
    scale: 1.05;
}



/* -------------------- 置頂按鈕 -------------------- */

#backToTop {
    text-align: center;
    vertical-align: middle;
    border: none;
    font-size: 20px;
    width: 48px;
    height: 48px;
    background-color: var(--bdc-green);
    color: var(--bdc-white);
    border-radius: 50%;

    position: fixed;
    bottom: 40px;
    right: 24px;
    z-index: 5;

    cursor: pointer;

    box-shadow: 1px 1px 14px hsla(0, 0%, 0%, .2);

    /* 改用 JS 寫不然會有問題 */
    /* transition: all .5S; */
    /* transform: translateY(0); */
}

#backToTop:hover {
    /* transform: translateY(-15%); */
}

/* -------------------- 小幫手機器人 -------------------- */
.chat-helper {
    /* border: 1px solid red; */
    /* background-color: var(--bdc-green);
    border-radius: 50%; */
    height: auto;
    width: 60px;

    position: fixed;
    bottom: 100px;
    right: 18px;

    cursor: pointer;

    z-index: 5;
}

.helper-talk {
    height: auto;
    width: 108px;

    position: fixed;
    bottom: 120px;
    right: 50px;
    
    opacity: 0;
    /* transition: all .3s ease; */
}

.chat-helper:hover {
    transform: scale(1.1);
}

.chat-helper:hover + .helper-talk {
    opacity: 1;
}

/* 燈箱遮罩 */
.lightbox-mask {
    background-color: hsl(0, 0%, 0%, .5);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;

    z-index: 10;

    display: none;
}

/* 機器人對話框 */
.lightbox-content {
    /* border: 1px solid red; */
    width: 60vw;
    max-width: 400px;
    position: fixed; /* 寫 JS 置中 */
    top: 0;
    left: 0;
    
    z-index: 101;

    display: none;
}
.chat-box {
    border: 5px solid var(--bdc-pink);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    
    background-color: var(--bdc-white);
    border-radius: 8px;

    position: relative;
}

.chat-box i{
    font-size: 20px;
    color: var(--bdc-pink);
    position: absolute;
    top: 0;
    right: 0;
    /* padding: 4px; */
    margin-top: 8px;
    margin-right: 8px;

    cursor: pointer;

}
.chat-box i:hover {
    color: hsl(0, 50%, 50%);
}
.chat-box-content {
    border: 1px solid #666;
    background-color: var(--bdc-white);
    padding: 12px;
    height: 300px;

    font-family: var(--chinese-font);
    color: var(--ftc-black);
    font-size: var(--p-size);
    border-radius: 8px;
}
.chat-box-content div {
    /* border: 1px solid red; */
    text-align: center;
    padding: 4px;
    order: 2;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-box-content img {
    width: 100%;
    max-width: 28px;
    height: auto;
    display: inline-block;
    padding: 8px;

    background-color: var(--bdc-pink);
    border-radius: 50%;

}
.chat-box-content p {
    background-color: white;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 8px;
}
.chat-box-textarea {
    background-color: var(--bdc-white);
    /* border: 1px solid darkgreen; */
    resize: none;
    padding: 8px;

    font-family: var(--chinese-font);
    color: var(--ftc-black);
    font-size: var(--p-size);

    border-radius: 8px;
    
}
.chat-box-textarea:focus {
    outline: 1px solid var(--ftc-300);
}



.bar-outside {
    /* border: 1px solid red; */
    height: 4px;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;

    background-color: hsl(60, 100%, 99%, .7);
}

.bar-inside{
    height: 4px;
    background: var(--bdc-green);

    width: 0;
    transition: width .2s linear;
}

