/*******************************************************************************
 * 基本设置
 ******************************************************************************/

*,
::after,
::before {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    /* 解决打印页面，背景色丢失的问题 */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

ol {
    list-style: none;
}

ul {
    list-style: none;
}

li {
    list-style: none;
}

a {
    text-decoration: none;
}

a:link {
    color: var(--blog-a-color);
    background-color: var(--blog-a-color-bg);
    -webkit-tap-highlight-color: transparent;
}

a:visited {
    color: var(--blog-a-color);
    background-color: var(--blog-a-color-bg);
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    color: var(--blog-a-color-hover);
    background-color: var(--blog-a-color-hover-bg);
    -webkit-tap-highlight-color: transparent;
}

a:active {
    color: var(--blog-a-color);
    background-color: var(--blog-a-color-bg);
    -webkit-tap-highlight-color: transparent;
}

input {
    outline: none;
    background: transparent;
    border: none;
}

input:focus {
    outline: none;
    background-color: transparent;
}

textarea {
    outline: none;
    background: transparent;
    border: none;
}

textarea:focus {
    outline: none;
    background-color: transparent;
}

button {
    outline: none;
    font-size: 1rem;
    padding: var(--blog-btn-padding);
    border: var(--blog-border-size) solid black;
    color: var(--blog-btn-color);
    background-color: var(--blog-btn-color-bg);
}

button:hover {
    color: var(--blog-btn-color-hover);
    background-color: var(--blog-btn-color-hover-bg);
}

button:active {
    color: var(--blog-btn-color);
    background-color: var(--blog-btn-color-bg);
}

/*******************************************************************************
 * 按钮
 ******************************************************************************/

label.btn {
    display: block;
    font-size: 1rem;
    padding: var(--blog-btn-padding);
    border: var(--blog-border-size) solid black;
    color: var(--blog-btn-color);
    background-color: var(--blog-btn-color-bg);
}

label.btn:hover {
    color: var(--blog-btn-color-hover);
    background-color: var(--blog-btn-color-hover-bg);
}

label.btn:active {
    color: var(--blog-btn-color);
    background-color: var(--blog-btn-color-bg);
}

a.btn {
    display: block;
    font-size: 1rem;
    padding: var(--blog-btn-padding);
    border: var(--blog-border-size) solid black;
    color: var(--blog-btn-color);
    background-color: var(--blog-btn-color-bg);
}

a.btn:hover {
    color: var(--blog-btn-color-hover);
    background-color: var(--blog-btn-color-hover-bg);
}

a.btn:active {
    color: var(--blog-btn-color);
    background-color: var(--blog-btn-color-bg);
}

/*******************************************************************************
 * 容器
 ******************************************************************************/

.container {
    max-width: var(--blog-container-max-width);
    padding: 0 0.75rem;
    margin: 1rem auto 2rem auto;
}

/*******************************************************************************
 * 顶部
 ******************************************************************************/

.container>header {
    display: flex;
    flex-direction: column;
    padding-bottom: 0.5rem;
    border-bottom: 0.2rem solid black;
}

/*******************************************************************************
 * 底部
 ******************************************************************************/

.container>footer {
    padding-top: 0.5rem;
    border-top: 0.2rem solid black;
}

/*******************************************************************************
 * 主体
 ******************************************************************************/

.container>main {
    margin: 1rem 0;
}

/*******************************************************************************
 * LOGO
 ******************************************************************************/

.logo {
    text-align: center;
    margin-bottom: 1rem;
}

/*******************************************************************************
 * 工具栏
 ******************************************************************************/

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.toolbar>:last-child {
    flex: 1 1 auto;
}

/*******************************************************************************
 * 面包屑导航栏
 ******************************************************************************/

.breadcrumb>ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb>ol>li:not(:last-child)::after {
    content: "/";
    padding: 0 0.375rem;
    color: var(--blog-color-text-disabled);
}

.breadcrumb>ol>li:last-child a {
    --blog-a-color: var(--blog-color-text-disabled);
    --blog-a-color-bg: transparent;
    --blog-a-color-hover: var(--blog-color-text-disabled);
    --blog-a-color-hover-bg: transparent;

    pointer-events: none;
}

.breadcrumb>ol>li span {
    color: var(--blog-color-text-disabled);
}

/*******************************************************************************
 * 菜单
 ******************************************************************************/

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.menu>li:not(:first-child)::before {
    content: "|";
    padding: 0 0.375rem;
    color: var(--blog-color-text-disabled);
}

.menu .disabled {
    color: var(--blog-color-text-disabled);
}

/*******************************************************************************
 * 模块导航
 ******************************************************************************/

.module-nav {
    margin-top: 1rem;
}

.module-nav>ul {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.module-nav>ul>li:not(:first-child) {
    margin-top: 0.5rem;
}

/*******************************************************************************
 * 表单
 ******************************************************************************/

.form {
    display: flex;
    flex-direction: column;
}

.form>*:not(:first-child) {
    margin-top: 0.5rem;
}

.form-input-group {
    display: flex;
}

.form-input-group>* {
    border: var(--blog-border-size) solid black;
}

.form-input-group>*:not(:first-child) {
    border-left: none;
}

.form-input-group>label {
    padding: 0.375rem 0.75rem;
    color: var(--blog-color-text);
    background-color: var(--blog-color-text-bg);
}

.form-input-group>input {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0.375rem 0.75rem;
    color: var(--blog-color-text);
}

.form-input-group>textarea {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0.375rem 0.75rem;
    color: var(--blog-color-text);
    resize: vertical;
    min-height: calc(1.5rem + 0.75rem + 2px);
}

.form-input-group>.form-radio-group {
    flex: 1 1 auto;
}

.form-radio-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.form-radio-group-item {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    color: var(--blog-color-text);
}

.form-radio-group-item input[type=radio] {
    width: 1rem;
    height: 1rem;
}

.form-radio-group-item>*:not(:first-child) {
    margin-left: 0.375rem;
}

/*******************************************************************************
 * 错误提示框
 ******************************************************************************/

.alert {
    display: flex;
    flex-direction: column;
    background-color: var(--blog-alert-color-bg);
    padding: 1rem;
    border: var(--blog-border-size) solid var(--blog-alert-color-border);
}

.alert>*:not(:first-child) {
    margin-top: 0.75rem;
}

/*******************************************************************************
 * 分页导航栏
 ******************************************************************************/

.pagination {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: var(--blog-border-size) solid black;
}

.pagination>ul {
    display: flex;
    justify-content: center;
}

.pagination li:not(:first-child) {
    margin-left: 0.75rem;
}

.pagination a.active {
    text-decoration: underline;
}

.pagination a.disabled {
    pointer-events: none;
    color: var(--blog-color-text-disabled);
}

/*******************************************************************************
 * 文章列表
 ******************************************************************************/

.article-list {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.article-list>li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.article-list>li:not(:first-child) {
    margin-top: 0.5rem;
}

.article-list .article-lock {
    height: 1rem;
    margin-right: 0.5rem;
}

.article-list .article-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.article-list .article-timestamp {
    font-size: 0.875rem;
    white-space: nowrap;
    flex: 1 1 auto;
    text-align: right;
    color: var(--blog-color-text-disabled);
}

/*******************************************************************************
 * 文章详情
 ******************************************************************************/

.article .article-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.article .article-title {
    word-break: break-all;
    text-align: center;
}

.article .article-metadata {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--blog-color-text-disabled);
}

.article .article-metadata>* {
    white-space: nowrap;
}

.article .article-metadata>*:not(:first-child) {
    margin-left: 0.375rem;
}

.article .article-metadata-item {
    display: flex;
    align-items: center;
}

.article .article-metadata-item img {
    height: 0.875rem;
    margin-right: 0.25rem;
}

.article .article-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    margin-top: 0.5rem;
}

.article .article-tags>* {
    padding: 0 0.375rem;
}

.article .article-main {
    word-break: break-all;
}

/*******************************************************************************
 * 文章附件
 ******************************************************************************/

.article-attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0.5rem 0 0.5rem;
    max-width: 100%;
    font-size: 0.875rem;
    margin-top: 1rem;
    border-top: var(--blog-border-size) solid black;
}

.article-attachment-list .article-attachment-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid black;
    transition: all 0.2s ease;
}

.article-attachment-list .article-attachment-item:hover {
    border-color: #4096ff;
    box-shadow: 0 0.125rem 0.5rem rgba(64, 150, 255, 0.1);
}

.article-attachment-item .article-attachment-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.article-attachment-item .article-attachment-exts {
    display: flex;
}

.article-attachment-exts .article-attachment-size {
    margin-right: 0.25rem;
    white-space: nowrap;
}

.article-attachment-exts .article-attachment-download-btn {
    white-space: nowrap;
}

/*******************************************************************************
 * 文章解锁页面
 ******************************************************************************/

.article-unlock {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.article-unlock .article-title {
    word-break: break-all;
    text-align: center;
}

/*******************************************************************************
 * 模态框
 ******************************************************************************/

.modal {
    z-index: 1000;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    margin: 1.75rem auto;
    max-width: var(--blog-modal-max-width);
    width: var(--blog-modal-width);
}

.modal-header {
    font-size: 1.25rem;
    font-weight: bold;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 1rem;
}

.modal-footer>*:not(:first-child) {
    margin-left: 0.375rem;
}

.modal-main {
    padding: 1rem;
    border-top: var(--blog-border-size) solid var(--blog-modal-color-border);
    border-bottom: var(--blog-border-size) solid var(--blog-modal-color-border);
    color: var(--blog-color-text);
}

/*******************************************************************************
 * 模态框动画
 ******************************************************************************/

.modal.show {
    animation: modal-fade-in 0.3s ease forwards;
}

.modal.hide {
    animation: modal-fade-out 0.3s ease forwards;
}

.modal.show .modal-dialog {
    animation: modal-dialog-fade-in 0.3s ease forwards;
}

.modal.hide .modal-dialog {
    animation: modal-dialog-fade-out 0.3s ease forwards;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes modal-dialog-fade-in {
    from {
        transform: translateY(-8rem);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes modal-dialog-fade-out {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-8rem);
    }
}

/*******************************************************************************
 * 标签列表
 ******************************************************************************/

.tags {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.tags li {
    padding: 0.25rem 0.5rem;
}

/*******************************************************************************
 * 标签编辑
 ******************************************************************************/

#modal_edit_tag .modal-main {
    display: flex;
    flex-wrap: wrap;
}

#modal_edit_tag .modal-main>*:not(:last-child) {
    margin-right: 0.375rem;
}

.edit-tag-name {
    color: var(--blog-a-color);
}

/*******************************************************************************
 * 会话信息
 ******************************************************************************/

.session-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    word-break: break-all;
    line-height: 1.5;
}

.session-info>*:not(:first-child) {
    margin-top: 0.5rem;
}

.session-info-item>span:first-child::after {
    content: ":";
    padding: 0 0.375rem;
}

.permission-item {
    border-radius: 0.25rem;
    padding: 0 0.25rem;
    background-color: #dcdcdc;
}

/*******************************************************************************
 * 消息提示框
 ******************************************************************************/

.tips {
    z-index: 2000;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}

.tips>*:last-child {
    margin-bottom: 1.75rem;
}

.tips>* {
    margin: 0 auto 0.75rem auto;
}

.tips-item {
    color: var(--blog-tips-item-color);
    background-color: var(--blog-tips-item-color-bg);
    border: var(--blog-border-size) solid var(--blog-tips-item-color-border);
    border-radius: 0.25rem;
    padding: 0.5rem 1.25rem;
    max-width: var(--blog-tips-item-max-width);
    width: var(--blog-tips-item-width);
}

/*******************************************************************************
 * 消息提示框动画
 ******************************************************************************/

.tips-item.show {
    animation: tips-item-fade-in 0.3s ease forwards;
}

.tips-item.hide {
    animation: tips-item-fade-out 0.3s ease forwards;
}

@keyframes tips-item-fade-in {
    from {
        transform: translateY(8rem);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes tips-item-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}