body {
    /* background-color: rgb(237, 237, 237); */
    margin: 0px;
    font-size: 14px;
    font-family: "LXGW WenKai TC", cursive;
}

/* ============================= */
/*             導覽列            */
/* ============================= */

header {
    display: flex;
    justify-content: space-between;
    background-color: #333;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 130px;
    height: 50px;
    font-size: 22px;
    color: #fff;
    /* margin-left: 15px; */
}

.navbar {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: #fff;
    height: 50px;
    width: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    transition: background-color 0.3s ease-in-out;
    /* margin-left: 15px; */
}

.nav-link:hover {
    background-color: gray;
}

.menu-icon {
    display: none;
}

#banner {
    width: 100%;
    height: 600px;
    overflow: hidden;
    text-align: center;
    margin-bottom: 30px;
    background-color: #F0EEE8;
}

#banner img {
    max-width: 100%;
    height: 105%;
    object-fit: cover;
}

/* ============================= */
/*              about            */
/* ============================= */

#about {
    padding: 0 0 30px 0;
    /* background-color: lightslategray; */
    font-size: 18px;
}

.container {
    width: 80%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    margin: auto;
}

.photo {
    width: 46%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 25px;
}

.photo img {
    width: 80%;
    max-width: 100%;
    border-radius: 20px;
}

.desc {
    width: 46%;
    /* display: flex;
    align-items: center;
    text-indent: 20px; */
}

.desc p {
    margin-bottom: 10px;
}

.desc h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.educational {
    background-color: #f7f7f7;
    width: 90%;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    margin-bottom: 10px;
}

.educational p {
    margin: 10px 20px 10px 20px;
}

.skill-list {
    margin: 0;
    padding: 0;
    padding-left: 20px;
    list-style: none;
}

.skill-list li {
    display: flex;
}

.skill-name {
    width: 150px;
    margin-bottom: 20px;
}

.skill-bar {
    width: 300px;
    height: 20px;
    background-color: #ddd;
    border-radius: 20px;
    box-shadow: -2px 2px 2px #646464 inset;
}

.skill-level {
    /* text-align: center; */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    height: 20px;
}

.skill-html {
    width: 90%;
    animation: html 2s 1;
    background-image: linear-gradient(to right, #ee96a9, #f4839a, #f96f8a, #fd5879, #ff3b66);
}

.skill-css {
    width: 80%;
    animation: css 2s 1;
    background-image: linear-gradient(to right, #d1b3f8, #c697f9, #bb78f8, #b256f5, #aa26f0);
}

.skill-js {
    width: 70%;
    animation: js 2s 1;
    background-image: linear-gradient(to right, #f0e257, #dbe444, #c1e732, #a1ea24, #78ec1f);
}

.skill-php {
    width: 60%;
    animation: php 2s 1;
    background-image: linear-gradient(to right, #7ea9f9, #6091ff, #4e76ff, #4e57ff, #5f28fb);
}

.skill-sql {
    width: 50%;
    animation: sql 2s 1;
    background-image: linear-gradient(to right, #7ef9c9, #00e8e0, #00d4f5, #00bcff, #28a0fb);
}

@keyframes html {
    from {
        opacity: 0;
        width: 0;
    }

    to {
        opacity: 1;
        width: 90%;
    }
}

@keyframes css {
    from {
        opacity: 0;
        width: 0;
    }

    to {
        opacity: 1;
        width: 80%;
    }
}

@keyframes js {
    from {
        opacity: 0;
        width: 0;
    }

    to {
        opacity: 1;
        width: 70%;
    }
}

@keyframes php {
    from {
        opacity: 0;
        width: 0;
    }

    to {
        opacity: 1;
        width: 60%;
    }
}

@keyframes sql {
    from {
        opacity: 0;
        width: 0;
    }

    to {
        opacity: 1;
        width: 50%;
    }
}

/* ============================= */
/*           experience          */
/* ============================= */

#experience {
    padding: 50px 0;
    background-color: grey;
    font-size: 18px;
}

#experience h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 30px;
}

.experience-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.experience-list li {
    width: 25%;
    height: 300px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 26px;
    margin: 0 10px;
    border-radius: 20px;
    text-align: center;
    transition: 0.3s ease-in-out;
}

.experience-list li:hover {
    scale: 1.05;
    box-shadow: 1px 1px 10px #333;
}

.experience-list span {
    margin-bottom: 10px;
}

.experience-list i {
    font-size: 50px;
}

.experience-list h3 {
    margin: 5px 0;
}

.experience-list {
    margin: 5px 0;
}

.experience-time {
    margin: 0px;
}

/* ============================= */
/*           portfolio           */
/* ============================= */

#portfolio {
    padding: 50px 0;
    /* background-color: lightcoral; */
    font-size: 18px;
}

#portfolio .container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    height: 600px;
}

#portfolio h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 30px;
}

.item {
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    border-radius: 20px;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.item img {
    width: 100%;
}

.item:nth-child(1){
    grid-area: 1/1/3/3;
}
.item:nth-child(7){
    grid-area: 2/4/4/5;
}

.fit {
    object-fit: cover;
    height: 397px;
}

.fit2 {
    object-fit: cover;
    height: 195px;
}

.back {
    background-color: lightgrey;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotateY(180deg);
    transition: transform 0.5s;
}

.item:hover .back {
    transform: rotateY(0deg);
}

/* ============================= */
/*            contact            */
/* ============================= */

#contact {
    background-color: gray;
}
#contact .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px;
}

.contact-info {
    width: 48%;
}

.contact-info h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 60px;
}

.contact-about {
    list-style: none;
    margin: 0;
    padding: 0 0 0 60px;
    font-size: 18px;
}

.contact-about li {
    padding: 10px;
}

.contact-about i {
    margin-right: 10px;
}

.contact-form {
    width: 46%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #d3d3d3;
    padding: 30px 10px;
    border-radius: 10px;
    box-sizing: border-box;
}

.contact-group {
    width: 100%;
}
.contact-form label {
    font-size: 18px;
    padding-left: 5px;
}
.contact-form input {
    width:95%;
    height: 40px;
    border: none;
    border-radius: 5px;
    margin:8px 0 10px 0;
    padding: 5px;
    font-size: 16px;
}

.contact-form textarea {
    border: none;
    border-radius: 5px;
    width: 95%;
    padding: 5px;
    margin-top: 8px;
    font-size: 16px;
}

.contact-form button {
    border: none;
    border-radius: 5px;
    background-color: #000;
    color: #fff;
    width: 120px;
    height: 40px;
    margin: 18px 0 0 0;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s ease-in-out;
}

.contact-form button:hover {
    background-color: #959595;
    color: #333;
}

/* ============================= */
/*             footer            */
/* ============================= */

footer {
    background-color: #000;
}

footer p {
    text-align: center;
    color: #fff;
    margin: 0;
    padding: 10px;
    font-size: 16px;
}

/* ================================== */
/*               手機版               */
/* ================================== */

@media screen and (max-width: 500px) {

    /* ============================= */
    /*             導覽列            */
    /* ============================= */
    .menu-icon {
        display: flex;
        color: white;
        justify-content: center;
        align-items: center;
        width: 50px;
    }

    nav{
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background-color: #333;
        z-index: 1000;
    }

    header {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;  
    }
    
    .navbar {
        flex-wrap: wrap;
        display: none;
    }

    .navbar.active{
        display: block;
    }

    .nav-link {
        width: 100vw;
        border-bottom: 1px solid #fff;
    }

    #banner {
        height: 300px;
    }

    #banner img{
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }


    /* ============================= */
    /*             about             */
    /* ============================= */

    .container {
        display: flex;
        flex-direction: column;
    }

    .desc h2 {
        margin-top: 20px;
    }

    .photo,
    .desc {
        width: 100%;
    }

    .photo {
        padding-top: 0;
    }

    .photo img {
        width: 90%;
    }

    .educational {
        width: 95%;
    }

    /* ============================= */
    /*           experience          */
    /* ============================= */

    #experience {
        padding: 30px 0;
    }

    .experience-list {
        flex-direction: column;
        width: 100%;
    }

    .experience-list li {
        width: 80%;
        margin-bottom: 20px;
    }

    /* ============================= */
    /*           portfolio           */
    /* ============================= */

    #portfolio {
        padding: 30px 0;
    }
    
    #portfolio .container {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .item {
        margin-bottom: 20px;
    }


    /* ============================= */
    /*            contact            */
    /* ============================= */

    #contact .container {
        display: flex;
        flex-direction: column;
    }

    .contact-info {
        width: 100%;
        margin-bottom: 30px;
    }
    .contact-info h2{
        margin-bottom: 30px;
    }

    .contact-form {
        width: 100%;
        padding: 30px;
    }
    .contact-form button {
        width: 100%;
        padding:0;
        margin: 18px auto 0 auto; 
    }

}

/* ================================== */
/*               平板版               */
/* ================================== */
@media screen and (min-width: 501px) and (max-width: 1024px){

    /* ============================= */
    /*             about             */
    /* ============================= */

    #banner {
        height: 500px;
    }

    .educational {
        width: 100%;
    }
    
    .skill-name {
        width: 200px;
    }

    /* ============================= */
    /*           experience          */
    /* ============================= */

    .experience-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .experience-list li {
        width: 38%;
        height: auto;
        margin-bottom: 20px;
    }

    /* ============================= */
    /*           portfolio           */
    /* ============================= */

    #portfolio .container {
        grid-template-columns: repeat(2, 1fr); 
        grid-auto-rows: auto;                  
        height: auto;                          
    }

    .item:nth-child(1){
        grid-area: auto; 
    }
    .item:nth-child(7) {
        height: 300px; 
        grid-area: auto; 
        overflow: hidden;
    }
    .fit, .fit2 {
        height: auto;
        object-fit: cover;
        width: 100%;
    }
}