/* ============================================================
   《问道长生》· 修仙人生旧弹窗插画装裱
   ------------------------------------------------------------
   服务范围：
     · 坊市 / 丹器 / 事件 / 宗门 / 洞天（洞府 + 灵田）场景横幅
     · 背包 / 存档 / 图鉴 / 修炼 / 结局等旧弹窗的统一宣纸层次
   明确不涉及：
     · 斗法弹窗 .modal.combat-modal（已有 combat-stage.css）
     · 轮回牌局独立全屏层（不接管、不覆盖）
   建议加载顺序：css/style.css 之后。
   ============================================================ */

/* ---------- 一、通用宣纸 / 青绿层次 ---------- */
.modal:not(.combat-modal) {
  box-shadow:
    0 14px 46px rgba(20, 28, 24, 0.40),
    inset 0 0 0 1px rgba(44, 74, 82, 0.20),
    inset 0 0 0 6px rgba(255, 252, 242, 0.52);
}

/* 标题下的一笔青绿朱砂界画 */
.modal:not(.combat-modal) h1::after {
  content: "";
  display: block;
  width: 84px;
  height: 1px;
  margin: 7px auto 0;
  background: linear-gradient(90deg,
    transparent,
    rgba(44, 74, 82, 0.58) 20%,
    rgba(168, 54, 44, 0.62) 50%,
    rgba(44, 74, 82, 0.58) 80%,
    transparent);
  box-shadow: 0 1px 0 rgba(255, 252, 242, 0.55);
}

/* 小节标题：加一条若隐若现的青绿纸界 */
.modal:not(.combat-modal) .body h3 {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(44, 74, 82, 0.12);
}

/* 分隔线中央嵌一枚青玉菱花 */
.modal:not(.combat-modal) .hr {
  position: relative;
  height: 0;
  margin: 15px 0;
  border-top: 1px solid rgba(138, 128, 114, 0.42);
}
.modal:not(.combat-modal) .hr::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  transform: rotate(45deg);
  background: rgba(63, 111, 87, 0.55);
  box-shadow: 0 0 0 2px rgba(243, 236, 219, 0.95);
}

/* 页签：一条浅宣纸条，和下方内容分层 */
.modal:not(.combat-modal) .tabs {
  padding: 2px 6px 0;
  border: 1px solid rgba(185, 172, 144, 0.55);
  border-bottom-color: rgba(44, 74, 82, 0.24);
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, rgba(255, 252, 242, 0.50), rgba(233, 223, 200, 0.16));
}
.modal:not(.combat-modal) .tab.active {
  background: rgba(255, 252, 242, 0.45);
}

/* 标签与输入框：淡淡的纸面压印，不抢正文 */
.modal:not(.combat-modal) .tag {
  font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 252, 242, 0.35);
}
.modal:not(.combat-modal) .input {
  box-shadow: inset 0 1px 3px rgba(43, 38, 32, 0.06);
}
.modal:not(.combat-modal) .input:focus {
  box-shadow: 0 0 0 3px rgba(168, 54, 44, 0.12);
}

/* 事件选项：左侧青玉书签，悬停转朱砂 */
.modal.modal-event .event-opt {
  background: linear-gradient(180deg, rgba(255, 252, 242, 0.94), rgba(243, 236, 219, 0.72));
  box-shadow: inset 3px 0 0 rgba(63, 111, 87, 0.45), 0 1px 2px rgba(43, 38, 32, 0.05);
}
.modal.modal-event .event-opt:hover:not(.blocked):not(:disabled),
.modal.modal-event .event-opt:focus-visible:not(.blocked):not(:disabled) {
  box-shadow: inset 3px 0 0 rgba(168, 54, 44, 0.62), 0 3px 10px rgba(168, 54, 44, 0.14);
}
.modal.modal-event .event-opt.blocked {
  box-shadow: inset 3px 0 0 rgba(138, 128, 114, 0.28);
}

/* 事件徽记与后果标签：不小于 12px，窄屏也清晰 */
.modal:not(.combat-modal) .event-pool,
.modal:not(.combat-modal) .opt-tag {
  font-size: 12px;
}

/* 键盘焦点：不改变鼠标交互，只给可操作项一圈朱砂 */
.modal:not(.combat-modal) .event-opt:focus-visible,
.modal:not(.combat-modal) .tab:focus-visible,
.modal:not(.combat-modal) .modal-x:focus-visible {
  outline: 2px solid rgba(168, 54, 44, 0.72);
  outline-offset: 2px;
}

/* ---------- 二、场景横幅 ---------- */
.scene-banner {
  position: relative;
  height: 136px;
  margin: 2px 0 14px;
  overflow: hidden;
  border: 1px solid rgba(44, 74, 82, 0.26);
  border-radius: 3px;
  background-color: #d9d4c1;
  background-image:
    linear-gradient(90deg,
      rgba(243, 236, 219, 0.94) 0%,
      rgba(243, 236, 219, 0.62) 14%,
      rgba(243, 236, 219, 0.12) 36%,
      rgba(43, 38, 32, 0.16) 100%),
    linear-gradient(180deg,
      rgba(243, 236, 219, 0.10) 0%,
      rgba(43, 38, 32, 0.05) 58%,
      rgba(43, 38, 32, 0.24) 100%),
    var(--scene-img, none),
    radial-gradient(ellipse at 72% 118%, rgba(63, 111, 87, 0.34), transparent 62%),
    linear-gradient(180deg, #dfe6dc 0%, #e9dfc8 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center, center, var(--scene-pos, center), center, center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 242, 0.28),
    0 2px 8px rgba(43, 38, 32, 0.12);
}

/* 两条描金细轴，像一幅横披 */
.scene-banner::before,
.scene-banner::after {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(154, 116, 18, 0.52), transparent);
}
.scene-banner::before { left: 7px; }
.scene-banner::after { right: 7px; }

/* 右下角朱砂小印 */
.scene-banner-seal,
.scene-strip-seal {
  position: absolute;
  right: 12px;
  bottom: 9px;
  padding: 4px 2px;
  border: 1px solid rgba(168, 54, 44, 0.72);
  border-radius: 2px;
  color: #a8362c;
  background: rgba(243, 236, 219, 0.86);
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-align: center;
  writing-mode: vertical-rl;
  box-shadow: 0 1px 4px rgba(43, 38, 32, 0.16);
}

/* 灵田区的小横条：与主横幅同一套装裱，但更矮 */
.scene-strip {
  position: relative;
  height: 84px;
  margin: 8px 0 10px;
  overflow: hidden;
  border: 1px solid rgba(44, 74, 82, 0.24);
  border-radius: 3px;
  background-color: #d9d4c1;
  background-image:
    linear-gradient(90deg,
      rgba(243, 236, 219, 0.86) 0%,
      rgba(243, 236, 219, 0.28) 24%,
      rgba(43, 38, 32, 0.14) 100%),
    linear-gradient(180deg, rgba(243, 236, 219, 0.08), rgba(43, 38, 32, 0.18)),
    var(--scene-img, none),
    linear-gradient(180deg, #e2e8dc 0%, #e9dfc8 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center, center, var(--scene-pos, center), center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 242, 0.24),
    0 1px 5px rgba(43, 38, 32, 0.10);
}
.scene-strip::before,
.scene-strip::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(154, 116, 18, 0.46), transparent);
}
.scene-strip::before { left: 6px; }
.scene-strip::after { right: 6px; }
.scene-strip-seal {
  right: 10px;
  bottom: 7px;
  padding: 3px 2px;
  font-size: 12px;
}

/* ---------- 三、六张场景图的独立裁切 ---------- */
.scene-shop {
  --scene-img: url("../assets/art/scenes/shop.webp");
  --scene-pos: 50% 56%;
}
.scene-rest {
  --scene-img: url("../assets/art/scenes/rest.webp");
  --scene-pos: 50% 62%;
}
.scene-forge {
  --scene-img: url("../assets/art/scenes/forge.webp");
  --scene-pos: 50% 48%;
}
.scene-event {
  --scene-img: url("../assets/art/scenes/event.webp");
  --scene-pos: 50% 40%;
}
.scene-sect {
  --scene-img: url("../assets/art/scenes/sect.webp");
  --scene-pos: 50% 46%;
}
.scene-garden {
  --scene-img: url("../assets/art/scenes/garden.webp");
  --scene-pos: 50% 56%;
}

/* ---------- 四、窄屏：横幅收至 78px，操作区不被挤压 ---------- */
@media (max-width: 640px) {
  .scene-banner {
    height: 78px;
    margin: 0 0 11px;
  }
  .scene-banner-seal,
  .scene-strip-seal {
    right: 9px;
    bottom: 7px;
    padding: 3px 2px;
    font-size: 12px;
  }
  .scene-strip {
    height: 70px;
    margin: 6px 0 9px;
  }
  .scene-strip-seal {
    right: 8px;
    bottom: 6px;
  }
  .modal:not(.combat-modal) .tabs {
    padding: 1px 4px 0;
  }
  .modal:not(.combat-modal) h1::after {
    width: 70px;
  }
}

/* ---------- 五、减动效 / 游戏内关闭动画 ---------- */
@media (prefers-reduced-motion: reduce) {
  .scene-banner,
  .scene-strip,
  .scene-banner-seal,
  .scene-strip-seal,
  .modal:not(.combat-modal) .event-opt,
  .modal:not(.combat-modal) .tab,
  .modal:not(.combat-modal) .tag {
    animation: none !important;
    transition: none !important;
  }
}
body.no-anim .scene-banner,
body.no-anim .scene-strip,
body.no-anim .scene-banner-seal,
body.no-anim .scene-strip-seal,
body.no-anim .modal:not(.combat-modal) .event-opt,
body.no-anim .modal:not(.combat-modal) .tab,
body.no-anim .modal:not(.combat-modal) .tag {
  animation: none !important;
  transition: none !important;
}
