/* ==========================================================================
   星艺导报 · 仿真翻书阅读器（journal_detail 专用）
   结构：.book-stage 阅读台 > .book 书体 > .book-sheet 书页（正面/背面双面）
   ========================================================================== */

/* ---------- 阅读台：暖木色书桌 + 聚光 + 纸纹颗粒 ---------- */
.book-stage{
    position:relative;
    margin-top:40px;
    padding:30px 22px 24px;
    border-radius:16px;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(255,214,150,.14) 0%, rgba(255,214,150,0) 55%),
        repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, rgba(0,0,0,0) 1px 3px),
        repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, rgba(0,0,0,0) 2px 6px),
        linear-gradient(180deg, #3a2c21 0%, #2b211a 46%, #191310 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,235,200,.10),
        inset 0 -14px 34px rgba(0,0,0,.55),
        0 18px 44px rgba(24,16,10,.35);
}

/* ---------- 工具条 ---------- */
.book-toolbar{
    display:flex; align-items:center; justify-content:center;
    gap:14px; flex-wrap:wrap;
    position:relative; z-index:5;
}
.bk-btn{
    width:40px; height:40px; border-radius:50%;
    border:1px solid rgba(200,162,74,.55);
    background:linear-gradient(180deg, rgba(255,236,200,.12), rgba(255,236,200,.03));
    color:#e9d9b4; font-size:17px; line-height:1;
    cursor:pointer; user-select:none;
    display:inline-flex; align-items:center; justify-content:center;
    transition:transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.bk-btn:hover:not(:disabled){
    background:linear-gradient(180deg, rgba(255,236,200,.22), rgba(255,236,200,.08));
    color:#fff3d6; box-shadow:0 0 0 3px rgba(200,162,74,.18), 0 4px 14px rgba(0,0,0,.4);
    transform:translateY(-1px);
}
.bk-btn:active:not(:disabled){ transform:translateY(0) scale(.94); }
.bk-btn:disabled{ opacity:.32; cursor:not-allowed; }
.bk-btn.bk-sound{ font-size:15px; }
.bk-btn.bk-sound[aria-pressed="false"]{ color:#8d7f68; border-color:rgba(141,127,104,.4); }
.bk-indicator{
    min-width:190px; text-align:center;
    font-size:14px; letter-spacing:2px; color:#f0e4c6;
    font-family:Arial, "微软雅黑", sans-serif;
    padding:0 6px;
}
.bk-indicator b{ color:#ffd98a; font-size:16px; padding:0 2px; }

/* ---------- 书体 ---------- */
.book{
    --book-dur:900ms;
    --edgeL:6px;
    --edgeR:6px;
    position:relative;
    margin:30px auto 12px;
    width:min(1060px, 96%, calc(70vh * 1.5));
    aspect-ratio:3 / 2;
    perspective:2600px;
    touch-action:pan-y;
}
.book-shadow{
    position:absolute; left:4%; right:4%; bottom:-22px; height:34px;
    background:radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 72%);
    filter:blur(6px);
    pointer-events:none;
}
/* 左右底页（翻开后可见的垫底纸面） */
.book-side{
    position:absolute; top:0; height:100%; width:50%;
    background:
        linear-gradient(90deg, rgba(60,42,24,.16) 0%, rgba(60,42,24,0) 10%),
        linear-gradient(180deg, #fbf8f1 0%, #f2ecdf 100%);
    box-shadow:inset 0 0 26px rgba(94,74,48,.14);
}
.book-left{ left:0; border-radius:6px 0 0 6px;
    background:
        linear-gradient(270deg, rgba(60,42,24,.18) 0%, rgba(60,42,24,0) 10%),
        linear-gradient(180deg, #f8f4ea 0%, #efe8da 100%);
}
.book-right{ right:0; border-radius:0 6px 6px 0; }
/* 书脊压痕 */
.book-spine{
    position:absolute; left:50%; top:-2px; bottom:-2px; width:30px;
    transform:translateX(-50%);
    background:linear-gradient(90deg,
        rgba(0,0,0,0) 0%, rgba(30,20,10,.22) 34%, rgba(20,12,6,.42) 50%,
        rgba(30,20,10,.22) 66%, rgba(0,0,0,0) 100%);
    pointer-events:none; z-index:80;
}
/* 两侧纸叠厚度（随翻页进度变化） */
.book-edge{
    position:absolute; top:5px; bottom:5px;
    background:repeating-linear-gradient(90deg, #efe9db 0 1px, #cdc4ae 1px 2px);
    box-shadow:0 2px 6px rgba(0,0,0,.4);
    pointer-events:none;
}
.edge-left{ left:0; transform:translateX(-100%); width:var(--edgeL); border-radius:3px 0 0 3px; }
.edge-right{ right:0; transform:translateX(100%); width:var(--edgeR); border-radius:0 3px 3px 0; }

/* ---------- 书页：双面 3D 叶 ---------- */
.book-sheet{
    position:absolute; top:0; left:50%; width:50%; height:100%;
    transform-origin:0 50%;
    transform-style:preserve-3d;
    transition:transform var(--book-dur) cubic-bezier(.32,.72,.24,1);
    will-change:transform;
    cursor:grab;
}
.book-sheet.dragging{ transition:none; cursor:grabbing; }
.book-sheet.flipped{ transform:rotateY(-180deg); }
.sheet-face{
    position:absolute; inset:0;
    -webkit-backface-visibility:hidden; backface-visibility:hidden;
    overflow:hidden;
    background:linear-gradient(180deg, #fdfaf3 0%, #f4eee1 100%);
    box-shadow:inset 0 0 22px rgba(94,74,48,.12);
}
.sheet-front{
    border-radius:0 6px 6px 0;
    background:
        linear-gradient(90deg, rgba(60,42,24,.20) 0%, rgba(60,42,24,.05) 5%, rgba(60,42,24,0) 12%),
        linear-gradient(180deg, #fdfaf3 0%, #f4eee1 100%);
}
.sheet-back{
    transform:rotateY(180deg);
    border-radius:6px 0 0 6px;
    background:
        linear-gradient(270deg, rgba(60,42,24,.20) 0%, rgba(60,42,24,.05) 5%, rgba(60,42,24,0) 12%),
        linear-gradient(180deg, #fbf7ee 0%, #f1ebdd 100%);
}
.sheet-face img{
    display:block; width:100%; height:100%;
    object-fit:contain;
    opacity:0; transition:opacity .45s ease;
    pointer-events:none;
}
.sheet-face img.bk-loaded{ opacity:1; }
/* 翻页过程中的动态明暗（纸面受光变化） */
.sheet-shade{
    position:absolute; inset:0; pointer-events:none; opacity:0;
    background:linear-gradient(90deg,
        rgba(24,16,8,.62) 0%, rgba(24,16,8,.20) 34%,
        rgba(255,248,230,.14) 62%, rgba(24,16,8,.30) 100%);
}
.sheet-back .sheet-shade{
    background:linear-gradient(270deg,
        rgba(24,16,8,.62) 0%, rgba(24,16,8,.20) 34%,
        rgba(255,248,230,.14) 62%, rgba(24,16,8,.30) 100%);
}
.book-sheet.flipping .sheet-shade{ animation:bkShade var(--book-dur) ease-in-out both; }
@keyframes bkShade{ 0%{opacity:0;} 42%{opacity:.6;} 100%{opacity:0;} }
/* 翻动叶在静页上投下的移动阴影 */
.book-cast{
    position:absolute; inset:0; pointer-events:none; opacity:0; z-index:70;
    background:linear-gradient(90deg,
        rgba(0,0,0,0) 0%, rgba(10,6,2,.34) 42%, rgba(10,6,2,.10) 58%, rgba(0,0,0,0) 100%);
    background-size:52% 100%; background-repeat:no-repeat;
}
.book-cast.cast-fwd{ animation:bkCastFwd var(--book-dur) ease-in-out both; }
.book-cast.cast-back{ animation:bkCastBack var(--book-dur) ease-in-out both; }
@keyframes bkCastFwd{
    0%{ opacity:0; background-position:100% 0; }
    30%{ opacity:1; }
    100%{ opacity:0; background-position:0% 0; }
}
@keyframes bkCastBack{
    0%{ opacity:0; background-position:0% 0; }
    30%{ opacity:1; }
    100%{ opacity:0; background-position:100% 0; }
}

/* ---------- 提示文案 ---------- */
.book-hint{
    text-align:center; font-size:12px; letter-spacing:1px;
    color:rgba(240,228,198,.62); padding-top:16px;
}
.book-hint em{ font-style:normal; color:#ffd98a; }

/* ---------- 双击放大灯箱 ---------- */
.book-lb{
    position:fixed; inset:0; z-index:99999;
    display:none; align-items:center; justify-content:center;
    background:rgba(14,10,6,.94);
}
.book-lb.open{ display:flex; }
.book-lb img{
    max-width:92vw; max-height:88vh;
    transform-origin:center center;
    cursor:grab; user-select:none; -webkit-user-drag:none;
    box-shadow:0 24px 80px rgba(0,0,0,.7);
    background:#fdfaf3;
}
.book-lb img.panning{ cursor:grabbing; }
.bk-lb-close{
    position:absolute; top:22px; right:26px;
    width:44px; height:44px; border-radius:50%;
    border:1px solid rgba(200,162,74,.6); background:rgba(255,236,200,.08);
    color:#f0e4c6; font-size:20px; cursor:pointer;
    transition:background .18s ease, transform .18s ease;
}
.bk-lb-close:hover{ background:rgba(255,236,200,.2); transform:rotate(90deg); }
.bk-lb-cap{
    position:absolute; left:0; right:0; bottom:18px;
    text-align:center; font-size:13px; letter-spacing:2px; color:rgba(240,228,198,.75);
}
.bk-lb-tip{
    position:absolute; top:26px; left:30px;
    font-size:12px; letter-spacing:1px; color:rgba(240,228,198,.5);
}

/* ---------- 响应式 ---------- */
@media screen and (max-width:760px){
    .book-stage{ padding:20px 10px 16px; border-radius:10px; }
    .book{ width:98%; margin-top:20px; }
    .bk-indicator{ min-width:130px; font-size:12px; letter-spacing:1px; }
    .bk-btn{ width:34px; height:34px; font-size:14px; }
    .book-hint{ font-size:11px; }
}
@media (prefers-reduced-motion: reduce){
    .book{ --book-dur:1ms; }
    .book-sheet{ transition-duration:1ms; }
}
