/* 《夜航》阅读器样式 */

body.yhOn { overflow: hidden; }

.yhFull {
  position: fixed; inset: 0; z-index: 999970;
  display: none; flex-direction: column;
  background: #07060d;
  color: #ece6f7;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.yhFull.on { display: flex; }

/* 背景：模糊的场景照片 + 季节色调 */
.yhFull::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(52, 34, 92, .5), transparent 60%),
    radial-gradient(90% 70% at 90% 100%, rgba(20, 60, 80, .3), transparent 62%),
    linear-gradient(180deg, #0a0816, #07060d 60%, #05040a);
}
.yhFull.s2::before {
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(38, 40, 76, .5), transparent 62%),
    radial-gradient(100% 70% at 10% 100%, rgba(10, 46, 60, .4), transparent 60%),
    linear-gradient(180deg, #070912, #05060c 60%, #04050a);
}
.yhBg {
  position: absolute; inset: -6%; z-index: 0;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  filter: blur(26px) brightness(.34) saturate(.85);
  opacity: .85; transition: background-image .5s, opacity .5s;
}

/* 顶栏 */
.yhTop {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 8px;
  font-size: 11.5px; letter-spacing: .08em; color: rgba(210, 200, 235, .6);
}
.yhExit {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(190, 175, 230, .28);
  background: rgba(22, 16, 38, .7); color: #cfc6e8;
  font-size: 13px; line-height: 1; cursor: pointer;
}
.yhChT { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yhProg { flex: 0 0 auto; opacity: .7; }

/* 舞台 */
.yhStage {
  position: relative; z-index: 2; flex: 1; min-height: 0;
  cursor: pointer;
}

/* 立绘 */
.yhStand {
  position: absolute; right: -4%; bottom: 0;
  width: 76%; max-width: 520px; height: 78%;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
.yhStand.on { opacity: 1; }
.yhStand img {
  max-height: 100%; max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .6));
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
}

/* 对话框 */
.yhBox {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 56px 22px calc(env(safe-area-inset-bottom, 0px) + 30px);
  background: linear-gradient(180deg, transparent, rgba(5, 4, 10, .88) 34%, rgba(5, 4, 10, .97));
  z-index: 3;
}
.yhWho {
  font-size: 12.5px; letter-spacing: .18em;
  color: #8fd8cc; margin-bottom: 10px;
}
.yhTx {
  font-size: 17px; line-height: 2.05; letter-spacing: .02em;
  color: #f2ecff; min-height: 3.2em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}
.yhHint {
  margin-top: 14px; font-size: 11px; letter-spacing: .14em;
  color: rgba(200, 190, 225, .42);
  animation: yhBreath 2.6s ease-in-out infinite;
}
@keyframes yhBreath { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }

/* 章节标题卡 */
.yhTitleCard {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; letter-spacing: .16em; color: #f6f1ff;
  background: rgba(6, 5, 12, .92);
  opacity: 0; pointer-events: none; transition: opacity .5s;
  text-align: center; padding: 0 30px;
}
.yhTitleCard.on { opacity: 1; }

/* 岔口 */
.yhChoices {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 26px);
  background: linear-gradient(180deg, transparent, rgba(4, 3, 9, .95) 30%);
  display: none; flex-direction: column; gap: 10px;
}
.yhChoices.on { display: flex; }
.yhQ {
  font-size: 13px; color: rgba(220, 210, 245, .8);
  text-align: center; margin-bottom: 4px; line-height: 1.8;
}
.yhOpt {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(150, 190, 255, .26);
  background: rgba(22, 20, 40, .92);
  color: #eee8ff; cursor: pointer;
  transition: border-color .2s, transform .12s;
}
.yhOpt:active { transform: scale(.985); }
.yhOpt b { display: block; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.yhOpt i {
  display: block; margin-top: 5px;
  font-style: normal; font-size: 11px; letter-spacing: .04em;
  color: rgba(180, 175, 205, .62);
}
.yhOpt[data-o="a"] { border-color: rgba(130, 220, 200, .34); }
.yhOpt[data-o="a"] i { color: rgba(130, 220, 200, .68); }

/* HUD：替的三格 + 光/影 */
.yhHud {
  position: absolute; z-index: 5;
  left: 16px; top: calc(env(safe-area-inset-top, 0px) + 54px);
  display: none; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: .1em; color: rgba(215, 205, 240, .55);
}
.yhHud.on { display: flex; }
.yhHudT { opacity: .7; }
.yhDots { display: flex; gap: 4px; }
.yhDots i {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid rgba(160, 220, 200, .5);
  background: transparent;
}
.yhDots i.on { background: #7fe0c8; box-shadow: 0 0 8px rgba(127, 224, 200, .7); }
.yhBar {
  position: relative; width: 42px; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, .12); overflow: hidden;
}
.yhBar b { position: absolute; left: 0; top: 0; bottom: 0; background: #ffd98a; transition: width .4s; }
.yhBar.sh b { background: #7fb6ff; }

/* 付费闸门 */
.yhGate { padding: 6px 4px 2px; text-align: center; }
.yhGateT { font-size: 16px; letter-spacing: .04em; color: #f4efff; margin-bottom: 10px; }
.yhGateP { font-size: 13px; line-height: 1.95; color: rgba(210, 202, 232, .78); margin-bottom: 16px; }
.yhGateRow { display: flex; gap: 8px; }
.yhGateRow input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(160, 150, 200, .34);
  background: rgba(16, 14, 28, .9); color: #eee8ff;
  font-size: 14px; letter-spacing: .12em; text-transform: uppercase;
}
.yhGateRow button {
  flex: 0 0 auto; padding: 12px 18px; border-radius: 12px;
  border: 1px solid rgba(130, 220, 200, .45);
  background: rgba(60, 190, 165, .16); color: #a8f0dd;
  font-size: 13.5px; cursor: pointer;
}
.yhGateTip {
  margin-top: 14px; font-size: 11px; line-height: 1.9;
  color: rgba(190, 182, 215, .55);
}
.yhBuy { color: #8fd8cc; text-decoration: underline; cursor: pointer; }
.yhGateSmall { font-size: 13px; line-height: 2; color: rgba(215, 208, 238, .82); }
.yhGateSmall b { color: #8fd8cc; }
.yhEndTag { display: block; text-align: center; font-size: 12px; letter-spacing: .3em; color: rgba(200, 192, 225, .5); margin-top: 8px; }

/* 首页入口条 */
.yhCard {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px; padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(150, 170, 235, .22);
  background: linear-gradient(135deg, rgba(44, 38, 78, .55), rgba(18, 34, 52, .5));
  cursor: pointer; position: relative; overflow: hidden;
}
.yhCard:active { transform: scale(.995); }
.yhCard .yhc {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  background: url("../img/yh/cover_a.webp") center 22% / cover no-repeat;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.yhCard .yht { flex: 1; min-width: 0; }
.yhCard .yht b { display: block; font-size: 14px; color: #f0ebff; letter-spacing: .04em; }
.yhCard .yht span { display: block; font-size: 11.5px; color: rgba(200, 194, 228, .62); margin-top: 3px; }
.yhCard .yhp {
  flex: 0 0 auto; font-size: 11px; padding: 4px 9px; border-radius: 8px;
  border: 1px solid rgba(255, 200, 120, .4); color: #ffd98a;
}
.yhCard .yhp.free { border-color: rgba(130, 220, 200, .45); color: #9fe9d6; }

@media (max-width: 380px) {
  .yhTx { font-size: 16px; }
  .yhStand { width: 82%; height: 72%; }
}

.yhTitleSub {
  display: block; margin-top: 12px;
  font-size: 11.5px; font-style: normal; letter-spacing: .2em;
  color: rgba(200, 194, 228, .5);
}

/* 结局清单（闸门里） */
.yhEndList {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
  margin: 4px 0 16px; padding: 12px;
  border-radius: 12px; border: 1px solid rgba(150, 160, 220, .16);
  background: rgba(14, 14, 26, .5);
}
.yhEndItem {
  font-size: 11.5px; letter-spacing: .03em; color: rgba(205, 198, 230, .62);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
