*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    cursor: default;
}
html,
body {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--body-color);
    font-family: 'KaiTi';
    overflow-y: hidden;
    border: 2px solid var(--header-color);
}
button {
    cursor: pointer;
}
a {
    color: #000;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.english {
    font-family: 'Times New Roman', Times, serif;
}
.header {
    width: 100%;
    height: var(--header-height);
    background: var(--header-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 .5rem;
}
.logo {
    width: max-content;
    height: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: calc(var(--header-height) * .75);
    font-weight: 900;
    color: var(--color-yellow);
    position: relative;
}
.icon:hover {
    text-decoration: none;
}
.title {
    font-family: 'Times New Roman', Times, serif;
    text-decoration: underline;
    color: inherit;
}
.subtitle {
    font-size: 1rem;
    position: absolute;
    bottom: 10px;
    right: 0;
    transform: translateX(100%);
    color: inherit;
}
.subtitle:hover {
    text-decoration: none;
}
.header-right {
    display: flex;
    align-items: center;
}
.searcher {
    font-size: 0;
    display: inline;
    height: calc(var(--header-height) * .6);
}
.searcher > * {
    height: 100%;
    border: none;
    outline: none;
    vertical-align: middle;
    font-family: "KaiTi";
    font-size: 1rem;
    font-weight: 900;
}
.searcher > input {
    width: 300px;
    max-width: 30vw;
    border-radius: 2px 0 0 2px;
    padding-left: 6px;
    border: 2px solid var(--color-yellow);
}
.searcher > input::placeholder {
    font-style: italic;
    text-indent: 4px;
}
.searcher > select {
    width: 60px;
    background: var(--color-yellow);
}
.searcher > button {
    border-left: 1px solid var(--color-green);
    width: 40px;
    background: var(--color-yellow);
    border-radius: 0 2px 2px 0;
}
.header-button {
    font-size: 1rem;
    width: max-content;
    height: calc(var(--header-height) * .6);
    padding: 0 4px;
    border: none;
    outline: none;
    margin-left: .5rem;
    border-radius: 2px;
    background: var(--color-green);
}
#container {
    overflow: hidden;
    height: calc(100vh - var(--header-height));
    position: relative;
}
#materials {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--material-width));
    grid-template-rows: var(--material-height);
    gap: 1.5rem;
    padding: 2rem;
    justify-content: center;
    overflow-x: hidden;
    filter: blur(10px);
}
.material-container {
    position: relative;
}
.material {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--material-color);
    top: 0;
    border-radius: 6px;
    box-shadow: 3px 3px 10px gray;
    border: solid 5px var(--color-orange);
    height: var(--material-height);
}
.material-container:hover .material {
    filter: brightness(40%);
    box-shadow: 10px 10px 2px gray;
}
.material-container:hover .material-modal {
    opacity: 1;
}
.material-image,
.material-image > img {
    width: var(--material-image-width);;
    height: calc(var(--material-height) - 10px);
}
.material-image > img {
    object-fit: cover;
}
.material-info {
    width: calc(var(--material-width) - var(--material-image-width));
    height: var(--material-height);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}
.material-info > .name,
.material-info > .author,
.material-info > .year {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
#materials .info {
    text-decoration: underline;
    font-weight: 900;
}
#materials .material-name {
    position: absolute;
    margin: auto 5px;
    right: 0;
    left: 0;
    font-weight: 900;
    height: max-content;
    padding: 0.5rem;
    bottom: 5px;
    text-align: center;
    background: #F5CD3B;
    color: #fff;
    word-break: break-all;
}
.material-modal {
    position: absolute;
    margin: auto 5px;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
    height: max-content;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.material-modal:hover {
    opacity: 1;
}
#materials .material-modal .urls {
    color: #fff;
    width: max-content;
    height: max-content;
    padding: 1rem;
    background: var(--color-orange);
    border-radius: 2px;
    font-weight: 900;
}
#no-result {
    width: max-content;
    max-width: 600px;
    height: max-content;
    position: fixed;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    font-size: 2rem;
    color: var(--color-orange);
    font-weight: 900;
    font-style: italic;
    display: none;
    padding: 1rem;
}
.about,
.changelog {
    position: fixed;
    width: 800px;
    max-width: 80vw;
    height: 600px;
    max-height: 60vh;
    padding: 2rem;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    z-index: 100;
    background: rgba(0,0,0, 0.7);
    color: ivory;
    border-radius: 4px;
    box-shadow: 4px 4px 10px gray;
    font-size: 1.2rem;
    border: 6px solid var(--color-orange);
    overflow: auto;
}
.about p {
    margin-bottom: 1rem;
}
.about a,
.changelog a {
    color: var(--color-light-blue);
}
fieldset {
    margin-bottom: 1rem;
    padding: 1rem;
}
.modal {
    width: 600px;
    max-width: 90vw;
    height: max-content;
    max-height: 60vh;
    position: fixed;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    font-size: 1.2rem;
    padding: 1.5rem;
    background: var(--color-light-green);
    border-radius: 4px;
    box-shadow: 4px 4px 20px 2px;
    animation: fadeIn 2s ease-in-out;
}
.modal a {
    color: var(--color-dark-blue);
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
@keyframes blurOut {
    from {
        filter: blur(10px);
    }
    to {
        filter: blur(0);
    }
}
.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-content p {
    width: 100%;
    font-weight: 900;
}
.modal-content button {
    padding: .5rem 1rem;
    background: var(--color-yellow);
    margin-top: 1rem;
}
.new {
    order: -1;
}
.new .material::before {
    content: 'new🏳️‍🌈';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    font-weight: 900;
    color: ivory;
    border: 2px solid #F5E866;
    border-radius: 4px;
    background: #DA4F2C;
    font-family: 'Time New Roman';
}
@media screen and (max-width: 1120px) {
    #logo {
        margin-left: 2px;
    }
    .subtitle {
        display: none;
    }
}
@media screen and (max-width: 990px) {
    .title {
        display: none;
    }
    #no-result {
        max-width: 90vw;
    }
}
@media screen and (max-width: 520px) {
    .header-right > .header-button {
        display: none;
    }
}
@media screen and (max-width: 260px) {
    .searcher > select {
        display: none;
    }
}
@media screen and (max-width: 170px) {
    .searcher {
        display: none;
    }
}
