/* ============================================================
   components.css — 纸感手绘组件
   ============================================================ */

/* ---------- 通用纸卡 ---------- */
.paper {
  background: var(--card);
  border: var(--stroke-w) solid var(--stroke);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 20px;
  font-size: var(--fs-md); font-weight: 800; line-height: 1.35;
  color: var(--ink);
  background: var(--card);
  border: var(--stroke-w) solid var(--stroke);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--stroke);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) linear;
  text-align: center;
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--stroke);
}
.btn--primary {
  background: linear-gradient(180deg, var(--orange), #E8974A);
  color: #40291A;
}
.btn--green  { background: linear-gradient(180deg, #63A382, var(--green)); color: #F4FFFA; }
.btn--danger { background: linear-gradient(180deg, #EF8073, var(--red));  color: #FFF6F4; }
.btn--ghost  { background: transparent; box-shadow: none; border-width: 2px; border-color: rgba(58,51,44,.25); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: var(--fs-sm); box-shadow: 0 2px 0 var(--stroke); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* 角落胶带装饰 */
.tape {
  position: relative;
}
.tape::before {
  content: "";
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 58px; height: 18px;
  background: rgba(242,166,90,.5);
  border-left: 1px dashed rgba(58,51,44,.12);
  border-right: 1px dashed rgba(58,51,44,.12);
  border-radius: 2px;
  z-index: 1;
}

/* ============================================================
   首页
   ============================================================ */
.home { background: var(--paper); }

.home-hero {
  position: relative;
  flex: 0 0 auto;
  padding: calc(var(--sat) + 14px) 20px 16px;
  overflow: hidden;
  border-bottom: 2px solid rgba(58,51,44,.10);
}
.home-hero-art { position: absolute; inset: 0; z-index: 0; opacity: .9; }
.home-hero-inner { position: relative; z-index: 1; }

.home-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .22em;
  color: #6B4A20;
  background: rgba(242,166,90,.30);
  border: 1.5px solid rgba(201,154,63,.55);
  padding: 3px 10px; border-radius: var(--r-pill);
  margin-bottom: 10px;
}
.home-title {
  font-size: var(--fs-3xl);
  letter-spacing: .2em;
  display: flex; align-items: baseline; gap: 10px;
}
.home-title small {
  font-size: var(--fs-sm); letter-spacing: .3em;
  color: var(--ink-3); font-weight: 700;
}
.home-slogan {
  margin-top: 8px;
  font-size: var(--fs-md); font-weight: 700;
  color: var(--coral);
  letter-spacing: .04em;
}
.home-slogan i { font-style: normal; opacity: .45; margin: 0 4px; }

.home-hot {
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm);
  background: var(--card);
  border: 1.5px solid rgba(58,51,44,.12);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--ink-2);
}
.home-hot b { color: var(--red); font-family: var(--ff-num); font-size: var(--fs-lg); }
.home-hot .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); flex: 0 0 auto;
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity:.35; transform: scale(1.5);} }

.home-body { padding: 16px 16px calc(var(--sab) + 18px); }

.sec-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 6px 2px 12px;
}
.sec-head h2 { font-size: var(--fs-lg); letter-spacing: .1em; }
.sec-head span { font-size: var(--fs-xs); color: var(--ink-3); }
.sec-head .rule { flex: 1; height: 0; border-top: 2px dashed rgba(58,51,44,.16); }

/* 剧本卡 */
.script-card {
  display: block; width: 100%; text-align: left;
  position: relative;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--r-md);
  transition: transform var(--fast) var(--ease);
}
.script-card:active { transform: scale(.985); }
.script-card--locked { opacity: .82; }

.sc-top { display: flex; gap: 12px; align-items: flex-start; }
.sc-cover {
  position: relative; flex: 0 0 auto;
  width: 74px; height: 74px;
  border-radius: var(--r-sm);
  border: 2px solid var(--stroke);
  overflow: hidden;
  background: var(--paper-2);
}
.sc-cover svg { width: 100%; height: 100%; }
.sc-cover-lock {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(58,51,44,.5);
  color: #fff;
}
.sc-cover-lock svg { width: 24px; height: 24px; }

.sc-main { flex: 1 1 auto; min-width: 0; }
.sc-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.sc-badge {
  font-size: 10px; font-weight: 800; line-height: 1;
  padding: 4px 7px; border-radius: var(--r-pill);
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.sc-badge--hot { color: var(--red); }
.sc-badge--new { color: var(--green); }
.sc-badge--type { color: var(--ink-3); }
.sc-badge--diff { color: var(--gold); }
.sc-title {
  font-size: var(--fs-xl);
  letter-spacing: .04em;
  display: flex; align-items: center; gap: 8px;
}
.sc-no {
  font-family: var(--ff-num); font-size: var(--fs-sm);
  color: var(--orange); font-weight: 800;
}
.sc-desc {
  margin-top: 4px;
  font-size: var(--fs-sm); line-height: 1.65; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sc-meta {
  margin-top: 8px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 10px; color: var(--ink-4); font-weight: 700;
}
.sc-meta i { font-style: normal; display: inline-flex; align-items: center; gap: 3px; }
.sc-meta svg { width: 12px; height: 12px; }

/* 续玩进度条 */
.sc-progress {
  margin-top: 10px;
  height: 7px; border-radius: 99px;
  background: rgba(58,51,44,.10);
  overflow: hidden;
}
.sc-progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--orange), var(--coral));
}

.sc-cta {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sc-cta-btn {
  font-size: var(--fs-sm); font-weight: 800;
  color: #fff; background: var(--ink);
  padding: 8px 16px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 6px;
}
.sc-cta-btn svg { width: 14px; height: 14px; }
.sc-cta-hint { font-size: 10px; color: var(--ink-4); }

/* 首页功能方块 */
.home-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.home-tile {
  padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 800;
  border-radius: var(--r-sm);
  transition: transform var(--fast) var(--ease);
}
.home-tile:active { transform: scale(.96); }
.home-tile svg { width: 22px; height: 22px; }
.home-tile--danger { color: var(--red); }

/* 96110 横幅 */
.home-hotline {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #FFF3E4, #FFE7D2);
  border: 2px solid rgba(224,91,74,.35);
}
.home-hotline svg { width: 26px; height: 26px; flex: 0 0 auto; }
.home-hotline-txt { flex: 1; min-width: 0; }
.home-hotline-txt b { font-size: var(--fs-md); }
.home-hotline-txt span { font-size: 10px; color: var(--ink-2); display: block; }
.home-hotline a {
  font-family: var(--ff-num); font-weight: 800; font-size: var(--fs-lg);
  color: #fff; background: var(--red);
  padding: 8px 14px; border-radius: var(--r-pill);
  white-space: nowrap;
}

/* 声明条 */
.home-credit {
  margin-top: 16px;
  font-size: 10px; line-height: 1.9; color: var(--ink-4);
  text-align: center;
}
.home-credit button { text-decoration: underline; }

/* ============================================================
   结局图鉴
   ============================================================ */
.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gal-item {
  padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  border-radius: var(--r-md);
  min-height: 150px;
}
.gal-item svg { width: 100%; height: 62px; }
.gal-item b { font-size: var(--fs-md); }
.gal-item p { font-size: 10px; color: var(--ink-3); line-height: 1.6; }
.gal-item--locked { filter: grayscale(1); opacity: .55; }
.gal-item--locked svg { opacity: .5; }
.gal-tag {
  font-size: 9px; font-weight: 800;
  padding: 2px 8px; border-radius: 99px;
  color: #fff;
}

/* ============================================================
   剧情页
   ============================================================ */
.game { background: var(--paper); }

/* 场景舞台 */
.stage-scene {
  position: relative;
  flex: 0 0 auto;
  height: 32vh; height: 32dvh;
  min-height: 190px; max-height: 320px;
  overflow: hidden;
  border-bottom: 2px solid rgba(58,51,44,.12);
  background: var(--night);
}
.scene-layer {
  position: absolute; inset: -6% -4%;
  will-change: transform;
  transition: opacity var(--slow) var(--ease);
}
.scene-layer svg { width: 100%; height: 100%; }
/* 层级基线：所有场景图层都在 wash / godray 之上 */
.scene-layer[data-depth="1"] { z-index: 2; }
.scene-layer[data-depth="2"] { z-index: 3; }
.scene-layer[data-depth="3"] { z-index: 4; }
.scene-layer[data-depth="4"] { z-index: 5; }
.scene-layer[data-depth="5"] { z-index: 6; }
.scene-layer[data-depth="6"] { z-index: 7; }
.scene-wash {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
}
/* 场景进入动画 */
.scene-enter { animation: scene-in var(--slow) var(--ease) both; }
@keyframes scene-in {
  from { opacity: 0; filter: blur(7px); transform: scale(1.03); }
  to   { opacity: 1; filter: none; transform: none; }
}

/* 立绘 */
.portrait {
  position: absolute; z-index: 10;
  right: -2%; bottom: -2%;
  width: 54%; max-width: 240px;
  filter: drop-shadow(0 14px 22px rgba(58,51,44,.28));
  animation: portrait-in var(--norm) var(--ease) both;
  transform-origin: 60% 100%;
}
@keyframes portrait-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.portrait svg { width: 100%; height: auto; }
.portrait--center { right: auto; left: 50%; transform: translateX(-50%); width: 60%; }
.portrait--left { right: auto; left: -4%; }

/* 场景标签（幕标题） */
.act-tag {
  position: absolute; z-index: 12; left: 0; top: 0;
  display: flex; align-items: center; gap: 7px;
  background: rgba(58,51,44,.86);
  color: var(--paper);
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .16em;
  padding: 6px 14px 6px 12px;
  border-radius: 0 0 var(--r-sm) 0;
}
.act-tag i { font-style: normal; color: var(--orange); font-family: var(--ff-num); }

/* 场景小工具 */
.scene-tools {
  position: absolute; z-index: 12; right: 10px; top: 10px;
  display: flex; gap: 6px;
}
.scene-tool {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: rgba(255,253,248,.88);
  border: 1.5px solid rgba(58,51,44,.35);
  border-radius: 50%;
  color: var(--ink);
  box-shadow: var(--sh-1);
}
.scene-tool svg { width: 16px; height: 16px; }

/* 仪表条 */
.gauges {
  display: flex; align-items: center; gap: 10px;
}
.gauge { flex: 1 1 0; min-width: 0; }
.gauge-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  font-size: 10px; font-weight: 800; color: var(--ink-2);
  margin-bottom: 3px;
}
.gauge-head b { font-family: var(--ff-num); font-size: var(--fs-sm); }
.gauge-track {
  height: 8px; border-radius: 99px;
  background: rgba(58,51,44,.12);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(58,51,44,.16);
}
.gauge-fill {
  height: 100%; border-radius: 99px;
  transition: width var(--slow) var(--ease);
}
.gauge-fill--radar { background: linear-gradient(90deg, #7FC09A, var(--green)); }
.gauge-fill--trust { background: linear-gradient(90deg, var(--orange), var(--coral)); }
.gauge-fill--money { background: linear-gradient(90deg, #8B7FC7, var(--red)); width: 0 !important; }

/* 金额气泡 */
.wallet {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: flex-end;
  padding-left: 10px;
  border-left: 2px dashed rgba(58,51,44,.18);
}
.wallet small { font-size: 9px; color: var(--ink-4); font-weight: 800; letter-spacing: .1em; }
.wallet b { font-family: var(--ff-num); font-size: var(--fs-lg); color: var(--red); line-height: 1.1; }

/* 剧情滚动区 */
.game-story { padding: 16px 16px calc(var(--sab) + 12px); }

.log { display: flex; flex-direction: column; gap: 12px; }

.log-row { display: flex; flex-direction: column; gap: 4px; animation: log-in var(--norm) var(--ease) both; }
@keyframes log-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.log-row--right { align-items: flex-end; }

/* 旁白 */
.log-narr {
  font-size: var(--fs-md); line-height: 1.95; color: var(--ink-2);
  padding: 2px 4px;
}
.log-narr em { font-style: normal; color: var(--coral); font-weight: 700; }
.log-narr b { color: var(--ink); }

/* 对话气泡 */
.bubble {
  position: relative;
  max-width: 84%;
  display: flex; gap: 9px; align-items: flex-start;
}
.bubble-avatar {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--stroke);
  overflow: hidden;
  background: var(--paper-3);
  box-shadow: var(--sh-1);
}
.bubble-avatar svg { width: 100%; height: 100%; }
.bubble-body { min-width: 0; }
.bubble-name {
  font-size: 10px; font-weight: 800; color: var(--ink-3);
  margin: 0 2px 3px; letter-spacing: .06em;
  display: flex; align-items: center; gap: 5px;
}
.bubble-name u { text-decoration: none; color: var(--ink-4); font-weight: 600; }
.bubble-text {
  position: relative;
  background: var(--bubble-other);
  border: 2px solid var(--stroke);
  border-radius: 14px 16px 16px 14px / 14px 14px 16px 16px;
  padding: 9px 13px;
  font-size: var(--fs-md); line-height: 1.8;
  box-shadow: var(--sh-1);
  word-break: break-word;
}
.bubble-avatar + .bubble-body .bubble-text::before {
  content: "";
  position: absolute; left: -7px; top: 12px;
  width: 11px; height: 11px;
  background: var(--bubble-other);
  border-left: 2px solid var(--stroke);
  border-bottom: 2px solid var(--stroke);
  transform: rotate(45deg);
  border-radius: 0 0 0 3px;
}
.bubble--scam .bubble-text { background: #FFF6EE; }
.bubble--scam .bubble-avatar + .bubble-body .bubble-text::before { background: #FFF6EE; }
.bubble--scam .bubble-name { color: var(--red); }
.bubble--ally .bubble-text { background: #F0F7F2; }
.bubble--ally .bubble-avatar + .bubble-body .bubble-text::before { background: #F0F7F2; }
.bubble--ally .bubble-name { color: var(--green); }
.bubble--self { align-items: flex-end; }
.bubble--self .bubble-text { background: var(--bubble-self); }
.bubble--self .bubble-avatar + .bubble-body .bubble-text::before {
  background: var(--bubble-self);
  left: auto; right: -7px;
  transform: rotate(225deg);
}

/* 手机界面拟真气泡（群聊/落地页） */
.ui-mock {
  max-width: 92%;
  border-radius: 18px;
  border: 2px solid var(--stroke);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--sh-2);
  font-size: var(--fs-sm);
}
.ui-mock-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 11px;
  background: var(--paper-3);
  border-bottom: 2px solid var(--stroke);
  font-size: 10px; font-weight: 800; color: var(--ink-2);
}
.ui-mock-bar .kdot { display: flex; gap: 4px; }
.ui-mock-bar .kdot i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); display: block; }
.ui-mock-bar .kdot i:first-child { background: var(--red); }
.ui-mock-bar .kdot i:nth-child(2) { background: var(--orange); }
.ui-mock-bar .kdot i:last-child { background: var(--green); }
.ui-mock-bar span { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-mock-body { padding: 10px 11px; display: flex; flex-direction: column; gap: 8px; }

/* 拟真内部消息 */
.mk-msg { display: flex; gap: 7px; align-items: flex-start; }
.mk-msg--right { flex-direction: row-reverse; }
.mk-av {
  width: 26px; height: 26px; border-radius: 30%;
  flex: 0 0 auto; border: 1.5px solid var(--stroke);
  overflow: hidden; background: var(--paper-3);
}
.mk-av svg { width: 100%; height: 100%; }
.mk-txt {
  background: var(--paper);
  border: 1.5px solid rgba(58,51,44,.35);
  border-radius: 8px 10px 10px 8px;
  padding: 5px 9px; font-size: 11px; line-height: 1.7; color: var(--ink);
  max-width: 88%;
}
.mk-msg--right .mk-txt { background: #DCF3FF; }
.mk-txt img, .mk-img { max-width: 100%; border-radius: 6px; }

/* 拟真图片 */
.mk-shot {
  border-radius: 8px; border: 1.5px solid rgba(58,51,44,.3);
  overflow: hidden; max-width: 190px;
  background: var(--paper);
}
.mk-shot .cap { font-size: 9px; color: var(--ink-4); padding: 3px 6px; border-top: 1px dashed rgba(58,51,44,.16); }
.mk-shot svg { width: 100%; height: auto; }

/* 拟真按钮 */
.mk-btn {
  display: inline-block;
  padding: 5px 14px; border-radius: 99px;
  background: var(--green); color: #fff;
  font-size: 11px; font-weight: 800;
}

/* 锚点推送卡 */
.anchor-card {
  max-width: 92%;
  border-radius: var(--r-md);
  border: 2px solid var(--green);
  background: linear-gradient(160deg, #F2FAF4, #E8F5ED);
  padding: 11px 13px;
  box-shadow: var(--sh-2);
  animation: anchor-in var(--slow) var(--ease) both;
}
@keyframes anchor-in {
  0%   { opacity: 0; transform: translateY(10px); }
  60%  { opacity: 1; transform: translateY(-2px); }
  100% { transform: none; }
}
.anchor-card-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; color: var(--green);
  letter-spacing: .14em; margin-bottom: 5px;
}
.anchor-card-head svg { width: 13px; height: 13px; }
.anchor-card-sender { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.anchor-card-sender .bubble-avatar { width: 28px; height: 28px; }
.anchor-card-sender b { font-size: var(--fs-sm); }
.anchor-card-text { font-size: var(--fs-sm); line-height: 1.8; color: var(--ink); }

/* 系统提示（官方口径） */
.sys-note {
  max-width: 92%;
  align-self: center;
  text-align: center;
  font-size: 10px; line-height: 1.8; color: var(--ink-3);
  background: rgba(58,51,44,.05);
  border-radius: var(--r-pill);
  padding: 5px 14px;
}

/* ---------- 选项区 ---------- */
.choices { display: flex; flex-direction: column; gap: 9px; }
.choices-prompt {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); font-weight: 800; color: var(--ink-2);
  margin-bottom: 2px;
}
.choices-prompt svg { width: 15px; height: 15px; color: var(--orange); flex: 0 0 auto; }
.choice {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left;
  padding: 12px 14px;
  min-height: 52px;
  background: var(--card);
  border: 2px solid var(--stroke);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--stroke);
  font-size: var(--fs-md); line-height: 1.65; font-weight: 700;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) linear;
  animation: choice-in var(--norm) var(--ease) both;
}
@keyframes choice-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.choice:active { transform: translateY(3px); box-shadow: 0 0 0 var(--stroke); }

.choice-idx {
  flex: 0 0 auto;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-3);
  font-family: var(--ff-num); font-size: 11px; font-weight: 800; color: var(--ink-2);
  margin-top: 2px;
}
.choice-body { flex: 1 1 auto; min-width: 0; }
.choice-label { display: block; }
.choice-hint {
  display: block; margin-top: 3px;
  font-size: 10px; font-weight: 600; color: var(--ink-4);
  line-height: 1.6;
}
/* 高危选项：暖色描边 + 心跳 */
.choice--risky {
  border-color: var(--red);
  background: linear-gradient(180deg, #FFF8F6, var(--card));
}
.choice--risky .choice-idx { background: rgba(224,91,74,.14); color: var(--red); }
.choice--risky::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: inherit;
  border: 2px solid var(--red);
  opacity: 0;
  pointer-events: none;
  animation: risky-beat 2.2s infinite;
}
@keyframes risky-beat {
  0%, 100% { opacity: 0; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.985); }
}
/* 值得做的选项 */
.choice--wise { border-color: var(--green); }
.choice--wise .choice-idx { background: rgba(78,140,107,.14); color: var(--green); }
.choice--locked { opacity: .5; pointer-events: none; }

/* 继续箭头 */
.continue-cue {
  display: flex; justify-content: center; margin-top: 6px;
}
.continue-cue svg { width: 20px; height: 20px; color: var(--ink-4); animation: bob 1.4s infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity:.5 } 50% { transform: translateY(4px); opacity:1 } }

/* ============================================================
   结算页
   ============================================================ */
.result { background: var(--paper); }
.result-hero {
  position: relative; flex: 0 0 auto;
  padding: calc(var(--sat) + 16px) 20px 18px;
  overflow: hidden;
  border-bottom: 2px solid rgba(58,51,44,.12);
  text-align: center;
}
.result-hero-art { position: absolute; inset: 0; z-index: 0; }
.result-hero-inner { position: relative; z-index: 1; }
.result-ending-tag {
  display: inline-block; font-size: var(--fs-xs); font-weight: 800;
  letter-spacing: .3em; color: var(--ink-3); margin-bottom: 6px;
}
.result-title {
  font-size: 34px; letter-spacing: .22em; font-weight: 900;
}
.result-sub { font-size: var(--fs-md); color: var(--ink-2); margin-top: 6px; }
.result-loss {
  margin-top: 14px; display: inline-flex; flex-direction: column; align-items: center;
  padding: 10px 24px;
  border-radius: var(--r-md);
  background: var(--card); border: 2px solid var(--stroke);
  box-shadow: var(--sh-2);
  transform: rotate(-.8deg);
}
.result-loss small { font-size: 10px; color: var(--ink-4); font-weight: 800; letter-spacing: .16em; }
.result-loss b { font-family: var(--ff-num); font-size: 30px; line-height: 1.1; }
.result-loss--zero b { color: var(--green); }
.result-loss--zero small::after { content: "· 全身而退"; font-size: 10px; }

.result-body { padding: 16px 16px calc(var(--sab) + 20px); display: flex; flex-direction: column; gap: 16px; }

.panel { padding: 14px; border-radius: var(--r-md); }
.panel-title {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--fs-md); font-weight: 800;
  margin-bottom: 10px;
}
.panel-title svg { width: 16px; height: 16px; flex: 0 0 auto; }
.panel-title .rule { flex: 1; height: 0; border-top: 2px dashed rgba(58,51,44,.15); }
.panel p { font-size: var(--fs-sm); line-height: 1.9; color: var(--ink-2); }

/* 决策曲线 */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { width: 100%; height: 160px; display: block; }
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 10px; color: var(--ink-3); font-weight: 700; }
.chart-legend i { display: inline-flex; align-items: center; gap: 5px; font-style: normal; }
.chart-legend i::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: currentColor; }

/* 陷阱清单 */
.trap-list { display: flex; flex-direction: column; gap: 7px; }
.trap-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: rgba(224,91,74,.07);
  border-left: 3px solid var(--red);
  font-size: var(--fs-sm); line-height: 1.75;
}
.trap-item--ok { background: rgba(78,140,107,.07); border-left-color: var(--green); }
.trap-item svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 4px; }
.trap-item--ok svg { color: var(--green); }
.trap-item:not(.trap-item--ok) svg { color: var(--red); }

/* 知识卡 */
.kcard { position: relative; }
.kcard-face {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 148px;
}
.kcard-kicker {
  font-size: 10px; font-weight: 800; letter-spacing: .2em; color: var(--orange);
}
.kcard-term {
  font-size: var(--fs-xl); font-weight: 900; letter-spacing: .08em;
  display: flex; align-items: center; gap: 8px;
}
.kcard-term em {
  font-style: normal; font-size: 10px; font-weight: 800;
  background: var(--ink); color: var(--paper);
  padding: 2px 8px; border-radius: 99px; letter-spacing: .1em;
}
.kcard-text { font-size: var(--fs-sm); line-height: 1.9; color: var(--ink-2); }
.kcard-quote {
  font-size: 11px; line-height: 1.8; color: var(--ink-3);
  border-left: 3px solid var(--orange);
  padding-left: 10px; margin-top: auto;
}
.kcard-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.kcard-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); display: block; transition: all var(--fast); }
.kcard-dots i.on { background: var(--orange); width: 18px; border-radius: 99px; }

/* 行动清单 */
.act-list { display: flex; flex-direction: column; gap: 8px; }
.act-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 2px solid var(--stroke);
  font-size: var(--fs-sm); font-weight: 700;
  width: 100%; text-align: left;
}
.act-item svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--orange); }
.act-item span { flex: 1; }
.act-item u { text-decoration: none; font-family: var(--ff-num); font-size: 10px; color: var(--ink-4); }

/* 结局按钮组 */
.result-actions { display: flex; flex-direction: column; gap: 9px; }

/* 分享卡 */
.share-card {
  width: 100%; border-radius: var(--r-md); overflow: hidden;
  border: 2px solid var(--stroke);
  background: var(--card);
}
.share-card canvas { width: 100%; display: block; }

/* ============================================================
   Toast
   ============================================================ */
.toast-host {
  position: absolute; z-index: 45;
  left: 0; right: 0; bottom: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  padding: 0 20px;
}
.toast {
  max-width: 100%;
  background: rgba(58,51,44,.92);
  color: var(--paper);
  font-size: var(--fs-sm); font-weight: 700;
  padding: 9px 16px; border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
  animation: toast-in var(--norm) var(--ease) both;
  text-align: center;
}
.toast--out { animation: toast-out var(--norm) var(--ease) both; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ============================================================
   通用小组件
   ============================================================ */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--ink-3); }
.tiny { font-size: var(--fs-xs); }
.center { text-align: center; }
.empty-state {
  padding: 34px 20px; text-align: center; color: var(--ink-4);
  font-size: var(--fs-sm); line-height: 1.9;
}
.empty-state svg { width: 44px; height: 44px; margin: 0 auto 12px; opacity: .6; }

/* 设置行 */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 2px;
  border-bottom: 1.5px dashed rgba(58,51,44,.12);
}
.set-row:last-child { border-bottom: 0; }
.set-row-l { font-size: var(--fs-md); font-weight: 700; }
.set-row-l small { display: block; font-size: 10px; color: var(--ink-4); font-weight: 600; }
.seg { display: flex; gap: 5px; }
.seg button {
  min-width: 42px; height: 32px; padding: 0 10px;
  border-radius: 99px; border: 2px solid rgba(58,51,44,.22);
  font-size: var(--fs-sm); font-weight: 800; color: var(--ink-3);
  transition: all var(--fast) var(--ease);
}
.seg button.on {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.switch {
  width: 50px; height: 28px; border-radius: 99px;
  background: rgba(58,51,44,.18); position: relative;
  transition: background var(--fast) linear;
  border: 2px solid var(--stroke);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(58,51,44,.3);
  transition: transform var(--fast) var(--ease);
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(22px); }

/* 章节头（回放/图鉴） */
.sec-block { padding: 14px; border-radius: var(--r-md); }

/* 历史列表 */
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--paper);
  border-left: 3px solid var(--orange);
}
.hist-item--choice { border-left-color: var(--cyan); }
.hist-item--anchor { border-left-color: var(--green); }
.hist-item-who { font-size: 10px; font-weight: 800; color: var(--ink-3); flex: 0 0 52px; }
.hist-item-txt { font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-2); }
.hist-item-delta { font-size: 10px; font-family: var(--ff-num); color: var(--ink-4); margin-top: 2px; }

/* ============================================================
   剧本通用拟真元件扩展
   ============================================================ */

/* 短信气泡 */
.mk-sms {
  font-size: 11.5px; line-height: 1.75;
  background: linear-gradient(180deg, #FFFDF8, #F7F1E4);
  border: 1.5px solid rgba(58,51,44,.35);
  border-radius: 12px;
  padding: 9px 11px;
  color: var(--ink);
  position: relative;
}
.mk-sms::before {
  content: ""; position: absolute; top: 6px; left: -5px;
  width: 10px; height: 10px; background: #FFFDF8;
  border-left: 1.5px solid rgba(58,51,44,.35);
  border-bottom: 1.5px solid rgba(58,51,44,.35);
  transform: rotate(45deg); border-radius: 0 0 0 2px;
}
.mk-sms u { color: var(--cyan); text-decoration: underline; }
.mk-sms b { color: var(--red); }

/* 组合单条目 */
.mk-combo {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; margin-bottom: 5px;
  background: var(--paper);
  border: 1.5px solid rgba(58,51,44,.3);
  border-radius: 9px;
  font-size: 11.5px;
}
.mk-combo:last-child { margin-bottom: 0; }
.mk-combo b { flex: 0 0 52px; color: var(--ink); font-size: 10.5px; }
.mk-combo span {
  flex: 0 0 auto; font-family: var(--ff-num); font-weight: 800;
  color: var(--red); font-size: 13px;
}
.mk-combo i { font-style: normal; font-size: 9.5px; color: var(--ink-4); margin-left: auto; }

/* 待结算/账户小卡 */
.mk-acct {
  border: 1.5px solid rgba(58,51,44,.3);
  border-radius: 9px;
  background: linear-gradient(180deg, #F4FBF8, #E8F4EE);
  padding: 9px 11px;
}
.mk-acct-row { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--ink-2); }
.mk-acct-row + .mk-acct-row { margin-top: 3px; }
.mk-acct-row b { font-family: var(--ff-num); color: var(--green); }
.mk-acct-row--warn b { color: var(--red); }

/* 视频通话面板（AI 换脸专用） */
.mk-vcall {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--stroke);
  background: #1A1620;
}
.mk-vcall-face { position: relative; height: 168px; overflow: hidden; }
.mk-vcall-face svg { width: 100%; height: 100%; display: block; }
.mk-vcall-face svg .vc-glitch { display: none; }
.mk-vcall--glitch .mk-vcall-face svg .vc-glitch { display: block; }
.mk-vcall-badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; align-items: center; gap: 6px;
  font-size: 9px; font-weight: 800; color: #FFF6EE;
  z-index: 3;
}
.mk-vcall-badges .live {
  background: var(--red); padding: 2px 8px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 4px;
}
.mk-vcall-badges .live i { width: 5px; height: 5px; border-radius: 50%; background: #FFF6EE; display: block; animation: pulse 1.6s infinite; }
.mk-vcall-badges .time { background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 99px; font-family: var(--ff-num); }
.mk-vcall-badges .sig { margin-left: auto; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 99px; }
.mk-vcall-bar {
  display: flex; gap: 8px; padding: 9px 10px;
  background: #241F2B;
}
.mk-vcall-bar .vc-btn {
  flex: 1; text-align: center;
  font-size: 10px; font-weight: 800; color: #FFF6EE;
  background: rgba(255,255,255,.14);
  border-radius: 99px; padding: 6px 0;
}
.mk-vcall-bar .vc-btn--red { background: var(--red); }
.mk-vcall-bar .vc-btn--green { background: var(--green); }

/* AI 破绽标注 */
.mk-glitchnote {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 10px; line-height: 1.7; color: var(--ink-2);
  background: rgba(224,91,74,.08);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 7px 10px;
  margin-top: 7px;
}
.mk-glitchnote svg { width: 12px; height: 12px; color: var(--red); flex: 0 0 auto; margin-top: 3px; }

/* 反诈提示条 */
.mk-warn {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 10.5px; line-height: 1.75;
  background: #FFF3E4;
  border: 1.5px dashed rgba(201,154,63,.7);
  border-radius: 9px;
  padding: 8px 10px;
  color: #8A5A20;
}
.mk-warn svg { width: 13px; height: 13px; color: var(--gold); flex: 0 0 auto; margin-top: 2px; }

/* 转账凭条 */
.mk-receipt {
  border: 1.5px solid rgba(58,51,44,.3);
  border-radius: 9px;
  background: linear-gradient(180deg, #FFFDF8, #F4EDDF);
  padding: 9px 11px;
  font-size: 10.5px;
  color: var(--ink-2);
}
.mk-receipt .r-row { display: flex; justify-content: space-between; gap: 8px; }
.mk-receipt .r-row + .r-row { margin-top: 4px; }
.mk-receipt .r-row b { color: var(--ink); font-family: var(--ff-num); }
.mk-receipt .r-row--total { border-top: 1px dashed rgba(58,51,44,.2); padding-top: 5px; margin-top: 6px; }
.mk-receipt .r-row--total b { color: var(--red); font-size: 13px; }
.mk-receipt .r-stamp {
  display: inline-block; margin-top: 7px;
  font-size: 9px; font-weight: 800; letter-spacing: .2em;
  color: var(--green); border: 2px solid var(--green);
  border-radius: 4px; padding: 2px 8px;
  transform: rotate(-4deg);
}
.mk-receipt .r-stamp--red { color: var(--red); border-color: var(--red); }

/* 时间戳分隔 */
.mk-time { text-align: center; font-size: 9.5px; color: var(--ink-4); font-weight: 700; margin: 2px 0; }

/* 头像带小角标（AI 标识） */
.mk-ai-flag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 8.5px; font-weight: 800;
  color: #fff; background: #6B5B95;
  padding: 1px 6px; border-radius: 99px;
  margin-left: 5px; vertical-align: middle;
}

/* 视频通话内的立绘需要填满 */
.mk-vcall-face { background:#1A1620; }
.mk-vcall-face > svg:first-child { position:absolute; inset:0; width:100%!important; height:100%!important; }

/* 头像 AI 标识 */
.bubble-avatar-wrap { position: relative; flex: 0 0 auto; }
.bubble-avatar-wrap .ai-dot {
  position: absolute; right: -3px; bottom: -2px;
  font-size: 7px; font-weight: 800; color: #fff;
  background: #6B5B95; border: 1.2px solid #FFFDF8;
  border-radius: 99px; padding: 0 3px; line-height: 1.5;
}

/* 立绘挂载点（剧情舞台内） */
.stage-portrait-holder {
  position: absolute; inset: 0; z-index: 10;
  pointer-events: none;
}
.stage-portrait-holder .portrait {
  position: absolute; right: -4%; bottom: -3%;
  width: 52%; max-width: 230px;
}
@media (max-height: 700px) {
  .stage-scene { height: 27dvh; min-height: 160px; }
  .stage-portrait-holder .portrait { width: 44%; max-width: 180px; }
}
@media (min-height: 820px) and (max-width: 767px) {
  .stage-scene { height: 34dvh; min-height: 240px; }
  .stage-portrait-holder .portrait { width: 58%; max-width: 260px; }
}

/* 历史回放行（恢复存档时） */
.hist-replay { opacity: .85; }

/* 结局图鉴网格内小卡 */
.gal-item svg text { font-family: var(--ff); }

/* 结算页 loss 模块 */
.result-loss--zero small::after { content: ' · 全身而退'; font-size: 10px; }

/* 顶部幕标签小屏适配 */
@media (max-width: 360px) {
  .act-tag { font-size: 9.5px; padding: 5px 10px; }
}
