/* 剧情页：背景插图 + 深色遮罩，台词框和选项是玻璃 */
.sp {
  position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  background-color: #151b29; background-size: cover; background-position: center;
  background-image: linear-gradient(180deg, rgba(15, 20, 32, .45), rgba(15, 20, 32, .88) 75%), var(--sp-img, none);
  transition: background-image .6s;
}
.sp[data-bg=home]     { --sp-img: url(../assets/bg/home.webp); }
.sp[data-bg=school]   { --sp-img: url(../assets/bg/school.webp); }
.sp[data-bg=street]   { --sp-img: url(../assets/bg/street.webp); }
.sp[data-bg=hospital] { --sp-img: url(../assets/bg/hospital.webp); }
.sp[data-bg=market]   { --sp-img: url(../assets/bg/market.webp); }
.sp[data-bg=bridge]   { --sp-img: url(../assets/bg/bridge.webp); }
.sp[data-bg=tunnel]   { --sp-img: url(../assets/bg/tunnel.webp); }
.sp[data-bg=night]    { --sp-img: url(../assets/bg/night.webp); }
.sp[data-bg=factory]  { --sp-img: url(../assets/bg/factory.webp); }
.sp[data-bg=dusk]     { --sp-img: url(../assets/bg/dusk.webp); }
.sp[data-bg=tunnel]   { background-image: linear-gradient(180deg, rgba(8, 10, 16, .7), rgba(8, 10, 16, .94) 70%), var(--sp-img); }

.sp-top { position: absolute; top: 12px; right: 16px; display: flex; gap: 8px; z-index: 5; }
.sp-btn {
  padding: 4px 10px; font-size: 12px; letter-spacing: 2px; border-radius: 12px; color: #f1ede6;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sp-btn.on { background: var(--cream); color: var(--ink); }

.sp-cast { flex: 1; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; min-height: 0; }
.sp-cast .npc-bust { width: 240px; height: 283px; margin-bottom: -40px; background: none; box-shadow: none; border: 0; }  /* 下半身压在玻璃后面 */
.sp-cast .npc-bust img { width: 100%; height: 100%; object-fit: contain; }

.sp-box {
  position: relative; margin: 0 16px 14px; min-height: 140px; padding: 22px 18px 28px; cursor: pointer;
  border-radius: 22px; color: #4d4740;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .55); border-top: 1px solid rgba(255, 255, 255, .9);
  backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.sp-name {
  position: absolute; top: -14px; left: 18px; padding: 4px 14px; border-radius: 999px;
  font-size: 13px; letter-spacing: 2px; color: #4d4740;
  background: rgba(255, 255, 255, .88); border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sp-text { font-size: 16px; line-height: 1.85; letter-spacing: .5px; }
.sp-box:not(.talk) .sp-text { color: #5d5750; }
.sp-in { animation: spIn .35s ease both; }
@keyframes spIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sp-tap { position: absolute; right: 16px; bottom: 9px; font-size: 10px; color: #8a837b; animation: spBlink 1.2s infinite; }
.sp-box.done .sp-tap { display: none; }
@keyframes spBlink { 50% { opacity: .2; } }

.sp-opts { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 20px; }
.sp-opts:empty { display: none; }
.sp-opt {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 42px; padding: 9px 18px; border-radius: 999px; text-align: center;
  font-size: 15px; color: #f4f1ec;
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .10));
  border: 1px solid rgba(255, 255, 255, .45); border-top-color: rgba(255, 255, 255, .7);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.sp-opt:disabled { opacity: .4; cursor: default; }
.sp-opt-tx { flex: 0 1 auto; }
.sp-opt-attr { font-size: 11px; color: #e8d9b4; letter-spacing: 1px; }
.sp-opt-hint { font-size: 11px; color: var(--tx-dim); }

.sp-log { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; padding: 16px; background: rgba(21, 27, 41, .97); }
.sp-log[hidden] { display: none; }
.sp-log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; letter-spacing: 4px; }
.sp-log-list { flex: 1; overflow-y: auto; font-size: 14px; line-height: 1.8; color: var(--cream-dim); }
.sp-log-list p { margin-bottom: 8px; }
.sp-log-list b { color: var(--cream); font-weight: 500; }
