:root {
    --line-color: #4a4a4a7b;
}

* {
    margin: 0;
    padding: 0;
    font-family: Microsoft JhengHei;
    list-style: none;
}

html {
    position: relative;
    height: 100%;
}

body {
    position: relative;
    display: grid;
    grid-template-rows: min-content min-content auto min-content;
    min-height: 100%;
}

header {
    border-bottom: 1px var(--line-color) solid;
    padding: 8px;
    display: grid;
    grid-template-columns: min-content auto min-content;
    align-items: center;
}

header .logo {
    text-wrap: nowrap;
    font-size: 20px;
    font-weight: bolder;
}

header .logo img {
    width: 40px;
    height: 40px;
    vertical-align: middle;
}

header .burger-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
}

header .burger-btn img {
    width: 40px;
}

.menu-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s ease;
}

.menu-panel.active {
    grid-template-rows: 1fr;
}

.menu-panel > div {
    overflow: hidden;
}

.menu-panel .menu-panel-content {
    padding: 10px;
    background-color: #f1efef;
}

#main {
    padding: 20px;
}

#main .main-subtitle {
    border-bottom: 1px var(--line-color) solid;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#main .tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, max-content));
    grid-gap: 16px;
    justify-content: space-evenly;
    padding: initial;
    margin-bottom: 20px;
}

#main .tool-cards .tool-card {
    display: grid;
    grid-template-rows: max-content max-content auto;
    row-gap: 10px;
    justify-content: center;
    box-sizing: border-box;
    width: 350px;
    height: 100%;
    border: 1px var(--line-color) solid;
    border-radius: 10px;
    padding: 15px;
    background-color: #f8f8f8;
}

#main .tool-cards > a {
    color: #000;
    text-decoration: none;
}

#main .tool-cards .tool-card:hover {
    box-shadow: 0 0 5px #707070;
    cursor: pointer;
}

#main .tool-cards .tool-card .title {
    text-align: center;
    font-weight: bold;
}

#main .tool-cards .tool-card .demo-img {
    width: 100%;
    height: 150px;
}

#main .gadgets {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#main .gadgets a {
    color: #000;
    text-decoration: none;
    border: var(--line-color) solid 1px;
    border-radius: 10px;
    padding: 8px;
}

#main .gadgets a:hover {
    box-shadow: 0 0 5px #707070;
}

#main .games-wrap {
    position: relative;
    margin-bottom: 20px;
}

#main .games-wrap .flappy-bird {
    width: 40px;
    transform: rotateZ(-20deg);
}

#main .games-wrap .ghosts {
    position: absolute;
    right: 0;
    top: 0;
}

#main .games-wrap .ghosts img {
    width: 32px;
    height: 32px;
    transform: rotateY(180deg);
}

#main .games-wrap .games {
    margin-left: 40px;
    margin-right: 40px;
}

#main .games-wrap .games a {
    color: #000;
    text-decoration: none;
    padding: 8px;
    border: var(--line-color) solid 1px;
    border-radius: 10px;
}

#main .games-wrap .games a:hover {
    box-shadow: 0 0 5px #707070;
}

#main .code-judge-solutions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

#main .code-judge-solutions a {
    color: #000;
    text-decoration: none;
    padding: 8px;
    border: var(--line-color) solid 1px;
    border-radius: 10px;
}

#main .code-judge-solutions a:hover {
    box-shadow: 0 0 5px #707070;
}

footer {
    background-color: #2e2e2e;
    color: #fff;
    border-top: 1px var(--line-color) solid;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 20px;
    padding-right: 20px;
}

footer .footer-body {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: space-evenly;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer .copyright {
    text-align: center;
}

footer .icon-group img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

footer .footer-body h2 {
    text-wrap: nowrap;
}

footer .contact-us {
    display: grid;
    grid-template-rows: repeat(2, min-content);
}