/* ============================================================
   家族修仙 · 青云山
   竖屏 H5 · 深蓝仙门 + 暖金灵光
   ============================================================ */

:root {
  --orange: #ff8a3d;
  --orange-2: #ffb45c;
  --orange-deep: #1ED97C;
  --gold: #f6cf8b;
  --gold-soft: #ffe3b6;
  --ink: #1F060D;
  --ink-2: #300A15;
  --ink-3: #471122;
  --text: #eef6ff;
  --muted: #D19EAE;
  --muted-2: #B57F90;
  --line: rgba(255, 205, 140, .24);
  --line-cool: rgba(150, 190, 255, .15);
  --glass: rgba(8, 21, 41, .72);
  --shadow: 0 10px 28px rgba(0, 0, 0, .34);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 12%, #5C162C 0, #260810 48%, #030812 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body.no-scroll { overflow: hidden; }

[hidden] { display: none !important; }

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  margin: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:active { -webkit-tap-highlight-color: transparent; }

img { display: block; max-width: 100%; }

.mp-icon {
  width: 22px;
  height: 22px;
  flex: none;
}

/* ---------------- 舞台 ---------------- */

.game {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  overflow: hidden;
  background: #26070F;
  isolation: isolate;
  box-shadow: 0 0 90px rgba(0, 0, 0, .7);
}

.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.scene-art {
  position: absolute;
  inset: -2px;
  background-image: url("images/gen/home_scene.png");
  background-repeat: no-repeat;
  background-position: 78% 0%;
  background-size: cover;
  filter: saturate(1.06) brightness(.96) contrast(1.02);
  transform: scale(1.015);
  transform-origin: 50% 0;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 52% 46%, rgba(5, 13, 28, 0) 38%, rgba(5, 13, 28, .26) 75%, rgba(4, 10, 20, .62) 100%),
    linear-gradient(180deg, rgba(5, 13, 28, 0) 55%, rgba(4, 10, 21, .42) 78%, rgba(4, 10, 21, .82) 100%);
  pointer-events: none;
}

.scene-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 250px;
  background: linear-gradient(180deg, rgba(4, 12, 26, .96) 0%, rgba(5, 14, 30, .82) 18%, rgba(5, 15, 31, .48) 48%, rgba(5, 15, 31, 0) 100%);
  pointer-events: none;
}

.scene-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 260px;
  background: linear-gradient(0deg, rgba(4, 10, 21, .94) 0%, rgba(4, 11, 23, .62) 32%, rgba(4, 11, 23, 0) 100%);
  pointer-events: none;
}

.motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.mote {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: #ffe4b0;
  box-shadow: 0 0 8px rgba(255, 205, 130, .75);
  opacity: 0;
  animation: moteRise linear infinite;
}

/* ---------------- 顶部玩家 ---------------- */

.hud {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: calc(var(--safe-top) + 10px) 11px 0;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 2px 0;
  text-align: left;
  border-radius: 16px;
}

.hud-player:active .hud-avatar { transform: scale(.95); }

.hud-avatar {
  position: relative;
  width: 51px;
  height: 51px;
  flex: none;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe8b3 0%, #59DFB7 45%, #218A62 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5), 0 0 20px rgba(255, 178, 90, .28);
  transition: transform .15s ease;
}

.av-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 32%, #782341 0, #441022 62%, #310915 100%);
  border: 1px solid rgba(255, 240, 205, .45);
}

.av-inner svg { width: 100%; height: 100%; display: block; }
.av-inner img { width: 100%; height: 100%; object-fit: cover; }

.hud-avatar-realm.realm-up {
  animation: realmPulse 1.15s ease 2;
  border-color: #ffe9bd;
  background: linear-gradient(180deg, #ffe7b5, #ffb050);
  color: #033A21;
  box-shadow: 0 0 14px rgba(255, 196, 100, .95), 0 0 26px rgba(255, 138, 50, .5);
}

.hud-avatar-realm {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(100% - 4px);
  transform: translateX(-50%);
  max-width: 68px;
  padding: 0 4px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 220, 165, .55);
  background: linear-gradient(180deg, rgba(255, 185, 92, .96), rgba(201, 104, 28, .96));
  color: #03321C;
  font-size: 7px;
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: .02em;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .4);
}

.hud-info {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.hud-name-row b {
  min-width: 0;
  max-width: 118px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .03em;
  color: #fff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .65);
}

.hud-title {
  flex: none;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 207, 138, .42);
  background: rgba(255, 160, 80, .14);
  color: #ffd9a4;
  font-size: 8px;
  font-style: normal;
  line-height: 1.4;
  white-space: nowrap;
}

.hud-realm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.hud-realm {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10.5px;
  font-weight: 600;
  color: #cfe2ff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}

.hud-exp-text {
  flex: none;
  font-size: 8px;
  color: rgba(218, 235, 255, .72);
  font-variant-numeric: tabular-nums;
}

.hud-exp {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 1px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .12);
  overflow: hidden;
}

.hud-exp i {
  display: block;
  height: 100%;
  width: 30%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7a2e, #ffc061 70%, #ffe6ae);
  box-shadow: 0 0 8px rgba(255, 170, 80, .7);
  transition: width .35s ease;
}

.hud-currency {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: none;
  margin-top: 1px;
}

.cur {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 25px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(7, 19, 37, .92), rgba(9, 23, 44, .58));
  border: 1px solid rgba(255, 209, 147, .28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.cur:active { transform: scale(.96); }

.cur .mp-icon { width: 13px; height: 13px; }
.cur-stone .mp-icon { color: #80d0ff; filter: drop-shadow(0 0 4px rgba(90, 190, 255, .45)); }
.cur-jade .mp-icon { color: #ffd27a; filter: drop-shadow(0 0 4px rgba(255, 190, 80, .4)); }

.cur b {
  min-width: 30px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cur em {
  margin-left: 1px;
  color: #ffce84;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.hud-tools {
  width: 29px;
  height: 29px;
  flex: none;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(9, 23, 44, .88), rgba(8, 20, 38, .55));
  border: 1px solid rgba(255, 207, 145, .26);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.hud-tools .mp-icon { width: 17px; height: 17px; color: #ffe0b1; }
.hud-tools:active { transform: scale(.93); }

/* ---------------- 主线 ---------------- */

.quest-strip {
  position: absolute;
  z-index: 18;
  top: calc(var(--safe-top) + 84px);
  left: 11px;
  width: min(62%, 258px);
  min-height: 53px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 7px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 2px solid rgba(255, 154, 75, .85);
  background: linear-gradient(90deg, rgba(7, 20, 39, .95) 0%, rgba(8, 21, 42, .8) 62%, rgba(8, 21, 42, .5) 100%);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.quest-strip:active { transform: scale(.985); }

.quest-ico {
  width: 35px;
  height: 35px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 25%, rgba(255, 196, 100, .34), rgba(255, 138, 61, .08) 70%);
  border: 1px solid rgba(255, 196, 120, .4);
  color: #ffd18d;
  box-shadow: inset 0 0 12px rgba(255, 160, 70, .16);
}

.quest-ico .mp-icon { width: 20px; height: 20px; }

.quest-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quest-text b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff3df;
}

.quest-text em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9.5px;
  font-style: normal;
  color: #D9A9B9;
}

.quest-arrow { color: rgba(255, 214, 160, .9); display: flex; }
.quest-arrow .mp-icon { width: 15px; height: 15px; }

/* ---------------- 快捷 ---------------- */

.quick-rail {
  position: absolute;
  z-index: 18;
  top: calc(var(--safe-top) + 83px);
  right: 10px;
  display: grid;
  grid-template-columns: repeat(2, 53px);
  gap: 5px 6px;
}

.quick-rail button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #f0f6ff;
  font-size: 9.5px;
  font-weight: 600;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .8);
}

.quick-rail button:active .q-ico { transform: scale(.9); }

.q-ico {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 24%, rgba(255, 230, 176, .38), rgba(255, 162, 76, .1) 46%, rgba(8, 21, 40, .72) 72%);
  border: 1px solid rgba(255, 205, 140, .42);
  box-shadow: 0 4px 13px rgba(0, 0, 0, .3), inset 0 0 12px rgba(255, 170, 80, .14);
  transition: transform .14s ease;
}

.q-ico .mp-icon { width: 19px; height: 19px; color: #ffd9a5; }

/* ---------------- 家族印 ---------------- */

.family-seal {
  position: absolute;
  z-index: 17;
  left: 11px;
  top: 44%;
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #fff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .8);
}

.family-seal:active .fs-ico { transform: scale(.92); }

.fs-ico {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 24%, rgba(255, 230, 176, .32), rgba(8, 21, 40, .78) 68%);
  border: 1px solid rgba(255, 211, 151, .44);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .35), inset 0 0 15px rgba(255, 170, 80, .12);
  transition: transform .14s ease;
}

.fs-ico .mp-icon { width: 25px; height: 25px; color: #ffe1b2; }
.family-seal b { font-family: var(--serif); font-size: 12px; letter-spacing: .12em; }
.family-seal em { font-size: 8.5px; font-style: normal; color: #ffcf8b; }

/* ---------------- 良缘 / 子嗣 ---------------- */

.story-cards {
  position: absolute;
  z-index: 16;
  right: 0;
  top: 43%;
  width: min(46%, 196px);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.story-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 66px;
  padding: 7px 6px 7px 10px;
  text-align: left;
  overflow: hidden;
  border-radius: 15px 0 0 15px;
  border: 1px solid rgba(255, 207, 140, .24);
  border-right: 0;
  background: linear-gradient(90deg, rgba(9, 22, 42, .5) 0%, rgba(9, 23, 44, .82) 42%, rgba(9, 23, 44, .94) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.story-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 170, 90, .55), rgba(255, 170, 90, 0));
}

.story-card.romance { border-color: rgba(255, 186, 160, .3); }
.story-card.romance::after { background: linear-gradient(90deg, rgba(255, 146, 129, .6), rgba(255, 146, 129, 0)); }
.story-card.heir { border-color: rgba(140, 200, 255, .28); }
.story-card.heir::after { background: linear-gradient(90deg, rgba(120, 190, 255, .55), rgba(120, 190, 255, 0)); }

.story-card:active { transform: translateX(-2px); }

.sc-body {
  flex: 1;
  min-width: 0;
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-body b {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  white-space: nowrap;
}

.sc-body em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9.5px;
  font-style: normal;
  color: #ccdcf2;
}

.sc-art {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  order: 2;
  border-radius: 10px;
  border: 1px solid rgba(255, 218, 165, .5);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
  background: #4A1425;
}

.sc-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.sc-art svg { width: 100%; height: 100%; display: block; border-radius: 9px; }

.sc-realm.realm-up {
  animation: realmPulse 1.15s ease 2;
  border-color: #ffe9bd;
  background: linear-gradient(180deg, #ffe7b5, #ffb050);
  color: #033A21;
  box-shadow: 0 0 12px rgba(255, 196, 100, .95), 0 0 22px rgba(255, 138, 50, .5);
}

.sc-realm {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  max-width: 62px;
  padding: 0 4px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 222, 170, .62);
  background: linear-gradient(180deg, rgba(255, 190, 95, .96), rgba(214, 116, 32, .96));
  color: #03321C;
  font-size: 7px;
  font-weight: 900;
  line-height: 1.55;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .38);
}

.sc-arrow { width: 12px; height: 12px; flex: none; order: 3; color: rgba(255, 216, 162, .9); }

/* ---------------- 系统动态 ---------------- */

.feed {
  position: absolute;
  z-index: 16;
  left: 11px;
  bottom: calc(var(--safe-bottom) + 78px);
  width: min(58%, 240px);
  max-height: 52px;
  overflow: hidden;
  padding: 6px 9px;
  border-radius: 9px;
  border-left: 2px solid rgba(255, 154, 75, .9);
  background: linear-gradient(90deg, rgba(6, 17, 33, .88) 0%, rgba(6, 17, 33, .56) 100%);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .26);
}

.feed-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 9.5px;
  line-height: 1.62;
  color: #d9e7f8;
  white-space: nowrap;
  overflow: hidden;
}

.feed-row b { flex: none; color: #ffb266; font-weight: 800; }
.feed-row span { overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 开始历练 ---------------- */

.start-btn {
  position: absolute;
  z-index: 19;
  right: 10px;
  bottom: calc(var(--safe-bottom) + 84px);
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffefc4 0%, #ffc069 26%, #ff933f 52%, #23DD80 78%, #13A95A 100%);
  border: 2px solid rgba(255, 239, 199, .98);
  box-shadow:
    0 0 0 5px rgba(255, 162, 72, .14),
    0 0 34px rgba(255, 134, 48, .55),
    0 10px 24px rgba(0, 0, 0, .4),
    inset 0 0 18px rgba(255, 255, 255, .45);
  color: #044124;
  transition: transform .14s ease;
}

.start-btn:active { transform: scale(.955); }

.start-btn::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(88, 39, 2, .36);
  animation: spin 22s linear infinite;
}

.start-btn::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(150deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, 0) 44%);
  pointer-events: none;
}

.start-core {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.02;
}

.start-core b {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .38), 0 -1px 0 rgba(100, 45, 4, .2);
}

.start-core em {
  margin-top: 4px;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 800;
  opacity: .72;
  letter-spacing: .04em;
}

.start-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 205, 130, .38);
  pointer-events: none;
  animation: startPulse 3.4s ease-out infinite;
}

.start-ring.r1 { inset: -9px; }
.start-ring.r2 { inset: -19px; animation-delay: 1.7s; }

/* ---------------- 底部导航 ---------------- */

.dock {
  position: absolute;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--safe-bottom) + 68px);
  display: flex;
  align-items: stretch;
  padding: 0 3px var(--safe-bottom);
  background: linear-gradient(180deg, rgba(5, 13, 27, 0) 0%, rgba(5, 13, 27, .82) 32%, rgba(4, 10, 20, .97) 100%);
  border-top: 1px solid rgba(255, 205, 140, .12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dock button {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #D8A9B9;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: color .15s ease, transform .12s ease;
}

.dock button:active { transform: scale(.93); }

.dock button .mp-icon {
  width: 23px;
  height: 23px;
  color: #EBBDCD;
  transition: color .15s ease, filter .15s ease;
}

.dock button.is-on { color: #ffd49a; }
.dock button.is-on .mp-icon {
  color: #ffb766;
  filter: drop-shadow(0 0 7px rgba(255, 160, 70, .55));
}

.dock button.is-on::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ffb15e, transparent);
}

.dock-dot {
  position: absolute;
  top: 10px;
  left: 52%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a46;
  border: 1px solid #ffd9c2;
  box-shadow: 0 0 8px rgba(255, 90, 70, .9);
}

/* ---------------- 奇遇浮标 ---------------- */

.encounter-popup {
  position: absolute;
  z-index: 31;
  top: calc(var(--safe-top) + 150px);
  left: 11px;
  width: min(64%, 252px);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 196, 118, .5);
  background: linear-gradient(90deg, rgba(38, 27, 19, .94), rgba(18, 26, 43, .88));
  box-shadow: 0 8px 28px rgba(0, 0, 0, .38), 0 0 20px rgba(255, 150, 70, .15);
  animation: popIn .32s cubic-bezier(.22, 1, .36, 1) both;
}

.encounter-popup:active { transform: scale(.98); }

.ep-seal {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 221, 166, .7);
  background: radial-gradient(circle at 35% 25%, #ffd597, #34E7A0 62%, #148F55);
  color: #053B22;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(255, 168, 76, .45);
}

.ep-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ep-main b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11.5px; color: #ffe3b8; }
.ep-main em { font-size: 9px; font-style: normal; color: #DCB4C1; }
.ep-arrow { display: flex; color: #ffd39a; }
.ep-arrow .mp-icon { width: 15px; height: 15px; }

/* ---------------- 弹层 ---------------- */

.overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 calc(var(--safe-bottom) + 64px);
  background: rgba(2, 7, 16, .6);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity .2s ease;
}

.overlay.show { opacity: 1; }

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - var(--safe-bottom) - 64px - var(--safe-top) - 8px);
  max-height: calc(100dvh - var(--safe-bottom) - 64px - var(--safe-top) - 8px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 16px;
  border-radius: 23px 23px 0 0;
  background: linear-gradient(180deg, #471123 0%, #310A15 36%, #24070F 100%);
  border: 1px solid rgba(255, 205, 140, .22);
  border-bottom: 0;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: translateY(26px);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.sheet::-webkit-scrollbar { display: none; }
.overlay.show .sheet { transform: translateY(0); }

.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 13px 15px 7px;
  background: linear-gradient(180deg, rgba(17, 41, 71, .99) 0%, rgba(15, 36, 63, .94) 72%, rgba(15, 36, 63, 0) 100%);
}

.sheet-back {
  width: 31px;
  height: 31px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: #d8e7f8;
}

.sheet-back:active { transform: scale(.9); }
.sheet-back .mp-icon { width: 16px; height: 16px; }

.sheet-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .24em;
  color: #78F1CD;
  text-transform: uppercase;
}

.sheet-kicker::before {
  content: "";
  width: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #78F1CD);
}

.close-x {
  width: 31px;
  height: 31px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: #d8e7f8;
}

.close-x:active { transform: scale(.9); }
.close-x .mp-icon { width: 16px; height: 16px; }

.sheet-body { padding: 0 15px 6px; }

.sheet-title {
  margin: 1px 0 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.sheet-sub {
  margin: 0 0 13px;
  font-size: 11.5px;
  line-height: 1.65;
  color: #D29FAF;
}

.sheet-sub b { color: #ffd59a; }

/* ---------------- 通用卡 / 按钮 ---------------- */

.panel-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line-cool);
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 17px 0 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #ffd7a1;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 205, 140, .28), rgba(255, 205, 140, 0));
}

.section-title .mp-icon { width: 15px; height: 15px; color: #ffc27a; }

.btn-main {
  width: 100%;
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 13px;
  border: 1px solid rgba(255, 229, 185, .55);
  background: linear-gradient(180deg, #ffc06d 0%, #ff9a4a 50%, #26E98B 100%);
  box-shadow: 0 8px 20px rgba(255, 120, 40, .28), inset 0 1px 0 rgba(255, 255, 255, .55);
  color: #03351E;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: .04em;
  transition: transform .12s ease, filter .12s ease;
}

.btn-main:active { transform: scale(.98); filter: brightness(.95); }
.btn-main[disabled] { opacity: .42; filter: grayscale(.35); box-shadow: none; pointer-events: none; }
.btn-main .mp-icon { width: 18px; height: 18px; }

.btn-ghost {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 205, 140, .3);
  background: rgba(255, 255, 255, .055);
  color: #ffd7a1;
  font-size: 12px;
  font-weight: 700;
}

.btn-ghost:active { transform: scale(.98); background: rgba(255, 255, 255, .09); }
.btn-ghost .mp-icon { width: 16px; height: 16px; }

.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 29px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 169, 93, .42);
  background: linear-gradient(180deg, rgba(255, 154, 74, .2), rgba(255, 138, 61, .09));
  color: #ffc27e;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-btn:active { transform: scale(.95); }
.mini-btn[disabled] { opacity: .45; pointer-events: none; }

.mini-btn.cool {
  border-color: rgba(150, 190, 255, .2);
  background: rgba(255, 255, 255, .05);
  color: #E5B9C8;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7d32, #ffbe62 68%, #ffe6ad);
  box-shadow: 0 0 8px rgba(255, 170, 80, .55);
  transition: width .3s ease;
}

.progress.jade i { background: linear-gradient(90deg, #812F9F, #BD7FE0); box-shadow: 0 0 8px rgba(100, 225, 170, .4); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055);
  color: #d7e6f8;
  font-size: 9.5px;
  line-height: 1.4;
}

.chip .mp-icon { width: 12px; height: 12px; }
.chip.gold { border-color: rgba(255, 206, 132, .35); background: rgba(255, 160, 60, .12); color: #ffd9a3; }
.chip.blue { border-color: rgba(120, 190, 255, .3); background: rgba(80, 150, 255, .1); color: #bfe2ff; }
.chip.pink { border-color: rgba(255, 150, 170, .3); background: rgba(255, 100, 140, .1); color: #ffd0da; }
.chip.green { border-color: rgba(110, 220, 160, .28); background: rgba(60, 190, 130, .1); color: #c6ffe4; }

.empty {
  padding: 24px 16px;
  text-align: center;
  border-radius: 15px;
  border: 1px dashed rgba(150, 190, 255, .22);
  background: rgba(255, 255, 255, .025);
  color: #C78FA0;
  font-size: 11.5px;
  line-height: 1.7;
}

.empty .mp-icon { width: 31px; height: 31px; color: rgba(255, 203, 137, .62); margin-bottom: 6px; }
.empty b { display: block; color: #d7e6f8; font-size: 13px; margin-bottom: 4px; }

/* ---------------- 角色页 ---------------- */

.char-stage {
  position: relative;
  height: 248px;
  margin-top: 1px;
  overflow: hidden;
  border-radius: 19px;
  border: 1px solid rgba(150, 190, 255, .16);
  background:
    radial-gradient(ellipse at 50% 42%, rgba(122, 182, 255, .24) 0%, rgba(30, 70, 120, .1) 48%, rgba(7, 18, 34, 0) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .006));
}

.char-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 53%;
  width: 188px;
  height: 188px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 150, .22);
  box-shadow:
    0 0 0 20px rgba(255, 210, 150, .026),
    0 0 0 46px rgba(255, 210, 150, .016),
    inset 0 0 40px rgba(255, 190, 120, .05);
}

.char-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 210px;
  height: 58px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 196, 120, .16), transparent 68%);
}

.char-figure {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -8px;
  width: 184px;
  height: 246px;
  transform: translateX(-50%);
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .42));
}

.char-figure svg { width: 100%; height: 100%; }

.char-tag-line {
  position: absolute;
  z-index: 3;
  left: 12px;
  top: 11px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.char-id {
  position: relative;
  z-index: 3;
  margin-top: 7px;
  padding: 0 2px;
}

.char-id h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: .06em;
  color: #fff;
}

.char-id p {
  margin: 4px 0 0;
  font-size: 11px;
  color: #EBBCCD;
}

.char-id p b { color: #ffd79e; font-weight: 700; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.stat-cell {
  padding: 9px 5px;
  text-align: center;
  border-radius: 11px;
  border: 1px solid rgba(150, 190, 255, .13);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}

.stat-cell span {
  display: block;
  margin-bottom: 3px;
  font-size: 9px;
  color: #C78FA0;
}

.stat-cell b {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  color: #fff;
  font-weight: 800;
}

.stat-cell b em { font-size: 8.5px; font-style: normal; color: #C78FA0; font-weight: 400; }

.attr-bars { display: flex; flex-direction: column; gap: 9px; }

.attr-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 10px;
  color: #E5B9C8;
}

.attr-bar-head b { color: #ffd59a; font-size: 11px; }
.attr-bar-head em { font-style: normal; color: #C78FA0; font-size: 9px; }

.grow-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.grow-row:first-child { border-top: 0; }
.grow-main { flex: 1; min-width: 0; }
.grow-main b { display: block; font-size: 11.5px; color: #f1f7ff; }
.grow-main span { display: block; margin-top: 2px; font-size: 9.5px; color: #C78FA0; }
.grow-main em { display: block; margin-top: 1px; font-size: 9px; font-style: normal; color: #ffc889; }

/* ---------------- 立绘头像 / 族人 ---------------- */

.head-pill {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 210, 150, .45);
  background: radial-gradient(circle at 50% 32%, #7D2443, #350B18 70%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}

.head-pill svg { width: 100%; height: 100%; display: block; }
.head-pill img { width: 100%; height: 100%; object-fit: cover; }

.avatar-stack {
  width: 54px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.realm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  height: 15px;
  padding: 0 5px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 140, .34);
  background: linear-gradient(180deg, rgba(255, 170, 80, .2), rgba(7, 19, 37, .88));
  color: #ffd9a0;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
}

.realm-badge.realm-up {
  animation: realmPulse 1.15s ease 2;
  border-color: #ffe9bd;
  background: linear-gradient(180deg, #ffe7b5, #ffb050);
  color: #033A21;
  box-shadow: 0 0 14px rgba(255, 196, 100, .95), 0 0 26px rgba(255, 138, 50, .5);
}

.hud-realm.realm-up {
  animation: realmTextPulse 1.1s ease 2;
  color: #ffe0a6;
  text-shadow: 0 0 12px rgba(255, 190, 90, .95), 0 0 22px rgba(255, 138, 50, .6);
}

@keyframes realmPulse {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.16); }
  70% { transform: scale(.98); }
}

@keyframes realmTextPulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.06); }
}

.row-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid rgba(150, 190, 255, .13);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}

.row-card:last-child { margin-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; color: #fff; }
.row-main b .tag { flex: none; }
.row-main em { display: block; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 9.5px; font-style: normal; color: #D29FAF; }
.row-side { flex: none; display: flex; align-items: center; gap: 5px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: #EBBCCD;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.5;
}

.tag.gold { border-color: rgba(255, 206, 132, .32); background: rgba(255, 160, 60, .12); color: #ffd7a0; }
.tag.pink { border-color: rgba(255, 150, 170, .32); background: rgba(255, 100, 140, .1); color: #ffd0da; }
.tag.blue { border-color: rgba(120, 190, 255, .3); background: rgba(80, 150, 255, .1); color: #bfe2ff; }
.tag.green { border-color: rgba(110, 220, 160, .28); background: rgba(60, 190, 130, .1); color: #c6ffe4; }

/* ---------------- 分段 ---------------- */

.seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin: 4px 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .22);
}

.seg button {
  flex: 1;
  min-height: 33px;
  border-radius: 8px;
  color: #D29FAF;
  font-size: 11px;
  font-weight: 700;
}

.seg button.on {
  border: 1px solid rgba(255, 180, 100, .32);
  background: linear-gradient(180deg, rgba(255, 170, 80, .22), rgba(255, 138, 61, .08));
  color: #ffd7a1;
  box-shadow: 0 2px 10px rgba(255, 120, 40, .12);
}

/* ---------------- 出装 ---------------- */

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.outfit-card {
  position: relative;
  padding: 7px 7px 9px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid rgba(150, 190, 255, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
  overflow: hidden;
}

.outfit-card.on {
  border-color: rgba(255, 190, 110, .62);
  background: linear-gradient(180deg, rgba(255, 170, 80, .15), rgba(255, 138, 61, .03));
  box-shadow: 0 0 0 2px rgba(255, 170, 80, .1), 0 6px 18px rgba(255, 120, 40, .13);
}

.outfit-art {
  height: 118px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 46%, rgba(122, 182, 255, .18), rgba(7, 18, 34, 0) 70%);
}

.outfit-art svg { width: 100%; height: 100%; }
.outfit-card b { display: block; font-size: 10.5px; color: #f2f8ff; }
.outfit-card em { display: block; margin-top: 2px; font-size: 8.5px; font-style: normal; color: #C78FA0; }
.outfit-card .pick-mark {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffae58;
  color: #03321C;
  font-size: 10px;
  font-weight: 900;
}

/* ---------------- 表单 / 命格 ---------------- */

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 13px 0 6px;
  font-size: 10px;
  font-weight: 700;
  color: #D29FAF;
}

.form-label em { font-style: normal; color: #B57F90; font-weight: 400; }

.name-input {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 205, 140, .24);
  background: rgba(0, 0, 0, .26);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.name-input:focus {
  border-color: rgba(255, 160, 80, .8);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, .12);
}

.name-input::placeholder { color: #A56F80; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.choice {
  min-height: 42px;
  padding: 6px 2px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .11);
  background: rgba(255, 255, 255, .04);
  color: #cfe0f5;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.choice small { display: block; font-size: 8px; font-weight: 400; opacity: .62; }
.choice.on {
  border-color: rgba(255, 180, 100, .68);
  background: linear-gradient(180deg, rgba(255, 170, 80, .2), rgba(255, 138, 61, .06));
  color: #ffd7a1;
  box-shadow: 0 0 14px rgba(255, 138, 61, .14);
}

.choice:active { transform: scale(.96); }

.gender-row { display: flex; gap: 6px; }
.gender-row .choice { flex: 1; }

/* ---------------- 修炼 ---------------- */

.realm-hero {
  position: relative;
  overflow: hidden;
  padding: 16px 14px 13px;
  border-radius: 17px;
  border: 1px solid rgba(255, 205, 140, .24);
  background:
    radial-gradient(circle at 50% 0%, rgba(130, 190, 255, .16), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
}

.realm-hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -38px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 150, .16);
  box-shadow: 0 0 0 22px rgba(255, 210, 150, .025);
}

.realm-kicker { font-size: 9px; letter-spacing: .2em; color: #78F1CD; }
.realm-name { margin: 4px 0 2px; font-family: var(--serif); font-size: 24px; color: #fff; letter-spacing: .05em; }
.realm-name em { font-size: 10px; font-style: normal; color: #ffd59a; margin-left: 5px; letter-spacing: .02em; }
.realm-exp-line { display: flex; justify-content: space-between; margin: 9px 0 4px; font-size: 9.5px; color: #D29FAF; }
.realm-exp-line b { color: #ffe0ad; font-weight: 700; }

.cult-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cult-actions .btn-main, .cult-actions .btn-ghost { min-height: 44px; font-size: 12px; }
.cult-actions .btn-main .mp-icon, .cult-actions .btn-ghost .mp-icon { width: 16px; height: 16px; }

.ad-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 205, 140, .14);
  background: rgba(255, 160, 70, .05);
  color: #D9A9B9;
  font-size: 9.5px;
  line-height: 1.5;
}

.ad-hint .mp-icon { width: 14px; height: 14px; color: #ffc47d; }

/* ---------------- 产业 ---------------- */

.income-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 205, 140, .22);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 180, 90, .14), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
}

.income-orb {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 150, .4);
  background: radial-gradient(circle at 35% 25%, rgba(255, 220, 160, .32), rgba(255, 138, 61, .08) 70%);
  color: #ffd28b;
}

.income-orb .mp-icon { width: 22px; height: 22px; }
.income-main { flex: 1; min-width: 0; }
.income-main span { display: block; font-size: 9px; color: #D29FAF; }
.income-main b { display: block; margin-top: 1px; font-size: 18px; color: #ffe1ac; font-variant-numeric: tabular-nums; }
.income-main b em { font-size: 9px; font-style: normal; color: #D29FAF; font-weight: 400; }

.source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.source-row:first-child { border-top: 0; }

.src-icon {
  width: 35px;
  height: 35px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .055);
  color: #ffd39a;
}

.src-icon .mp-icon { width: 19px; height: 19px; }
.src-body { flex: 1; min-width: 0; }
.src-top { display: flex; align-items: center; gap: 5px; }
.src-top b { font-size: 11.5px; color: #f1f7ff; }
.src-level { font-size: 8.5px; color: #ffc889; }
.src-sub { margin-top: 1px; font-size: 9px; color: #C78FA0; }
.src-sub em { font-style: normal; color: #BC8FD8; }
.src-progress { margin-top: 4px; height: 4px; border-radius: 4px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.src-progress i { display: block; height: 100%; background: linear-gradient(90deg, #ff8a3d, #ffd28b); border-radius: inherit; }
.src-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.src-pending { font-size: 9.5px; color: #ffd59a; font-variant-numeric: tabular-nums; }

/* ---------------- 世家 ---------------- */

.family-card {
  padding: 11px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid rgba(150, 190, 255, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
}

.family-card:last-child { margin-bottom: 0; }
.fam-top { display: flex; align-items: center; gap: 8px; }
.fam-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 210, 150, .35);
  background: radial-gradient(circle at 35% 25%, rgba(255, 220, 160, .25), rgba(255, 138, 61, .06) 70%);
  color: #ffd39a;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 900;
}
.fam-top .row-main b { font-size: 12px; }
.fam-favor-line { display: flex; justify-content: space-between; margin-top: 7px; font-size: 9px; color: #C78FA0; }
.fam-favor-line b { color: #ffd59a; font-weight: 700; }
.fam-actions { display: flex; gap: 6px; margin-top: 8px; }
.fam-actions .mini-btn { flex: 1; }

/* ---------------- 历练 ---------------- */

.adv-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 112px;
  margin-bottom: 9px;
  padding: 10px 11px;
  overflow: hidden;
  text-align: left;
  border-radius: 15px;
  border: 1px solid rgba(255, 205, 140, .22);
  background-color: #471023;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .3);
}

.adv-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(4, 12, 24, .92) 0%, rgba(4, 12, 24, .65) 52%, rgba(4, 12, 24, .2) 100%), var(--adv-art);
  background-size: cover;
  background-position: center;
  filter: saturate(1.06);
  transition: transform .3s ease;
}

.adv-card:active::before { transform: scale(1.04); }
.adv-card[data-act="adv:hill"]::before { background-position: center, 43% 12%; }
.adv-card[data-act="adv:market"]::before { background-position: center, 68% 32%; }
.adv-card[data-act="adv:secret"]::before { background-position: center, 82% 70%; }
.adv-card > * { position: relative; z-index: 1; }

.adv-main { flex: 1; min-width: 0; }
.adv-main b { display: block; font-family: var(--serif); font-size: 17px; letter-spacing: .05em; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.adv-main em { display: block; margin-top: 3px; font-size: 9.5px; font-style: normal; color: #d5e4f7; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.adv-cost {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 9px;
  color: #ffd59a;
}

.adv-cost b {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 140, .34);
  background: rgba(7, 18, 34, .62);
  font-size: 10px;
  color: #ffe0ad;
}

.adv-cost b .mp-icon { width: 12px; height: 12px; }

.result-art {
  position: relative;
  height: 152px;
  margin-bottom: 9px;
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid rgba(255, 205, 140, .22);
  background-image: linear-gradient(180deg, rgba(4, 12, 24, .12), rgba(4, 12, 24, .78)), var(--adv-art);
  background-size: cover;
  background-position: center;
}

.result-art span {
  position: absolute;
  left: 11px;
  bottom: 9px;
  font-family: var(--serif);
  font-size: 18px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .65);
}

.cost { color: #ffd7a1; font-weight: 700; }

.result-text {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.75;
  color: #EBBCCD;
}

.reward-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 11px; }

.reward-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 205, 140, .18);
  background: rgba(255, 180, 90, .06);
  color: #ffe0ad;
  font-size: 10px;
  font-weight: 700;
}

.reward-chip .mp-icon { width: 14px; height: 14px; color: #ffc27a; }
.reward-chip.blue { border-color: rgba(120, 190, 255, .22); background: rgba(80, 150, 255, .06); color: #cbebff; }
.reward-chip.blue .mp-icon { color: #8fd0ff; }
.reward-chip.green { border-color: rgba(110, 220, 160, .22); background: rgba(60, 190, 130, .06); color: #d2ffea; }
.reward-chip.green .mp-icon { color: #C78FE6; }

/* ---------------- 背包 ---------------- */

.pack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.item-card {
  position: relative;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(150, 190, 255, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
}

.item-orb {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  color: #CB9FE5;
}

.item-orb .mp-icon { width: 21px; height: 21px; }
.item-card b { display: block; font-size: 11.5px; color: #f3f8ff; }
.item-card em { display: block; margin-top: 2px; min-height: 24px; font-size: 9px; font-style: normal; line-height: 1.45; color: #C78FA0; }
.item-card .item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.item-card .qty { font-size: 9px; color: #ffd59a; }

/* ---------------- 更多 ---------------- */

.more-list { display: flex; flex-direction: column; gap: 7px; }

.more-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  text-align: left;
  border-radius: 13px;
  border: 1px solid rgba(150, 190, 255, .13);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
}

.more-row:active { transform: scale(.99); background: rgba(255, 255, 255, .07); }
.more-ico {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 205, 140, .26);
  background: rgba(255, 160, 70, .08);
  color: #ffd39a;
}
.more-ico .mp-icon { width: 20px; height: 20px; }
.more-main { flex: 1; min-width: 0; }
.more-main b { display: block; font-size: 12px; color: #f2f8ff; }
.more-main em { display: block; margin-top: 2px; font-size: 9.5px; font-style: normal; color: #C78FA0; }
.more-row > .mp-icon { width: 15px; height: 15px; color: #B57F90; }

/* ---------------- 广告 ---------------- */

.ad-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 14, .84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .2s ease;
}

.ad-overlay.show { opacity: 1; }

.ad-box {
  width: min(100%, 344px);
  padding: 14px;
  border-radius: 21px;
  border: 1px solid rgba(255, 205, 140, .32);
  background: linear-gradient(180deg, #54162A, #320A15 58%, #260810);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .66), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.ad-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  color: #cfe2ff;
}

.ad-brand span { display: flex; align-items: center; gap: 4px; }
.ad-brand .mp-icon { width: 14px; height: 14px; color: #ffd39a; }
.ad-brand em { font-style: normal; color: #ffcf8b; font-weight: 700; }

.ad-visual {
  position: relative;
  height: 238px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 15px;
  background-image: url("images/gen/home_scene.png");
  background-repeat: no-repeat;
  background-position: 50% 36%;
  background-size: cover;
  border: 1px solid rgba(255, 205, 140, .24);
}

.ad-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 180, 90, .26), transparent 56%),
    linear-gradient(180deg, rgba(4, 10, 20, .18) 0%, rgba(4, 10, 20, .36) 44%, rgba(4, 10, 20, .86) 100%);
}

.ad-copy {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.28;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .72);
}

.ad-copy b { color: #ffd28b; }

.ad-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  overflow: hidden;
}

.ad-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a3d, #ffd28b);
  transition: width .5s linear;
}

.ad-foot {
  margin: 8px 0 11px;
  text-align: center;
  font-size: 9.5px;
  color: #D29FAF;
}

.ad-claim {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 229, 185, .55);
  background: linear-gradient(180deg, #ffc06d, #ff9a4a 52%, #26E98B);
  color: #03351E;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(255, 120, 40, .28);
}

.ad-cancel {
  display: block;
  margin: 8px auto 0;
  padding: 2px 8px;
  color: #C78FA0;
  font-size: 10px;
  text-decoration: underline;
}

.lineage-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 205, 140, .28);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 196, 110, .2), rgba(255, 138, 61, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
}

.lineage-seal {
  width: 39px;
  height: 39px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 205, 140, .4);
  background: radial-gradient(circle at 35% 25%, rgba(255, 210, 130, .3), rgba(7, 19, 37, .7) 74%);
  color: #ffd9a2;
}

.lineage-seal .mp-icon { width: 21px; height: 21px; }
.lineage-banner-main { flex: 1; min-width: 0; }
.lineage-banner-main b { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: .03em; color: #fff3df; }
.lineage-banner-main em { display: block; margin-top: 2px; font-size: 8.5px; font-style: normal; color: #D29FAF; }

.lineage-gen {
  position: relative;
  padding-left: 14px;
  margin-bottom: 14px;
}

.lineage-gen::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 5px;
  bottom: 2px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 190, 110, .62), rgba(255, 190, 110, .1));
}

.gen-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.gen-num {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 205, 140, .38);
  background: rgba(255, 160, 80, .12);
  color: #ffd39a;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
}

.gen-head b { font-family: var(--serif); font-size: 13px; letter-spacing: .04em; color: #ffe0ad; }
.gen-head em { margin-left: auto; font-size: 8.5px; font-style: normal; color: #C78FA0; }

.lineage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.lineage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 9px 5px 8px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid rgba(150, 190, 255, .15);
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  transition: transform .14s ease;
}

.lineage-card:active { transform: scale(.97); }

.lineage-avatar {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 150, .5);
  background: radial-gradient(circle at 50% 32%, #7D2443, #350B18 70%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}

.lineage-avatar svg { width: 100%; height: 100%; display: block; }
.lineage-card b {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10.5px;
  color: #fff;
}
.lineage-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px; }
.lineage-meta .tag { padding: 0 4px; font-size: 7px; font-style: normal; }

/* ---------------- 随缘事件弹窗 ---------------- */

.fate-overlay {
  position: fixed;
  z-index: 108;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 28%, rgba(26, 58, 100, .62), rgba(2, 7, 16, .92));
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  opacity: 0;
  transition: opacity .2s ease;
}

.fate-overlay.show { opacity: 1; }

.fate-card {
  position: relative;
  width: 100%;
  max-width: 382px;
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 210, 150, .42);
  background: linear-gradient(180deg, #5A172C 0%, #340B17 58%, #26070F 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .68), 0 0 60px rgba(255, 150, 60, .14), inset 0 1px 0 rgba(255, 255, 255, .09);
  transform: translateY(20px) scale(.97);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
  -webkit-overflow-scrolling: touch;
}

.fate-overlay.show .fate-card { transform: translateY(0) scale(1); }

.fate-art {
  position: relative;
  height: 176px;
  overflow: hidden;
  border-radius: 23px 23px 0 0;
  background-size: cover;
  background-repeat: no-repeat;
}

.fate-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 12, 26, .18) 0%, rgba(5, 14, 28, .08) 34%, rgba(7, 18, 34, .72) 78%, #340B17 100%),
    linear-gradient(90deg, rgba(4, 12, 26, .62), rgba(4, 12, 26, 0) 60%);
}

.fate-seal {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 14px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 230, 180, .8);
  background: radial-gradient(circle at 34% 24%, #ffe0a1, #34E7A0 60%, #148F55);
  color: #053B22;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(255, 168, 76, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
}

.fate-live {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 140, .36);
  background: rgba(7, 19, 37, .72);
  color: #ffd8a0;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.fate-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffb45c;
  box-shadow: 0 0 8px #ffb45c;
  animation: fateBlink 1.4s ease-in-out infinite;
}

.fate-art-copy {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 13px;
}

.fate-art-copy em {
  display: block;
  font-size: 8.5px;
  font-style: normal;
  letter-spacing: .16em;
  color: #ffd39a;
}

.fate-art-copy b {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: .06em;
  color: #fff3df;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .7);
}

.fate-art.has-portrait .fate-art-copy { right: 98px; }

.fate-portrait {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 14px;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid rgba(255, 224, 170, .85);
  background: #400D1D;
  box-shadow: 0 0 22px rgba(255, 180, 90, .55), 0 8px 18px rgba(0, 0, 0, .45);
}

.fate-portrait svg { width: 100%; height: 100%; display: block; }

.fate-body { padding: 13px 16px calc(16px + var(--safe-bottom)); }

.fate-desc {
  margin: 0 0 11px;
  font-size: 11.5px;
  line-height: 1.75;
  color: #cfe0f5;
}

.fate-hint {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  padding: 9px 10px;
  margin-bottom: 12px;
  border-radius: 11px;
  border: 1px dashed rgba(255, 200, 130, .32);
  background: rgba(255, 170, 80, .06);
  color: #ffd8a0;
  font-size: 9px;
  line-height: 1.55;
}

.fate-hint .mp-icon { width: 14px; height: 14px; margin-top: 1px; color: #ffc47a; }

.fate-actions { display: flex; gap: 8px; }

.fate-actions button {
  min-height: 44px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.fate-miss {
  flex: 1;
  border: 1px solid rgba(150, 190, 255, .22);
  background: rgba(255, 255, 255, .05);
  color: #E5B9C8;
}

.fate-miss:active { transform: scale(.98); }

.fate-accept {
  flex: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255, 229, 185, .55);
  background: linear-gradient(180deg, #ffc974, #ff9a4a 58%, #26E98B);
  color: #03351E;
  box-shadow: 0 8px 20px rgba(255, 120, 40, .28), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.fate-accept:active { transform: scale(.98); }

.fate-close { width: 100%; }
.fate-close .mp-icon { width: 16px; height: 16px; }
.fate-rewards { margin-top: 4px; }
.fate-card.is-result .fate-art { height: 158px; }

@keyframes fateBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .32; transform: scale(.68); }
}

/* ---------------- 突破 ---------------- */

.breakthrough {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 150, 60, .18), rgba(2, 8, 18, .9) 58%, rgba(2, 6, 14, .96) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .25s ease;
}

.breakthrough.show { opacity: 1; }

.bt-inner {
  position: relative;
  width: min(100%, 360px);
  padding: 23px 18px 19px;
  overflow: hidden;
  text-align: center;
  border-radius: 23px;
  border: 1px solid rgba(255, 210, 150, .42);
  background: linear-gradient(180deg, rgba(26, 52, 88, .98), rgba(9, 22, 42, .99));
  box-shadow: 0 0 80px rgba(255, 150, 60, .23), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.bt-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 8.5px;
  letter-spacing: .2em;
  color: #ffcf8b;
}

.bt-kicker i { width: 14px; height: 1px; background: linear-gradient(90deg, transparent, #ffcf8b); }
.bt-kicker i:last-child { background: linear-gradient(90deg, #ffcf8b, transparent); }

.bt-inner h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 29px;
  letter-spacing: .08em;
  color: #ffe0a6;
  text-shadow: 0 0 22px rgba(255, 190, 100, .4);
}

.bt-meditate {
  position: relative;
  width: 186px;
  height: 186px;
  margin: 2px auto 2px;
}

.bt-meditate svg { position: relative; z-index: 2; width: 100%; height: 100%; }

.bt-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 205, 130, .3);
  transform: translate(-50%, -50%);
  animation: btRing 2.6s ease-out infinite;
}

.bt-ring.r1 { width: 130px; height: 130px; }
.bt-ring.r2 { width: 160px; height: 160px; animation-delay: .7s; }
.bt-ring.r3 { width: 190px; height: 190px; animation-delay: 1.4s; }

.bt-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: -8px 0 3px;
}

.bt-avatar {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid rgba(255, 224, 170, .85);
  background: radial-gradient(circle at 50% 32%, #7D2443, #350B18 70%);
  box-shadow: 0 0 22px rgba(255, 180, 90, .55), 0 6px 16px rgba(0, 0, 0, .45);
}

.bt-avatar svg { width: 100%; height: 100%; display: block; }

.bt-line { margin: 3px 0 4px; font-size: 12px; color: #d7e6f8; }
.bt-line b { color: #ffd28b; font-size: 15px; }
.bt-boost { margin: 0 0 14px; font-size: 10px; color: #D29FAF; }

.bt-close {
  width: 100%;
  min-height: 43px;
  border-radius: 12px;
  border: 1px solid rgba(255, 229, 185, .5);
  background: linear-gradient(180deg, #ffc06d, #ff9a4a 52%, #26E98B);
  color: #03351E;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(255, 120, 40, .26);
}

/* ---------------- 提示 / 粒子 ---------------- */

.toast-wrap {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 110px);
  width: 88%;
  max-width: 420px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast {
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 140, .34);
  background: rgba(7, 19, 37, .96);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
  animation: toastIn .24s cubic-bezier(.22, 1, .36, 1) both;
}

.toast.good { border-color: rgba(120, 230, 180, .45); color: #c9ffe8; }
.toast.bad { border-color: rgba(255, 120, 100, .45); color: #ffc9c0; }

.float-gain {
  position: fixed;
  z-index: 190;
  pointer-events: none;
  color: #ffe0a6;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
  animation: floatUp 1.1s ease-out forwards;
}

.spark {
  position: fixed;
  z-index: 190;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd28b;
  box-shadow: 0 0 8px #ffb15e;
  pointer-events: none;
  animation: sparkOut .72s ease-out forwards;
}

.fx-layer { position: fixed; inset: 0; z-index: 190; pointer-events: none; }

/* ---------------- 动画 ---------------- */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes startPulse {
  0% { transform: scale(.94); opacity: .8; }
  70% { transform: scale(1.14); opacity: 0; }
  100% { transform: scale(1.14); opacity: 0; }
}

@keyframes moteRise {
  0% { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; }
  12% { opacity: .8; }
  70% { opacity: .5; }
  100% { transform: translate3d(26px, -88vh, 0) scale(1.1); opacity: 0; }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(7px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(4px) scale(.92); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-42px) scale(1.04); }
}

@keyframes sparkOut {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -24px)) scale(.3); }
}

@keyframes btRing {
  0% { transform: translate(-50%, -50%) scale(.86); opacity: .8; }
  100% { transform: translate(-50%, -50%) scale(1.16); opacity: 0; }
}

/* ---------------- 小屏适配 ---------------- */

/* 矮屏：把良缘/子嗣卡抬高，避开人物面部 */
@media (max-height: 720px) {
  .story-cards { top: 34%; }
  .family-seal { top: 39%; }
  .feed { bottom: calc(var(--safe-bottom) + 74px); }
  .start-btn { bottom: calc(var(--safe-bottom) + 78px); }
}

@media (max-width: 370px) {
  .lineage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fate-art { height: 158px; }
  .fate-art-copy b { font-size: 23px; }
  .fate-seal { width: 40px; height: 40px; font-size: 18px; }
  .fate-portrait { width: 62px; height: 62px; }
  .fate-art.has-portrait .fate-art-copy { right: 84px; }
  .fate-body { padding-left: 13px; padding-right: 13px; }
  .hud { padding-left: 9px; padding-right: 8px; gap: 4px; }
  .hud-avatar { width: 46px; height: 46px; }
  .hud-name-row b { font-size: 15px; max-width: 92px; }
  .hud-title { font-size: 7.5px; }
  .hud-realm { font-size: 9.5px; }
  .hud-exp-text { font-size: 7.5px; }
  .cur { height: 23px; padding: 0 5px; }
  .cur b { font-size: 9.5px; min-width: 26px; }
  .hud-tools { width: 27px; height: 27px; }

  .quest-strip { left: 9px; width: 55%; min-height: 49px; }
  .quest-text b { font-size: 11px; }
  .quest-text em { font-size: 8.5px; }
  .quest-ico { width: 31px; height: 31px; }

  .quick-rail { right: 8px; grid-template-columns: repeat(2, 48px); gap: 4px; }
  .q-ico { width: 34px; height: 34px; }
  .quick-rail button { font-size: 8.5px; }

  .family-seal { left: 9px; width: 52px; }
  .fs-ico { width: 46px; height: 46px; }
  .family-seal b { font-size: 11px; }

  .story-cards { width: 48%; top: 43%; }
  .story-card { min-height: 66px; padding: 7px 7px 7px 9px; }
  .sc-body b { font-size: 14px; }
  .sc-body em { font-size: 8.5px; }
  .sc-art { width: 43px; height: 43px; }

  .feed { left: 9px; width: 57%; padding: 5px 7px; }
  .feed-row { font-size: 8.5px; }

  .start-btn { width: 98px; height: 98px; right: 8px; bottom: calc(var(--safe-bottom) + 80px); }
  .start-core b { font-size: 22px; }
  .start-core em { font-size: 8px; }

  .dock { height: calc(var(--safe-bottom) + 63px); }
  .dock button { font-size: 8.5px; }
  .dock button .mp-icon { width: 21px; height: 21px; }

  .sheet-title { font-size: 22px; }
  .char-stage { height: 226px; }
  .char-figure { width: 168px; height: 226px; }
}

@media (min-width: 560px) {
  .game {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    height: min(92vh, 900px);
    transform: translate(-50%, -50%);
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, .08);
    overflow: hidden;
  }
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 478px; max-height: 88vh; border-radius: 22px; border-bottom: 1px solid rgba(255, 205, 140, .22); }
  .toast-wrap { bottom: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   2025 家族修仙 · 灵缘重制
   暖金宣纸 + 青云仙门 + 随缘灵缘卡
   ============================================================ */

:root {
  --paper-1: #fcf5e4;
  --paper-2: #BDF1E6;
  --paper-3: #9AE3D2;
  --paper-ink: #124A33;
  --paper-ink-2: #287B5E;
  --paper-line: rgba(148, 101, 43, .32);
  --gold-line: #47B997;
  --gold-deep: #188F6A;
}

.scene-art {
  background-position: 70% 0%;
  filter: saturate(1.1) brightness(.94) contrast(1.03);
}

.scene-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 52% 34%, rgba(255, 216, 156, .18) 0%, rgba(255, 178, 92, .05) 38%, transparent 66%),
    linear-gradient(180deg, rgba(255, 194, 110, .08) 0%, transparent 32%);
  mix-blend-mode: screen;
}

.scene-top {
  height: 210px;
  background: linear-gradient(180deg, rgba(5, 15, 31, .72) 0%, rgba(5, 15, 31, .38) 30%, rgba(5, 15, 31, .08) 70%, transparent 100%);
}

.scene-bottom {
  height: 240px;
  background: linear-gradient(0deg, rgba(4, 10, 21, .95) 0%, rgba(4, 11, 23, .6) 34%, transparent 100%);
}

/* ---------------- HUD ---------------- */

.hud {
  top: calc(var(--safe-top) + 8px);
  left: 12px;
  right: 12px;
  padding: 0;
  gap: 8px;
  align-items: flex-start;
  z-index: 28;
}

.hud-player {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 7px;
  border-radius: 18px;
  border: 1px solid rgba(255, 214, 160, .3);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 186, 105, .17), transparent 44%),
    linear-gradient(100deg, rgba(12, 29, 51, .94), rgba(12, 28, 50, .62));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hud-player:active { transform: scale(.992); }

.hud-avatar {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe9b8 0%, #63E0BB 42%, #2A966D 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 18px rgba(255, 178, 90, .3);
}

.hud-avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 224, 172, .32);
  pointer-events: none;
}

.av-inner {
  border: 2px solid rgba(10, 26, 46, .9);
  box-shadow: inset 0 0 16px rgba(3, 10, 20, .5);
}

.hud-gen {
  position: absolute;
  z-index: 5;
  left: -3px;
  top: -3px;
  min-width: 28px;
  padding: 0 4px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 226, 178, .55);
  background: linear-gradient(180deg, #782D46, #50172C);
  color: #ffe3b2;
  font-size: 6.5px;
  font-weight: 900;
  font-style: normal;
  letter-spacing: .03em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}

.hud-avatar-realm {
  top: auto;
  bottom: -7px;
  max-width: 70px;
  height: 14px;
  font-size: 7px;
  line-height: 12px;
  border-color: rgba(255, 226, 172, .72);
  background: linear-gradient(180deg, #ffd792, #4DEFBE 48%, #20CC8D);
  color: #033A21;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .42), 0 0 10px rgba(255, 180, 80, .35);
}

.hud-info { gap: 1px; }

.hud-name-row b {
  max-width: 132px;
  font-size: 18px;
  letter-spacing: .04em;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .65);
}

.hud-title {
  padding: 1px 5px;
  border-radius: 4px;
  border-color: rgba(255, 207, 138, .45);
  background: rgba(255, 160, 80, .16);
  font-size: 7.5px;
}

.hud-family {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: #ffd79b;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}

.hud-realm-row { margin-top: 1px; }

.hud-realm {
  font-size: 9.5px;
  color: #c7e2ff;
}

.hud-exp-text { font-size: 7.5px; }

.hud-exp {
  height: 4px;
  margin-top: 2px;
  border: 0;
  background: rgba(0, 0, 0, .48);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
}

.hud-exp i {
  background: linear-gradient(90deg, #ff8a3d, #ffc766 64%, #ffe7b0);
  box-shadow: 0 0 8px rgba(255, 170, 80, .8);
}

.hud-tools {
  width: 38px;
  height: 38px;
  margin-top: 9px;
  border-color: rgba(255, 214, 160, .3);
  background: linear-gradient(180deg, rgba(12, 29, 51, .9), rgba(9, 22, 42, .55));
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.hud-tools .mp-icon { width: 18px; height: 18px; color: #ffe1b0; }

/* ---------------- 资源条 ---------------- */

.res-bar {
  position: absolute;
  z-index: 25;
  top: calc(var(--safe-top) + 82px);
  left: 12px;
  right: 12px;
  display: flex;
  align-items: stretch;
  gap: 5px;
}

.res {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 211, 152, .2);
  background: linear-gradient(180deg, rgba(9, 24, 44, .82), rgba(8, 20, 38, .56));
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.res:active { transform: scale(.97); }
.res .mp-icon { width: 14px; height: 14px; flex: none; }
.res-stone .mp-icon { color: #7fd0ff; filter: drop-shadow(0 0 5px rgba(90, 190, 255, .55)); }
.res-jade .mp-icon { color: #ffd078; filter: drop-shadow(0 0 5px rgba(255, 190, 80, .5)); }
.res-fame .mp-icon { color: #d8a6ff; filter: drop-shadow(0 0 5px rgba(190, 130, 255, .5)); }

.res span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.res em {
  font-style: normal;
  font-size: 6.5px;
  letter-spacing: .06em;
  color: #C594A5;
}

.res b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.res-plus {
  margin-left: auto;
  color: #ffd18a;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.era-chip {
  flex: none;
  width: 78px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 211, 152, .2);
  background: linear-gradient(180deg, rgba(9, 24, 44, .82), rgba(8, 20, 38, .56));
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.era-chip .mp-icon { width: 13px; height: 13px; color: #ffce7a; flex: none; }
.era-chip span { min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1; }
.era-chip b { font-size: 8px; color: #ffe0ad; white-space: nowrap; }
.era-chip em { font-style: normal; font-size: 6px; color: #C291A2; white-space: nowrap; }

/* ---------------- 族人侧栏 ---------------- */

.kin-rail {
  position: absolute;
  z-index: 20;
  left: 12px;
  top: calc(var(--safe-top) + 126px);
  width: 104px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  border-radius: 13px;
  border: 1px solid rgba(255, 211, 152, .18);
  background: linear-gradient(180deg, rgba(8, 22, 41, .82), rgba(7, 18, 34, .42));
  box-shadow: 0 7px 20px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.kin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  padding: 0 2px 4px;
  border-bottom: 1px solid rgba(255, 205, 140, .14);
}

.kin-head span { display: flex; align-items: center; gap: 3px; font-size: 8px; font-weight: 800; letter-spacing: .08em; color: #ffd8a0; }
.kin-head .mp-icon { width: 11px; height: 11px; }
.kin-head em { font-style: normal; font-size: 6.5px; color: #C493A4; }

.kin-card {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  text-align: left;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .05);
  background: rgba(255, 255, 255, .04);
}

.kin-card.is-player {
  border-color: rgba(255, 190, 100, .3);
  background: linear-gradient(100deg, rgba(255, 164, 72, .16), rgba(255, 255, 255, .035));
}

.kin-card:active { transform: scale(.97); }

.kin-av-wrap {
  width: 38px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.kin-av {
  width: 32px;
  height: 32px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 160, .45);
  background: radial-gradient(circle at 50% 32%, #7D2443, #350B18 70%);
}

.kin-av svg { width: 100%; height: 100%; display: block; }

.kin-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.kin-copy b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 8.5px; color: #fff; }
.kin-copy em { font-style: normal; font-size: 6.5px; color: #D9A9B9; }
.kin-av-wrap .realm-badge { height: 12px; padding: 0 2px; font-size: 5.6px; border-radius: 4px; max-width: 38px; }

.kin-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 20px;
  font-size: 7px;
  color: #ffd39a;
}

.kin-more .mp-icon { width: 9px; height: 9px; }

.kin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 2px;
  text-align: center;
  font-size: 7px;
  line-height: 1.5;
  color: #D29FAF;
}

.kin-empty .mp-icon { width: 17px; height: 17px; color: #ffc47a; }

/* ---------------- 快捷操作 ---------------- */

.quick-rail {
  top: calc(var(--safe-top) + 126px);
  right: 12px;
  grid-template-columns: repeat(2, 46px);
  gap: 4px 5px;
  z-index: 21;
}

.quick-rail button { gap: 1px; font-size: 8px; }

.q-ico {
  width: 34px;
  height: 34px;
  border-color: rgba(255, 205, 140, .36);
  background: radial-gradient(circle at 36% 24%, rgba(255, 230, 176, .34), rgba(255, 162, 76, .08) 48%, rgba(8, 21, 40, .7) 74%);
}

.q-ico .mp-icon { width: 17px; height: 17px; }

/* ---------------- 灵缘卡组 ---------------- */

.fate-deck {
  position: absolute;
  z-index: 45;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 130px);
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 392px);
  max-height: calc(100vh - 266px - var(--safe-top) - var(--safe-bottom));
  max-height: calc(100dvh - 266px - var(--safe-top) - var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 1px 3px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.fate-deck::-webkit-scrollbar { display: none; }

.fate-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 4px 1px;
  color: #ffe0ad;
  font-size: 8px;
  letter-spacing: .05em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .8);
}

.fate-deck-head span { display: flex; align-items: center; gap: 4px; font-weight: 800; }
.fate-deck-head .mp-icon { width: 11px; height: 11px; color: #ffd18a; }
.fate-deck-head em { font-style: normal; font-size: 7px; color: #c9d9ea; }

.fate-v2 {
  position: relative;
  padding: 8px 9px 7px;
  border-radius: 15px;
  border: 1px solid var(--gold-line);
  color: var(--paper-ink);
  background:
    radial-gradient(circle at 9% 0%, rgba(255, 255, 255, .92), rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 92% 102%, rgba(164, 109, 39, .15), rgba(164, 109, 39, 0) 46%),
    linear-gradient(158deg, var(--paper-1) 0%, var(--paper-2) 58%, var(--paper-3) 100%);
  box-shadow:
    0 11px 24px rgba(0, 0, 0, .4),
    inset 0 0 0 3px rgba(255, 255, 255, .34),
    inset 0 0 0 4px rgba(173, 127, 60, .2);
}

.fate-v2::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 11px;
  border: 1px solid rgba(160, 112, 48, .26);
  pointer-events: none;
}

.fate-v2:nth-child(odd) { margin-right: 8px; transform: rotate(-.35deg); }
.fate-v2:nth-child(even) { margin-left: 8px; transform: rotate(.35deg); }
.fate-v2 { animation: fateFadeIn .3s ease both; }

@keyframes fateFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fc-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 35px;
  padding: 0 0 6px;
  border-bottom: 1px solid rgba(145, 98, 40, .24);
}

.fc-seal {
  position: absolute;
  left: 0;
  top: 0;
  width: 27px;
  height: 27px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #35B08B;
  background: radial-gradient(circle at 35% 25%, #fff4d7, #7EEDD6 56%, #35C59B);
  color: #085A39;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(120, 70, 20, .25), inset 0 1px 0 rgba(255, 255, 255, .7);
}

.fc-title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
}

.fc-title b {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 1px 13px;
  border-radius: 6px;
  border: 1px solid rgba(160, 112, 48, .38);
  background: linear-gradient(180deg, #fffaf0, #B0F0E1 60%, #8EE4CF);
  box-shadow: 0 2px 5px rgba(120, 70, 20, .18), inset 0 1px 0 rgba(255, 255, 255, .7);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.35;
  color: #085A39;
}

.fc-title em {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 7px;
  letter-spacing: .05em;
  color: #3DA382;
}

.fc-x {
  position: absolute;
  right: 0;
  top: 0;
  width: 25px;
  height: 25px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(140, 95, 40, .3);
  background: rgba(255, 255, 255, .26);
  color: #267D5E;
}

.fc-x:active { transform: scale(.9); }
.fc-x .mp-icon { width: 13px; height: 13px; }

.fc-main { display: flex; gap: 8px; padding: 6px 0 5px; }

.fc-art {
  position: relative;
  width: 72px;
  height: 82px;
  flex: none;
  overflow: hidden;
  border-radius: 9px;
  border: 2px solid #58C4A7;
  background-color: #9DD8CA;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: 0 3px 8px rgba(90, 50, 15, .28), inset 0 0 0 1px rgba(255, 244, 218, .5);
}

.fc-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 245, 220, .08), rgba(92, 55, 17, .12));
  pointer-events: none;
}

.fc-art.t-romance { background-image: url("images/gen/fate_romance.png"); background-position: 50% 36%; }
.fc-art.t-romance-m { background-image: url("images/gen/fate_romance_m.png"); background-position: 50% 30%; }
.fc-art.t-heir { background-image: url("images/gen/fate_heir.png"); background-position: 50% 48%; }
.fc-art.t-encounter { background-image: url("images/gen/fate_encounter.png"); background-position: 50% 50%; }
.fc-art.t-adventure { background-image: url("images/gen/fate_adventure.png"); background-position: 50% 46%; }

.fc-desc {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 9.5px;
  line-height: 1.6;
  color: #205B44;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 4.8em;
  overflow: hidden;
}

.fc-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(145, 98, 40, .2);
}

.fc-tier {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 7px;
  color: #348C6E;
}

.fc-tier .mp-icon { width: 10px; height: 10px; color: #35B08B; }

.fc-actions { margin-left: auto; display: flex; gap: 5px; flex: none; }

.fc-btn {
  min-height: 33px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  transition: transform .12s ease;
}

.fc-btn.miss {
  border: 1px solid rgba(140, 95, 40, .36);
  background: rgba(255, 255, 255, .22);
  color: #287B5E;
}

.fc-btn.accept {
  border: 1px solid #1FA97B;
  background: linear-gradient(180deg, #ffe9ae, #62F2CE 56%, #2DD9A3);
  color: #044B2E;
  box-shadow: 0 3px 8px rgba(150, 85, 15, .32), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.fc-btn:active { transform: scale(.96); }

/* ---------------- 灵缘结果 ---------------- */

.fate-overlay {
  z-index: 108;
  padding: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(35, 55, 84, .55), rgba(3, 9, 19, .86));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.fate-card {
  width: 100%;
  max-width: 372px;
  max-height: calc(100dvh - 32px);
  border-radius: 18px;
  border: 1px solid var(--gold-line);
  color: var(--paper-ink);
  background: linear-gradient(158deg, var(--paper-1) 0%, var(--paper-2) 62%, var(--paper-3) 100%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .62),
    inset 0 0 0 4px rgba(255, 255, 255, .3),
    inset 0 0 0 5px rgba(173, 127, 60, .2);
}

.travel-paper {
  position: relative;
  padding: 17px 15px 14px;
  border-radius: inherit;
}

.travel-paper::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 12px;
  border: 1px solid rgba(160, 112, 48, .28);
  pointer-events: none;
}

.fr-x {
  position: absolute;
  z-index: 4;
  right: 10px;
  top: 10px;
}

.fr-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 7.5px;
  letter-spacing: .18em;
  color: #3DA382;
}

.fr-kicker i { width: 16px; height: 1px; background: linear-gradient(90deg, transparent, #47B997); }
.fr-kicker i:last-child { background: linear-gradient(90deg, #47B997, transparent); }

.fr-title {
  margin: 5px 0 10px;
  text-align: center;
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: .1em;
  color: #085A39;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.fr-body { display: flex; gap: 9px; align-items: flex-start; }
.fr-art { width: 72px; height: 82px; }
.fr-copy { flex: 1; min-width: 0; }
.fr-copy p { margin: 0; font-size: 10px; line-height: 1.7; color: #205B44; }

.fr-subject {
  display: block;
  float: right;
  width: 34px;
  height: 34px;
  margin: 0 0 5px 7px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid #58C4A7;
  background: #50172D;
}

.fr-subject svg { width: 100%; height: 100%; display: block; }

.travel-paper .reward-grid,
.travel-paper .fate-rewards { margin-top: 10px; }

.travel-paper .reward-chip {
  border-color: rgba(150, 100, 40, .3);
  background: rgba(255, 255, 255, .32);
  color: #1B6B4C;
}

.travel-paper .reward-chip .mp-icon { color: #35B08B; }

.travel-paper .fate-hint {
  margin: 10px 0;
  border-color: rgba(150, 100, 40, .3);
  background: rgba(255, 240, 205, .4);
  color: #287B5E;
  font-size: 8.5px;
}

.travel-paper .fate-hint .mp-icon { color: #2FA584; }

.travel-paper .fate-accept {
  width: 100%;
  min-height: 43px;
  border: 1px solid #1FA97B;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe9ae, #62F2CE 56%, #2DD9A3);
  color: #044B2E;
  font-size: 11.5px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(150, 85, 15, .26), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.travel-paper .fate-accept .mp-icon { color: #085A3D; }

/* ---------------- 灵缘簿 ---------------- */

.fate-book-hero {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 205, 140, .28);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 196, 110, .18), rgba(255, 138, 61, 0) 56%),
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
}

.fb-seal {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 165, .6);
  background: radial-gradient(circle at 35% 25%, #ffe0a1, #34E7A0 60%, #148F55);
  color: #053B22;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 0 15px rgba(255, 168, 76, .4);
}

.fate-book-hero b { display: block; font-family: var(--serif); font-size: 14px; color: #fff2da; }
.fate-book-hero em { display: block; margin-top: 3px; font-style: normal; font-size: 9px; line-height: 1.65; color: #D9A9B9; }

.fate-book-row { align-items: center; }

.fb-icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 165, .5);
  background: radial-gradient(circle at 35% 25%, #ffd597, #34E7A0 62%, #148F55);
  color: #053B22;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 900;
}

.fate-log {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(150, 190, 255, .14);
  background: rgba(255, 255, 255, .025);
}

.fate-log-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(150, 190, 255, .08);
  font-size: 9px;
  line-height: 1.55;
  color: #cfe0f5;
}

.fate-log-row:last-child { border-bottom: 0; }
.fate-log-row em { flex: none; font-style: normal; font-size: 7.5px; color: #B57F90; }

/* ---------------- 分支谱系 ---------------- */

.lineage-banner {
  margin-bottom: 10px;
  border-color: rgba(255, 205, 140, .3);
}

.lt-root-card {
  display: flex;
  align-items: stretch;
  gap: 7px;
  flex-wrap: wrap;
  padding: 9px;
  margin-bottom: 12px;
  border-radius: 15px;
  border: 1px solid rgba(255, 205, 140, .3);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 196, 110, .18), rgba(255, 138, 61, 0) 56%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
}

.lt-root-person {
  flex: 1 1 46%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.lt-root-person.is-spouse {
  padding-left: 7px;
  border-left: 1px dashed rgba(255, 160, 120, .28);
}

.lt-root-link { display: flex; align-items: center; color: #ff9f7a; }
.lt-root-link .mp-icon { width: 13px; height: 13px; }

.lt-av {
  width: 52px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lt-av > svg {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 150, .5);
  background: radial-gradient(circle at 50% 32%, #7D2443, #350B18 70%);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .32);
}

.lt-av .realm-badge { margin-top: 2px; height: 13px; padding: 0 3px; font-size: 6.5px; }

.lt-main { flex: 1; min-width: 0; }
.lt-main b { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: #fff; }
.lt-main b .tag { flex: none; }
.lt-main em { display: block; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-style: normal; font-size: 8px; color: #D29FAF; }

.lt-branches {
  position: relative;
  padding-left: 12px;
}

.lt-branches::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 190, 110, .7), rgba(255, 190, 110, .08));
}

.lt-branch { position: relative; margin-bottom: 9px; }

.lt-branch::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 36px;
  width: 9px;
  height: 1px;
  background: rgba(255, 190, 110, .55);
}

.lt-branch-tag {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 205, 140, .3);
  background: rgba(255, 160, 80, .14);
  color: #ffd39a;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .06em;
}

.lt-branch-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 6px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(150, 190, 255, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}

.lt-branch-head:active { transform: scale(.99); }
.lt-branch.is-open .lt-branch-head { border-color: rgba(255, 205, 140, .34); background: linear-gradient(180deg, rgba(255, 170, 80, .09), rgba(255, 255, 255, .015)); }

.lt-chevron { width: 16px; height: 16px; flex: none; color: #ffd39a; }

.lt-branch-detail {
  margin-top: 6px;
  padding: 8px;
  border-radius: 11px;
  border: 1px dashed rgba(255, 205, 140, .24);
  background: rgba(255, 255, 255, .025);
}

.lt-detail-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #ffd7a1;
}

.lt-detail-label .mp-icon { width: 12px; height: 12px; color: #ff9f7a; }

.lt-spouse-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  margin-bottom: 7px;
  border-radius: 10px;
  border: 1px solid rgba(255, 150, 170, .16);
  background: rgba(255, 120, 150, .06);
}

.lt-spouse-wrap {
  width: 38px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.lt-spouse-av {
  width: 32px;
  height: 32px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255, 180, 190, .5);
  background: #50172D;
}

.lt-spouse-wrap .realm-badge { height: 12px; padding: 0 2px; font-size: 5.8px; max-width: 38px; }

.lt-spouse-av svg { width: 100%; height: 100%; display: block; }

.lt-note {
  padding: 7px 8px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .16);
  font-size: 8.5px;
  line-height: 1.55;
  color: #D29FAF;
}

.lt-kids {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 7px;
}

.lt-child-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 3px;
  border-radius: 10px;
  border: 1px solid rgba(150, 190, 255, .14);
  background: rgba(255, 255, 255, .035);
}

.lt-child-av {
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 150, .42);
  background: #50172D;
}

.lt-child-av svg { width: 100%; height: 100%; display: block; }

.lt-child-card b {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 8.5px;
  color: #fff;
}

.lt-child-card .realm-badge { height: 12px; padding: 0 3px; font-size: 5.8px; }
.lt-child-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; }
.lt-child-meta .tag { padding: 0 3px; font-size: 5.8px; }

.lt-sub {
  margin: 5px 0;
  padding-left: 7px;
  border-left: 1px solid rgba(255, 205, 140, .24);
}

.lt-sub-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  text-align: left;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}

.lt-sub-av {
  position: relative;
  width: 32px;
  height: 34px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lt-sub-av > svg {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 150, .35);
  background: #50172D;
}

.lt-sub-av .realm-badge { margin-top: 1px; height: 11px; padding: 0 2px; font-size: 5.5px; }

.lt-sub-detail { padding: 6px 0 0 6px; }

/* ---------------- 系统动态 / 底栏 ---------------- */

.feed {
  bottom: calc(var(--safe-bottom) + 73px);
  left: 12px;
  width: min(62%, 250px);
  max-height: 56px;
  padding: 5px 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(5, 15, 30, .9) 0%, rgba(5, 15, 30, .58) 100%);
}

.feed-row { font-size: 8.5px; line-height: 1.55; }

.dock {
  height: calc(var(--safe-bottom) + 64px);
  padding: 0 2px var(--safe-bottom);
  background: linear-gradient(180deg, rgba(5, 13, 27, 0) 0%, rgba(5, 13, 27, .86) 30%, rgba(4, 10, 20, .98) 100%);
  border-top-color: rgba(255, 205, 140, .16);
}

.dock button { gap: 2px; font-size: 8.5px; }
.dock button .mp-icon { width: 22px; height: 22px; }
.dock button.is-on::after { bottom: 3px; }

.dock-dot {
  top: 7px;
  left: 54%;
  width: 6px;
  height: 6px;
}

/* ---------------- 小屏 ---------------- */

@media (max-height: 720px) {
  .kin-rail { top: calc(var(--safe-top) + 120px); transform: scale(.94); transform-origin: left top; }
  .quick-rail { top: calc(var(--safe-top) + 120px); transform: scale(.94); transform-origin: right top; }
  .fate-deck { bottom: calc(var(--safe-bottom) + 118px); max-height: calc(100vh - 258px - var(--safe-top) - var(--safe-bottom)); max-height: calc(100dvh - 258px - var(--safe-top) - var(--safe-bottom)); }
  .fc-art { width: 60px; height: 68px; }
  .fc-desc { -webkit-line-clamp: 2; max-height: 3.2em; }
  .feed { display: none; }
}

@media (max-width: 370px) {
  .kin-rail { width: 96px; }
  .res em { display: none; }
  .era-chip { width: 66px; }
  .era-chip b { font-size: 7.5px; }
  .fc-title b { font-size: 15px; }
  .fc-btn { padding: 0 8px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .fate-v2, .fate-card, .kin-card, .res, .hud-player { transition: none !important; animation: none !important; }
}

/* 灵缘卡出现时，提示条移到上方，避免挡住接受 / 错过 */
body.fate-on .toast-wrap {
  top: calc(var(--safe-top) + 118px);
  bottom: auto;
}

.lt-child-card:active,
.lt-sub-head:active,
.lt-spouse-row:active {
  transform: scale(.98);
}

/* ============================================================
   世家分支 · 首页分支模式
   参考图：浅色水墨底 + 世家印 + 夫妻卡 + 朱红线谱
   ============================================================ */

/* 首页族人栏入口 */
.kin-tree-entry {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 4px;
  text-align: left;
  border-radius: 8px;
  border: 1px solid rgba(255, 196, 120, .3);
  background: linear-gradient(100deg, rgba(255, 168, 80, .16), rgba(255, 255, 255, .03));
}

.kin-tree-entry .kin-tree-ico { width: 15px; height: 15px; flex: none; color: #ffd18a; }
.kin-tree-entry span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.kin-tree-entry b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 8px; color: #ffe2b3; }
.kin-tree-entry em { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-style: normal; font-size: 6px; color: #D9A9B9; }
.kin-tree-entry .kin-tree-arrow { width: 10px; height: 10px; flex: none; color: #ffd39a; }
.kin-tree-entry:active { transform: scale(.98); }

/* 全屏分支模式 */
.tree-screen {
  position: absolute;
  z-index: 55;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--safe-bottom) + 66px);
  overflow: hidden;
  color: #273B35;
  background: #f4f2eb;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .22s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}

.tree-screen.show { opacity: 1; transform: none; }
.tree-screen[hidden] { display: none; }

.tree-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 10%, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(ellipse at 85% 38%, rgba(176, 197, 199, .32) 0%, rgba(176, 197, 199, 0) 62%),
    radial-gradient(ellipse at 40% 88%, rgba(188, 201, 198, .4) 0%, rgba(188, 201, 198, 0) 66%),
    linear-gradient(180deg, #fbfbf8 0%, #f1f2ee 48%, #e5e9e4 100%);
}

.tree-wash::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: url("images/gen/home_scene.png");
  background-size: cover;
  background-position: 50% 40%;
  filter: blur(8px) saturate(.32) brightness(1.32);
  opacity: .11;
}

.tree-wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 42% 16% at 18% 36%, rgba(112, 137, 139, .18), rgba(112, 137, 139, 0) 72%),
    radial-gradient(ellipse 54% 14% at 72% 58%, rgba(110, 133, 136, .16), rgba(110, 133, 136, 0) 74%),
    radial-gradient(ellipse 38% 12% at 42% 78%, rgba(112, 135, 136, .15), rgba(112, 135, 136, 0) 76%);
  filter: blur(1px);
}

.tree-head {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: calc(var(--safe-top) + 9px) 12px 7px;
}

.tree-back { flex: none; width: 28px; height: 28px; }

.tree-seal {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 9px 5px 5px;
  border-radius: 10px;
  border: 1.5px solid #75C7B7;
  background: linear-gradient(160deg, #5F4652 0%, #35232C 62%, #22151B 100%);
  box-shadow: 0 4px 10px rgba(28, 24, 18, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.tree-seal-ico {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #75C7B7;
  background: radial-gradient(circle at 35% 25%, #f8e5b6, #57C7A7 58%, #24775E);
  color: #0C3D30;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 1px 4px rgba(0, 0, 0, .3);
}

.tree-seal-ico .mp-icon { width: 18px; height: 18px; }

.tree-seal-main { min-width: 0; }
.tree-seal-main b {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 102px;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .05em;
  line-height: 1.2;
  color: #f7ebd1;
}

.tree-stars { display: flex; align-items: center; gap: 1px; height: 9px; margin-top: 1px; }
.tree-stars .mp-icon { width: 9px; height: 9px; color: #5DE6C9; }
.tree-seal-main em { display: block; margin-top: 1px; font-style: normal; font-size: 6.5px; color: #8DC9C0; }

.tree-top-actions { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }

.tree-res-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 23px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(100, 80, 50, .22);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 1px 4px rgba(80, 60, 30, .08);
  color: #2D4C43;
  font-size: 8px;
}

.tree-res-pill .mp-icon { width: 11px; height: 11px; }
.tree-res-pill:nth-child(1) .mp-icon { color: #C93A7D; }
.tree-res-pill:nth-child(2) .mp-icon { color: #2EC9AC; }
.tree-res-pill b { font-size: 8px; font-weight: 800; white-space: nowrap; }

.tree-round {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(100, 80, 50, .22);
  background: rgba(255, 255, 255, .72);
  color: #355D51;
  box-shadow: 0 1px 4px rgba(80, 60, 30, .08);
}

.tree-round:active { transform: scale(.92); }
.tree-round .mp-icon { width: 14px; height: 14px; }

.tree-subhead {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 12px 5px;
  border-bottom: 1px solid rgba(100, 80, 50, .12);
}

.tree-subhead span { display: flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 800; letter-spacing: .03em; color: #2D4C43; }
.tree-subhead span .mp-icon { width: 12px; height: 12px; color: #338F75; }
.tree-subhead em {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 7px;
  color: #658C82;
}

.tree-fold {
  flex: none;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid rgba(120, 90, 50, .28);
  background: rgba(255, 255, 255, .55);
  color: #2D6B56;
  font-size: 7px;
  font-weight: 700;
}

.tree-fold:active { transform: scale(.96); }
.tree-fold[disabled] { opacity: .5; pointer-events: none; }

/* 树面 */
.tree-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tree-scroll::-webkit-scrollbar { display: none; }

.tree-canvas {
  position: relative;
  width: max-content;
  min-width: 100%;
  padding: 10px 16px 26px 38px;
}

.tree-canvas::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, #55B973 0%, #8FD9AF 72%, rgba(217, 166, 143, .18) 100%);
}

.tree-gen {
  position: relative;
  width: max-content;
  min-width: 100%;
  padding-bottom: 12px;
}

.tree-gen-head { display: flex; align-items: center; gap: 5px; height: 17px; padding-left: 1px; margin-bottom: 2px; }

.tree-gen-tag {
  display: inline-flex;
  align-items: center;
  height: 14px;
  padding: 0 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #4b4c44, #2f332f);
  color: #C8F4EC;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .05em;
  box-shadow: 0 1px 3px rgba(40, 35, 25, .2);
}

.tree-gen-head em { font-style: normal; font-size: 7px; color: #638B80; }

.tree-gen-line {
  position: relative;
  height: 2px;
  margin-left: -20px;
  background: linear-gradient(90deg, #4AB466 0%, #7ACF9E 55%, rgba(207, 148, 122, .24) 100%);
  box-shadow: 0 1px 3px rgba(150, 75, 56, .16);
}

.tree-gen.is-first .tree-gen-line::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #E87FAB;
  border: 2px solid #f7f4eb;
  box-shadow: 0 0 0 1px #E87FAB, 0 2px 4px rgba(40, 70, 100, .25);
}

.tree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: max-content;
  min-width: 100%;
  padding-top: 14px;
}

.tree-unit { position: relative; flex: none; }

.tree-unit::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 2px;
  height: 14px;
  background: #62C485;
}

.tree-unit::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -17px;
  width: 7px;
  height: 7px;
  transform: translateX(-50%) rotate(45deg);
  background: #f6ead6;
  border: 1px solid #4AB466;
}

.tree-unit-main { display: block; padding: 0; border: 0; background: none; text-align: left; }
.tree-unit-main:active { transform: scale(.985); }

.tree-couple { display: flex; align-items: center; gap: 3px; }

.tree-person {
  width: 66px;
  padding: 3px 3px 4px;
  border-radius: 8px;
  border: 1px solid #6E9B8E;
  background: linear-gradient(180deg, #fdfaf4, #f5eee1);
  box-shadow: 0 2px 6px rgba(70, 50, 25, .12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.tree-person.primary { border-color: #4EB095; background: linear-gradient(180deg, #fffdf7, #f4ead6); }
.tree-person.spouse { border-color: #91C48A; background: linear-gradient(180deg, #fffafb, #f6e8eb); }
.tree-person.is-empty { border-style: dashed; border-color: #7FB8A8; background: rgba(255, 255, 255, .34); opacity: .84; }

.tree-person b {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: .02em;
  color: #223C34;
}

.tree-av { position: relative; width: 45px; height: 45px; margin-top: 1px; }

.tree-av > svg {
  width: 45px;
  height: 45px;
  display: block;
  border-radius: 50%;
  border: 1px solid rgba(90, 70, 45, .3);
  background: #e9e2d6;
  box-shadow: 0 1px 3px rgba(70, 50, 25, .12);
}

.tree-av .realm-badge.realm-up {
  background: linear-gradient(180deg, #ffe7a8, #4EF0C3);
  color: #054A32;
  box-shadow: 0 0 10px rgba(230, 160, 60, .8);
  animation: realmPulseCenter 1.15s ease 2;
}

.hud-avatar-realm.realm-up { animation: realmPulseCenter 1.15s ease 2; }

@keyframes realmPulseCenter {
  0%, 100% { transform: translateX(-50%) scale(1); }
  35% { transform: translateX(-50%) scale(1.16); }
  70% { transform: translateX(-50%) scale(.98); }
}

.tree-av .realm-badge {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  height: 12px;
  padding: 0 2px;
  font-size: 6.2px;
  line-height: 10px;
  border-radius: 4px;
  border-color: #4EB095;
  background: linear-gradient(180deg, #fff6e0, #9AE8D8);
  color: #1E6A53;
  box-shadow: 0 1px 2px rgba(80, 60, 30, .18);
}

.tree-empty-av {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed #7FB8A8;
  background: rgba(255, 255, 255, .4);
  color: #63A592;
}

.tree-empty-av .mp-icon { width: 18px; height: 18px; }
.tree-role { font-style: normal; font-size: 7.2px; color: #648A7F; margin-top: 7px; }

.tree-tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; }
.tree-tags .tag { padding: 0 2px; font-size: 6.2px; line-height: 1.5; border-radius: 3px; border-color: rgba(120, 90, 50, .22); background: rgba(255, 255, 255, .55); color: #487A68; }
.tree-tags .tag.gold { border-color: rgba(170, 120, 40, .3); background: rgba(240, 210, 150, .35); color: #168A68; }
.tree-tags .tag.blue { border-color: rgba(80, 120, 160, .25); background: rgba(180, 210, 230, .3); color: #8A4565; }

.tree-heart { position: relative; width: 14px; height: 14px; flex: none; display: grid; place-items: center; color: #54C267; }
.tree-heart::before { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 1px; background: #62C485; opacity: .7; z-index: 0; }
.tree-heart .mp-icon { position: relative; z-index: 1; width: 11px; height: 11px; background: #f7f4eb; border-radius: 50%; }

.tree-unit-foot { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 3px; }
.tree-unit-count {
  height: 12px;
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(120, 90, 50, .18);
  background: rgba(255, 255, 255, .55);
  color: #487A68;
  font-size: 6px;
  white-space: nowrap;
}
.tree-unit-foot .mp-icon { width: 9px; height: 9px; color: #338F75; }

.tree-empty-branch { position: relative; padding: 8px 0 10px 24px; min-width: 220px; }
.tree-empty-stem { position: absolute; left: 18px; top: 0; width: 1.5px; height: 24px; background: #85C9AA; }
.tree-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 210px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px dashed #7FB8A8;
  background: rgba(255, 255, 255, .4);
  text-align: center;
  color: #648A7F;
}
.tree-empty-card .mp-icon { width: 20px; height: 20px; color: #4EB095; }
.tree-empty-card b { font-family: var(--serif); font-size: 11px; color: #315C4F; }
.tree-empty-card em { font-style: normal; font-size: 7px; line-height: 1.5; }

.tree-foot {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  gap: 7px;
  padding: 6px 12px 8px;
  border-top: 1px solid rgba(100, 80, 50, .14);
  background: linear-gradient(180deg, rgba(247, 244, 236, .2), rgba(247, 244, 236, .94));
}

.tree-foot button {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 9px;
  border: 1px solid rgba(120, 90, 50, .3);
  background: rgba(255, 255, 255, .62);
  color: #355D51;
  font-size: 9px;
  font-weight: 800;
}

.tree-foot button.is-main {
  border-color: #36A987;
  background: linear-gradient(180deg, #f8e7be, #7EE1C9);
  color: #104D39;
  box-shadow: 0 3px 8px rgba(150, 100, 40, .18), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.tree-foot button:active { transform: scale(.98); }
.tree-foot .mp-icon { width: 13px; height: 13px; }

/* 分支模式时底栏浮在树面上 */
.dock { z-index: 90; }

@media (max-width: 370px) {
  .tree-seal-main b { max-width: 54px; font-size: 11px; }
  .tree-res-pill { padding: 0 4px; }
  .tree-res-pill b { font-size: 7.5px; }
  .tree-person { width: 62px; }
  .tree-couple { gap: 2px; }
  .tree-heart { width: 12px; }
  .tree-av, .tree-av > svg { width: 42px; height: 42px; }
  .tree-unit-main { width: 100%; }
}

/* 分支模式中提示条移到上方，避免挡住树底返回按钮 */
body.tree-on .toast-wrap {
  top: calc(var(--safe-top) + 112px);
  bottom: auto;
}

@media (prefers-reduced-motion: reduce) {
  .tree-screen { transition: none; }
}

/* ============================================================
   主页修为圆满 · 直接突破
   ============================================================ */

.hud-break {
  display: none;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 21px;
  margin-top: 2px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(255, 235, 186, .78);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .55), transparent 46%),
    linear-gradient(180deg, #ffdf9c 0%, #ffb45f 54%, #33F1A2 100%);
  color: #033C22;
  box-shadow: 0 3px 10px rgba(255, 128, 42, .34), inset 0 1px 0 rgba(255, 255, 255, .6);
  animation: breakReadyGlow 1.9s ease-in-out infinite;
}

.hud-break[hidden] { display: none !important; }

body.break-ready .hud-break { display: flex; }
body.break-ready .hud-exp-text,
body.break-ready .hud-exp { display: none; }

.hud-break .mp-icon { width: 12px; height: 12px; flex: none; color: #086A3E; }
.hud-break b {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
}
.hud-break em {
  margin-left: auto;
  font-style: normal;
  font-size: 7.5px;
  font-weight: 700;
  opacity: .78;
  white-space: nowrap;
}
.hud-break .hb-arrow { width: 10px; height: 10px; opacity: .7; }

body.break-ready .hud-player {
  border-color: rgba(255, 226, 164, .66);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .34), 0 0 22px rgba(255, 162, 64, .24), inset 0 1px 0 rgba(255, 255, 255, .12);
}

body.break-ready .hud-avatar {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 22px rgba(255, 178, 90, .6);
}

@keyframes breakReadyGlow {
  0%, 100% { filter: brightness(1); box-shadow: 0 3px 10px rgba(255, 128, 42, .3), inset 0 1px 0 rgba(255, 255, 255, .6); }
  50% { filter: brightness(1.08); box-shadow: 0 4px 16px rgba(255, 128, 42, .55), 0 0 18px rgba(255, 196, 110, .45), inset 0 1px 0 rgba(255, 255, 255, .7); }
}

/* ============================================================
   命格初定 · 角色预览
   ============================================================ */

.creation-hero {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 4px 0 2px;
  padding: 10px 11px;
  border-radius: 15px;
  border: 1px solid rgba(255, 205, 140, .24);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 186, 105, .2), transparent 52%),
    linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.creation-av {
  width: 72px;
  height: 72px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid rgba(255, 220, 160, .58);
  background: radial-gradient(circle at 50% 30%, #872B4B, #330A16 72%);
  box-shadow: 0 5px 15px rgba(0, 0, 0, .38), 0 0 16px rgba(255, 172, 80, .2);
}

.creation-av svg { width: 100%; height: 100%; display: block; }

.creation-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.creation-copy b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .05em;
  color: #fff3df;
}
.creation-copy em { font-style: normal; font-size: 10px; font-weight: 700; color: #ffd39a; }
.creation-copy span { font-size: 9px; line-height: 1.5; color: #D29FAF; }

body.break-ready .hud-realm-row { display: none; }

/* ============================================================
   主页修炼道场 · 时流 · 突破 · 月报 · 生平
   ============================================================ */

.home-stage {
  position: absolute;
  z-index: 19;
  top: calc(var(--safe-top) + 122px);
  left: 50%;
  width: min(calc(100% - 24px), 380px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

.home-stage > * { pointer-events: auto; }

.hero-figure-wrap {
  position: relative;
  width: 158px;
  height: 178px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-halo {
  position: absolute;
  inset: -16px -22px -6px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 52%, rgba(255, 226, 168, .3) 0%, rgba(255, 164, 74, .12) 45%, rgba(255, 138, 61, 0) 72%);
  pointer-events: none;
}

.hero-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 172px;
  height: 172px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }

.hr-track {
  fill: none;
  stroke: rgba(255, 205, 140, .15);
  stroke-width: 5;
}

.hr-fill {
  fill: none;
  stroke: #ffc36e;
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px rgba(255, 178, 90, .85));
  transition: stroke-dashoffset .45s cubic-bezier(.22, 1, .36, 1), stroke .3s ease;
}

.hr-fill.pump { animation: ringPump .6s ease; }

@keyframes ringPump {
  0% { stroke-width: 5; }
  40% { stroke-width: 9; filter: drop-shadow(0 0 16px rgba(255, 210, 140, 1)); }
  100% { stroke-width: 5; }
}

.hero-figure {
  position: relative;
  width: 148px;
  height: 174px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 50%;
  transition: transform .15s ease;
}

.hero-figure:active { transform: scale(.97); }
.hero-figure.is-meditating .hero-avatar svg { animation: heroMeditate .9s ease; }

.hero-avatar {
  position: relative;
  z-index: 2;
  display: block;
  width: 142px;
  height: 174px;
}

.hero-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .42));
  animation: heroBreathe 3.8s ease-in-out infinite;
  transform-origin: 50% 88%;
}

@keyframes heroBreathe {
  0%, 100% { transform: translateY(1px) scale(1); }
  50% { transform: translateY(-3px) scale(1.012); }
}

@keyframes heroMeditate {
  0% { transform: scale(1); }
  35% { transform: scale(1.035) translateY(-2px); filter: drop-shadow(0 0 16px rgba(255, 210, 130, .75)); }
  100% { transform: scale(1); }
}

.hero-breath {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 2px;
  width: 98px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 210, 140, .38), transparent 70%);
  animation: breathGlow 3.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathGlow {
  0%, 100% { opacity: .45; transform: translateX(-50%) scale(.9); }
  50% { opacity: .9; transform: translateX(-50%) scale(1.08); }
}

.hero-pct {
  position: absolute;
  z-index: 4;
  right: -8px;
  bottom: 16px;
  min-width: 46px;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 236, 196, .7);
  background: linear-gradient(180deg, #ffe2a6, #ffb15d 58%, #2EE99C);
  color: #023A21;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 4px 12px rgba(180, 100, 25, .38), inset 0 1px 0 rgba(255, 255, 255, .55);
  font-variant-numeric: tabular-nums;
}

.hero-full-tag {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 206, .85);
  background: linear-gradient(180deg, #fff0c9, #ffc56f);
  color: #06542F;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(255, 190, 100, .7);
  animation: fullTagPulse 1.5s ease-in-out infinite;
}

.hero-full-tag .mp-icon { width: 11px; height: 11px; }

@keyframes fullTagPulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 0 12px rgba(255, 190, 100, .55); }
  50% { filter: brightness(1.12); box-shadow: 0 0 22px rgba(255, 210, 130, .9); }
}

.hero-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  padding: 0 4px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

.hero-name-row b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 120px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .05em;
  color: #fff5e3;
}

.hero-name-row span {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 156, .4);
  background: rgba(9, 23, 43, .72);
  color: #ffd7a1;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.hero-name-row em {
  flex: none;
  font-style: normal;
  font-size: 8px;
  color: #E5B9C8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hero-bar {
  width: 178px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 216, 160, .24);
  background: rgba(0, 0, 0, .5);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
}

.hero-bar i {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7a2e, #ffbf61 62%, #ffe8b4);
  box-shadow: 0 0 9px rgba(255, 170, 80, .75);
  transition: width .4s ease;
}

.home-stage.is-full .hr-fill {
  stroke: #fff0c2;
  animation: ringFull 1.3s ease-in-out infinite;
}

.home-stage.is-full .hero-bar i {
  background: linear-gradient(90deg, #ffc061, #fff0c2 60%, #ffd77f);
  animation: barFull 1.3s ease-in-out infinite;
}

.home-stage.is-full .hero-halo {
  background:
    radial-gradient(ellipse at 50% 52%, rgba(255, 238, 190, .55) 0%, rgba(255, 174, 82, .24) 45%, rgba(255, 138, 61, 0) 72%);
  animation: fullHalo 1.8s ease-in-out infinite;
}

@keyframes ringFull {
  0%, 100% { filter: drop-shadow(0 0 7px rgba(255, 190, 100, .7)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 230, 170, 1)); }
}

@keyframes barFull {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes fullHalo {
  0%, 100% { opacity: .8; transform: scale(.97); }
  50% { opacity: 1; transform: scale(1.04); }
}

/* 时流面板 */
.time-panel {
  width: min(100%, 312px);
  margin-top: 5px;
  padding: 6px 9px 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 211, 152, .22);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 190, 110, .13), transparent 62%),
    linear-gradient(180deg, rgba(9, 24, 44, .86), rgba(7, 18, 34, .66));
  box-shadow: 0 5px 16px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.tp-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.tp-date { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tp-date .mp-icon { width: 12px; height: 12px; color: #ffd18a; }
.tp-date b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; color: #ffe5bb; }
.tp-top em { flex: none; font-style: normal; font-size: 7px; color: #D29FAF; }

.tp-track {
  height: 3px;
  margin: 4px 0 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, .46);
}

.tp-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9a4a, #ffd79a);
  box-shadow: 0 0 7px rgba(255, 178, 90, .65);
  transition: width .6s linear;
}

.tp-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tp-foot > span { display: flex; align-items: center; gap: 3px; }
.tp-foot .mp-icon { width: 11px; height: 11px; color: #ffc780; }
.tp-foot em { font-style: normal; font-size: 7.5px; color: #E4B7C6; }

.speed-group {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 211, 152, .16);
  background: rgba(0, 0, 0, .32);
}

.speed-group button {
  min-width: 31px;
  height: 23px;
  border-radius: 999px;
  color: #D9A9B9;
  font-size: 9px;
  font-weight: 900;
}

.speed-group button.on {
  background: linear-gradient(180deg, #ffd38b, #3DF0AF);
  color: #033C22;
  box-shadow: 0 1px 5px rgba(255, 150, 60, .4);
}

.speed-group button:active { transform: scale(.94); }

/* 三个主操作 */
.hero-actions {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 9px;
  width: min(100%, 312px);
  margin-top: 2px;
}

.ha {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 4px 5px;
  border-radius: 15px;
  border: 1px solid rgba(255, 211, 152, .24);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 190, 110, .14), transparent 64%),
    linear-gradient(180deg, rgba(11, 29, 52, .92), rgba(8, 20, 38, .7));
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .14s ease;
}

.ha:active { transform: scale(.96); }

.ha-ico {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 216, 160, .32);
  background: radial-gradient(circle at 40% 30%, rgba(255, 224, 170, .3), rgba(255, 150, 70, .08) 70%);
  color: #ffdcaa;
}

.ha-ico .mp-icon { width: 17px; height: 17px; }
.ha b { font-size: 10px; font-weight: 900; color: #fff1da; line-height: 1.2; }
.ha em { font-style: normal; font-size: 7px; color: #D9A9B9; white-space: nowrap; }

.ha-break {
  flex: 1.18;
  border-color: rgba(255, 226, 168, .5);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 150, .26), transparent 66%),
    linear-gradient(180deg, rgba(74, 45, 18, .94), rgba(34, 22, 12, .82));
  box-shadow: 0 6px 18px rgba(255, 130, 40, .22), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.ha-break .ha-ico {
  border-color: rgba(255, 236, 190, .7);
  background: linear-gradient(180deg, #ffe2a6, #ffb45e 58%, #2EE99C);
  color: #055A34;
  box-shadow: 0 0 13px rgba(255, 178, 90, .55);
}

.ha-break em { color: #ffd9a3; }

.ha-break:disabled { opacity: .58; filter: grayscale(.25); }

body.break-ready .ha-break {
  animation: breakReadyGlow 1.9s ease-in-out infinite;
}

.ha-break[disabled] { animation: none; }

/* 待处理弹窗计数 */
.popup-queue-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 222, 164, .45);
  background: linear-gradient(180deg, rgba(61, 43, 22, .92), rgba(35, 25, 14, .86));
  color: #ffe2b2;
  font-size: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3), 0 0 13px rgba(255, 170, 70, .16);
}

.popup-queue-pill b { font-size: 8px; font-weight: 900; }
.popup-queue-pill .mp-icon { width: 11px; height: 11px; color: #ffc36e; }
.popup-queue-pill:active { transform: scale(.96); }

/* 突破弹窗失败态 + 数据 */
.bt-stat-row {
  display: flex;
  gap: 5px;
  margin: 0 0 12px;
}

.bt-boost { line-height: 1.55; }

.bt-stat-row[hidden] { display: none !important; }

.bt-stat-row > span {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 211, 152, .2);
  background: rgba(255, 255, 255, .045);
}

.bt-stat-row em { font-style: normal; font-size: 7px; color: #D29FAF; }
.bt-stat-row b { font-size: 11px; color: #ffe0a6; font-variant-numeric: tabular-nums; }

.breakthrough.is-fail {
  background:
    radial-gradient(circle at 50% 42%, rgba(94, 125, 168, .22), rgba(2, 8, 18, .92) 58%, rgba(2, 6, 14, .97) 100%);
}

.breakthrough.is-fail .bt-inner {
  border-color: rgba(170, 198, 236, .42);
  background: linear-gradient(180deg, rgba(27, 42, 66, .99), rgba(8, 18, 34, .99));
  box-shadow: 0 0 70px rgba(90, 140, 200, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.breakthrough.is-fail h2 { color: #F4C9D7; text-shadow: 0 0 20px rgba(130, 175, 230, .4); }
.breakthrough.is-fail .bt-kicker { color: #E89FB9; }
.breakthrough.is-fail .bt-kicker i { background: linear-gradient(90deg, transparent, #E89FB9); }
.breakthrough.is-fail .bt-kicker i:last-child { background: linear-gradient(90deg, #E89FB9, transparent); }
.breakthrough.is-fail .bt-meditate { opacity: .72; filter: saturate(.6); }
.breakthrough.is-fail .bt-avatar { border-color: rgba(190, 216, 245, .7); box-shadow: 0 0 18px rgba(120, 165, 220, .4), 0 6px 16px rgba(0, 0, 0, .45); }
.breakthrough.is-fail .bt-line b { color: #ffb7a7; }
.breakthrough.is-fail .bt-stat-row b { color: #d5e6fa; }
.breakthrough.is-fail .bt-close {
  border-color: rgba(190, 216, 245, .5);
  background: linear-gradient(180deg, #cfdff2, #C891A4 55%, #A66E80);
  color: #39121D;
}

/* 中央小人的突破光效 */
.home-stage.is-breaking .hero-figure { animation: heroBreakShake 1.9s ease; }
.home-stage.is-breaking .hero-ring { animation: heroBreakRing 1.9s ease; }
.home-stage.is-breaking .hero-halo { animation: heroBreakHalo 1.9s ease; }
.home-stage.is-break-success .hero-avatar svg { filter: drop-shadow(0 0 24px rgba(255, 232, 170, 1)) drop-shadow(0 12px 18px rgba(0, 0, 0, .4)); }
.home-stage.is-break-fail .hero-avatar svg { animation: heroFailShake .55s ease 2; filter: grayscale(.55) brightness(.9) drop-shadow(0 8px 14px rgba(0, 0, 0, .4)); }

@keyframes heroBreakShake {
  0% { transform: translateY(0) scale(1); }
  16% { transform: translateY(-4px) scale(1.03); }
  32% { transform: translateY(1px) scale(.995); }
  46% { transform: translateY(-7px) scale(1.05); }
  60% { transform: translateY(0) scale(1); }
  74% { transform: translateY(-2px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

.home-stage.is-break-fail .hero-figure { animation: heroFailShake .55s ease 2; }

@keyframes heroFailShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

@keyframes heroBreakRing {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  55% { transform: translate(-50%, -50%) scale(1.22); opacity: .95; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes heroBreakHalo {
  0%, 100% { opacity: .75; transform: scale(1); }
  45% { opacity: 1; transform: scale(1.28); }
}

.hero-float {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 4px;
  transform: translate(-50%, 8px) scale(.9);
  max-width: 170px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 238, 200, .75);
  background: linear-gradient(180deg, rgba(255, 241, 207, .98), rgba(255, 189, 103, .98));
  color: #054A2C;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .35), 0 0 20px rgba(255, 190, 100, .5);
  transition: opacity .18s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
}

.hero-float.show {
  opacity: 1;
  transform: translate(-50%, -12px) scale(1);
  animation: floatUp 2.4s ease both;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.86); }
  12% { opacity: 1; transform: translate(-50%, -4px) scale(1.02); }
  24% { transform: translate(-50%, -8px) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -24px) scale(.98); }
}

/* 灵缘单卡动画 */
.fate-deck.is-single .fate-v2 {
  animation: fateCardIn .55s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes fateCardIn {
  0% { opacity: 0; transform: translateY(20px) scale(.97) rotate(0deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(-.35deg); }
}

/* 家族月报 */
.month-overlay {
  position: fixed;
  z-index: 115;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px calc(22px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 196, 110, .13), rgba(2, 8, 18, .84) 58%, rgba(2, 6, 14, .94) 100%);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.month-overlay.show { opacity: 1; pointer-events: auto; }

.month-card {
  position: relative;
  width: min(100%, 370px);
  max-height: min(78vh, 620px);
  overflow-y: auto;
  padding: 14px 14px 12px;
  border-radius: 20px;
  border: 1px solid #47B997;
  color: #124A33;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 92% 102%, rgba(164, 109, 39, .18), rgba(164, 109, 39, 0) 48%),
    linear-gradient(158deg, #fcf5e4 0%, #BDF1E6 58%, #9AE3D2 100%);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, .52),
    inset 0 0 0 3px rgba(255, 255, 255, .35),
    inset 0 0 0 4px rgba(173, 127, 60, .2);
  transform: translateY(22px) scale(.96);
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
  scrollbar-width: none;
}

.month-card::-webkit-scrollbar { display: none; }
.month-overlay.show .month-card { transform: translateY(0) scale(1); }

.mr-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(148, 101, 43, .28);
}

.mr-seal {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(143, 92, 24, .5);
  background: linear-gradient(180deg, #fffdf6, #ACEFE1);
  color: #188F6A;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.mr-title { flex: 1; min-width: 0; }
.mr-title b { display: block; font-family: var(--serif); font-size: 16px; letter-spacing: .04em; color: #124A33; }
.mr-title em { display: block; margin-top: 2px; font-style: normal; font-size: 8px; color: #428A72; }

.mr-x {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(143, 92, 24, .24);
  color: #188F6A;
}

.mr-x .mp-icon { width: 15px; height: 15px; }

.mr-body { display: flex; flex-direction: column; gap: 5px; padding: 9px 0 3px; }

.mr-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 7px;
  border-radius: 10px;
  border: 1px solid rgba(148, 101, 43, .16);
  background: rgba(255, 255, 255, .38);
}

.mr-ico {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(143, 92, 24, .22);
  background: rgba(255, 255, 255, .5);
}

.mr-ico .mp-icon { width: 15px; height: 15px; }
.mr-ico.gold { color: #1FB78B; }
.mr-ico.pink { color: #6EC25A; }
.mr-ico.rose { color: #54C267; }
.mr-ico.blue { color: #9F3F67; }
.mr-ico.green { color: #5F4A86; }
.mr-ico.cool { color: #A8765A; }

.mr-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mr-copy b { font-size: 10px; color: #124A33; }
.mr-copy em { font-style: normal; font-size: 9px; line-height: 1.5; color: #287B5E; }
.mr-copy em strong { color: #12A36B; }

.mr-note { margin: 6px 0 8px; font-size: 8px; text-align: center; color: #428A72; }

.mr-btn {
  width: 100%;
  min-height: 41px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 11px;
  border: 1px solid #36A987;
  background: linear-gradient(180deg, #f8e7be, #7EE1C9);
  color: #104D39;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(150, 100, 40, .18), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.mr-btn:active { transform: scale(.985); }
.mr-btn .mp-icon { width: 15px; height: 15px; }

/* 家族成员按辈分 */
.gen-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 9px; }

.gen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 3px;
}

.gen-head span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #ffe3b4;
}

.gen-head span::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffd08a, #30E9A0);
  box-shadow: 0 0 7px rgba(255, 170, 80, .5);
}

.gen-head em { font-style: normal; font-size: 8px; color: #D29FAF; }
.member-hint { margin: -2px 0 7px; }

.member-row { cursor: pointer; }
.member-row:active { transform: scale(.99); background: rgba(255, 255, 255, .07); }

/* 生平大事记 */
.timeline-card { padding: 10px 10px 8px; }

.life-timeline { position: relative; display: flex; flex-direction: column; gap: 9px; padding-left: 12px; }

.life-timeline::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 190, 100, .65), rgba(255, 190, 100, .1));
}

.tl-row { position: relative; display: flex; align-items: flex-start; gap: 6px; }

.tl-dot {
  position: absolute;
  left: -12px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 2px solid #380D1B;
  background: #ffc36e;
  box-shadow: 0 0 7px rgba(255, 180, 90, .75);
}

.tl-age {
  flex: none;
  min-width: 30px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 211, 152, .24);
  background: rgba(255, 178, 90, .1);
  color: #ffd39a;
  font-size: 7.5px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tl-text { flex: 1; padding-top: 1px; font-size: 9.5px; line-height: 1.55; color: #c9dbee; }

.tl-empty { display: flex; align-items: center; gap: 7px; padding: 4px; color: #D29FAF; font-size: 9.5px; line-height: 1.5; }
.tl-empty .mp-icon { color: #ffc47a; }

/* 修炼页突破成功率 */
.break-rate-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 211, 152, .2);
  background: rgba(255, 255, 255, .04);
}

.break-rate-row > span { display: flex; align-items: center; gap: 5px; font-size: 9px; color: #d7e6f8; }
.break-rate-row .mp-icon { width: 12px; height: 12px; color: #ffd18a; }
.break-rate-row b { color: #ffd28b; font-size: 12px; }
.break-rate-row em { font-style: normal; font-size: 7.5px; line-height: 1.5; color: #D29FAF; }

/* 小屏适配 */
@media (max-height: 720px) {
  .home-stage { top: calc(var(--safe-top) + 112px); gap: 3px; }
  .hero-figure-wrap { width: 142px; height: 154px; }
  .hero-avatar { width: 128px; height: 154px; }
  .hero-ring { width: 152px; height: 152px; }
  .hero-pct { bottom: 10px; font-size: 10px; min-width: 40px; }
  .hero-actions { max-width: 292px; }
  .time-panel { padding: 4px 8px; }
  .ha { padding: 4px 3px; }
  .ha-ico { width: 26px; height: 26px; }
  .feed { display: none; }
}

@media (max-width: 370px) {
  .home-stage { width: calc(100% - 14px); }
  .hero-name-row em { display: none; }
  .hero-actions { gap: 6px; max-width: 280px; }
  .time-panel { max-width: 280px; }
  .hero-pct { right: -2px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-avatar svg, .hero-breath, .hero-halo, .hr-fill, .hero-bar i, .hero-full-tag,
  .home-stage.is-full .hr-fill, .home-stage.is-full .hero-halo, .ha-break,
  .fate-deck.is-single .fate-v2, .home-stage.is-breaking .hero-figure,
  .home-stage.is-breaking .hero-ring, .home-stage.is-breaking .hero-halo { animation: none !important; }
}

.exp-pct {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 211, 152, .28);
  background: rgba(255, 178, 90, .14);
  color: #ffd28b;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 800;
}

@media (max-width: 390px) {
  .kin-rail { width: 92px; }
  .quick-rail { grid-template-columns: repeat(2, 42px); gap: 4px; }
  .q-ico { width: 30px; height: 30px; }
  .hero-figure-wrap { width: 148px; height: 168px; }
  .hero-avatar { width: 136px; height: 164px; }
  .hero-ring { width: 158px; height: 158px; }
  .hero-pct { right: -2px; bottom: 12px; }
}

/* ============================================================
   首页 V3 · 云海仙门实景布局（参考图重构）
   ============================================================ */

/* 场景：轻微呼吸推进，保持原画完整可见 */
.scene-art {
  background-position: 50% 0%;
  background-size: cover;
  filter: saturate(1.08) brightness(.99) contrast(1.02);
  transform-origin: 50% 28%;
  animation: sceneBreath 36s ease-in-out infinite alternate;
}

@keyframes sceneBreath {
  0% { transform: scale(1.02) translateY(0); }
  100% { transform: scale(1.075) translateY(-8px); }
}

.scene-top {
  height: 210px;
  background: linear-gradient(180deg, rgba(5, 15, 31, .5) 0%, rgba(5, 15, 31, .24) 34%, transparent 100%);
}

.scene-vignette {
  background:
    radial-gradient(circle at 52% 44%, rgba(5, 13, 28, 0) 40%, rgba(5, 13, 28, .14) 76%, rgba(4, 10, 20, .42) 100%),
    linear-gradient(180deg, rgba(5, 13, 28, 0) 56%, rgba(4, 10, 21, .22) 78%, rgba(4, 10, 21, .62) 100%);
}

/* ---------------- 顶部：角色 / 货币 / 快捷 ---------------- */

.hud-v3 {
  position: absolute;
  z-index: 30;
  top: calc(var(--safe-top) + 8px);
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.hud-v3 > * { pointer-events: auto; }

.hud-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.profile-card {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 7px;
  text-align: left;
  border-radius: 19px;
  border: 1px solid rgba(255, 218, 164, .4);
  border-left: 2px solid rgba(255, 196, 110, .66);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 194, 122, .18), transparent 44%),
    linear-gradient(105deg, rgba(9, 24, 44, .95), rgba(9, 24, 44, .7));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  transition: transform .15s ease;
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 15px;
  border: 1px solid rgba(255, 233, 196, .1);
  pointer-events: none;
}

.profile-card:active { transform: scale(.992); }

.profile-av {
  position: relative;
  width: 62px;
  height: 62px;
  flex: none;
}

.hud-v3 .hud-avatar {
  position: relative;
  width: 62px;
  height: 62px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #1D8F69, #ffe8b2, #45D9AB, #fff0c6, #1D8F69);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .46), 0 0 17px rgba(255, 184, 92, .34);
}

.hud-v3 .av-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #350B19;
  background: radial-gradient(circle at 50% 32%, #872B4B, #310815 72%);
  box-shadow: inset 0 0 14px rgba(2, 10, 22, .55);
}

.hud-v3 .av-inner svg,
.hud-v3 .av-inner img { width: 100%; height: 100%; display: block; }

.hud-v3 .hud-gen {
  position: absolute;
  z-index: 4;
  top: auto;
  left: -3px;
  bottom: -3px;
  transform: none;
  min-width: 19px;
  height: 19px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 232, 190, .78);
  background: linear-gradient(180deg, #782D46, #421021);
  color: #ffe8bf;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

.profile-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.profile-name-row b {
  min-width: 0;
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff7e8;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}

.profile-name-row em {
  flex: none;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 210, 150, .32);
  background: rgba(255, 170, 80, .12);
  color: #ffd49a;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
}

.profile-realm {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
  font-weight: 600;
  color: #d3e4fa;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .65);
}

.profile-family {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 7px;
  color: #C792A5;
}

.profile-exp {
  position: relative;
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 216, 160, .22);
  background: rgba(0, 0, 0, .46);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
}

.profile-exp i {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7a2e, #ffbf61 62%, #fff0c2);
  box-shadow: 0 0 9px rgba(255, 176, 80, .8);
  transition: width .4s ease;
}

.profile-exp em {
  position: absolute;
  z-index: 2;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 6.5px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hud-side {
  width: 128px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-money {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.money-pill {
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px 0 6px;
  border-radius: 9px;
  border: 1px solid rgba(255, 214, 158, .3);
  background: linear-gradient(180deg, rgba(9, 23, 43, .95), rgba(8, 20, 38, .76));
  box-shadow: 0 3px 10px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.money-pill:active { transform: scale(.96); }
.money-pill .mp-icon { width: 12px; height: 12px; flex: none; }
.money-pill.jade .mp-icon { color: #ffd078; filter: drop-shadow(0 0 4px rgba(255, 190, 80, .55)); }
.money-pill.stone .mp-icon { color: #7fd0ff; filter: drop-shadow(0 0 4px rgba(90, 190, 255, .5)); }

.money-pill b {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.money-pill em {
  flex: none;
  color: #ffd18a;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.hud-tools-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.hud-round {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 158, .32);
  background: linear-gradient(180deg, rgba(12, 30, 52, .95), rgba(8, 20, 38, .8));
  box-shadow: 0 3px 9px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.hud-round .mp-icon { width: 16px; height: 16px; color: #ffddad; }
.hud-round:active { transform: scale(.92); }

.hud-red-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #310B18;
  background: #ff5f52;
  box-shadow: 0 0 7px rgba(255, 80, 60, .9);
}

/* 资质 / 快捷 */
.hud-subrow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
}

.stat-panel {
  width: 152px;
  flex: none;
  padding: 5px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 214, 158, .25);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 190, 110, .13), transparent 58%),
    linear-gradient(180deg, rgba(9, 23, 43, .9), rgba(8, 20, 38, .66));
  box-shadow: 0 5px 15px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 18px;
  border-top: 1px solid rgba(255, 255, 255, .045);
}

.stat-line:first-child { border-top: 0; }

.stat-line span {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 7.5px;
  color: #D29FAF;
}

.stat-line .mp-icon { width: 11px; height: 11px; color: #ffd18a; }
.stat-line b {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8.5px;
  font-weight: 800;
  color: #ffe1b0;
  text-align: right;
}
.stat-line b.is-green { color: #C19FE6; }

.hud-quick {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.hud-quick button {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #f2f7ff;
  font-size: 7.5px;
  font-weight: 700;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .8);
}

.hud-quick button:active .hq-ico { transform: scale(.9); }

.hq-ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 214, 158, .38);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 226, 170, .24), transparent 62%),
    linear-gradient(180deg, rgba(13, 32, 56, .95), rgba(8, 20, 38, .78));
  box-shadow: 0 4px 11px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .14s ease;
}

.hq-ico .mp-icon { width: 20px; height: 20px; color: #ffd9a5; }
.hud-quick b { font-size: 7.5px; font-weight: 700; color: #eaf4ff; }

.hq-badge {
  position: absolute;
  top: -4px;
  right: 26%;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1.5px solid #310B18;
  background: linear-gradient(180deg, #ff7a63, #32E352);
  color: #fff;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 0 7px rgba(255, 80, 60, .8);
}

.hq-dot {
  position: absolute;
  top: 1px;
  right: 27%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #310B18;
  background: #ff5f52;
  box-shadow: 0 0 7px rgba(255, 80, 60, .85);
}

/* ---------------- 时流胶囊 ---------------- */

.time-capsule {
  position: absolute;
  display: block;
  font-style: normal;
  z-index: 31;
  left: 12px;
  bottom: calc(var(--safe-bottom) + 196px);
  width: min(58%, 218px);
  padding: 5px 8px 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 214, 158, .25);
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 194, 110, .15), transparent 62%),
    linear-gradient(180deg, rgba(8, 22, 41, .88), rgba(7, 18, 34, .7));
  box-shadow: 0 5px 15px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.tc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.tc-head span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tc-head .mp-icon { width: 11px; height: 11px; color: #ffd18a; }
.tc-head b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
  color: #ffe5bb;
}
.tc-head em { flex: none; font-style: normal; font-size: 6.5px; color: #D29FAF; }

.tc-track {
  height: 3px;
  margin: 3px 0 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, .46);
}

.tc-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9a4a, #ffd79a);
  box-shadow: 0 0 7px rgba(255, 178, 90, .65);
  transition: width .6s linear;
}

.tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.tc-foot > span { display: flex; align-items: center; gap: 3px; }
.tc-foot .mp-icon { width: 10px; height: 10px; color: #ffc780; }
.tc-foot em { font-style: normal; font-size: 7px; color: #E4B7C6; }

.time-capsule .speed-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px;
  border-radius: 999px;
  border: 1px solid rgba(255, 211, 152, .16);
  background: rgba(0, 0, 0, .3);
}

.time-capsule .speed-group button {
  min-width: 26px;
  height: 17px;
  border-radius: 999px;
  color: #D9A9B9;
  font-size: 7px;
  font-weight: 900;
}

.time-capsule .speed-group button.on {
  background: linear-gradient(180deg, #ffd38b, #3DF0AF);
  color: #033C22;
  box-shadow: 0 1px 5px rgba(255, 150, 60, .4);
}

.time-capsule .speed-group button:active { transform: scale(.94); }

/* ---------------- 中央萌系小人 ---------------- */

.home-stage {
  position: absolute;
  z-index: 22;
  top: auto;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 252px);
  width: 170px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.home-stage > * { pointer-events: auto; }

.hero-figure-wrap {
  position: relative;
  width: 170px;
  height: 184px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-halo { inset: -10px -20px -4px; }

.hero-ring { width: 176px; height: 176px; }

.hero-figure { width: 154px; height: 182px; }

.hero-avatar { width: 154px; height: 182px; }

.hero-pct {
  right: -4px;
  bottom: 9px;
  min-width: 39px;
  padding: 3px 6px;
  font-size: 10px;
}

.hero-full-tag { bottom: -1px; font-size: 7px; }
.hero-name-row b { max-width: 94px; font-size: 13px; }
.hero-name-row span { font-size: 7px; padding: 1px 5px; }
.hero-name-row em { font-size: 7px; }
.hero-bar { width: 118px; height: 4px; }
.hero-float { top: -8px; font-size: 8px; max-width: 150px; }

/* ---------------- 奇遇徽章 ---------------- */

.fate-badge {
  position: absolute;
  z-index: 31;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 250px);
  width: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #ffe3b2;
}

.fate-badge:active .fate-badge-diamond { transform: rotate(45deg) scale(.93); }

.fate-badge-diamond {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
  border-radius: 13px;
  border: 1px solid rgba(255, 238, 194, .85);
  background:
    radial-gradient(circle at 36% 22%, rgba(255, 255, 255, .6), transparent 32%),
    linear-gradient(145deg, #ffe7b1 0%, #64F4CD 42%, #22C48D 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, .4),
    0 0 20px rgba(255, 186, 88, .4),
    inset 0 0 0 3px rgba(120, 70, 18, .18),
    inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: transform .16s ease;
}

.fbd-inner {
  transform: rotate(-45deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  color: #064B2C;
}

.fbd-inner .mp-icon { width: 22px; height: 22px; color: #0A6C45; }
.fbd-inner b {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .12em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}

.fate-badge em {
  font-style: normal;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 158, .2);
  background: rgba(7, 19, 37, .76);
  color: #d5e5f8;
  font-size: 6.5px;
}

.fate-badge-dot {
  position: absolute;
  top: 0;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #310B18;
  background: #ff5f52;
  box-shadow: 0 0 8px rgba(255, 80, 60, .9);
}

.fate-badge.has-pending .fate-badge-diamond {
  animation: fateBadgePulse 2s ease-in-out infinite;
}

.fate-badge.has-pending em { color: #ffd493; border-color: rgba(255, 200, 120, .4); }

@keyframes fateBadgePulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(0, 0, 0, .4), 0 0 16px rgba(255, 186, 88, .35); }
  50% { box-shadow: 0 8px 22px rgba(0, 0, 0, .4), 0 0 30px rgba(255, 204, 120, .8); }
}

/* ---------------- 突破任务条 ---------------- */

.quest-card {
  position: absolute;
  z-index: 32;
  left: 12px;
  bottom: calc(var(--safe-bottom) + 120px);
  width: calc(100% - 146px);
  max-width: 246px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(255, 211, 152, .3);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 190, 110, .16), transparent 52%),
    linear-gradient(100deg, rgba(8, 22, 41, .94), rgba(8, 20, 38, .74));
  box-shadow: 0 7px 20px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .14s ease, border-color .2s ease;
}

.quest-card:active { transform: scale(.985); }

.quest-card.is-ready {
  border-color: rgba(255, 226, 168, .72);
  box-shadow: 0 7px 22px rgba(0, 0, 0, .34), 0 0 22px rgba(255, 160, 60, .3), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.quest-card.is-ready .qc-icon {
  background: linear-gradient(180deg, #ffe2a6, #ffb45e 58%, #2EE99C);
  color: #055A34;
  box-shadow: 0 0 14px rgba(255, 178, 90, .55);
}

.qc-icon {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 158, .4);
  background: radial-gradient(circle at 35% 25%, rgba(255, 222, 166, .32), rgba(255, 150, 70, .08) 70%);
  color: #ffd28b;
}

.qc-icon .mp-icon { width: 20px; height: 20px; }

.qc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.qc-main > b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  color: #fff2da;
}
.qc-main > em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 7.5px;
  color: #D9A9B9;
}

.qc-progress {
  position: relative;
  display: block;
  height: 9px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 216, 160, .16);
  background: rgba(0, 0, 0, .44);
}

.qc-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7a2e, #ffc36e 70%, #ffe8b4);
  box-shadow: 0 0 8px rgba(255, 170, 80, .7);
  transition: width .4s ease;
}

.qc-progress b {
  position: absolute;
  z-index: 2;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 6px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95);
  font-variant-numeric: tabular-nums;
}

.qc-arrow { width: 13px; height: 13px; flex: none; color: rgba(255, 214, 160, .75); }

/* ---------------- 开始修炼 ---------------- */

.start-cultivate {
  position: absolute;
  z-index: 33;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 114px);
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 240, 200, .78);
  background:
    radial-gradient(circle at 38% 26%, #fff6d8 0%, #ffe0a0 26%, #f6b85e 55%, #25C78F 82%, #128C5C 100%);
  color: #054A2B;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, .42),
    0 0 26px rgba(255, 190, 100, .55),
    inset 0 0 18px rgba(255, 250, 225, .6),
    inset 0 -8px 18px rgba(120, 60, 10, .25);
  transition: transform .14s ease, box-shadow .2s ease;
}

.start-cultivate:active { transform: scale(.94); }

.start-cultivate.is-tapped { animation: startTap .52s ease; }

@keyframes startTap {
  0% { transform: scale(.93); }
  45% { transform: scale(1.045); box-shadow: 0 10px 28px rgba(0, 0, 0, .42), 0 0 42px rgba(255, 220, 150, .9); }
  100% { transform: scale(1); }
}

.sc-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(120, 64, 12, .38);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.sc-ring.r1 { width: 120px; height: 120px; animation: scSpin 14s linear infinite; }
.sc-ring.r2 { width: 134px; height: 134px; border-style: solid; border-color: rgba(255, 226, 168, .46); animation: scSpin 22s linear infinite reverse; }

@keyframes scSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.sc-core {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .98;
  margin-top: -2px;
}

.sc-core b {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .1em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 2px 4px rgba(110, 55, 8, .25);
}

.sc-core em {
  font-family: var(--serif);
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 2px 5px rgba(110, 55, 8, .3);
}

.sc-rate {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  min-width: 36px;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid rgba(110, 60, 12, .26);
  background: rgba(255, 250, 232, .56);
  color: #065B36;
  font-size: 6.5px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.start-cultivate.is-ready {
  animation: startReady 1.9s ease-in-out infinite;
}

@keyframes startReady {
  0%, 100% { box-shadow: 0 10px 26px rgba(0, 0, 0, .42), 0 0 26px rgba(255, 190, 100, .55), inset 0 0 18px rgba(255, 250, 225, .6); }
  50% { box-shadow: 0 10px 28px rgba(0, 0, 0, .42), 0 0 46px rgba(255, 220, 150, .98), inset 0 0 22px rgba(255, 255, 240, .8); }
}

/* ---------------- 底部动态 / 导航 ---------------- */

.feed {
  position: absolute;
  z-index: 34;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 64px);
  width: auto;
  max-height: 48px;
  padding: 6px 14px;
  border-radius: 0;
  border-top: 1px solid rgba(255, 205, 140, .14);
  background: linear-gradient(180deg, rgba(4, 12, 24, .16) 0%, rgba(4, 12, 24, .84) 38%, rgba(3, 9, 18, .94) 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  font-size: 8.5px;
  line-height: 1.45;
}

.feed-row b { flex: none; color: #ffb266; font-weight: 900; }
.feed-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #d2e2f5;
}

.dock-v3 {
  position: absolute;
  z-index: 90;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--safe-bottom) + 64px);
  padding: 4px 6px var(--safe-bottom);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0;
  border-top: 1px solid rgba(255, 205, 140, .15);
  background: linear-gradient(180deg, rgba(4, 11, 22, 0) 0%, rgba(4, 12, 24, .9) 32%, rgba(2, 7, 14, .99) 100%);
}

.dock-v3 button {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding-top: 0;
  color: #E2B8C7;
  font-size: 8px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
  transition: transform .12s ease, color .2s ease;
}

.dock-v3 button:active { transform: scale(.92); }
.dock-v3 button .mp-icon { width: 23px; height: 23px; color: #c9dcef; transition: color .2s ease, filter .2s ease; }
.dock-v3 button.is-on { color: #ffd79a; }
.dock-v3 button.is-on .mp-icon { color: #ffd08a; filter: drop-shadow(0 0 7px rgba(255, 180, 80, .6)); }
.dock-v3 button.is-on::after {
  content: "";
  width: 14px;
  height: 2px;
  margin-top: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ffcf88, transparent);
}

/* 灵缘卡在新首页上居中偏上，避免遮住底部操作 */
.fate-deck.is-single {
  top: calc(var(--safe-top) + 186px);
  bottom: auto;
  z-index: 80;
  max-height: 52vh;
  max-height: 52dvh;
}

/* ---------------- 小屏适配 ---------------- */

@media (max-height: 720px) {
  .hud-v3 { top: calc(var(--safe-top) + 6px); gap: 5px; }
  .profile-card { padding: 5px 7px 5px 5px; }
  .profile-av, .hud-v3 .hud-avatar { width: 54px; height: 54px; }
  .profile-name-row b { font-size: 17px; }
  .hud-side { width: 122px; }
  .hud-quick button { max-width: 46px; }
  .hq-ico { width: 34px; height: 34px; }
  .stat-panel { width: 144px; padding: 3px 7px; }
  .stat-line { min-height: 16px; }
  .time-capsule { bottom: calc(var(--safe-bottom) + 186px); }
  .home-stage { bottom: calc(var(--safe-bottom) + 236px); }
  .fate-badge { bottom: calc(var(--safe-bottom) + 236px); }
  .quest-card { bottom: calc(var(--safe-bottom) + 116px); min-height: 60px; }
  .start-cultivate { bottom: calc(var(--safe-bottom) + 110px); width: 98px; height: 98px; }
  .sc-ring.r1 { width: 112px; height: 112px; }
  .sc-ring.r2 { width: 124px; height: 124px; }
  .sc-core b { font-size: 16px; }
  .sc-core em { font-size: 20px; }
  .feed { display: flex; max-height: 42px; padding: 4px 12px; }
  .dock-v3 { height: calc(var(--safe-bottom) + 60px); }
  .dock-v3 button { font-size: 7.5px; padding-top: 0; }
  .dock-v3 button .mp-icon { width: 21px; height: 21px; }
}

@media (max-width: 370px) {
  .hud-side { width: 112px; }
  .hud-money { gap: 3px; }
  .money-pill { padding-left: 4px; }
  .hud-quick { gap: 3px; }
  .hq-ico { width: 35px; height: 35px; }
  .stat-panel { width: 136px; }
  .quest-card { width: calc(100% - 138px); }
  .start-cultivate { width: 96px; height: 96px; right: 10px; }
  .sc-ring.r1 { width: 110px; height: 110px; }
  .sc-ring.r2 { width: 122px; height: 122px; }
  .fate-badge { width: 80px; right: 10px; }
  .fate-badge-diamond { width: 70px; height: 70px; }
}

/* 让旧的侧栏/旧主页元素彻底退出新布局 */
.kin-rail:empty { display: none; }

/* ============================================================
   首页 V4 · 参考图二版（全幅云海 + 左右浮动入口）
   ============================================================ */

/* 顶部快捷：六格横向铺满 */
.hud-v3 {
  top: calc(var(--safe-top) + 8px);
  gap: 7px;
}

.hud-quick {
  width: 100%;
  flex: none;
  justify-content: space-between;
  gap: 3px;
}

.hud-quick button {
  flex: 1 1 0;
  max-width: none;
  gap: 2px;
}

.hq-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.hq-ico .mp-icon { width: 21px; height: 21px; }
.hud-quick b { font-size: 7.5px; }

.hq-badge { right: 18%; }
.hq-dot { right: 18%; }

.hud-side { width: 128px; }

.hud-tools-row {
  display: flex;
  justify-content: flex-end;
}

.hud-gear {
  align-self: flex-end;
  width: 30px;
  height: 30px;
}

/* ---------------- 良缘佳期 ---------------- */

.romance-card {
  position: absolute;
  z-index: 30;
  top: calc(var(--safe-top) + 158px);
  left: 12px;
  width: 128px;
  height: 152px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255, 194, 198, .62);
  background: #202A17;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .38), 0 0 20px rgba(255, 150, 170, .16), inset 0 0 0 2px rgba(255, 255, 255, .08);
  transition: transform .15s ease;
}

.romance-card:active { transform: scale(.975); }

.romance-art {
  position: absolute;
  inset: 0;
  background-image: url("images/gen/spouse.png");
  background-repeat: no-repeat;
  background-position: 50% 8%;
  background-size: cover;
  filter: saturate(1.06) brightness(1.02);
  transform: scale(1.04);
}

.romance-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(38, 14, 24, 0) 28%, rgba(38, 14, 24, .28) 56%, rgba(30, 9, 18, .94) 100%),
    radial-gradient(circle at 80% 8%, rgba(255, 210, 220, .22), transparent 46%);
  pointer-events: none;
}

.romance-heart {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 225, 230, .8);
  background: linear-gradient(180deg, #ff9fb4, #6DE45D);
  color: #fff;
  box-shadow: 0 2px 8px rgba(120, 20, 45, .5), inset 0 1px 0 rgba(255, 255, 255, .5);
}

.romance-heart .mp-icon { width: 13px; height: 13px; }

.romance-copy {
  position: absolute;
  z-index: 3;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.romance-copy b {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #fff5f6;
  text-shadow: 0 1px 7px rgba(30, 5, 14, .95);
}

.romance-copy em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 7.5px;
  color: #ffd6dc;
  text-shadow: 0 1px 5px rgba(30, 5, 14, .95);
}

.romance-card.has-spouse { border-color: rgba(255, 210, 170, .72); }
.romance-card.has-spouse .romance-heart { background: linear-gradient(180deg, #ffd08a, #3FE9A1); color: #fff8e8; }

/* ---------------- 右侧浮标 ---------------- */

.side-rail {
  position: absolute;
  z-index: 31;
  top: calc(var(--safe-top) + 330px);
  right: 10px;
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}

.side-action {
  position: relative;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #f6ecd9;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
}

.side-action:active .sa-ico { transform: scale(.91); }

.sa-ico {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 218, 166, .55);
  background:
    radial-gradient(circle at 38% 26%, rgba(255, 228, 176, .3), transparent 44%),
    radial-gradient(circle at 50% 50%, rgba(20, 36, 54, .96), rgba(7, 17, 31, .92) 72%);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .38), inset 0 0 0 2px rgba(255, 255, 255, .05), inset 0 0 14px rgba(255, 180, 90, .1);
  transition: transform .14s ease;
}

.sa-ico .mp-icon { width: 24px; height: 24px; color: #ffe2ae; }

.side-action.is-fate .sa-ico::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 220, 160, .3);
}

.sa-dot {
  position: absolute;
  top: 0;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #2F0A17;
  background: #ff5f52;
  box-shadow: 0 0 8px rgba(255, 80, 60, .9);
}

.sa-heir-img {
  overflow: hidden;
  border-color: rgba(255, 208, 160, .7);
  background: radial-gradient(circle at 50% 40%, #A4F4D2, #327A52 75%);
}

.sa-heir-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: scale(1.15);
}

/* ---------------- 时流 / 聊天 / 修炼 ---------------- */

.time-capsule {
  left: 12px;
  bottom: calc(var(--safe-bottom) + 136px);
  width: min(58%, 214px);
  padding: 4px 8px;
  border-radius: 11px;
}

.feed {
  left: 12px;
  right: 134px;
  bottom: calc(var(--safe-bottom) + 72px);
  width: auto;
  min-height: 54px;
  max-height: 58px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1px solid rgba(255, 211, 152, .18);
  flex-direction: row;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 190, 110, .1), transparent 52%),
    linear-gradient(180deg, rgba(6, 17, 33, .84), rgba(5, 13, 26, .9));
  box-shadow: 0 6px 18px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  display: flex;
  align-items: flex-start;
  gap: 7px;
  overflow: hidden;
}

.feed-ico {
  width: 27px;
  height: 27px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 158, .28);
  background: rgba(255, 190, 110, .1);
}

.feed-ico .mp-icon { width: 15px; height: 15px; color: #ffd6a0; }

.feed-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  font-size: 8.5px;
  line-height: 1.45;
}

.feed-row b { flex: none; color: #ffb266; font-weight: 900; }
.feed-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #d7e7fa;
}

.start-cultivate {
  right: 12px;
  bottom: calc(var(--safe-bottom) + 70px);
  width: 112px;
  height: 112px;
}

.sc-icon {
  width: 27px;
  height: 27px;
  margin-bottom: 1px;
  color: #055A36;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .5));
}

.sc-core b {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .08em;
}

.sc-core em {
  font-family: inherit;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .1em;
  color: #096A40;
}

.sc-ring.r1 { width: 126px; height: 126px; }
.sc-ring.r2 { width: 140px; height: 140px; }
.sc-rate { bottom: 8px; }

/* 底部六格导航 */
.dock-v3 {
  height: calc(var(--safe-bottom) + 66px);
  padding: 3px 4px var(--safe-bottom);
}

.dock-v3 button {
  font-size: 7.5px;
  gap: 2px;
}

.dock-v3 button .mp-icon { width: 22px; height: 22px; }

/* 中央小人在新底栏上方 */
.home-stage {
  left: 54%;
  bottom: calc(var(--safe-bottom) + 210px);
  width: 168px;
}

@media (max-height: 720px) {
  .hud-v3 { top: calc(var(--safe-top) + 6px); gap: 5px; }
  .profile-card { padding: 5px 7px 5px 5px; }
  .profile-av, .hud-v3 .hud-avatar { width: 54px; height: 54px; }
  .profile-name-row b { font-size: 17px; }
  .hud-side { width: 118px; }
  .hq-ico { width: 35px; height: 35px; }
  .hq-ico .mp-icon { width: 19px; height: 19px; }
  .romance-card { top: calc(var(--safe-top) + 148px); width: 116px; height: 132px; }
  .romance-copy b { font-size: 13px; }
  .romance-copy em { font-size: 6.5px; }
  .side-rail { top: calc(var(--safe-top) + 222px); gap: 7px; }
  .sa-ico { width: 42px; height: 42px; }
  .sa-ico .mp-icon { width: 21px; height: 21px; }
  .side-action { width: 56px; font-size: 7.5px; }
  .time-capsule { bottom: calc(var(--safe-bottom) + 130px); }
  .home-stage { bottom: calc(var(--safe-bottom) + 198px); width: 156px; }
  .hero-figure-wrap { width: 156px; height: 166px; }
  .hero-ring { width: 158px; height: 158px; }
  .hero-figure, .hero-avatar { width: 140px; height: 164px; }
  .feed { bottom: calc(var(--safe-bottom) + 68px); right: 124px; min-height: 50px; max-height: 54px; padding: 6px 8px; }
  .feed-row { font-size: 7.5px; }
  .start-cultivate { width: 102px; height: 102px; bottom: calc(var(--safe-bottom) + 66px); }
  .sc-ring.r1 { width: 114px; height: 114px; }
  .sc-ring.r2 { width: 126px; height: 126px; }
  .sc-icon { width: 24px; height: 24px; }
  .sc-core b { font-size: 19px; }
  .dock-v3 { height: calc(var(--safe-bottom) + 60px); }
}

@media (max-width: 370px) {
  .hud-side { width: 110px; }
  .hud-quick { gap: 1px; }
  .hq-ico { width: 36px; height: 36px; }
  .romance-card { width: 112px; }
  .home-stage { left: 55%; width: 150px; }
  .start-cultivate { width: 102px; height: 102px; right: 10px; }
  .side-rail { right: 8px; }
  .feed { right: 120px; }
}

/* 世家往来横幅 */
.family-banner {
  position: absolute;
  z-index: 30;
  top: calc(var(--safe-top) + 158px);
  right: 12px;
  width: 152px;
  min-height: 62px;
  display: block;
  padding: 7px 21px 7px 9px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 210, 152, .3);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 190, 110, .13), transparent 52%),
    linear-gradient(100deg, rgba(8, 22, 41, .88), rgba(8, 20, 38, .58));
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: transform .14s ease;
}

.family-banner:active { transform: scale(.98); }

.fbn-kicker {
  display: block;
  margin-bottom: 1px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #ffd39a;
}

.family-banner b {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  color: #fff2dc;
}

.family-banner em {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 7px;
  color: #D9A9B9;
}

.fbn-arrow {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  color: rgba(255, 214, 160, .7);
}

@media (max-height: 720px) {
  .family-banner {
    top: calc(var(--safe-top) + 148px);
    width: 140px;
    min-height: 56px;
    padding: 5px 18px 5px 8px;
  }
  .family-banner b { font-size: 10px; }
}

@media (max-width: 370px) {
  .family-banner { width: 134px; }
}

.side-action.is-on .sa-ico {
  border-color: rgba(255, 226, 176, .9);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .36), 0 0 18px rgba(255, 186, 90, .5), inset 0 0 14px rgba(255, 190, 110, .2);
}

.side-action.is-on b { color: #ffd79a; }

/* ============================================================
   首页 V5 · 排行榜 + 突破 / 娶妻 / 奇遇卡
   ============================================================ */

.leaderboard-card {
  position: absolute;
  z-index: 30;
  top: calc(var(--safe-top) + 158px);
  left: 12px;
  width: 188px;
  display: block;
  padding: 7px 8px 6px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 158, .34);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 194, 110, .15), transparent 46%),
    linear-gradient(160deg, rgba(8, 22, 41, .94), rgba(7, 18, 34, .76));
  box-shadow: 0 9px 24px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .15s ease;
}

.leaderboard-card:active { transform: scale(.985); }

.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 0 2px 4px;
  border-bottom: 1px solid rgba(255, 211, 152, .16);
}

.lb-head b {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .07em;
  color: #ffe4b6;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .6);
}

.lb-head .mp-icon { width: 13px; height: 13px; color: #D29FAF; }

.lb-list { display: flex; flex-direction: column; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 33px;
  padding: 2px 1px;
  border-top: 1px solid rgba(255, 255, 255, .045);
  border-radius: 6px;
}

.lb-row:first-child { border-top: 0; }
.lb-row.is-player { background: rgba(255, 170, 80, .11); }

.lb-rank {
  width: 16px;
  flex: none;
  text-align: center;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  color: #D29FAF;
  font-variant-numeric: tabular-nums;
}

.lb-row.rank-1 .lb-rank { color: #ffd76a; text-shadow: 0 0 7px rgba(255, 190, 70, .7); }
.lb-row.rank-2 .lb-rank { color: #d8e7f6; }
.lb-row.rank-3 .lb-rank { color: #8BF0C3; }

.lb-av {
  width: 25px;
  height: 25px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255, 218, 164, .5);
  background: radial-gradient(circle at 50% 32%, #872B4B, #310815 72%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.lb-av svg { width: 100%; height: 100%; display: block; }

.lb-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.lb-copy b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8.5px;
  font-weight: 800;
  color: #fff3df;
}
.lb-copy em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 6.5px;
  color: #D29FAF;
}
.lb-row.is-player .lb-copy b { color: #ffd9a3; }

.lb-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 211, 152, .18);
  font-size: 7px;
  color: #D29FAF;
}

.lb-foot em { font-style: normal; flex: none; }
.lb-foot > b {
  flex: none;
  font-size: 12px;
  font-weight: 900;
  color: #ffd28b;
  font-variant-numeric: tabular-nums;
}
.lb-my-power {
  margin-left: auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #D29FAF;
}
.lb-my-power b { font-size: 8px; font-weight: 800; color: #ffe0ad; }
.lb-foot .mp-icon { width: 10px; height: 10px; flex: none; color: rgba(255, 214, 160, .7); }

/* 右侧功能卡 */
.feature-cards {
  position: absolute;
  z-index: 30;
  top: calc(var(--safe-top) + 158px);
  right: 12px;
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.feature-card {
  position: relative;
  min-height: 61px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 7px 19px 7px 7px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 158, .32);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 190, 110, .13), transparent 56%),
    linear-gradient(100deg, rgba(8, 22, 41, .95), rgba(8, 20, 38, .74));
  box-shadow: 0 6px 17px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: transform .14s ease;
}

.feature-card:active { transform: scale(.975); }

.feature-card::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 58px;
  background-image: var(--fc-art);
  background-size: cover;
  background-position: center;
  opacity: .55;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 58%);
  pointer-events: none;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 20, 38, .82) 0%, rgba(8, 20, 38, .5) 58%, rgba(8, 20, 38, .12) 100%);
  pointer-events: none;
}

.feature-card.is-break { --fc-art: url("images/gen/estate_court.png"); border-color: rgba(255, 214, 158, .42); }
.feature-card.is-love { --fc-art: url("images/gen/spouse.png"); border-color: rgba(255, 186, 198, .44); }
.feature-card.is-fate { --fc-art: url("images/gen/fate_encounter.png"); border-color: rgba(196, 174, 255, .36); }

.fc-ico {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 218, 166, .48);
  background: radial-gradient(circle at 38% 26%, rgba(255, 228, 176, .3), rgba(20, 36, 54, .9) 72%);
  color: #ffe2ae;
}

.fc-ico .mp-icon { width: 19px; height: 19px; }

.is-love .fc-ico { color: #ffc0cb; border-color: rgba(255, 190, 200, .5); }
.is-fate .fc-ico { color: #d9c6ff; border-color: rgba(200, 180, 255, .45); }

.fc-main {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fc-main b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #fff3df;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .6);
}

.fc-main em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: 6.8px;
  color: #E4B7C6;
}

.fc-arrow {
  position: relative;
  z-index: 2;
  width: 11px;
  height: 11px;
  flex: none;
  color: rgba(255, 214, 160, .7);
}

.feature-card .sa-dot {
  top: 5px;
  right: 5px;
  z-index: 4;
}

/* 榜单全屏页 */
.lb-sheet-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px 4px;
  font-size: 7px;
  color: #D29FAF;
}
.lb-sheet-head span:first-child { width: 26px; flex: none; text-align: center; }
.lb-sheet-head span:nth-child(2) { flex: 1; }
.lb-sheet-head span:last-child { width: 52px; flex: none; text-align: right; }

.lb-sheet-list { display: flex; flex-direction: column; gap: 2px; }

.lb-sheet-list .lb-row {
  min-height: 40px;
  padding: 4px 3px;
  border-radius: 8px;
  border-top: 1px solid rgba(255, 255, 255, .05);
}
.lb-sheet-list .lb-row.is-player {
  border: 1px solid rgba(255, 190, 100, .4);
  background: linear-gradient(90deg, rgba(255, 170, 80, .16), rgba(255, 170, 80, .04));
}
.lb-sheet-list .lb-av { width: 29px; height: 29px; }
.lb-sheet-list .lb-copy b { font-size: 10px; }
.lb-sheet-list .lb-copy em { font-size: 7px; }

.lb-power {
  width: 52px;
  flex: none;
  text-align: right;
  font-size: 9px;
  font-weight: 800;
  color: #ffd79a;
  font-variant-numeric: tabular-nums;
}

/* 冷却提示 */
.cooldown-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 9px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(140, 210, 170, .28);
  background: rgba(60, 160, 110, .1);
  color: #CDB8E6;
  font-size: 8px;
  line-height: 1.45;
}
.cooldown-banner.is-cooling {
  border-color: rgba(255, 190, 100, .26);
  background: rgba(255, 170, 70, .09);
  color: #ffd9a3;
}
.cooldown-banner .mp-icon { width: 13px; height: 13px; }

.adv-card.is-cooling { opacity: .55; filter: saturate(.6); }
.fc-tier.is-cooling { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; color: #ffd39a; }

/* 小屏：榜单只留两行，功能卡压缩 */
@media (max-height: 720px) {
  .leaderboard-card { top: calc(var(--safe-top) + 148px); width: 176px; padding: 5px 6px 5px; }
  .lb-head b { font-size: 11.5px; }
  .lb-row { min-height: 28px; }
  .lb-row:nth-child(n+3) { display: none; }
  .lb-av { width: 22px; height: 22px; }
  .lb-copy b { font-size: 8px; }
  .lb-copy em { font-size: 6px; }
  .lb-foot { margin-top: 2px; padding-top: 3px; }
  .feature-cards { top: calc(var(--safe-top) + 148px); width: 148px; gap: 4px; }
  .feature-card { min-height: 43px; padding: 4px 16px 4px 6px; gap: 5px; border-radius: 11px; }
  .fc-ico { width: 27px; height: 27px; }
  .fc-ico .mp-icon { width: 15px; height: 15px; }
  .fc-main b { font-size: 10.5px; }
  .fc-main em { font-size: 6px; }
  .feature-card::after { width: 44px; }
}

@media (max-width: 370px) {
  .leaderboard-card { width: 166px; }
  .feature-cards { width: 142px; }
  .fc-main b { font-size: 11px; }
}

/* ============================================================
   寿元 / 坐化 / 轮回
   ============================================================ */

.death-overlay {
  position: fixed;
  z-index: 135;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 42%, rgba(90, 130, 180, .16), rgba(2, 7, 15, .9) 58%, rgba(1, 4, 10, .97) 100%);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .38s ease;
}

.death-overlay.show { opacity: 1; pointer-events: auto; }

.death-card {
  width: min(100%, 360px);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 18px 17px;
  text-align: center;
  border-radius: 23px;
  border: 1px solid rgba(180, 205, 238, .42);
  background:
    radial-gradient(circle at 50% 0%, rgba(160, 195, 240, .12), transparent 50%),
    linear-gradient(180deg, rgba(25, 43, 70, .99), rgba(7, 17, 32, .99));
  box-shadow: 0 26px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: translateY(22px) scale(.96);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
  scrollbar-width: none;
}
.death-card::-webkit-scrollbar { display: none; }
.death-overlay.show .death-card { transform: translateY(0) scale(1); }

.death-kicker {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .32em;
  color: #C691A3;
}

.death-seal {
  width: 58px;
  height: 58px;
  margin: 10px auto 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(190, 215, 245, .5);
  background: radial-gradient(circle at 50% 30%, rgba(190, 220, 255, .18), rgba(8, 20, 37, .8) 72%);
  color: #dcecff;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(130, 175, 230, .28), inset 0 0 16px rgba(160, 200, 245, .12);
}

.death-card h2 {
  margin: 2px 0 5px;
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: .12em;
  color: #e8f3ff;
  text-shadow: 0 0 22px rgba(140, 185, 240, .35);
}

.death-line { margin: 0 0 5px; font-size: 10.5px; line-height: 1.6; color: #EFC8D7; }
.death-line b { color: #ffe0a6; }
.death-text { margin: 0 0 11px; font-size: 9px; line-height: 1.65; color: #D29FAF; }
.death-text b { color: #ffd79a; }

.death-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 11px;
}

.death-grid > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 5px;
  border-radius: 9px;
  border: 1px solid rgba(180, 205, 238, .18);
  background: rgba(255, 255, 255, .035);
}

.death-grid em { font-style: normal; font-size: 7px; color: #C58FA2; }
.death-grid b { font-size: 10.5px; color: #ffe0a6; }

.death-note { margin: 0 0 11px; font-size: 8px; line-height: 1.6; color: #C58FA2; }

.death-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 231, 185, .6);
  background: linear-gradient(180deg, #ffe2a6, #ffb45e 56%, #2EE99C);
  color: #023A21;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(255, 130, 40, .26), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.death-btn:active { transform: scale(.98); }
.death-btn .mp-icon { width: 17px; height: 17px; }

@media (max-height: 720px) {
  .death-card { padding: 17px 15px 14px; }
  .death-seal { width: 48px; height: 48px; font-size: 22px; margin: 7px auto 4px; }
  .death-card h2 { font-size: 22px; }
  .death-text { font-size: 8.5px; }
  .death-grid { gap: 5px; margin-bottom: 9px; }
  .death-btn { min-height: 41px; }
}

.fc-btn[disabled], .btn-main[disabled] {
  opacity: .52;
  filter: grayscale(.35);
  box-shadow: none;
  pointer-events: none;
}

.adv-card[disabled] { pointer-events: none; }

@media (max-height: 660px) {
  .feature-card.is-fate { display: none; }
  .feature-card { min-height: 40px; }
  .feature-cards { gap: 3px; }
  .home-stage { bottom: calc(var(--safe-bottom) + 188px); }
}

/* 排行榜：我的名次置顶 */
.lb-my-sticky {
  position: sticky;
  top: 51px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0 5px;
  padding: 4px 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 206, 140, .48);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 200, 120, .2), transparent 52%),
    linear-gradient(180deg, rgba(24, 41, 65, .99), rgba(10, 23, 42, .99));
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.lb-my-label {
  width: 30px;
  flex: none;
  text-align: center;
  font-size: 6.5px;
  line-height: 1.25;
  color: #ffd39a;
}

.lb-my-sticky .lb-row {
  flex: 1;
  min-width: 0;
  border-top: 0;
  min-height: 34px;
  background: transparent;
}

.lb-my-sticky .lb-rank { color: #ffd76a; }
.lb-my-sticky .lb-copy b { color: #ffe0ad; }

/* 传承结算 */
.inherit-panel {
  margin: 8px 0 9px;
  padding: 8px 8px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255, 211, 152, .3);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 190, 110, .12), transparent 52%),
    rgba(255, 255, 255, .035);
  text-align: left;
}

.inherit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.inherit-head b { font-family: var(--serif); font-size: 11px; color: #ffe0ad; }
.inherit-head em { font-style: normal; font-size: 6.5px; color: #D29FAF; }

.inherit-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.inherit-chips .reward-chip { font-size: 7.5px; padding: 3px 7px; }
.inherit-note { margin: 5px 0 0; font-size: 7px; line-height: 1.5; color: #D29FAF; }

.heir-pick { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 5px; text-align: left; }
.heir-pick > b { font-size: 8.5px; color: #ffd39a; letter-spacing: .04em; }

.heir-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(180, 205, 238, .22);
  background: rgba(255, 255, 255, .04);
  transition: transform .14s ease, border-color .2s ease;
}

.heir-card:active { transform: scale(.985); border-color: rgba(255, 220, 160, .55); }

.heir-av {
  width: 32px;
  height: 32px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255, 218, 164, .45);
  background: radial-gradient(circle at 50% 32%, #872B4B, #310815 72%);
}

.heir-av svg { width: 100%; height: 100%; display: block; }

.heir-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.heir-copy b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; color: #fff2dc; }
.heir-copy b em { margin-left: 4px; padding: 0 3px; border-radius: 3px; background: rgba(255, 178, 90, .14); color: #ffd39a; font-size: 6px; font-style: normal; }
.heir-copy > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 7px; color: #D29FAF; }
.heir-card .mp-icon { width: 12px; height: 12px; flex: none; color: rgba(255, 214, 160, .7); }

.death-btn.secondary {
  margin-top: 7px;
  border: 1px solid rgba(180, 205, 238, .28);
  background: rgba(255, 255, 255, .05);
  color: #EFC8D7;
  box-shadow: none;
}

@media (max-width: 340px) {
  .leaderboard-card { width: 150px; }
  .feature-cards { width: 132px; right: 8px; }
  .feature-card { padding-right: 14px; }
  .fc-main b { font-size: 10px; }
  .hud-quick b { font-size: 6.5px; }
  .hq-ico { width: 34px; height: 34px; }
}

.lb-my-sticky .lb-av { width: 27px; height: 27px; }
.lb-my-sticky .lb-copy b { font-size: 10px; }
.lb-my-sticky .lb-copy em { font-size: 7px; }
.lb-my-sticky .lb-power { width: 48px; font-size: 8.5px; }

/* ============================================================
   滚动修复：首页画布与所有弹层都可以上下滑动
   ============================================================ */

html, body {
  overscroll-behavior: none;
}

/* 首页可滚动画布：矮屏（<720px）时向上滑动可看到底部内容 */
.home-scroll {
  position: absolute;
  inset: 0;
  z-index: 15;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}

.home-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

.home-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 720px;
}

/* 弹层：限制在本应用画布内，内容超出即可滚动 */
.overlay {
  box-sizing: border-box;
  overflow: hidden;
}

.sheet {
  max-height: 100%;
  padding-bottom: calc(16px + var(--safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.sheet-body { padding-bottom: 18px; }

.fate-card,
.month-card,
.death-card,
.bt-inner,
.ad-box,
.fate-deck,
.tree-scroll,
.tree-canvas {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.fate-card {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.month-card {
  max-height: min(86dvh, 660px);
  overflow-y: auto;
}

.death-card {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* 突破 / 广告弹窗在矮屏也可滚动，不再裁掉按钮 */
.breakthrough {
  overflow-y: auto;
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
}

.bt-inner {
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px);
  overflow-x: hidden;
  overflow-y: auto;
}

.ad-overlay {
  overflow-y: auto;
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
}

.ad-box {
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px);
  overflow-x: hidden;
  overflow-y: auto;
}

/* 隐藏系统滚动条，保留手势滚动 */
.sheet,
.fate-card,
.month-card,
.death-card,
.bt-inner,
.ad-box {
  scrollbar-width: none;
}

.sheet::-webkit-scrollbar,
.fate-card::-webkit-scrollbar,
.month-card::-webkit-scrollbar,
.death-card::-webkit-scrollbar,
.bt-inner::-webkit-scrollbar,
.ad-box::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (max-width: 560px) {
  .home-canvas { min-height: 720px; }
}

@media (max-width: 370px) {
  .home-canvas { min-height: 700px; }
}

/* ============================================================
   角色创建 · 命格初定（参考图定制）
   全屏仙界立绘 + 资质 / 灵根命格选择
   ============================================================ */

.overlay.is-creation {
  z-index: 100;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: #02070f;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.overlay.is-creation .sheet {
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0 auto;
  padding-bottom: 0;
  border: 0;
  border-radius: 0;
  background: #1F060D;
  box-shadow: 0 0 90px rgba(0, 0, 0, .7);
  overflow: hidden;
  transform: none;
  transition: none;
}

.overlay.is-creation .sheet::-webkit-scrollbar { display: none; }

.cwt {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1F060D;
}

/* ---------- 仙界立绘背景 ---------- */

.cwt-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #2E0A16;
}

.cwt-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 26% 0%;
  filter: saturate(1.04) contrast(1.02);
}

.cwt-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 9, 18, .9) 0%, rgba(3, 9, 18, .38) 12%, rgba(3, 9, 18, 0) 28%, rgba(3, 9, 18, 0) 50%, rgba(6, 16, 31, .62) 68%, rgba(6, 16, 31, .95) 85%, #1F060D 100%),
    linear-gradient(90deg, rgba(3, 9, 18, .8), rgba(3, 9, 18, .3) 13%, transparent 30%, transparent 82%, rgba(3, 9, 18, .5)),
    radial-gradient(ellipse at 50% 40%, transparent 42%, rgba(2, 7, 15, .4) 100%);
  pointer-events: none;
}

.cwt-veil::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 72px;
  background: linear-gradient(90deg, rgba(3, 9, 18, 0), rgba(3, 9, 18, .72) 68%, rgba(3, 9, 18, .92));
  pointer-events: none;
}

.cwt-glow {
  position: absolute;
  left: 52%;
  top: 27%;
  width: 330px;
  height: 330px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 214, 148, .16), rgba(255, 180, 90, 0) 68%);
  filter: blur(5px);
  pointer-events: none;
}

/* ---------- 顶部标题 ---------- */

.cwt-head {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: calc(var(--safe-top) + 56px);
  padding: calc(var(--safe-top) + 12px) 16px 2px;
}

.cwt-back {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(240, 210, 160, .42);
  background: radial-gradient(circle at 35% 28%, rgba(70, 105, 150, .6), rgba(9, 22, 40, .68));
  color: #f6e2bc;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cwt-back .mp-icon {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

.cwt-back:active { transform: scale(.92); }

.cwt-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cwt-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: .12em;
  color: #f9e8c6;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .75), 0 0 22px rgba(255, 196, 110, .22);
}

.cwt-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cwt-title-line i {
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(240, 205, 140, 0), rgba(240, 205, 140, .85));
}

.cwt-title-line i:last-child { transform: scaleX(-1); }

.cwt-title-line em {
  font-style: normal;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .32em;
  color: #87D9C5;
}

/* ---------- 立绘区 / 角色圆环 ---------- */

.cwt-stage {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
}

.cwt-rail {
  position: absolute;
  left: 12px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 30px;
  border: 1px solid rgba(200, 220, 245, .18);
  background: linear-gradient(180deg, rgba(10, 25, 45, .58), rgba(8, 20, 38, .24));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.cwt-face {
  background-image: url("images/gen/gptimg_1795515799_look.png");
  background-repeat: no-repeat;
  background-size: 1024% auto;
  background-color: #4F2230;
}

.cwt-fc1 { background-position: 2.75% 19.1%; }
.cwt-fc2 { background-position: 2.6% 35.2%; }
.cwt-fc3 { background-position: 2.6% 50.9%; }
.cwt-fc4 { background-position: 2.6% 66.6%; }

.cwt-face-btn {
  position: relative;
  width: 50px;
  height: 50px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(226, 204, 164, .5);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .42);
}

.cwt-face-btn::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, .4);
  pointer-events: none;
}

.cwt-face-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.cwt-face-btn.on {
  border-color: #ffd089;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .45), 0 0 16px rgba(255, 170, 70, .55);
}

.cwt-face-btn.on .cwt-face-ring {
  border-color: rgba(255, 214, 150, .78);
  box-shadow: 0 0 12px rgba(255, 186, 96, .55), inset 0 0 8px rgba(255, 186, 96, .25);
}

.cwt-face-btn:active { transform: scale(.94); }

.cwt-cap {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 150px);
  padding: 7px 12px 7px 8px;
  border-radius: 30px;
  border: 1px solid rgba(230, 206, 164, .22);
  background: linear-gradient(120deg, rgba(8, 21, 40, .74), rgba(9, 24, 45, .34));
  box-shadow: 0 5px 18px rgba(0, 0, 0, .3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cwt-cap-ico {
  width: 25px;
  height: 25px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #ffd79b, #43E5AD);
  color: #054A2F;
  box-shadow: 0 0 12px rgba(255, 175, 80, .4);
}

.cwt-cap-ico .mp-icon { width: 14px; height: 14px; }

.cwt-cap-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cwt-cap-main b {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .08em;
  color: #fff0d4;
}

.cwt-cap-main em {
  font-style: normal;
  font-size: 8.5px;
  color: #E2B9C7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 命格面板 ---------- */

.cwt-sheet {
  position: relative;
  z-index: 4;
  flex: none;
  max-height: 62vh;
  max-height: 62dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 14px 0;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(240, 205, 150, .48);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(72, 112, 158, .3), transparent 58%),
    linear-gradient(180deg, rgba(15, 34, 59, .94) 0%, rgba(8, 21, 39, .98) 32%, #050e1c 100%);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cwt-sheet::-webkit-scrollbar { display: none; }

.cwt-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 132px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #92F0D8, transparent);
}

.cwt-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 13px;
  margin: 0 auto 4px;
}

.cwt-grip i {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 196, 135, .7));
}

.cwt-grip i:last-child { transform: scaleX(-1); }

.cwt-grip em {
  font-style: normal;
  font-size: 8px;
  letter-spacing: .34em;
  color: #77C7B1;
}

.cwt-id {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 1px 9px;
}

.cwt-id-face {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 209, 158, .65);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .4), 0 0 12px rgba(255, 176, 82, .16);
}

.cwt-id-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cwt-id-kicker {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  letter-spacing: .24em;
  color: #74B1A1;
}

.cwt-id-kicker .mp-icon { width: 10px; height: 10px; color: #7ED9C0; }

.cwt-name-input {
  width: 100%;
  height: 25px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(228, 198, 145, .3);
  border-radius: 0;
  background: transparent;
  color: #fff2d8;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .08em;
  outline: none;
}

.cwt-name-input:focus { border-bottom-color: rgba(255, 200, 110, .85); }

.cwt-name-input::placeholder {
  color: #AD7E8D;
  font-family: inherit;
}

.cwt-id-seal {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(220, 100, 80, .55);
  border-radius: 5px;
  color: #8EE0AA;
  font-family: var(--serif);
  font-size: 13px;
  transform: rotate(8deg);
  opacity: .82;
  box-shadow: inset 0 0 8px rgba(220, 100, 80, .12);
}

.cwt-panel {
  position: relative;
  margin-top: 8px;
  padding: 9px 11px 8px;
  border-radius: 12px;
  border: 1px solid rgba(160, 190, 226, .22);
  background: linear-gradient(158deg, rgba(55, 86, 124, .4), rgba(15, 32, 56, .5) 52%, rgba(11, 25, 45, .55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 6px 18px rgba(0, 0, 0, .18);
}

.cwt-panel::before,
.cwt-panel::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.cwt-panel::before {
  left: -1px;
  top: -1px;
  border-left: 1.5px solid rgba(238, 201, 132, .85);
  border-top: 1.5px solid rgba(238, 201, 132, .85);
  border-radius: 4px 0 0 0;
}

.cwt-panel::after {
  right: -1px;
  bottom: -1px;
  border-right: 1.5px solid rgba(238, 201, 132, .7);
  border-bottom: 1.5px solid rgba(238, 201, 132, .7);
  border-radius: 0 0 4px 0;
}

.cwt-panel-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.cwt-panel-head h2 {
  position: relative;
  margin: 0;
  padding-left: 10px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #B4F4E5;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}

.cwt-panel-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translateY(-50%) rotate(45deg);
  background: linear-gradient(135deg, #ffe5b0, #45D5AC);
  box-shadow: 0 0 7px rgba(255, 196, 110, .6);
}

.cwt-panel-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(230, 196, 135, .55), rgba(160, 190, 225, .05));
}

.cwt-panel-head em {
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: .04em;
  color: #8CE8D0;
  white-space: nowrap;
}

.cwt-apt {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.cwt-apt-btn {
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 7px;
  border: 1px solid rgba(158, 190, 225, .4);
  background: linear-gradient(180deg, rgba(73, 101, 138, .58), rgba(29, 48, 76, .66));
  color: #dce9f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.cwt-apt-btn b {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
}

.cwt-apt-btn small {
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: .06em;
  color: #CA98A9;
}

.cwt-apt-btn.on {
  border-color: #7DF3D6;
  background: linear-gradient(180deg, rgba(255, 205, 130, .26), rgba(198, 126, 42, .12));
  color: #ffe6b8;
  box-shadow: inset 0 0 0 1px rgba(255, 222, 165, .55), 0 0 14px rgba(255, 170, 70, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.cwt-apt-btn.on small { color: #87E6CC; }

.cwt-apt-btn:active { transform: scale(.96); }

.cwt-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0 0;
  font-size: 9px;
  line-height: 1.5;
  color: #D09DAE;
}

.cwt-hint .mp-icon {
  width: 11px;
  height: 11px;
  color: #89ECD1;
}

.cwt-hint-extra {
  margin-left: auto;
  color: #7DB7A8;
  white-space: nowrap;
}

.cwt-hint-extra b {
  font-size: 9.5px;
  color: #ffd18f;
}

.cwt-roots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.cwt-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 1px 0;
}

.cwt-gem {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--el);
  background: radial-gradient(circle at 36% 26%, rgba(255, 255, 255, .5), rgba(255, 255, 255, .06) 24%, rgba(10, 26, 46, .9) 58%, #220710 100%);
  box-shadow: inset 0 0 18px var(--el), 0 4px 12px rgba(0, 0, 0, .4);
  transition: transform .15s ease, box-shadow .18s ease;
}

.cwt-gem::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, var(--el), transparent 68%);
  opacity: .62;
}

.cwt-gem .mp-icon {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  color: #fff;
  filter: drop-shadow(0 0 4px var(--el)) drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

.cwt-root.on .cwt-gem {
  border-color: #ffe0a6;
  box-shadow: inset 0 0 14px rgba(255, 255, 255, .2), 0 0 0 2px rgba(255, 214, 148, .32), 0 0 22px var(--el);
}

.cwt-root.on .cwt-gem::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 148, .45);
}

.cwt-root b {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #ECC3D1;
}

.cwt-root.on b {
  color: #ffe6b8;
  text-shadow: 0 0 8px rgba(255, 180, 80, .4);
}

.cwt-root:active .cwt-gem { transform: scale(.94); }

.cwt-tier {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(160, 190, 225, .18);
}

.cwt-tier-label {
  flex: none;
  font-size: 8px;
  letter-spacing: .12em;
  color: #C68FA2;
}

.cwt-tier-list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.cwt-tier-btn {
  height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(155, 185, 220, .3);
  background: rgba(20, 40, 66, .6);
  color: #D8A9BA;
  font-size: 9.5px;
}

.cwt-tier-btn.on {
  border-color: rgba(243, 200, 125, .9);
  background: linear-gradient(180deg, rgba(255, 205, 130, .2), rgba(190, 120, 40, .08));
  color: #ffe3b0;
  box-shadow: inset 0 0 0 1px rgba(255, 222, 165, .28), 0 0 10px rgba(255, 170, 70, .16);
}

.cwt-tier-cur {
  flex: none;
  font-size: 8.5px;
  color: #85E1C8;
}

.cwt-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px -14px 0;
  padding: 9px 14px calc(var(--safe-bottom) + 12px);
  background: linear-gradient(180deg, rgba(6, 16, 31, 0), rgba(6, 16, 31, .92) 30%, #050e1c 100%);
}

.cwt-random {
  width: 93px;
  height: 50px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  border: 1px solid rgba(235, 205, 150, .38);
  background: linear-gradient(180deg, rgba(41, 67, 100, .85), rgba(15, 32, 55, .92));
  color: #AFE7DA;
  font-size: 10px;
  letter-spacing: .04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.cwt-random .mp-icon {
  width: 16px;
  height: 16px;
  color: #8DEED4;
}

.cwt-random:active { transform: scale(.97); }

.cwt-start {
  position: relative;
  flex: 1;
  height: 50px;
  border-radius: 10px;
  border: 1px solid #ffe8b9;
  background: linear-gradient(180deg, #ffe9b0 0%, #f7cd80 34%, #4FE0B7 72%, #36C99A 100%);
  color: #074A31;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45), 0 0 24px rgba(255, 176, 76, .32), inset 0 1px 0 #fff8dc, inset 0 -2px 0 rgba(120, 68, 12, .35);
}

.cwt-start span {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .18em;
  text-shadow: 0 1px 0 rgba(255, 250, 230, .55);
}

.cwt-start::before,
.cwt-start::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 8px;
  border-top: 1px solid rgba(110, 62, 8, .5);
  border-radius: 50%;
  transform: translateY(-50%);
}

.cwt-start::before { left: 18px; }
.cwt-start::after { right: 18px; }

.cwt-start:active {
  transform: scale(.985);
  filter: brightness(1.03);
}

/* ---------- 小屏适配 ---------- */

@media (max-height: 760px) {
  .cwt-head {
    min-height: calc(var(--safe-top) + 50px);
    padding-top: calc(var(--safe-top) + 8px);
  }

  .cwt-title h1 { font-size: 22px; }
  .cwt-rail {
    top: auto;
    bottom: 8px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 8px;
    padding: 5px 7px;
    border-radius: 30px;
  }
  .cwt-face-btn { width: 44px; height: 44px; }
  .cwt-cap { display: none; }
  .cwt-sheet { max-height: 64vh; max-height: 64dvh; padding-top: 6px; }
  .cwt-id { padding-bottom: 6px; }
  .cwt-id-face { width: 38px; height: 38px; }
  .cwt-panel { margin-top: 6px; padding: 8px 10px 7px; }
  .cwt-apt-btn { height: 38px; }
  .cwt-gem { width: 42px; height: 42px; }
  .cwt-actions { padding-top: 7px; }
  .cwt-random, .cwt-start { height: 46px; }
}

@media (max-width: 360px) {
  .cwt-sheet { padding-left: 11px; padding-right: 11px; }
  .cwt-apt { gap: 4px; }
  .cwt-apt-btn b { font-size: 12px; }
  .cwt-gem { width: 40px; height: 40px; }
  .cwt-gem .mp-icon { width: 18px; height: 18px; }
  .cwt-root b { font-size: 8.5px; }
  .cwt-start span { font-size: 18px; }
  .cwt-random { width: 84px; }
  .cwt-hint-extra { display: none; }
  .cwt-actions {
    margin-left: -11px;
    margin-right: -11px;
    padding-left: 11px;
    padding-right: 11px;
  }
}
