@media (prefers-color-scheme: dark) {
    :root {
        --tt: #fff;
        --bg: #000;
        --bg2: #22191b;
        --bd: #dcdcdc;
        --bd2: #551d30;
        --hl: #ffb1c5;
    }
}

:root {
    --tt: #fff;
    --bg: #000;
    --bg2: #22191b;
    --bd: #dcdcdc;
    --bd2: #551d30;
    --hl: #ffb1c5;
    interpolate-size: allow-keywords;
}

body {
    color: var(--tt);
    background: var(--bg);
    margin: 0;
    overscroll-behavior-y: contain;
    font-family: 'Noto Serif JP',
        'Hiragino Mincho ProN',
        'Yu Mincho',
        'MS Mincho',
        'BIZ UDMincho',
        serif;
}

main {
    margin: auto;
    padding: 0 .8em .4em .8em;
    overflow-x: clip;
    max-width: 26em;
    user-select: none;
}

footer {
    font-size: 95%;
    padding: 1em;
    margin-top: 1em;
    background: var(--bg2);
    padding-bottom: 5em;
    columns: 20em;
    column-gap: 4em;
    column-rule: 3px dashed var(--bd);
}

details {
    margin: .7em 0;
    transition: height 0.6s ease;
    height: 1em;

    &[open] {
        height: auto;
    }
}

summary {
    font-weight: bold;
    margin-left: .8em;
}

h1 {
    font-size: 120%;
    margin: 0;
    margin-bottom: .5em;
}

::-webkit-search-cancel-button {
    display: none;
}

input {
    margin: 0;
    outline: none;
    accent-color: var(--hl);
    flex: 1;
    background: unset;
    min-width: 0;
    font-family: inherit;
}

[type="search"] {
    color: var(--tt);
    border: 0;
    border-bottom: 2px solid var(--bd);
    font-size: 105%;
    margin: .1em 0;
}

[type="search"]+span::before {
    content: '✕';
    color: var(--hl);
    font-weight: bold;
    width: 1em;
    margin-left: -1.2em;
    cursor: pointer;
}

textarea+span::before {
    content: '✕';
    color: var(--hl);
    font-weight: bold;
    width: 1em;
    margin-left: -1.2em;
    cursor: pointer;
    position: absolute;
    margin-left: 2em;
}


[type="checkbox"] {
    vertical-align: middle;
}

label {
    vertical-align: middle;
}

fieldset{
    margin:.4em 0;
    padding:0 0 .4em .6em;
    border-style:dashed;
}

legend{
    font-size: 80%;
}

.card {
    background: var(--bg2);
    border-radius: 25px;
    padding: .8em;
}

.box {
    background: var(--bg);
    border: 1px solid var(--bd2);
    border-radius: 25px;
    padding: .4em .8em;
    margin: .3em 0;
}

textarea {
    color: var(--tt);
    background: var(--bg);
    margin-right: -4em;
    padding: .5em;
    font-family: 'Courier New', monospace;
    border-color: var(--bd2);
}

button {
    all: unset;
    background: var(--bd2);
    border-radius: 28px;
    padding: .3em .8em;
    font-size: 90%;
}

button:active,
.key span:active {
    background: var(--hl);
}

.flex {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.key span {
    display: inline-block;
    border-radius: 28px;
    border: 1px solid var(--hl);
    padding: .15em .3em .3em .4em;
    margin: .12em .1em;
    min-width: 1.2em;
    text-align: center;
    letter-spacing: -.1em;
    cursor: pointer;
    line-height: 1;
    font-size: 90%;
    letter-spacing: 1px;
}

.ml span {
    width: 2em;
    display: inline-block;
    text-align: center;
    border: 1px solid var(--bd);
    line-height: 1;
    padding-bottom: .1em;
}

a {
    color: var(--hl);
    user-select: none;
}

i {
    font-family: times;
}

ul {
    margin: .5em 0;
    padding-left: 1.84em;
}

li {
    margin: .1em 0;
}

/*词类*/
.classkey {
    position: sticky;
    top: 2px;
    z-index: 2;
    margin: 0;
}

.classkey summary,
.classkey summary::-webkit-details-marker {
    list-style: none;
    position: absolute;
    right: -.8em;
    background: var(--bd2);
    padding:2px .5em 5px .5em;
    line-height: 1;
    box-shadow: var(--bg) 0 0 5px;
}

.classkey summary:after {
    content: "☰";
    padding-left: .4em;
    font-weight: bold;
}

.classkey[open] summary:after {
    content: "✕";
    color: red;
}

.classkey+div {
    background: var(--bg2);
    width: calc(100% + 1.4em);
    padding: .6em 0 .8em .6em;
    transform: translateX(120%);
    margin-bottom: -12.6em;
    transition: all .5s;
    position: sticky;
    top: 2px;
    z-index: 1;
    box-shadow: var(--bg) 0 0 6px;
}

.classkey[open]+div {
    transform: translateX(-1em)
}

.classkey+div small {
    color: #999;
    display: block;
    text-align: center;
}

.classkey+div div {
    display: flex;
    margin: 0 .1em;
}

.classkey+div span {
    padding-top:.2em;
}

/*表格*/
#progressBar {
    text-align: center;
    vertical-align: middle;
    position: sticky;
    top: 2px;
    padding: 0 0 .1em 0;
    margin-bottom: .5em;
    background: var(--bg);
    z-index: 8;
    box-shadow: var(--bg) 5px 0 6px;
}

table * {
    transition: all .4s;
}

table {
    border-collapse: collapse;
    table-layout: fixed;
}

#resultsTable {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="310" height="180"><text x="10" y="30" transform="rotate(-30, 90, 30)" fill="rgba(0,0,0,0.2)">@ky4kayezu</text><text x="110" y="70" transform="rotate(-30, 220, 50)" fill="rgba(0,0,0,0.2)">音kotobasiori栞</text></svg>');
  background-repeat: repeat;
}


td {
    border: 1px solid var(--bd);
    text-align: left;
    word-break: break-all;
    overflow-wrap: break-word;
    height: 1em;
}

thead td {
    font-weight: bold;
    font-family: times;
    font-style: unset;
}

[trans] {
    font-family: times;
    font-style: italic;
    padding-left: .5em;
}

[acc] {
    text-align: center;
}

[ety] {
    white-space: nowrap;
}

div::-webkit-scrollbar {
    display: none;
}

[acc] span {
    display: none;
}

.ska [acc] :nth-child(1),
.sra [acc] :nth-child(2),
.sla [acc] :nth-child(3) {
    display: inline;
}

u {
    text-decoration: inherit;
    text-decoration-thickness: .15em !important;
    position: relative;
    display: inline-block;
    line-height: 1;
    padding-bottom: 1px;
}

u::before,
u::after {
    color: var(--tt);
    font-size: .7em;
    border-radius: 2px;
    background: #551d30aa;
    border: 1px solid var(--bd2);
    position: absolute;
    top: -.4em;
    box-shadow: 1px 1px 2px var(--bg2);
    transform: scaleX(.8);
    transform-origin: center;
    font-style: normal;
    font-weight: bold;
    z-index: 1;
}

[go] {
    color: var(--bg);
    background: #e57373;
}

[gk] {
    color: var(--bg);
    background: #e65100;
}

[ka] {
    color: var(--bg);
    background: #ffc107;
}

[to] {
    color: var(--bg);
    background: #aed581;
}

[x1] {
    color: var(--bg);
    background: #4dd0e1;
}

[x2] {
    color: var(--bg);
    background: #ba68c8;
}

[sk] {
    text-decoration: underline;
    text-decoration-color: var(--tt) !important;
}

[kn],
[kn] u {
    color: #888 !important;
    font-style: italic;
    text-shadow:
        -.5px -.5px 0 #000,
        0.5px -.5px 0 #000,
        -.5px 0.5px 0 #000,
        0.5px 0.5px 0 #000,
        -.7px 000px 0 #000,
        0.7px 000px 0 #000,
        000px -.7px 0 #000,
        000px 0.7px 0 #000;
}

[kn] u:nth-child(n) {
    z-index: 4;
}

[kn] u:nth-child(2n) {
    z-index: 3;
}

[kn] u:nth-child(3n) {
    z-index: 2;
}

[kn] u:nth-child(4n) {
    z-index: 1;
}


[sc] {
    text-decoration: underline double;
    text-decoration-color: var(--tt) !important;
}

[p]::before {
    content: 'Ｐ';
    right: -.3em
}

[t]::before {
    content: 'Ｔ';
    right: -.3em
}

[k]::before {
    content: 'Ｋ';
    right: -.3em
}

[h]::after {
    content: 'Ｈ';
    left: -.3em
}

[lc]::before {
    content: '長';
    left: -.3em
}

[sv]::before {
    content: '舒';
    left: -.3em
}

[cv]::before {
    content: '連';
    left: -.3em
}