
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    margin: 0;
    padding: 0;
    
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: #2b2b2b;
    -webkit-user-select: none;
    user-select: none;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

#canvas {
    position: absolute;
    top: 0; left: 0;
    perspective: 2200px;
    
    touch-action: none;
}

#book-zoom {
    transform-origin: center center;
}


#book-zoom { position: relative; }
.sj-book {
    position: relative;
    box-shadow: 0 22px 45px rgba(0, 0, 0, .65), 0 4px 10px rgba(0, 0, 0, .5);
}

.sj-book.closed { box-shadow: none; }
.sj-book.closed .own-size { box-shadow: 0 14px 34px rgba(0, 0, 0, .6); }
.sj-book .own-size {
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 12px rgba(0, 0, 0, .45);
}
.sj-book .own-size .pf { margin: 0 auto; }
.sj-book .own-size img { max-width: 100%; }

.sj-book .own-size .pf {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
body.eb-forbid-select .sj-book .own-size .pf {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.sj-book .p-temporal { background: #fff; }


.sj-book .own-size:after {
    content: "";
    position: absolute; top: 0; bottom: 0; width: calc(32px * var(--eb-scale, 1));
    pointer-events: none; z-index: 6;
}
.sj-book .own-size.odd:after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.32), rgba(0,0,0,0)); }
.sj-book .own-size.even:after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.32), rgba(0,0,0,0)); }


.sj-book .own-size:before {
    content: "";
    position: absolute; top: 0; bottom: 0; width: calc(14px * var(--eb-scale, 1));
    pointer-events: none; z-index: 6;
}
.sj-book .own-size.odd:before { right: 0; background: linear-gradient(to left, rgba(0,0,0,.16), rgba(0,0,0,0)); }
.sj-book .own-size.even:before { left: 0; background: linear-gradient(to right, rgba(0,0,0,.16), rgba(0,0,0,0)); }


.sj-book .hard { background: transparent; }

.sj-book .hard .cover-img { display: block; width: 100%; height: 100%; object-fit: fill; }
.sj-book .hard .cover-face {
    width: 100%; height: 100%; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2b3a4a, #16202b);
}
.sj-book .hard .cover-face.cover-back { background: linear-gradient(135deg, #1d2937, #0e1620); }
.sj-book .hard .cover-face .cover-title { color: #e8eef6; font-size: 48px; line-height: 1.5; text-align: center; padding: 0 12%; }
.sj-book .hard .cover-inner { width: 100%; height: 100%; background: linear-gradient(#f3f6fa, #e2e9f1); }

.sj-book .hard:after { width: calc(34px * var(--eb-scale, 1)); }
.sj-book .hard.odd:after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.55), rgba(0,0,0,0)); }
.sj-book .hard.even:after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.55), rgba(0,0,0,0)); }


.sj-book.closed-front .own-size.inner-front { display: none; }
.sj-book.closed-back  .own-size.inner-back  { display: none; }


#book-zoom.eb-single .eb-single-inner {
    position: absolute;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(0, 0, 0, .45);
}
#book-zoom.eb-single .eb-single-inner .cover-img {
    display: block; width: 100%; height: 100%; object-fit: fill;
}
#book-zoom.eb-single .eb-single-inner .cover-inner {
    width: 100%; height: 100%; background: linear-gradient(#f3f6fa, #e2e9f1);
}

#book-zoom.eb-single .sj-book .page-wrapper.eb-under-hide { display: none !important; }


.book-depth {
    position: absolute;
    
    top: 0; bottom: 0;
    z-index: 40;
    width: 0; 
    pointer-events: none;
    overflow: hidden;
    transition: width .7s ease, left .7s ease, right .7s ease;
    background-image: url(../images/pages-depth.png);
    background-repeat: no-repeat;
    background-size: auto 101.5%;
}

.book-depth.left  { left: 0;  background-position: left 41.17%; }
.book-depth.right { right: 0; background-position: right 41.17%; }

#book-zoom.eb-single .book-depth { z-index: 1; }
#book-zoom.eb-single .sj-book,
#book-zoom.eb-single .sj-book .page-wrapper,
#book-zoom.eb-single .sj-book .own-size { overflow: visible !important; }

.book-depth.no-anim { transition: none; }


.ebook-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 44px;
    z-index: 300;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    box-sizing: border-box;
    font-size: 14px;
    background: rgba(0, 0, 0, .42);
}
.ebook-topbar a { color: #dbe7f6; text-decoration: none; }
.ebook-topbar a:hover { color: #fff; }
.ebook-topbar .tb-auth a { margin-left: 18px; }
.ebook-topbar .tb-nav a + a { margin-left: 18px; }
.ebook-topbar a.tb-reg {
    background: #ffd666; color: #7a5200;
    padding: 5px 14px; border-radius: 14px;
}
.ebook-topbar a.tb-reg:hover { color: #7a5200; }
.ebook-topbar a.tb-out {
    background: rgba(255, 255, 255, .16);
    padding: 5px 14px; border-radius: 14px;
}
.ebook-topbar a.tb-out:hover { color: #fff; background: rgba(255, 255, 255, .28); }


.ebook-turn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 46px; height: 84px;
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 34px; line-height: 1;
    background: rgba(0, 0, 0, .28);
    border-radius: 10px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.ebook-turn:hover { background: rgba(0, 0, 0, .5); }
.ebook-turn.l { left: 14px; }
.ebook-turn.r { right: 14px; }
.ebook-turn.disabled { opacity: .2; cursor: default; background: rgba(0,0,0,.15); }


.ebook-bottom {
    position: fixed;
    height: 44px;
    z-index: 150;
    display: flex; align-items: center; gap: 12px;
    padding: 0 16px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, .42);
    border-radius: 10px;
}
.ebook-bottom .pos { color: #fff; font-size: 13px; min-width: 74px; text-align: center; }
.ebook-bottom input[type=range] {
    flex: 1 1 auto;
    min-width: 0;   
    -webkit-appearance: none;
    height: 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .35);
    outline: none;
    cursor: pointer;
}
.ebook-bottom input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 4px rgba(0,0,0,.5);
}
.ebook-bottom input[type=range]::-moz-range-thumb {
    width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff;
}
.ebook-bottom .toolbar a {
    color: #dbe7f6; text-decoration: none; font-size: 13px; margin-left: 10px;
}


.ebook-thumb {
    position: fixed;
    bottom: 56px; left: 50%;
    transform: translateX(-50%);
    z-index: 160;
    display: none;
    overflow: hidden;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .45);
}

.ebook-thumb .eb-thumb-page {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    background: #fff;
}
.ebook-thumb .eb-thumb-page + .eb-thumb-page {
    margin-left: 2px;
    box-shadow: inset 2px 0 3px rgba(0, 0, 0, .2);
}
.ebook-thumb .eb-thumb-page:first-child:not(:last-child) { box-shadow: inset -2px 0 3px rgba(0, 0, 0, .2); }
.ebook-thumb img { display: block; position: absolute; top: 0; left: 0; max-width: none; }


.ebook-tip {
    position: fixed;
    left: 0; right: 0; top: 45%;
    text-align: center;
    color: #eee;
    font-size: 14px;
    line-height: 1.8;
    padding: 0 24px;
}
.ebook-tip a { color: #8cc4ff; }


.eb-bgm {
    position: fixed;
    right: 10px; top: 52px;
    z-index: 300;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .42);
    color: #cbd6e2;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.eb-bgm:hover { background: rgba(0, 0, 0, .6); color: #fff; }
.eb-bgm svg { display: block; }
.eb-bgm .ic-on { display: none; }
.eb-bgm.playing { color: #ffd666; }
.eb-bgm.playing .ic-off { display: none; }
.eb-bgm.playing .ic-on { display: block; animation: eb-bgm-spin 3s linear infinite; }
@keyframes eb-bgm-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }


.eb-msg-btn {
    position: fixed;
    left: 10px; top: 52px;
    z-index: 300;
    height: 42px; padding: 0 15px;
    display: flex; align-items: center; gap: 6px;
    border-radius: 21px;
    background: rgba(0, 0, 0, .42);
    color: #ffd666;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.eb-msg-btn:hover { background: rgba(0, 0, 0, .6); }
.eb-msg-btn svg { display: block; }


.eb-msg-pop {
    position: fixed;
    left: 14px; top: 102px;
    z-index: 310;
    display: none;
    width: 360px;
    max-width: calc(100vw - 28px);
    box-sizing: border-box;
}
.eb-msg-pop.show { display: block; }
.eb-msg-box {
    width: 100%;
    max-height: calc(100vh - 118px);
    overflow: auto;
    box-sizing: border-box;
    background: #fff; color: #22303f;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .38);
}
.eb-msg-hd {
    position: relative;
    padding: 14px 16px;
    font-size: 16px; font-weight: 600;
    border-bottom: 1px solid #eef1f5;
}
.eb-msg-hd .eb-msg-close {
    position: absolute;
    top: 8px; right: 10px;
    width: 30px; height: 30px;
    line-height: 28px; text-align: center;
    font-size: 22px; font-weight: 400;
    color: #98a1ad; cursor: pointer;
    border-radius: 50%;
}
.eb-msg-hd .eb-msg-close:hover { background: #f2f4f7; color: #22303f; }
.eb-msg-bd { padding: 12px 16px 16px; }
.eb-msg-bd label {
    display: block;
    font-size: 12px; color: #68727f;
    margin: 10px 0 5px;
}
.eb-msg-bd label em { color: #d93025; font-style: normal; }
.eb-msg-bd input[type=text],
.eb-msg-bd input[type=tel],
.eb-msg-bd textarea {
    width: 100%; box-sizing: border-box;
    padding: 0 10px; height: 38px;
    border: 1px solid #dfe3e8; border-radius: 8px;
    font-size: 14px; font-family: inherit;
    background: #fbfcfe; color: #22303f;
    outline: none;
}
.eb-msg-bd textarea { height: auto; padding: 8px 10px; resize: vertical; }
.eb-msg-bd input:focus, .eb-msg-bd textarea:focus { border-color: #1a5fb4; background: #fff; }
.eb-msg-code { display: flex; align-items: center; gap: 10px; }
.eb-msg-code input { flex: 1 1 auto; min-width: 0; }
.eb-msg-code img {
    flex: 0 0 auto;
    width: 110px; height: 38px;
    border: 1px solid #dfe3e8; border-radius: 8px;
    cursor: pointer;
    background: #f6f8fb;
}
.eb-msg-tip { min-height: 18px; margin-top: 8px; font-size: 13px; color: #98a1ad; }
.eb-msg-tip.err { color: #d93025; }
.eb-msg-submit {
    width: 100%; height: 42px;
    margin-top: 4px;
    border: 0; border-radius: 10px;
    background: #1a5fb4; color: #fff;
    font-size: 15px; cursor: pointer;
}
.eb-msg-submit:hover { background: #164f96; }
.eb-msg-submit:disabled { opacity: .6; cursor: default; }


.eb-msg-toast {
    position: fixed;
    left: 50%; top: 50%;
    z-index: 1200;
    transform: translate(-50%, -50%);
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .78);
    color: #fff; font-size: 14px;
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease;
    pointer-events: none;
}
.eb-msg-toast.show { opacity: 1; visibility: visible; }


.eb-turn-guide {
    position: fixed;
    top: 50%;                   
    left: 50%;
    z-index: 320;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 214, 102, .55);
    background: rgba(20, 28, 38, .9);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .38), 0 0 0 4px rgba(255, 214, 102, .12);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: eb-turn-guide-in .32s ease-out .12s forwards;
}
.eb-turn-guide svg { flex: 0 0 auto; color: #ffd666; }
.eb-turn-guide-out { animation: eb-turn-guide-out .28s ease-in forwards; }
@keyframes eb-turn-guide-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes eb-turn-guide-out {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to   { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
}



.eb-audio-btn {
    position: fixed;
    left: 14px; top: 12px;      
    z-index: 300;
    height: 42px; padding: 0 15px;
    display: flex; align-items: center; gap: 6px;
    border-radius: 21px;
    background: rgba(0, 0, 0, .42);
    color: #ffd666;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.eb-audio-btn:hover,
.eb-audio-btn.open { background: rgba(0, 0, 0, .62); }
.eb-audio-btn svg { display: block; }

.eb-audio-pop {
    position: fixed;
    left: 14px; top: 58px;
    z-index: 320;
    width: 260px;
    max-width: calc(100vw - 28px);
    max-height: 70vh;
    overflow: auto;
    box-sizing: border-box;
    padding: 0 14px 14px;
    border-radius: 10px;
    background: #fff;
    color: #1f2329;
    font-size: 13px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
}

.eb-audio-hd {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 -14px 8px;
    padding: 12px 14px 8px;
    background: #fff;
    border-radius: 10px 10px 0 0;
    font-size: 15px; font-weight: 600;
}
.eb-audio-hd .x { padding: 0 4px; color: #8a919b; font-size: 20px; line-height: 1; cursor: pointer; }
.eb-audio-sec {
    margin: 12px 0 6px;
    color: #8a919b; font-size: 12px;
}

.eb-audio-turns-hd { display: flex; align-items: center; justify-content: space-between; }
.eb-audio-clear {
    padding: 1px 9px;
    border: 1px solid #f0c9c0; border-radius: 10px;
    background: #fff; color: #d4380d;
    font-size: 12px; line-height: 18px;
    cursor: pointer;
}
.eb-audio-clear:hover { background: #fff2f0; }
.eb-audio-files, .eb-audio-turns { border-top: 1px solid #eef1f5; }
.eb-audio-file, .eb-audio-turn {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #f2f4f7;
}
.eb-audio-file .nm, .eb-audio-turn .nm {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eb-audio-file .dur, .eb-audio-turn .ts {
    color: #8a919b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.eb-audio-file .ops { display: flex; gap: 2px; }
.eb-audio-file .ops button,
.eb-audio-turn .del {
    width: 24px; height: 24px;
    padding: 0;
    border: 0; border-radius: 6px;
    background: #f2f4f7; color: #4e5969;
    font-size: 13px; line-height: 24px; text-align: center;
    cursor: pointer;
}
.eb-audio-file .ops button:disabled { opacity: .35; cursor: default; }
.eb-audio-file .ops button:hover:not(:disabled) { background: #e6eaf0; }
.eb-audio-turn .del:hover { background: #ffe8e8; color: #d4380d; }
.eb-audio-empty { padding: 10px 0; color: #a8afb8; }

.eb-audio-files-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eb-audio-upbtn {
    flex: 0 0 auto;
    height: 24px;
    padding: 0 10px;
    border: 1px solid #1a5fb4; border-radius: 6px;
    background: #fff; color: #1a5fb4;
    font-size: 12px; line-height: 22px;
    cursor: pointer;
}
.eb-audio-upbtn:hover { background: #eff5ff; }

.eb-audio-status {
    display: block;
    padding-top: 4px;
    color: #8a919b; font-size: 12px; line-height: 1.5;
    word-break: break-word;
}
.eb-audio-status.err { color: #d4380d; }


.eb-audio-tip {
    position: fixed;
    z-index: 340;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .82);
    color: #ffd666;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .16s ease, transform .16s ease;
}
.eb-audio-tip.show { opacity: 1; transform: translateY(0); }


.eb-audio-confirm {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: 400;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .38);
}
.eb-audio-confirm-box {
    width: 270px;
    max-width: calc(100vw - 48px);
    box-sizing: border-box;
    padding: 18px 16px 12px;
    border-radius: 12px;
    background: #fff;
    color: #1f2329;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.eb-audio-confirm-msg {
    font-size: 14px; line-height: 1.6;
    word-break: break-word;
}
.eb-audio-confirm-btns {
    display: flex; justify-content: flex-end; gap: 8px;
    margin-top: 16px;
}
.eb-audio-confirm-btns button {
    padding: 6px 16px;
    border: 1px solid #e5e8ee; border-radius: 6px;
    background: #f7f8fa; color: #4e5969;
    font-size: 13px; cursor: pointer;
}
.eb-audio-confirm-btns button:hover { background: #eef1f5; }
.eb-audio-confirm-btns .ok { border-color: #d4380d; background: #fff; color: #d4380d; }
.eb-audio-confirm-btns .ok:hover { background: #fff2f0; }

.eb-audio-bar {
    position: fixed;
    left: 130px; top: 52px;     
    z-index: 300;
    height: 42px;
    box-sizing: border-box;
    display: flex; align-items: center; gap: 6px;
    padding: 0 12px 0 6px;
    border-radius: 21px;
    background: rgba(0, 0, 0, .42);
    color: #cbd6e2;
    max-width: calc(100vw - 192px);   
    -webkit-tap-highlight-color: transparent;
}
.eb-audio-bar.eb-audio-editor { left: 84px; top: 12px; max-width: calc(100vw - 98px); }
.eb-audio-bar:hover { background: rgba(0, 0, 0, .52); }
.eb-audio-ic {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: transparent; color: #e6edf5;
    cursor: pointer;
}
.eb-audio-ic:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.eb-audio-ic .ic-pause { display: none; }
.eb-audio-ic.playing { color: #ffd666; }
.eb-audio-ic.playing .ic-play { display: none; }
.eb-audio-ic.playing .ic-pause { display: block; }
.eb-audio-insert-ic { color: #ffd666; }
.eb-audio-insert-ic:hover { background: rgba(255, 214, 102, .18); color: #ffe08a; }
.eb-audio-time {
    flex: 0 0 auto;
    color: #cbd6e2;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.eb-audio-range {
    flex: 1 1 auto;
    width: 150px; min-width: 40px; max-width: 180px;
    height: 16px;
    margin: 0;
    accent-color: #ffd666;
    cursor: pointer;
}

.eb-audio-bar.eb-audio-editor .eb-audio-range { flex: 1 1 auto; max-width: none; }
@media (max-width: 480px) {
    .eb-audio-bar { gap: 4px; padding-right: 8px; }
    .eb-audio-editor { left: 84px; max-width: calc(100vw - 98px); }
    .eb-audio-time { font-size: 11px; }
    .eb-audio-range { width: 70px; }
}


@media (max-width: 560px) and (orientation: portrait) {
    .eb-audio-bar.eb-audio-editor .eb-audio-range { display: none; }
}
