/* 雾小蒜の小窝 | https://ciallovo.top */


@keyframes show-comment {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@-webkit-keyframes show-comment {
    from { opacity: 0; -webkit-transform: translateY(10px); }
    to   { opacity: 1; -webkit-transform: translateY(0); }
}

.comment-zone {
    background: var(--white_10);
    border-radius: 10px;
    padding: 5px 20px 25px;
    margin: 3vh 12% 20px;
    line-height: 1em;
    position: relative;
}

.comment-zone > hr {
    margin-top: 0;
    border: 0;
    height: 1px;
    background-color: var(--white_20);
}

.comment-zone > h2 {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow-wrap: break-word;
}

.comment-list {
    margin-top: 10px;
}

.comment {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    background-color: var(--white_10);
    border: 1px solid var(--white_50);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
    animation: show-comment 0.5s ease forwards;
    z-index: 99;
    position: relative;
}

.comment__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.comment__body {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.comment__author {
    font-size: 1.2em;
    margin: 0;
    overflow-wrap: break-word;
    word-break: break-all;
}

.comment__time {
    font-size: 0.7em;
    margin: 0.2em 0;
    line-height: 1.3em;
    color: inherit;
    overflow-wrap: break-word;
    word-break: break-all;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.comment__reply-link {
    margin: 0;
    padding: 0;
    line-height: 1.3em;
    font-size: 0.85em;
}

.comment__reply-link a {
    text-decoration: none;
    color: var(--brown);
}

.comment__reply-to {
    margin: 0 0 4px;
    font-size: 0.8em;
    color: var(--brown);
    opacity: 0.8;
    text-decoration: none;
    display: block;
    cursor: pointer;
    text-align: left;
}

.comment__reply-to:hover {
    opacity: 0.8;
    text-decoration: none;
}

.comment__reply-to:active,
.comment__reply-to:visited,
.comment__reply-to:focus,
.comment__reply-to:link {
    color: var(--brown);
    text-decoration: none;
    outline: none;
}

.comment__content {
    font-family: "CEFFontsCJK", sans-serif, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: block;
    margin: 5px 0 10px;
    padding: 0;
    line-height: 1.2em;
    font-size: 0.85em;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

.comment__content p {
    display: inline;
    margin: 0;
    padding: 0;
}

.reply {
    word-break: keep-all;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--white_90);
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 8px;
    flex-shrink: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.comment__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin-top: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.comment__like {
    margin-right: auto;
}

.comment__toggle-replies {
    margin-left: 0;
}

.comment__like {
    background: none;
    border: 1px solid var(--white_20);
    cursor: pointer;
    color: var(--white_90);
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background 0.2s;
}

.comment__like:hover {
    background-color: var(--white_10);
}

.comment__like.liked {
    color: #e74c3c;
}

.comment__like svg {
    display: block;
}

.reply:hover {
    background-color: var(--white_10);
}

.comment__replies {
    width: 100%;
    margin-top: 6px;
    box-sizing: border-box;
}

.comment__toggle-replies {
    background: none;
    border: none;
    color: var(--white_90);
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background 0.2s;
    font-family: "CEFFontsCJK", sans-serif, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.comment__toggle-replies:hover {
    background-color: var(--white_10);
}

.comment__replies-list {
    margin-top: 8px;
}

.comment--reply {
    border-color: var(--white_20);
    background-color: var(--white_10);
    margin-top: 8px;
    margin-bottom: 8px;
}

.comment--reply .comment__avatar {
    width: 48px;
    height: 48px;
}

.github-login-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background: none;
    border: none;
    color: var(--white_90) !important;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    font-size: 0.85em;
}

.github-login-btn svg {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.github-login-btn span {
    white-space: nowrap;
}

.github-login-btn:hover {
    background: none;
}

.github-user-info {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 10px 20px;
    padding: 5px 15px;
    background: var(--white_10);
    border-radius: 8px;
    border: 1px solid var(--white_20);
    width: fit-content;
    max-width: calc(100% - 40px);
    box-sizing: border-box;
}

.github-user-info img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.github-user-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.github-user-info .logout-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background: none;
    border: 1px solid var(--white_50);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.comment-form {
    margin-top: 20px;
    border: 1px solid var(--white_50);
    border-radius: 8px;
}

.comment-form__heading {
    margin: 15px 0 20px 20px;
    overflow-wrap: break-word;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.comment-form__field {
    margin: 10px 20px;
}

.comment-form__field label {
    display: block;
    font-size: 1em;
    line-height: 1.1em;
    color: var(--brown);
    overflow-wrap: break-word;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.comment-form__field--checkbox label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--white_90);
}

.comment-form input,
.comment-form textarea {
    font-family: "CEFFontsCJK", sans-serif, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
    padding: 4px;
    margin-top: 6px;
    background: none;
    border: 1.5px solid var(--white_90);
    border-radius: 4px;
    color: var(--white);
    outline: none;
    box-sizing: border-box;
}

.comment-form input[type="checkbox"] {
    width: auto;
    margin: 0 6px 0 0;
    display: inline-block;
    vertical-align: middle;
}

.comment-form input {
    font-weight: bold;
    font-size: 1em;
}

.comment-form textarea {
    display: block;
    font-size: 1.1em;
    height: 80px;
    word-break: break-all;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--white);
}

.comment-form__tip {
    margin: 10px 20px;
    font-size: 1em;
    line-height: 1.1em;
    color: var(--brown);
    overflow-wrap: break-word;
}

.comment-form__captcha {
    margin: 20px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.comment-form__captcha iframe {
    max-width: 100%;
}

@media (max-width: 768px) {
    .comment-form__captcha iframe {
        max-width: calc(100vw - 60px);
    }
}

.comment-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 15px;
}

.comment-form__submit {
    font-size: 0.9em;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    color: var(--white_90);
}

.comment-form__submit:hover {
    color: var(--white);
}

#send.sending {
    background-color: rgb(136, 136, 136);
    cursor: not-allowed;
    color: var(--white);
}

.error,
.success {
    margin: 0 20px 20px;
    border: 1px solid var(--white_50);
    border-radius: 8px;
}

.error {
    background: rgba(255, 0, 0, 0.06);
}

.success {
    background: rgba(9, 255, 0, 0.06);
}

.error p,
.success p {
    color: var(--white);
    animation: show-comment 0.5s;
    line-height: 1.1em;
    margin: 10px 20px;
}

#reply-preview {
    margin: 10px 20px;
    padding: 10px 15px;
    background-color: var(--white_10);
    border: 1px solid var(--white_50);
    border-radius: 6px;
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.95em;
}

#reply-preview:not(:empty) {
    display: flex;
}

#reply-preview a {
    color: var(--brown);
    text-decoration: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#reply-preview a:hover {
    text-decoration: underline;
}

#reply-preview button {
    background: none;
    border: 1px solid var(--white_50);
    color: var(--white_90);
    padding: 2px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    flex-shrink: 0;
}

#cancel-reply {
    border: none !important;
}

#reply-preview button:hover {
    background-color: var(--white_20);
}

@media (max-width: 768px) {
    .comment-zone {
        background: none;
        border-radius: 0;
        padding: 0;
        margin: 6px 3px 20px;
    }

    .comment-form__field,
    .comment-form__heading,
    .comment-form__tip,
    .comment-form__captcha,
    .error,
    .success,
    #reply-preview,
    .github-user-info {
        margin-left: 15px;
        margin-right: 15px;
    }

    .comment-form__heading {
        margin-top: 15px;
        margin-bottom: 20px;
    }

    .comment-form__captcha {
        text-align: center;
    }

    .comment-form__footer {
        margin: 10px 15px;
    }

    .github-user-info {
        max-width: calc(100% - 30px);
    }
}

.highlight-comment {
    background-color: rgba(229, 208, 174, 0.15) !important;
    border-color: var(--brown) !important;
    -webkit-transition: all 0.5s ease;
    transition: all 0.5s ease;
}