:root {
    --app-light-background: #f8f8f8;
    --app-dark-background: #c1bdcc;
    --app-font-color:#d92e2b;
    --app-topic-color:#ff7a05;
    --app-subtopic-color: #00223b;
    --app-icon-color: #5ae8b9;
    --app-footer-color:#514d55;
    --app-box-radius: 15px;
    --app-button-radius: 50px;
    --app-image-radius: 50%;
}

.to-top {
    position: fixed;
    bottom: 80px;
    right: 10px;
    display: none;
    border: 2px solid var(--app-topic-color);
    color: var(--app-topic-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-weight: 500;
    font-size: 14px;
    background-color: transparent;
    transition: ease-in-out 0.25s;

    i {
        font-size: 20px;
    }

}

.to-top:hover {
    background-color: var(--app-topic-color);
    color: #fff;
}

/*--------------------------------------------*/
/*Utility classes                             */
/*--------------------------------------------*/
html {
  overflow-y: scroll;  /* 始终预留滚动条空间 */
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Roboto", sans-serif;
}

.container {
    width: min(100% - 30px, 1200px);
    margin-inline: auto;
}

.flex {
    display: flex;
}

.grid {
    display:grid;
    place-items: center;
}

.space {
    justify-content:space-between;
}

.row {
    gap:80px;
}

.col {
    width: calc(50% - 40px);
}

.block {
    padding:50px 0 150px;
}

.index-main {
    margin-top: 72px;
}

.subpage-main {
    margin-top: 72px;
    min-height: calc(100vh - 72px - 72px);
}

.topic {
    color: var(--app-topic-color);
}

.sub-topic {
    color: var(--app-subtopic-color);
    font-size: 40px;
}

/*--------------------------------------------*/
/*Header                                      */
/*--------------------------------------------*/

header {
    height: 72px;
    line-height: 72px;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 1000; 
    background-color: var(--app-light-background);

    h1 {
        font-size: 30px;
        color: var(--app-topic-color);
    }
    
    a {
        text-decoration-line: none;
        font-size: 18px;
        font-weight: 500;
        color: var(--app-subtopic-color);
        transition: transform ease-in-out 0.25s;
    }

    a:hover {
        color: var(--app-topic-color);
        transform: scale(1.05);
    }

    .tag {
        gap:40px;
    }
}

.logo-box {
    align-items: center;
    height:72px;
}

.logo {
    width:80px;
    height:40px;
}

.media-shortcuts {
    gap: 40px;
}

.fa-github {
    font-size: 45px;
    line-height: 72px;
    color:#1f2429;
}

.fa-linkedin {
    font-size: 45px;
    line-height: 72px;
    color: #0a66c2;
}

.menu-toggle, .close-menu-toggle {
  display: none;
  font-size: 28px;
  color: var(--app-subtopic-color);
  cursor: pointer;
  line-height: 72px;
}

.nav-menu {
    position: relative;
}

.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute;
    top: 100%;
    right:-30px;
    background-color: var(--app-light-background);
    min-width: 150px;
    z-index: 100;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.dropdown-menu a {
    padding: 10px 15px;
    color: var(--app-subtopic-color);
    text-decoration: none;
    font-size: 18px;
    line-height: 1.5;
}

.dropdown:hover .dropdown-menu {
    display:grid;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown {
    position: relative;
    height: 72px;
}

.fa-chevron-down {
    font-size: 12px;
    line-height: 72px;
}

/*--------------------------------------------*/
/*Home                                        */
/*--------------------------------------------*/

.hero-banner {
    height: calc(100vh - 72px);
    display: grid;
    place-items: center;
    text-align: center;
    margin-top: 72px;
    position:relative;
    background: var(--app-light-background) url(../img/hero-banner.gif) center center / cover no-repeat;
}

.intro {
    padding: px 0;
    font-weight: 500;
}

.hero-banner-title {
    color: #fff;
    font-size: 70px;
}

.hero-banner-subtitle {
    color: #fff;
    font-size: 30px;
    font-weight: 400;
}

.discover-more {
    width: 200px;
    height:50px;
    font-size: 20px;
    margin-top:50px;
    border-radius: 10px;
    background-color:  var(--app-topic-color);
    line-height: 50px;
    border-radius: 50px;
    transition: 0.5s ease;
}

.discover-more a {
    color: var(--app-subtopic-color);
    text-decoration: none;
    font-weight:500;
}

.discover-more:hover {
    background-color:#faa152;
}

/*--------------------------------------------*/
/*About Me                                    */
/*--------------------------------------------*/

.aboutme {
    scroll-margin-top: 72px;
    display:grid;
}

.aboutme-content {
    display:flex;
    margin-top: 30px;
}

.image-two {
    border-radius: var(--app-image-radius);
    width: 300px;
    height: 300px;
}

.detail {
    margin-top: 20px;
    font-size: 20px;
    line-height: 50px;
    color: var(--app-subtopic-color);
}

.highlight-two {
    font-weight: 500;
    font-size: 25px;
}

.hire {
    margin-top: 10px;
    width: 120px;
    height: 40px;
    font-weight: 500;
    font-size: 14px;
    color: var(--app-subtopic-color);
    border-radius: var(--app-button-radius);
    background-color: var(--app-topic-color);
    transition: ease-in-out 0.5s;
}

.hire:hover {
    background-color: #faa152;
}

.aboutme-text a {
    color: var(--app-topic-color);
    text-decoration: none;
    font-weight: 500;;
}

.aboutme-text a:hover {
    text-decoration: underline;
}

/*--------------------------------------------*/
/*My skill                                    */
/*--------------------------------------------*/

.myskills {
    font-size: 20px;
    scroll-margin-top: 72px;
    background-color: var(--app-light-background);
}

.skills-box {
    margin-top: 30px;
}

.skills-part {
    display:flex;
    flex-wrap: wrap;
    justify-content:center;
    margin-top: 20px;
    gap: 10px;
}

/*--------------------------------------------*/
/*My project                                  */
/*--------------------------------------------*/

.my-projects {
    scroll-margin-top: 72px;
}

.example-wrapper {
    width: 1200px;
    overflow: hidden;
    margin: auto;
}

.example-container {
    transition: transform 0.5s ease-in-out;
}

.example {
    margin: 30px 0;
    width: 270px;
    flex-shrink: 0;
    margin-right: 40px;
    border-radius: 15px;
}

.example:hover {
  cursor: pointer;
}

.project {
    width: 100%;
    height: 140px; 
    border-radius: 15px;
    border: 1px solid var(--app-dark-background);
}

.project-title {
    margin-top: 10px;;
    color:var(--app-subtopic-color);
}

.example p {
    margin: 10px 0;
    color:var(--app-subtopic-color);
}

.example a{
    display:flex;
    gap:5px;
    align-items:center;
    text-decoration: none;
    font-size: 14px;
}

.example a:hover {
    text-decoration:underline;
}

.projects-github a {
    text-decoration: none;
    color: var(--app-topic-color);
    font-weight: 500;
}

.projects-github a:hover {
    text-decoration:underline;
}

.scroll-btn-group {
    display: flex;
    gap:100px;
}

.backword-btn, .forward-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--app-subtopic-color);
    color:var(--app-subtopic-color);
    background-color: #fff;
    transition: ease-in-out 0.25s;

    i {
        font-size: 18px;
    }
}

.backword-btn:hover, .forward-btn:hover {
    background-color: var(--app-subtopic-color);
    color:#fff;
}

.example-explore {
    display:grid;
    justify-content: space-between;
}

.example-demo {

    color:var(--app-topic-color);
}

.example-code {
    
    color:#0a66c2;
}

/*--------------------------------------------*/
/*Contact me                                  */
/*--------------------------------------------*/
.contact-me {
    scroll-margin-top: 72px;
    background-color: var(--app-light-background);
}

.contact-form {
    margin-top:30px;
}

.contact-form label {
    color: var(--app-subtopic-color);
    font-size: 20px;
}

.contact-form input {
    width: 500px;
    height:50px;
    font-size: 20px;
    margin-top:10px;
    padding:15px;
    border-radius: 10px;
    border: 1px solid var(--app-dark-background);
    line-height: 50px;
}

.contact-form textarea {
    width: 500px;
    height:200px;
    font-size: 20px;
    margin-top:10px;
    padding:15px;
    border-radius: 10px;
    resize: none;
    border: 1px solid var(--app-dark-background);
}

.contact-form button {
    width: 500px;
    height:50px;
    font-size: 20px;
    margin-top:10px;
    border-radius: 10px;
    background-color:  var(--app-topic-color);
    line-height: 50px;
    color: var(--app-subtopic-color);
    border-radius: 50px;
    font-weight: 500;
    transition: 0.5s ease;
}

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

.result-message {
    display: none;
    margin-top: 10px;
}

/*--------------------------------------------*/
/*Footer                                      */
/*--------------------------------------------*/

footer {
    height: 72px;
    background-color: var(--app-footer-color);
    justify-content: center;
    line-height: 72px;
    font-size: 18px;
    color: #fff;
}

.fa-envelope {
    font-size: 20px;
    line-height: 72px;
    margin-right:10px;
}

/*--------------------------------------------*/
/*Media screen                                */
/*--------------------------------------------*/

@media screen and (max-width: 1200px) {
  .example-wrapper {
    width: 100%;    /* 变成100%宽度，适应容器 */
    padding: 0 15px; /* 给左右留点内边距 */
  }
}

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

    .hero-banner-title {
        font-size: 40px;
    }

    .hero-banner-subtitle {
        font-size: 20px;
    }

    .aboutme-content {
        display: grid;
        place-items: center;
    }

    .image-two {
        width: 200px;
        height: 200px;
    }

    .contact-form {
        width:85%;
    }

    .contact-form input,
    .contact-form textarea,
    .contact-form button {
        width: 100%;
    }

    .detail {
        font-size: 18px;
        line-height: 32px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility:hidden;
    }

    .fa-chevron-down {
        display:none;
    }

    .tag {
        display: none;
        position: absolute;
        top: 72px;
        right: 0;
        width: 150px;
        background-color: var(--app-light-background);
        flex-direction: column;
        text-align: center;
        z-index: 1000;
    }

    .tag.show {
        display: grid;
        gap: 0;
    }

    .tag a {
        font-size: 18px;
    }

    .media-shortcuts {
        display: none;
    }

    .skills-box {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .skills-part {
        display:grid;
        place-items: center;
        gap: 0;
    }

   .example-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .example {
        width: calc(50% - 20px);
        margin-right: 0;
    }

    .project {
        width: 100%;
    }

    .scroll-btn-group {
        display:none;
    }
    
    .sub-topic {
        font-size: 30px;
    }
}

@media screen and (max-width: 480px) {
    header h1 {
        font-size: 20px;
    }

    .tag {
        gap: 10px;
    }

    .fa-github, .fa-linkedin {
        font-size: 32px;
    }

    .hero-banner-title {
        font-size: 30px;
    }

    .hero-banner-subtitle {
        font-size: 16px;
    }

    .discover-more {
        width: 160px;
        font-size: 16px;
    }

    .sub-topic {
        font-size: 20px;
    }

    .example {
        width: 100%;
    }

    .skills-box {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-form label {
        font-size: 18px;
    }

    footer {
        font-size: 14px;
        padding: 0 10px;
        text-align: center;
    }
}
