.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 images: full-width, height auto, shared radius and border. */
.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;
}

/* Image wrapper: holds image plus optional caption. */
.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;
}

/* Image caption: shown below the image. */
.content .img-caption {
    font-size: 0.85rem;
    color: #8898aa;
    padding: 0.5rem 0 0;
    text-align: center;
    line-height: 1.4;
}

/* Lazy placeholder: pulse until lazyload.js swaps data-original into 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;
    }
}

/* Loaded image: stop animation, fade in. */
.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;
}

/* Word-wrap: break at word boundaries only; justify for CJK/Latin mix.
   Overflow handled by child scroll containers (table/pre/mjx-container). */
.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;
}

/* Custom scrollbar (width = vertical, height = horizontal). */
::-webkit-scrollbar {
    width: 10px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    /* Thumb */
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: #777777;
}

::-webkit-scrollbar-track {
    /* 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;
}

/* Mobile: disable fixed background-attachment (iOS fix). */
@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;
}

/* Spotlight (PC): rem decouples radius from the large display-1 font (3.3rem).
   4.5rem ≈ 72px (~2× line-height). background-clip must follow the background shorthand. */
@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(4.5rem 4.5rem at 0% 50%);
        clip-path: ellipse(4.5rem 4.5rem at 0% 50%);
        animation: spotlight-pc 5s infinite;
        background: var(--main-bg-image);
        background-position: center center;
        -webkit-background-clip: text;
        background-clip: text;
        white-space: nowrap;
    }
}

/* Spotlight (mobile): 8.9rem == original 2.7em (2.7 × 3.3rem), unchanged look. */
@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(8.9rem 8.9rem at 0% 50%);
        clip-path: ellipse(8.9rem 8.9rem at 0% 50%);
        animation: spotlight-mobile 5s infinite;
        background: var(--phone-bg-image);
        background-position: center center;
        -webkit-background-clip: text;
        background-clip: text;
        white-space: nowrap;
    }
}

@keyframes spotlight-pc {
    0% {
        -webkit-clip-path: ellipse(4.5rem 4.5rem at 0% 50%);
        clip-path: ellipse(4.5rem 4.5rem at 0% 50%);
    }

    50% {
        -webkit-clip-path: ellipse(4.5rem 4.5rem at 100% 50%);
        clip-path: ellipse(4.5rem 4.5rem at 100% 50%);
    }

    100% {
        -webkit-clip-path: ellipse(4.5rem 4.5rem at 0% 50%);
        clip-path: ellipse(4.5rem 4.5rem at 0% 50%);
    }
}

@keyframes spotlight-mobile {
    0% {
        -webkit-clip-path: ellipse(8.9rem 8.9rem at 0% 50%);
        clip-path: ellipse(8.9rem 8.9rem at 0% 50%);
    }

    50% {
        -webkit-clip-path: ellipse(8.9rem 8.9rem at 100% 50%);
        clip-path: ellipse(8.9rem 8.9rem at 100% 50%);
    }

    100% {
        -webkit-clip-path: ellipse(8.9rem 8.9rem at 0% 50%);
        clip-path: ellipse(8.9rem 8.9rem 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;
    }
}

/* ============================================================
   Overflow handling system
   ------------------------------------------------------------
   1. Desktop: native layout, overflow-x: auto on overflow sources.
   2. Mobile (<=768px): tables scroll as a unit; cells nowrap.
   3. Inline math never scrolls (wraps via parent .breakword).
   4. Block math scrolls only when it actually overflows.
   5. Scrollbars hidden but drag-scroll kept.
   6. Print: force all overflow visible, allow math to wrap.
   7. Tables: unified header, border, zebra, hover styles.
   ============================================================ */

/* Table scroll wrapper: footer.php wrapTables() wraps .content tables.
   Desktop keeps native table display for Bootstrap .table compatibility. */
.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;
}

/* Table styling: .content tables only; shared radius with images and code. */
.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;
}

/* Zebra striping: even rows tinted for readability. */
.content table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

/* Hover: row highlight. */
.content table tbody tr:hover {
    background-color: #f0f5ff;
    transition: background-color 0.15s ease-in-out;
}

/* MathJax inline: default inline behavior; wraps via parent .breakword. */

/* MathJax display math: scroll only on overflow; no max-width cap. */
.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 */
}

/* Math inside tables: scroll with the table, not independently. */
.content .scroll-wrap mjx-container,
.content table mjx-container {
    overflow: visible !important;
    max-width: none !important;
    display: inline-block !important;
    white-space: nowrap;
}

/* Legacy MathJax v2 class support. */
.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;
}

/* Code blocks: scroll on overflow, hidden scrollbar, shared radius. */
.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: hide scrollbar (desktop drag-scroll). */
.content .scroll-wrap {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content .scroll-wrap::-webkit-scrollbar {
    display: none;
}

/* Media elements: cap at container width. */
.content iframe,
.content video,
.content embed,
.content object {
    max-width: 100%;
}

/* Mobile tables (<=768px): table fills container (min-width 100%);
   overflow handled by .scroll-wrap; cells nowrap with min readable 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;
    }
}

/* Print: force all overflow visible, allow math to wrap. */
@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;
    }
}
