.loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    outline: 0;
    filter: blur(0px);
}

.blackback {
    background: rgba(0, 0, 0, 0.1);
}

.reading-width-unified {
    width: auto;
}

:root {
    --reading-block-gap-desktop: 2rem;
    --reading-block-gap-mobile: 1.35rem;
    --comments-inner-inset-desktop: 1rem;
    --comments-inner-inset-mobile: .5rem;
}

.reading-post-nav-shell {
    padding-top: 0;
    margin-top: var(--reading-block-gap-desktop);
}

.reading-sidebar-shell {
    padding-top: 0;
    margin-top: var(--reading-block-gap-desktop);
}

.post-nav-indicators {
    right: 0;
    bottom: 10px;
    left: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    margin-right: 10%;
    margin-left: 10%;
    padding: 0 12px;
}

.post-nav-title {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    margin: 0;
    padding: 18px 20px;
    text-align: center;
    color: #f5f7fa !important;
    background: linear-gradient(180deg, rgba(20, 28, 44, 0.56), rgba(20, 28, 44, 0.48));
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

.post-nav-title.text-info {
    color: #f5f7fa !important;
}

.post-nav-title-text {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    word-break: break-word;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-nav-icon {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    font-size: 1.5rem;
    color: #e8edf5;
    background: rgba(20, 28, 44, 0.5);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

@media (max-width: 767.98px) {
    .reading-post-nav-shell,
    .reading-sidebar-shell {
        margin-top: var(--reading-block-gap-mobile);
    }

    .post-nav-indicators {
        gap: 8px;
        margin-right: 6%;
        margin-left: 6%;
        padding: 0 8px;
    }

    .post-nav-title {
        min-height: 72px;
        padding: 14px 16px;
    }

    .post-nav-title-text {
        font-size: 1rem;
    }

    .post-nav-icon {
        flex-basis: 36px;
        font-size: 1.25rem;
    }
}

/* 内容图片：取消左右间隔，宽度撑满容器，高度自适应宽度。
   保留圆角与边框，与表格、代码框保持视觉一致。 */
.content img:not(.emoji) {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 1.5rem 0 0.5rem;
    position: relative;
    border-radius: .375rem;
    border: 1px solid #e9ecef;
    background-color: #f4f5f7;
}

/* 图片包装容器：用于显示图片名称 */
.content .img-wrapper {
    max-width: 100%;
    margin: 1.5rem 0;
    text-align: center;
}

.content .img-wrapper img {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 0;
    display: block;
}

/* 图片名称：显示在图片底部 */
.content .img-caption {
    font-size: 0.85rem;
    color: #8898aa;
    padding: 0.5rem 0 0;
    text-align: center;
    line-height: 1.4;
}

/* 懒加载占位符：图片未加载真实内容时显示加载动画。
   使用透明 GIF 占位符，lazyload.js 会将 data-original 复制到 src。 */
.content img[data-original]:not(.img-loaded) {
    min-height: 120px;
    background-color: #f4f5f7;
    background-size: cover;
    background-position: center;
    animation: img-loading-pulse 1.5s ease-in-out infinite;
}

@keyframes img-loading-pulse {
    0%, 100% {
        opacity: 1;
        background-color: #f4f5f7;
    }
    50% {
        opacity: 0.7;
        background-color: #eef0f2;
    }
}

/* 图片加载完成：移除动画，显示正常 */
.content img.img-loaded {
    animation: none;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.tu {
    width: 100%;
    height: 334px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.thumbnails {
    filter: blur(4px);
    transition: all 1.2s;
    max-width: 100%;
    vertical-align: middle;
}

/* 换行策略：仅在词边界换行，不截断英文单词内部。
   两端对齐让中英混排更美观。
   溢出处理交给子元素各自的滚动容器（table/pre/mjx-container），
   以及 body 的 overflow-x: hidden 作为最后防线。 */
.breakword {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: anywhere;
    text-align: justify;
    text-justify: inter-ideograph;
}

.pic:hover {
    transition: all 1.0s;
    transform: rotate(360deg);
    -ms-transform: rotate(360deg); /* IE 9 */
    -moz-transform: rotate(360deg); /* Firefox */
    -webkit-transform: rotate(360deg); /* Safari 和 Chrome */
    -o-transform: rotate(360deg); /* Opera */
}

.pic {
    transition: all 1.0s;
    transform: rotate(0deg);
    -ms-transform: rotate(0deg); /* IE 9 */
    -moz-transform: rotate(0deg); /* Firefox */
    -webkit-transform: rotate(0deg); /* Safari 和 Chrome */
    -o-transform: rotate(0deg); /* Opera */
}

.banner {
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    width: 100%;
    height: 100%;
    top: 0px;
    margin: 0 auto;
    position: relative;
    background-size: cover;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background-attachment: fixed;
}

.thumb a {
    height: 260px;
    position: relative;
    display: block;
    background-repeat: no-repeat;
    background-size: cover;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.complete {
    filter: blur(0);
}

img::after {
    content: "";
    height: 100%;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: url() no-repeat center;
}

.slidea {
    min-height: 72px;
    height: 168px;
}

.scrollbar {
    width: 30px;
    height: 300px;
    margin: 0 auto;
}

::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 10px;
    /*高宽分别对应横竖滚动条的尺寸*/
    height: 5px;
}

::-webkit-scrollbar-thumb {
    /*滚动条里面小方块*/
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: #777777;
}

::-webkit-scrollbar-track {
    /*滚动条里面轨道*/
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    border-radius: 10px;
    background: #EDEDED;
}

.banner {
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    width: 100%;
    height: 100%;
    top: 0px;
    margin: 0 auto;
    position: relative;
    background-size: cover;
}

.banner::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 0;
    background-attachment: fixed;
}

/* 移动端背景图片修复 */
@media (max-width: 768px) {
    .banner {
        background-attachment: scroll;
        min-height: 100vh;
        height: auto;
    }

    .banner::before {
        background-attachment: scroll;
    }
}

.top {
    position: absolute;
    top: 20%;
    left: 50%;
    margin-left: -25rem;
    margin-top: -3.5rem;
    width: 32rem;
    height: 7rem;
    z-index: 102;
}

.top-head {
    position: fixed;
    width: 100%;
    height: auto;
    background: #ffc;
    overflow-y: auto;
    min-height: 20px;
    line-height: 40px;
    top: 0;
    opacity: 0.7;
    z-index: 100000;
}

.text-black {
    color: #666;
}

.center {
    text-align: center;
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    margin: auto;
}

.blur {
    transition: all 0.4s;
    filter: blur(4px);
}

.noblur {
    transition: all 0.4s;
    filter: none;
}

blockquote {
    border-left: 2px solid rgba(136,152,170,.32);
    padding-left: 1rem;
}

.gravatar {
    background-image: url(https://cdn.sep.cc/avatar/);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

#clickcanvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10086;
    pointer-events: none;
}

#textarea {
    background: url(paiza.gif) right bottom no-repeat;
    background-color: white;
}

.splight_div {
    display: flex;
    justify-content: center;
    align-items: center;
}

.splight {
    position: relative;
    text-align: center;
    display: inline-block;
}

@media(min-width: 769px) {
    .splight::after {
        content: attr(data-spotlight);
        color: transparent;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 100%;
        -webkit-clip-path: ellipse(50px 50px at 0% 50%);
        clip-path: ellipse(50px 50px at 0% 50%);
        animation: spotlight 5s infinite;
        background: var(--main-bg-image);
        background-position: center center;
        -webkit-background-clip: text;
        background-clip: text;
        white-space: nowrap;
    }
}

@media(max-width: 768px) {
    .splight::after {
        content: attr(data-spotlight);
        color: transparent;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 100%;
        -webkit-clip-path: ellipse(50px 50px at 0% 50%);
        clip-path: ellipse(50px 50px at 0% 50%);
        animation: spotlight 5s infinite;
        background: var(--phone-bg-image);
        background-position: center center;
        -webkit-background-clip: text;
        background-clip: text;
        white-space: nowrap;
    }
}

@keyframes spotlight {
    0% {
        -webkit-clip-path: ellipse(50px 50px at 0% 50%);
        clip-path: ellipse(50px 50px at 0% 50%);
    }

    50% {
        -webkit-clip-path: ellipse(50px 50px at 100% 50%);
        clip-path: ellipse(50px 50px at 100% 50%);
    }

    100% {
        -webkit-clip-path: ellipse(50px 50px at 0% 50%);
        clip-path: ellipse(50px 50px at 0% 50%);
    }
}

.toc-container {
    position: fixed;
    right: -175px;
    width: 200px;
    z-index: 100;
    bottom: 50px;
}

.toc {
    height: 300px;
    padding-top: 1rem !important;
    margin-left: 0.5vw;
    padding-left: 23px;
}

.toc ul, .toc li {
    padding-left: 5px;
    list-style-type: none;
    padding-top: 2px;
}

.toc-list {
    overflow: overlay;
    width: 100%;
    height: 100%;
}

.up-btn {
    right: 45px;
    bottom: 45px;
    position: fixed;
    z-index: 9999;
    height: 60px;
    width: 60px;
    font-size: 20px;
    transition: opacity .25s ease-in-out;
    opacity: 0;
}

.upbtn-show {
    opacity: 1;
}

body.toc-open #upbtn {
    opacity: 0 !important;
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    .up-btn {
        right: 15px;
        bottom: 15px;
        height: 50px;
        width: 50px;
        font-size: 18px;
    }
}

/* ============================================================
   内容溢出处理系统（统一管理）
   ------------------------------------------------------------
   设计原则：
   1. 桌面端保持元素原生布局，仅设 overflow-x: auto
   2. 移动端（≤768px）对 table 采用 block 布局 + nowrap 单元格
   3. 表格作为整体滚动单元，内部公式跟随表格滚动
   4. 行内公式不滚动，由父级 .breakword 的 overflow-wrap 处理换行
   5. 块级公式溢出时滚动，短公式不出现滚动条
   6. 隐藏滚动条但保留拖动滚动（更美观）
   7. 打印时强制所有溢出可见，公式允许换行
   8. 表格样式统一：表头、边框、斑马纹、悬停效果
   ============================================================ */

/* --- 表格：通过 .scroll-wrap 包装容器实现整体滚动 ---
   JS（footer.php wrapTables）会自动给 .content 内的 table 包裹该容器。
   桌面端保留 table 原生 display，兼容 Bootstrap 的 .table 等样式类。 */
.content .scroll-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.content .scroll-wrap > table,
.content > table {
    display: table;
    width: 100%;
    margin-bottom: 0;
}

/* --- 表格样式统一设计（视觉一致性） ---
   仅对 .content 内的 table 生效，不影响 Bootstrap 组件中的表格。
   统一圆角设计，与图片、代码框保持一致。 */
.content table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #525f7f;
    border: 1px solid #e9ecef;
    border-radius: .375rem;
    overflow: hidden;
}

.content table thead th {
    background-color: #f4f5f7;
    color: #32325d;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    white-space: nowrap;
}

.content table thead th:first-child {
    border-top-left-radius: .375rem;
}

.content table thead th:last-child {
    border-top-right-radius: .375rem;
}

.content table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: top;
}

.content table tbody tr:last-child td {
    border-bottom: none;
}

.content table tbody tr:last-child td:first-child {
    border-bottom-left-radius: .375rem;
}

.content table tbody tr:last-child td:last-child {
    border-bottom-right-radius: .375rem;
}

/* 斑马纹：偶数行浅灰背景，提升可读性 */
.content table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

/* 悬停效果：鼠标悬停时行高亮 */
.content table tbody tr:hover {
    background-color: #f0f5ff;
    transition: background-color 0.15s ease-in-out;
}

/* --- MathJax 行内公式：保持默认 inline 行为 ---
   不设 overflow / display，由父级 .breakword 处理换行。 */

/* --- MathJax 块级公式（display math）：溢出时滚动 ---
   不设 max-width，让公式按自然宽度渲染；只有真正溢出时才出现滚动条。 */
.content mjx-container[display="true"] {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}

.content mjx-container[display="true"]::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* --- 表格内的公式：跟随表格整体滚动，不单独滚动 ---
   覆盖块级公式规则，确保表格行高一致、美观。 */
.content .scroll-wrap mjx-container,
.content table mjx-container {
    overflow: visible !important;
    max-width: none !important;
    display: inline-block !important;
    white-space: nowrap;
}

/* --- 旧版 MathJax v2 class 兼容 --- */
.content .MathJax_Display {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content .MathJax_Display::-webkit-scrollbar {
    display: none;
}

/* --- 代码块：溢出时滚动，隐藏滚动条，统一圆角 --- */
.content pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: .375rem;
}

.content pre::-webkit-scrollbar {
    display: none;
}

/* --- .scroll-wrap 容器也隐藏滚动条（桌面端拖动滚动） --- */
.content .scroll-wrap {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content .scroll-wrap::-webkit-scrollbar {
    display: none;
}

/* --- 多媒体元素：限制最大宽度 --- */
.content iframe,
.content video,
.content embed,
.content object {
    max-width: 100%;
}

/* --- 移动端表格优化（≤768px） ---
   保持 display: table 让表格至少撑满容器边框（min-width: 100%），
   超宽时由外层 .scroll-wrap 的 overflow-x: auto 负责横向滚动。
   单元格 nowrap 防止内容挤压换行，min-width 保证最小可读宽度。 */
@media (max-width: 768px) {
    .content .scroll-wrap > table,
    .content > table {
        display: table;
        width: 100%;
        min-width: 100%;
    }

    .content th,
    .content td {
        white-space: nowrap;
        min-width: 72px;
    }
}

/* --- 打印样式：强制所有溢出可见，公式允许换行 --- */
@media print {
    .content .scroll-wrap,
    .content pre,
    .content mjx-container[display="true"],
    .content .MathJax_Display {
        overflow: visible !important;
        overflow-x: visible !important;
    }

    .content .scroll-wrap > table,
    .content > table {
        display: table !important;
        width: 100% !important;
        overflow: visible !important;
        page-break-inside: auto;
    }

    .content th,
    .content td {
        overflow: visible !important;
        white-space: normal !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .content mjx-container[display="true"],
    .content .MathJax_Display {
        white-space: normal !important;
    }
}