*, *:before, *:after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    scroll-padding-top: 6.8rem;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    height: 100px;
}

.navbar {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    height: 100%;
}

.nav-link {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    align-items: center;
}

header .language-list {
    display: none !important;
    border-top: 1px solid #bebebe;
    padding: 30px 0 40px;
    width: 100vw;
    width: 100dvw;
    position: relative;
    justify-content: center;
}

header .dropdown-menu[data-bs-popper] {
    left: unset !important;
    bottom: 100% !important;
    top: unset !important;
    margin-bottom: -35px;
}

.container-fluid {
    --bs-gutter-x: unset !important;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

#container {
    margin: 0 auto;
}

:target {
    scroll-margin-top: 0;
}

.navbar {
    height: 100%;
    background-color: #fff;
}

a[aria-current] {
    color: #10589e;
}

.navbar-collapse {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.navbar-toggler {
    border: unset;
    height: 8vw;
    min-height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: flex-end;
}

.navbar-toggler:focus {
    text-decoration: none;
    outline: 0;
    box-shadow: 0 0 0;
}

.navbar-toggler[aria-expanded='false']::after {
    content: '';
    width: 20%;
    min-width: 22px;
    max-width: 40px;
    background-image: url('./images/Icon awesome-bars.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    transition: background-image .2s ease-in;
    margin: 1.5%;
}

.navbar-toggler[aria-expanded='true']::after {
    content: '';
    width: 20%;
    min-width: 22px;
    max-width: 50px;
    background-image: url('./images/Icon ionic-ios-close.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    transition: background-image .2s ease-in;
    margin: 2vw;
}

.open {
    max-width: 35px;
}

.close {
    display: none;
    max-width: 35px;
}

.nav-log {
    width: auto;
    height: 60px;
    margin-left: 20px;
}

.navbar-nav {
    gap: 20px;
}

.nav-link span {
    width: 40px;
    height: 26px;
    font-size: 18px;
    white-space: nowrap;
}

.navbar-nav li {
    display: flex;
    align-items: stretch;
}

.footer-top-text,
.footer-top-img {
    display: flex;
    flex-direction: row;
    width: 50%;
}

.footer-top,
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.footer-top-text  {
    justify-content: flex-end;
}

.footer-top-img {
    gap: 10px;
}

.footer-top-img img {
    width: auto;
    height: 60px;
    max-width: 181.7px;
    max-height: 60px;
}

.footer-top-text div {
    display: flex;
    justify-content: center;
    flex-direction: column;
    font-size: 14px;
    line-height: 2.57;
    text-align: right;
    width: 100%;
    max-width: 160px;
    white-space: nowrap;
}

.footer-top-text a {
    text-decoration: none !important;
    color: #bebebe !important;
    cursor: pointer;
}

.footer-top-text span {
    font-size: 18px;
    color: #000 !important;
}

.footer-top-text a:hover {
    color: #10589e !important;
}

.footer-Copyright {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.71;
    color: #000;
    text-align: left;
}

.language-list {
    display: flex;
    justify-content: flex-end;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* 覆寫 Bootstrap .dropdown-item 的預設藍 (#0d6efd), 用網站自己的 active 藍 */
.language-list .dropdown-item:active,
.language-list .dropdown-item.active {
    background-color: #008cc9;
    color: #fff;
}

/* 選項是直角方塊, 超出選單圓角處會被看到, 裁掉 */
.language-list .dropdown-menu {
    overflow: hidden;
}

.language-list button {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 159px;
    height: 32px;
    border-radius: 5px;
    border: 1px solid #bebebe;
    background-color: #fff;
    font-size: 14px;
    line-height: 2.57;
    text-align: right;
    background-position: center left;
    background-repeat: no-repeat;
    background-position-x: 20px;
    padding-left: 36px;
}

.language-list a {
    font-size: 14px;
    background-position: center left;
    background-repeat: no-repeat;
    margin-left: 20px;
}

.language-list button[value="zh-tw"],
.language-list a[value="zh-tw"] {
    background-image: url("./images/zh-tw.svg");
}

.language-list button[value="zh-cn"],
.language-list a[value="zh-cn"] {
    background-image: url("./images/zh-cn.svg");
}

.language-list button[value="en"],
.language-list a[value="en"] {
    background-image: url("./images/en.svg");
}

.language-list button[value="vi"],
.language-list a[value="vi"] {
    background-image: url("./images/vi.svg");
}

.language-list li:hover {
    background-color: #bebebe;
}

.language-list li:active {
    background-color: #008cc9;
}

.dropdown-menu {
    --bs-dropdown-link-hover-bg: unset;
}

#backtop {
    display: none;
    width: 10%;
    z-index: 99;
    right: 5%;
    bottom: 5%;
    max-width: 50px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 1px solid #fff;
    background-color: rgba(0,140,201,.6);
    background-image: url(./images/arrow_up.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 50% 50%;
    position: fixed;
    cursor: pointer;
}

#backtop:hover {
    background-color: #008cc9;
}

.row {
    --bs-gutter-x: unset;
}

/* RWD */

@media  (max-width: 576px) {

    header {
        height: 60px;
    }
    
    header .language-list {
        display: flex !important;
    }

    .navbar-collapse {
        height: calc(100dvh - 60px);
        transition: height 0s ease-in-out;
        background-color: #fff;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        padding-top: 40px;
    }

    .navbar-nav {
        flex: 1;
    }

    .nav-link span{
        font-size: 18px;
    }

    .nav-log{
        height: 36px;
    }

    .footer-top{
        display: flex;
        flex-direction: uncolumn;
        padding-left: 20px;
    }

    .footer-top-img{
        width: 100%;
        justify-content:flex-start;
    }

    .footer-top-img img {
        height: 30px;
    }

    .footer-top-text{
        margin-top: 20px;
        flex-direction: row-reverse;
        width: fit-content;
    }

    .footer-top-text span{
        font-size: 14px;
    }

    .footer-top-text div{
        width: 100%;
        align-items: flex-start;
        font-size: 14px;
        padding-right: 25px;
    }

    .footer-bottom{
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
    }

    .footer-Copyright{
        width: 100%;
        font-size: 12px;
        text-align: center;
    }

    .footer-bottom hr{
        display: block !important;;
    }

    .language-list {
        justify-content: center;
    }

    .language-list button {
        font-size: 12px;
        line-height: 2;
        justify-content: space-around;
    }
}

@media (min-width: 576px) and (max-width: 991px) {

    header .language-list {
        display: flex !important;
    }

    .navbar-collapse {
        height: calc(100dvh - 100px);
        transition: height 0s ease-in-out;
        background-color: #fff;
        position: absolute;
        top: 100px;
        left: 0;
        width: 100%;
        padding-top: 40px;
    }

    .navbar-nav {
        flex: 1;
    }

    .footer-top,
    .footer-bottom {
        padding: 0px 5%;
    }

    .footer-top-img{
        flex-direction: column;
        justify-content: flex-start;
    }

    .footer-top-img img:last-child{
        margin-top: 25px;
    }
}

@media (min-width: 992px) {
    .navbar {
        padding-top: 0;
        padding-bottom: 0;
    }

    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        align-items: stretch;
        height: 100%;
    }

    a[aria-current] {
        border-bottom: 3px solid #10589e;
        color: #10589e;
    }

    .navbar-nav {
        height: 100%;
        margin-right: 20px;
        justify-content: flex-end;
        gap:10%;
    }

    .navbar-nav li {
        height: 100%;
    }

    .nav-link span {
        font-size: 24px;
        width: auto;
        height: auto;
        padding-bottom: 0.5vw;
    }

    .nav-link:hover span {
        color: #10589e;
    }

    .nav-link {
        height: 100%;
        display: flex;
        border-bottom: 3px solid transparent;
    }

    .nav-link:hover {
        border-radius: 2.5px;
        border-bottom: 3px solid #10589e;
        z-index: 1;
    }

    .footer-top {
        padding:0 20px;
    }

}

@media (min-width: 1201px) {
    .nav-log {
        margin-left:0px;
    }

    .footer-top-text span {
        font-size: 14px;
    }

    .footer-top-text div {
        max-width: 12vw;
    }

    .dropdown-menu {
        --bs-dropdown-min-width: unset;
    }
}