:root {
    --bg-color: #fff;
    --bg2-color: rgb(236, 236, 236);
    --bg3-color: #fff9;
    --color: #252525;
    --color2: #fff;
    --shadow-color: #9995;
    --hover-color: #dfdfdf;
    --display-word: visible;
    --display-phonetic: visible;
    --display-translation: hidden;
    --display-aeiouy: none;
    --display-yuan: var(--color);
    --display-fu: var(--color);
    --word-s: 8rem;
    --phonetic-s: 2rem;
    --translation-s: 2rem;
    --word-s-h: 1rem;
    --phonetic-s-h: 1rem;
    --translation-s-h: 1rem;
    --main-div-height: 100%;
    --spacing: 0.1em;
    --not-spell: 1fr 0 0;
    --value-max-k: 0;
    --value-max-s: 0;
}

html {
    width: 100%;
    height: 100%;
    color: var(--color);
    background-color: var(--bg-color);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.add-button {
    display: none;
}

.nav {
    position: relative;
    display: flex;
    z-index: 2;
    width: 100%;
    margin: 0;
    padding: 16px 0 16px 0;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-color) 0 0 10px;
    align-items: center;
}

.nav-item {
    list-style: none;
    margin: 0 8px 0 8px;
    padding: 11px 0 11px 0;
    cursor: pointer;
}

#nav2 {
    display: flex;
    padding: 0;
    margin: 8px 0;
    background-color: var(--bg-color);
    overflow-x: auto;
    flex-shrink: 0;
}
#nav2::-webkit-scrollbar {
    display: none;
}

#nav2 > li {
    list-style: none;
    margin: 0 10px 0 10px;
    padding: 4px;
    font-size: 1rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
    cursor: pointer;
}

.nav2-li-h {
    color: var(--color2);
    background: var(--color);
    border-radius: 10px;
}

#dropdown {
    border: none;
    background-color: var(--bg-color);
    font-size: 1rem;
    color: var(--color);
    margin-left: 8px;
    outline: none;
}

#spacing {
    -webkit-appearance: none;
    border-radius: 10px;
    background: var(--bg2-color);
    margin: 0;
}

#spacing::-webkit-slider-thumb {
    -webkit-appearance: none;
    background-color: var(--color);
    border-radius: 10px;
    height: 20px;
    width: 20px;
}

#main {
    width: 100%;
    padding: 0 80px;
    box-sizing: border-box;
    background-color: var(--bg-color);
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

#main > div {
    scroll-snap-align: center;
    height: var(--main-div-height);
}
word-card {
    display: grid;
    grid-template-columns: var(--not-spell);
    grid-template-rows: auto 1fr;
    height: 100%;
}

word-card:focus {
    outline: 1px dashed;
}

word-card div {
    transition: 0.3s;
}

word-card #word_bar {
    grid-area: 1 / 1 / 2 / 4;
    display: flex;
    justify-content: right;
    margin-top: 16px;
}

word-card #el {
    border-radius: 10px;
    margin: 0 16px 0 0;
    height: 20px;
    display: flex;
    align-items: center;
    overflow: hidden;
    min-width: calc(2 * 20px + 1em + 2 * 4px);
}

word-card #el > button {
    border: none;
    outline: none;
    padding: 0;
    height: 20px;
    aspect-ratio: 1;
}
word-card #el > span {
    margin: 0 4px;
    mix-blend-mode: difference;
    color: #fff;
    min-width: 1em;
    text-align: center;
}
word-card #n {
    display: none;
}

word-card #tags {
    flex-grow: 1;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

word-card #tags > div {
    border-radius: 10px;
    margin-right: 8px;
    display: flex;
    align-items: center;
}

word-card #tags > div > button {
    height: 20px;
    width: 20px;
    border-radius: 10px;
    background-color: var(--bg2-color);
    border: none;
    outline: none;
    cursor: pointer;
}

word-card #tags > input {
    margin: 0;
    background-color: #0000;
}

word-card :is(#n, #s)::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
}

word-card #word_bar > button {
    height: 20px;
    width: 20px;
    border-radius: 10px;
    background-color: var(--bg2-color);
    border: none;
    outline: none;
    margin-left: 16px;
}

word-card #word-main {
    overflow: hidden;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

word-card #word-main > #more {
    font-size: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

word-card #stems {
    display: flex;
    flex-wrap: wrap;
}

word-card #stems > span {
    margin: 0 1rem;
}

word-card #def {
    list-style: circle;
}

word-card #word_other {
    width: 100%;
    overflow: hidden;
}
word-card #word_other iframe {
    width: 100%;
    max-height: 100vh;
}

word-card #word_spell {
    overflow: hidden;
    transition: 0.3s;
}

.cx {
    background-color: #eee;
    border-radius: 1rem;
    padding: 0 8px;
}

#List {
    position: fixed;
    transform: translateX(-110%);
    top: 0;
    bottom: 0;
    z-index: 3;
    color: var(--color);
    background-color: var(--bg3-color);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: 0.3s;
    box-shadow: 0px 0px 8px 0px var(--shadow-color);
    padding: 16px 0 0 0;
    overflow-y: auto;
    outline: none;
}

lock-b {
    display: block;
    position: relative;
    top: 2px;
    display: inline-block !important;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    box-shadow: var(--shadow);
    border-radius: 4px;
    transition: var(--transition);
}
lock-b > input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
}
lock-b:hover {
    background-color: var(--hover-color);
}

#control {
    display: flex;
    flex-direction: column;
}

#leftList {
    overflow-y: scroll;
}

#chart {
    width: 100%;
    height: 60px;
    display: flex;
}
#chart > div {
    width: 6px;
    margin-right: 1px;
}
#chart > div > div {
    margin-bottom: 1px;
    box-shadow: 0 0 1px #5555;
    width: 6px;
    height: 6px;
}
.llul {
    padding: 0;
}

#word {
    visibility: var(--display-word);
}
#phonetic {
    visibility: var(--display-phonetic);
}
#translation {
    visibility: var(--display-translation);
}

input {
    border: none;
    outline: none;
    background-color: var(--bg2-color);
    margin: 8px;
}

#store_file > button {
    background-color: var(--bg2-color);
    margin: 8px;
    border: none;
    border-radius: 8px;
}

#upload_store {
    display: none;
}

.yuan {
    /* color: #34A353; */
    color: var(--display-yuan);
}

.fu {
    /* color: #87a8d6; */
    color: var(--display-fu);
}

.aeiouy {
    /* text-decoration: underline; */
    text-decoration: var(--display-aeiouy);
}

.syllable {
    box-shadow: 0 8px var(--color);
}

.syllable_s {
    width: var(--spacing);
    display: inline-block;
}

.other_dic {
    color: var(--color);
}

#bing {
    width: 100%;
    height: 0;
    border: none;
    flex-grow: 1;
}

#spellWord {
    width: 90%;
    /* height: 60px; */
    border: none;
    border-bottom: solid 2px var(--shadow-color);
    background-color: var(--bg-color);
    /* margin: 1rem; */
    /* font-size: 4rem; */
    padding: 0 0 10px 30px;
}

#spellWord:focus {
    outline: none;
}

#write {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    display: none;
}
#write_bar {
    position: fixed;
    right: 0;
    top: 0;
    display: none;
    z-index: 2;
}
#write_bar > div {
    width: 16px;
    height: 16px;
    margin: 8px;
    border-radius: 4px;
}

#write_bar > div:nth-child(1) {
    background-color: rgb(255, 92, 92);
}
#write_bar > div:nth-child(2) {
    background-color: rgb(155, 155, 155);
}
#write_bar > div:nth-child(3) {
    background-color: rgb(116, 252, 116);
}
@media (max-width: 900px) {
    :root {
        --word-s: 4rem;
        --phonetic-s: 1.6rem;
        --translation-s: 1.6rem;
        --word-s-h: 1rem;
        --phonetic-s-h: 1rem;
        --translation-s-h: 1rem;
    }
    .nav {
        padding: 8px 0 8px 0;
    }

    .cx {
        border-radius: 10px;
    }

    #main {
        padding: 0 8px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000;
        --color: #dadada;
        --bg2-color: #444;
        --bg3-color: #0009;
        --shadow-color: #6665;
        --hover-color: #333;
        --color2: #000;
    }

    .cx {
        background-color: #333;
    }

    label {
        color: #fff;
    }
}
