/* ═══════════════════════════════════════════════════════════
   心语 App (Whisper) — 完整样式表
   对齐「心语二改」HTML 参考版
   字体通过 WhisperApp._injectFonts() 动态加载
   ═══════════════════════════════════════════════════════════ */

/* ── CSS 变量（字体在 JS 中通过 <link> 加载） ── */
:root {
    --w-bg: #fcfaf8;
    --w-paper: #fffdfa;
    --w-cover: #e2a896;
    --w-cover-current: #e2a896;
    --w-metal: #b8bdc5;
    --w-text-dark: #4a423f;
    --w-text-sub: #a89a94;
    --w-font-sans: 'Inter', sans-serif;
    --w-font-serif: 'Noto Serif SC', serif;
    --w-font-hand: 'Caveat', cursive;
    --w-font-sign: 'Ma Shan Zheng', 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
    --w-font-mono: 'Courier Prime', monospace;
}

#app-whisper * { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }

.whisper-root {
    width: 100%;
    height: 100%;
    max-width: 430px;
    margin: 0 auto;
    background: var(--w-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ════ 视图切换 ════ */
.view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transition: 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    pointer-events: none;
}
.view.active { opacity: 1; pointer-events: auto; }
#view-home { z-index: 20; }
#view-home.opening {
    opacity: 0;
    pointer-events: none;
    transition-delay: 0.3s;
}

/* ════ 首页 ════ */
.whisper-header {
    padding: max(30px, env(safe-area-inset-top)) 24px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.w-back-home {
    position: fixed;
    left: 14px;
    top: max(14px, env(safe-area-inset-top));
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--w-text-dark);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    z-index: 50;
}

.whisper-title {
    font-family: var(--w-font-hand);
    font-size: 48px;
    color: var(--w-cover);
    transition: color 0.4s;
}

.whisper-sub {
    font-size: 11px;
    color: var(--w-text-sub);
    letter-spacing: 4px;
    margin-top: 4px;
    text-transform: uppercase;
}

.char-selector {
    margin: 24px auto 0;
    padding: 12px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
    width: auto;
    align-self: center;
}
.char-selector:active { transform: scale(0.98); }

.char-info { display: flex; align-items: center; gap: 12px; }

.char-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--w-cover);
    transition: background 0.4s;
}

.char-name {
    font-family: var(--w-font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--w-text-dark);
}

.btn-switch {
    font-size: 12px;
    color: var(--w-cover);
    font-weight: 600;
    background: rgba(0,0,0,0.03);
    padding: 6px 12px;
    border-radius: 12px;
    transition: color 0.4s;
}

.book-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    padding-bottom: 40px;
    min-height: 0;
}

/* ── 本子封面 ── */
.journal-cover {
    width: 240px;
    height: 360px;
    background: var(--w-cover);
    border-radius: 4px 20px 20px 4px;
    box-shadow: inset 4px 0 10px rgba(255,255,255,0.2), 15px 20px 40px rgba(0,0,0,0.15);
    position: relative;
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.4s;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-image:
        radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
        radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 4px 4px;
    background-position: 0 0, 2px 2px;
}
.journal-cover.is-open { transform: rotateY(-130deg); }

.cover-stamp {
    position: absolute;
    left: 15px;
    bottom: 30px;
    width: 70px;
    height: 70px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(-20deg);
    z-index: 1;
    pointer-events: none;
}
.cover-stamp::before {
    content: 'WHISPER';
    font-family: var(--w-font-sans);
    font-weight: 700;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 2px;
}
.cover-stamp::after {
    content: '';
    position: absolute;
    width: 54px;
    height: 54px;
    border: 1px dashed rgba(255,255,255,0.4);
    border-radius: 50%;
}

.journal-strap {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: #c28d7e;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 4px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.4s ease;
    z-index: 2;
}
.journal-cover.is-open .journal-strap {
    right: -40px;
    opacity: 0;
}

.journal-clasp {
    width: 12px;
    height: 40px;
    border: 2px solid #fceee3;
    border-radius: 6px;
}

.journal-label {
    background: rgba(255,255,255,0.95);
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
    z-index: 3;
}

.label-title {
    font-family: var(--w-font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--w-text-dark);
    letter-spacing: 4px;
}

.label-sub {
    font-family: var(--w-font-hand);
    font-size: 16px;
    color: var(--w-cover);
    margin-top: 4px;
    transition: color 0.4s;
}

/* ════ 阅读视图背景（桌面质感） ════ */
#view-reading {
    z-index: 10;
    background-color: #9c928b;
    background-image:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 8px),
        repeating-linear-gradient(-45deg, rgba(0,0,0,0.1) 0, rgba(0,0,0,0.1) 2px, transparent 2px, transparent 8px);
    box-shadow: inset 0 0 60px rgba(0,0,0,0.3);
}

.reading-header {
    padding: max(15px, env(safe-area-inset-top)) 20px 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    position: relative;
    flex-shrink: 0;
}

.whisper-back-btn,
.whisper-overview-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    transition: 0.2s;
    opacity: 0.8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.whisper-back-btn:hover,
.whisper-overview-btn:hover { opacity: 1; }

/* ── 旋转容器 ── */
.reading-book-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 10px 10px 10px;
    will-change: transform;
}

/* ── 铁线圈 ── */
.w-rings {
    position: absolute;
    left: 12px;
    top: 40px;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    pointer-events: none;
    z-index: 30;
    width: 24px;
}
.w-ring {
    width: 24px;
    height: 10px;
    background: linear-gradient(to bottom, #ffffff, var(--w-metal), #8a929e);
    border-radius: 5px;
    box-shadow: 2px 4px 6px rgba(0,0,0,0.15);
}

/* ════ 轮播容器 ════ */
#whisper-carousel {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    min-height: 0;
}
#whisper-carousel.grabbing { cursor: grabbing; }

#whisper-boxes {
    display: flex;
    transition: transform 0.35s ease-out;
    will-change: transform;
    align-items: stretch;
    width: 100%;
    min-height: 0;
}

.whisper-box {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    padding: 0 10px 20px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: transform 0.8s cubic-bezier(0.3, 1, 0.2, 1), opacity 0.8s;
}
.whisper-box.side {
    opacity: 0.5;
    transform: scale(0.94);
}
.whisper-box.center {
    opacity: 1;
    transform: scale(1);
}
.whisper-box.tearing {
    transform: translateY(100vh) rotate(10deg);
    opacity: 0;
    pointer-events: none;
}

/* ════ 本子封皮 ════ */
.whisper-locket-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    background-color: #dcbfa6;
    border-radius: 8px 16px 16px 8px;
    box-shadow: 10px 20px 40px rgba(0,0,0,0.3), inset 2px 0 8px rgba(0,0,0,0.05);
    padding: 20px 15px 15px 45px;
    overflow: hidden;
    background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
    background-size: 6px 6px;
    border: 1px solid rgba(0,0,0,0.1);
}
.whisper-locket-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 34px;
    width: 2px;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
}

/* ── 咖啡渍装饰 ── */
.coffee-stain {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(
        circle,
        transparent 40%,
        rgba(139,69,19,0.08) 50%,
        rgba(139,69,19,0.03) 60%,
        transparent 70%
    );
    border-radius: 50%;
    transform: scaleY(0.8) rotate(45deg);
    pointer-events: none;
    z-index: 0;
}
.coffee-stain::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 90px;
    height: 90px;
    border: 2px solid rgba(139,69,19,0.06);
    border-radius: 50%;
}

/* ════ 白纸 ════ */
.diary-note-paper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    z-index: 2;
    background: var(--w-paper);
    border-radius: 2px 6px 16px 4px;
    box-shadow: 2px 8px 24px rgba(0,0,0,0.1);
    padding: 24px 20px 10px 20px;
    overflow: hidden;
}

/* ── 纸胶带 ── */
.top-tape {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    width: 80px;
    height: 24px;
    background: var(--w-cover);
    opacity: 0.6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 2px;
    z-index: 10;
    transition: background 0.4s;
    background-image: linear-gradient(90deg, transparent 50%, rgba(255,255,255,0.2) 50%);
    background-size: 4px 100%;
    pointer-events: none;
}

/* ── 爱心书签 ── */
.heart-bookmark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
}
.heart-bookmark svg {
    width: 26px;
    height: 26px;
    fill: transparent;
    stroke: #d0c8c9;
    stroke-width: 2px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.heart-bookmark.favorited svg {
    fill: var(--w-cover);
    stroke: var(--w-cover);
    animation: heart-beat 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 8px var(--w-cover));
}
@keyframes heart-beat {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ── 页面头部 ── */
.page-top {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    padding-right: 40px;
    flex-shrink: 0;
}

.whisper-box-title {
    font-family: var(--w-font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--w-text-dark);
    line-height: 1.3;
    flex: 1;
    word-break: break-all;
}

.page-date {
    font-family: var(--w-font-hand);
    font-size: 16px;
    color: var(--w-cover);
    white-space: nowrap;
    margin-left: 16px;
    transition: color 0.4s;
}

/* ── 纸张内容 ── */
.whisper-paper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding-bottom: 20px;
    position: relative;
    z-index: 2;
    font-family: var(--w-font-serif);
    font-size: 15px;
    color: var(--w-text-dark);
    line-height: 32px;
    text-align: justify;
    letter-spacing: 0.5px;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    will-change: transform;
    word-wrap: break-word;
    word-break: break-all;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 31px,
        rgba(92,77,71,0.05) 31px,
        rgba(92,77,71,0.05) 32px
    );
    background-position: 0 0;
}
.whisper-paper::-webkit-scrollbar { display: none; }
.whisper-paper p { margin-bottom: 16px; }

/* ── 签名 ── */
.signature,
.whisper-sign {
    display: block;
    text-align: right;
    margin-top: 30px;
    font-family: var(--w-font-sign);
    font-size: 24px;
    color: #111;
    font-weight: normal;
    flex-shrink: 0;
}

/* ── 隐藏墨迹（可点击揭示） ── */
.smudged-ink {
    color: transparent;
    text-shadow: 0 0 8px rgba(92,77,71,0.8);
    border-bottom: 1px dashed rgba(92,77,71,0.3);
    cursor: pointer;
    transition: 0.8s ease;
    user-select: none;
}
.smudged-ink.revealed {
    color: var(--w-cover);
    text-shadow: none;
    font-weight: 600;
    border-bottom-color: transparent;
}
.whisper-struck {
    opacity: 0.62;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(92,77,71,0.55);
}

/* ════ 装饰物品容器 ════ */
.decor-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    z-index: 10;
    position: relative;
    width: 100%;
    clear: both;
}

/* ════ 纪念物翻转卡 ════ */
.flip-item-wrapper {
    perspective: 1000px;
    width: 120px;
    height: 140px;
    transform: rotate(-2deg) translateZ(0);
    cursor: pointer;
    position: relative;
    isolation: isolate;
}

/* 回形针 */
.flip-paperclip {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(10deg);
    width: 14px;
    height: 36px;
    border: 2px solid var(--w-metal);
    border-bottom: none;
    border-radius: 7px;
    z-index: 10;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.flip-item-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    position: relative;
    will-change: transform;
}
.flip-item-wrapper.is-flipped .flip-item-inner {
    transform: rotateY(180deg) scale(1.1) translateZ(0);
    z-index: 20;
}

.flip-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}

/* 卡片背面 */
.flip-back {
    transform: rotateY(180deg) translateZ(1px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    font-family: var(--w-font-sign);
    font-size: 20px;
    color: #111;
    font-weight: normal;
    line-height: 1.4;
    background: #fff;
    background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 10px 10px;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
}
.candy-back { border-radius: 16px; }

/* 票据背面特殊样式 */
.flip-item-wrapper:has(.item-ticket) .flip-back {
    background: #fdf6e3;
    color: #5c4d47;
    font-family: var(--w-font-mono);
    font-size: 14px;
    font-weight: 600;
}

/* ── 快照 ── */
.item-polaroid {
    background: #fff;
    padding: 5px 5px 15px;
    display: flex;
    flex-direction: column;
}
.item-polaroid .photo-area {
    flex: 1;
    background: linear-gradient(135deg, var(--w-cover), #fceee3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    text-align: center;
    padding: 7px;
    font-family: var(--w-font-sans);
    letter-spacing: 1px;
}

/* ── 票根 ── */
.item-ticket {
    background: #fdf6e3;
    border: 1px solid #e0d8c8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px;
    position: relative;
}
.item-ticket::before,
.item-ticket::after {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    background: radial-gradient(circle at 0 10px, transparent 5px, #fdf6e3 6px) 0 0/10px 20px;
}
.item-ticket::after {
    left: auto;
    right: -5px;
    background: radial-gradient(circle at 10px 10px, transparent 5px, #fdf6e3 6px) 0 0/10px 20px;
}
.ticket-barcode {
    width: 72%;
    height: 28px;
    background: repeating-linear-gradient(
        90deg,
        #5c4d47 2px,
        transparent 2px,
        transparent 4px,
        #5c4d47 4px,
        #5c4d47 6px,
        transparent 6px,
        transparent 9px
    );
    margin-bottom: 6px;
    opacity: 0.65;
}
.ticket-text {
    font-family: var(--w-font-mono);
    font-size: 9px;
    color: var(--w-text-dark);
    letter-spacing: 2px;
    font-weight: 600;
}

/* ── 收据 ── */
.item-receipt {
    background: #fff;
    padding: 10px 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--w-font-mono);
    font-size: 9px;
    color: #333;
    line-height: 1.8;
    position: relative;
}
.item-receipt::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 10px;
    background:
        linear-gradient(-45deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%),
        linear-gradient(45deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%);
    background-size: 10px 20px;
}
.receipt-logo {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 3px;
    width: 100%;
    text-align: center;
}

/* ── 糖纸 ── */
.item-candy {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.6));
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05), inset 0 0 12px rgba(255,255,255,0.8);
    background-image:
        linear-gradient(45deg, rgba(255,182,193,0.4) 0%, rgba(173,216,230,0.4) 50%, rgba(255,255,224,0.4) 100%);
    position: relative;
    overflow: visible;
}
.item-candy::before,
.item-candy::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 40px;
    background: inherit;
    border: 1px solid rgba(255,255,255,0.6);
    z-index: -1;
}
.item-candy::before {
    left: -16px;
    clip-path: polygon(0 10%, 100% 40%, 100% 60%, 0 90%);
}
.item-candy::after {
    right: -16px;
    clip-path: polygon(100% 10%, 0 40%, 0 60%, 100% 90%);
}
.candy-text {
    font-family: var(--w-font-hand);
    font-size: 28px;
    font-weight: 700;
    color: var(--w-cover);
    text-shadow: 1px 1px 2px #fff;
    transform: rotate(-10deg);
    transition: color 0.4s;
}

/* ════ 删除按钮 ════ */
.whisper-delete-btn {
    align-self: center;
    background: none;
    border: none;
    color: #a89a94;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: 0.2s;
    padding: 10px;
    letter-spacing: 2px;
    margin-top: 10px;
    flex-shrink: 0;
}
.whisper-delete-btn:hover { color: #d9534f; }

/* ════ 锁链层 ════ */
.whisper-jewelry-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    overflow: hidden;
    border-radius: 8px 16px 16px 8px;
}
.is-locked .whisper-jewelry-layer {
    opacity: 1;
    pointer-events: auto;
}
.is-locked .diary-note-paper {
    filter: blur(5px);
    opacity: 0.95;
    pointer-events: none;
    user-select: none;
}
.is-locked .whisper-paper,
.is-locked .page-top {
    filter: blur(3px);
    user-select: none;
    pointer-events: none;
    opacity: 0.7;
}

.whisper-fine-chain {
    position: absolute;
    top: 50%;
    left: -10px;
    right: -10px;
    height: 8px;
    background-image: radial-gradient(circle, var(--w-metal) 40%, transparent 50%);
    background-size: 12px 12px;
    background-repeat: repeat-x;
    transform: translateY(-50%);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    transition: 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s;
}
.whisper-chain-l { transform: translateY(-20px) rotate(3deg); }
.whisper-chain-r { transform: translateY(20px) rotate(-3deg); }

.whisper-lock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    z-index: 20;
    transition: 0.3s;
}
.whisper-mini-lock {
    position: relative;
    width: 44px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.3s;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}
.whisper-lock-container:hover .whisper-mini-lock { transform: scale(1.05); }

.whisper-lock-shackle {
    width: 22px;
    height: 22px;
    border: 4px solid var(--w-metal);
    border-bottom: none;
    border-radius: 11px 11px 0 0;
    margin-bottom: -4px;
    transition: 0.4s ease;
    transform-origin: left bottom;
}
.whisper-lock-body {
    width: 40px;
    height: 36px;
    background: var(--w-metal);
    border-radius: 8px 8px 20px 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(135deg, #ffffff, var(--w-metal));
}
.whisper-lock-keyhole {
    width: 6px;
    height: 12px;
    background: #fff;
    border-radius: 3px;
}

.lock-status-text {
    font-family: var(--w-font-serif);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 8px 20px;
    border-radius: 20px;
    transition: 0.3s;
}
.whisper-lock-container.locked .whisper-mini-lock {
    filter: grayscale(100%) opacity(0.8);
}
.whisper-lock-container.locked .lock-status-text {
    background: rgba(0,0,0,0.6);
    color: #fff;
    backdrop-filter: blur(4px);
}

.whisper-lock-container.ready {
    animation: w-float 2s ease-in-out infinite;
}
.whisper-lock-container.ready .whisper-mini-lock {
    filter: drop-shadow(0 4px 16px var(--w-cover));
}
.whisper-lock-container.ready .lock-status-text {
    background: var(--w-cover);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background 0.4s;
}

@keyframes w-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.whisper-lock-container.shake {
    animation: w-shake 0.4s ease;
}
@keyframes w-shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px) rotate(-5deg); }
    75%       { transform: translateX(4px) rotate(5deg); }
}

.whisper-box.unlocking .whisper-lock-shackle {
    transform: translateY(-4px) rotate(-30deg);
}
.whisper-box.unlocking .whisper-lock-container {
    transform: scale(1.2);
    opacity: 0;
    transition: all 0.6s ease 0.2s;
}
.whisper-box.unlocking .whisper-chain-l {
    transform: translateY(-40px) rotate(8deg);
    opacity: 0;
}
.whisper-box.unlocking .whisper-chain-r {
    transform: translateY(40px) rotate(-8deg);
    opacity: 0;
}

/* ════ 圆点指示器 ════ */
.whisper-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 10px 0 12px;
    flex-shrink: 0;
}
.whisper-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(220,164,154,0.3);
    cursor: pointer;
    transition: all 0.3s;
}
.whisper-dot.active {
    background: var(--w-cover);
    transform: scale(1.4);
}

/* ════ 角色抽屉 ════ */
.sheet-mask {
    position: absolute;
    inset: 0;
    background: rgba(252,250,248,0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}
.sheet-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.sheet-panel {
    background: #fff;
    border-radius: 32px 32px 0 0;
    height: 65%;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.05);
}
.sheet-mask.show .sheet-panel { transform: translateY(0); }

.sheet-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
    font-family: var(--w-font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--w-text-dark);
}
.sheet-close-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--w-text-sub);
    background: none;
    border: none;
    cursor: pointer;
}

#whisper-char-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
}
#whisper-char-list::-webkit-scrollbar { display: none; }

.gem-avatar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #fffdfa;
    border-radius: 16px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.03);
    transition: 0.2s;
}
.gem-avatar:hover,
.gem-avatar.active {
    border-color: var(--w-cover);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    background: #fff;
}
.gem-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
}
.sheet-info { flex: 1; }
.sheet-name {
    font-family: var(--w-font-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--w-text-dark);
}
.sheet-aff {
    font-size: 12px;
    color: var(--w-text-sub);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.whisper-affinity-track {
    flex: 1;
    height: 4px;
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
    margin-left: 12px;
    overflow: hidden;
}
.whisper-affinity-fill {
    height: 100%;
    background: var(--w-cover);
    border-radius: 2px;
    transition: 0.4s;
}

/* ════ 总览弹窗 ════ */
#whisper-ov-mask {
    position: absolute;
    inset: 0;
    background: rgba(252,250,248,0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}
#whisper-ov-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.whisper-overview-panel {
    background: #fff;
    border-radius: 32px 32px 0 0;
    height: 75%;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.05);
}
#whisper-ov-mask.show .whisper-overview-panel { transform: translateY(0); }

.whisper-overview-head {
    padding: 20px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.toc-tabs { display: flex; gap: 24px; }
.toc-tab {
    font-family: var(--w-font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--w-text-sub);
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}
.toc-tab.active { color: var(--w-text-dark); }
.toc-tab.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    background: var(--w-cover);
    border-radius: 2px;
    transition: background 0.4s;
}

.ov-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.ov-write-btn {
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--w-cover);
    font-family: var(--w-font-serif);
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ov-write-btn:active {
    transform: scale(0.95);
    background: var(--w-cover);
    color: #fff;
}
.ov-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--w-text-sub);
    cursor: pointer;
    padding: 0;
    margin-left: 16px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}
#whisper-ov-list,
.w-items-grid {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    transform: translateX(10px);
}
#whisper-ov-list::-webkit-scrollbar,
.w-items-grid::-webkit-scrollbar { display: none; }
#whisper-ov-list.w-tab-active,
.w-items-grid.w-tab-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.w-items-grid {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
}

.whisper-ov-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fffdfa;
    border-radius: 16px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.03);
    transition: 0.2s;
}
.whisper-ov-item:active { transform: scale(0.98); }
.whisper-ov-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--w-cover);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--w-font-serif);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.4s;
}
.whisper-ov-num.locked { background: #d0c8c9; }
.whisper-ov-info { flex: 1; }
.whisper-ov-title {
    font-family: var(--w-font-serif);
    font-size: 15px;
    color: var(--w-text-dark);
    font-weight: 600;
}
.whisper-ov-sub {
    font-size: 11px;
    color: var(--w-text-sub);
    margin-top: 4px;
}

.w-collect-card {
    width: calc(50% - 6px);
    background: #faf8f5;
    border-radius: 14px;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0,0,0,0.03);
    cursor: pointer;
    transition: 0.2s;
}
.w-collect-card:active { transform: scale(0.95); }
.w-collect-icon { font-size: 28px; }
.w-collect-name {
    font-family: var(--w-font-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--w-text-dark);
}
.w-collect-date { font-size: 10px; color: var(--w-text-sub); }

/* ── 拾光子项页面 ── */
.w-sub-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 10px;
    font-family: var(--w-font-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--w-text-dark);
}
.w-sub-back {
    background: none;
    border: none;
    font-size: 26px;
    color: var(--w-text-sub);
    cursor: pointer;
    min-width: 36px;
    line-height: 1;
    padding: 0;
}
.w-sub-item {
    width: calc(50% - 6px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
}
.w-sub-item.w-item-polaroid-sub {
    background: #fff;
    padding: 5px 5px 0;
}
.w-sub-item.w-item-ticket-sub {
    background: #fdf6e3;
    border: 1px solid #e0d8c8;
    padding: 8px 6px;
    position: relative;
}
.w-sub-item.w-item-receipt-sub {
    background: #fff;
    padding: 8px 6px;
    font-family: var(--w-font-mono);
}
.w-sub-item.w-item-candy-sub {
    background: linear-gradient(
        135deg,
        rgba(255,182,193,0.15),
        rgba(173,216,230,0.15),
        rgba(255,255,224,0.15)
    );
    border: 1px solid rgba(255,255,255,0.6);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

/* ════ 解锁按钮（JS专用） ════ */
.whisper-unlock-btn {
    display: block;
    margin: auto auto 12px;
    padding: 10px 32px;
    background: var(--w-cover);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-family: var(--w-font-serif);
    cursor: pointer;
    letter-spacing: 4px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    transition: 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.whisper-unlock-btn:active {
    opacity: 0.85;
    transform: scale(0.96);
}
.whisper-locked-hint {
    display: block;
    text-align: center;
    margin: auto auto 12px;
    font-size: 12px;
    color: var(--w-text-sub);
    font-family: var(--w-font-sans);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ════ 辅助占位状态 ════ */
.w-empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fcfaf8;
    padding: 40px;
}
.w-empty-title {
    font-family: Caveat, cursive;
    font-size: 60px;
    color: #dca49a;
    opacity: 0.4;
}
.w-empty-msg {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    color: #5c4d47;
    margin-top: 16px;
}
.w-empty-sub {
    font-size: 13px;
    color: #a89a94;
    margin-top: 8px;
}
.w-empty-btn-back {
    position: absolute;
    top: 50px;
    left: 14px;
    font-size: 26px;
    color: #a89a94;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}
.w-empty-list {
    text-align: center;
    color: #a89a94;
    padding: 20px;
    font-size: 13px;
}
.w-empty-no-whispers {
    text-align: center;
    color: #a89a94;
    padding: 32px 0;
    font-size: 13px;
}
.w-empty-no-whispers-sub {
    font-size: 11px;
    color: #a89a94;
}
.w-no-whispers {
    color: #c2185b;
    padding: 40px;
}

/* ════ 拾光子项辅助 ════ */
.w-photo-cell {
    height: 70px;
    font-size: 11px;
    color: #a89a94;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, rgba(220,164,154,0.15), rgba(252,238,227,0.4));
}
.w-photo-date {
    padding: 6px 5px 4px;
    font-size: 10px;
    color: #a89a94;
    text-align: center;
}
.w-barcode-cell {
    margin: 10px auto 6px;
}
.w-ticket-cell {
    font-family: var(--w-font-mono);
    font-size: 11px;
    color: var(--w-text-dark);
    text-align: center;
    padding: 0 8px 8px;
}
.w-ticket-date {
    text-align: center;
    padding-bottom: 6px;
}
.w-receipt-cell {
    font-size: 10px;
    color: #555;
    text-align: center;
    padding: 4px 6px;
}
.w-receipt-date-cell {
    font-size: 9px;
    color: #aaa;
    text-align: center;
    padding-bottom: 4px;
    border-top: 1px dashed #ddd;
    margin-top: 4px;
    padding-top: 4px;
}
.w-candy-cell {
    font-size: 16px;
}

/* ════ Toast ════ */
.w-toast {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(14px);
    background: rgba(92,77,71,0.9);
    color: #fff;
    padding: 9px 20px;
    border-radius: 16px;
    font-size: 13px;
    box-shadow: 0 5px 18px rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    transition: all 0.32s;
    z-index: 999;
    white-space: nowrap;
    font-family: var(--w-font-sans);
}
.w-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
