:root {
  --ink: #342c4d;
  --cream: #fff4d6;
  --peach: #ff9b93;
  --sky: #8edbff;
  --mint: #8ce1bb;
  --violet: #bda5ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #162542;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e8ecf5;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

#cv { display: block; }  /* 尺寸由 JS 按 innerWidth/Height 精确设定，避免 100vh 与视口错位 */

.hud {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(31, 26, 53, .45);
  padding: 10px 12px 12px;
  border: 2px solid rgba(179, 213, 255, .48);
  border-radius: 19px;
  background: linear-gradient(165deg, rgba(65, 84, 132, .93), rgba(39, 54, 91, .91));
  box-shadow: 0 7px 0 rgba(18, 27, 51, .2), 0 12px 28px rgba(7, 13, 31, .24), inset 0 2px rgba(255, 255, 255, .13);
  backdrop-filter: blur(7px);
}
.hud-top { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.hud-left { display: flex; align-items: baseline; gap: 10px; }
#wave { color: #ffe28b; font-size: 17px; letter-spacing: 1px; }
#stage-name {
  padding: 2px 7px;
  border: 1px solid rgba(174, 226, 255, .22);
  border-radius: 999px;
  background: rgba(142, 219, 255, .1);
  color: #bfeaff;
  font-size: 10px;
  letter-spacing: .5px;
}
#kills { padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11px; color: #e9f3ff; }
#lv { padding: 3px 8px; border-radius: 999px; background: rgba(142,219,255,.14); color: #aee8ff; font-size: 12px; letter-spacing: .5px; }

.stat-row {
  display: grid;
  grid-template-columns: 31px 48px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 12px;
}
.stat-row[hidden] { display: none; }
.stat-label { font-size: 11px; letter-spacing: 1px; color: #dce7fa; }
.stat-value { font-size: 10px; color: #f6f9ff; text-align: right; font-variant-numeric: tabular-nums; }
.stat-track {
  position: relative;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(25, 34, 64, .58);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .28), 0 1px rgba(255,255,255,.08);
}
.hpbar { height: 12px; }
.shieldbar { height: 8px; }
.xpbar { height: 9px; }
#hp-loss, #hp, #shield, #xp { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; }
#hp-loss { width: 100%; z-index: 1; background: linear-gradient(90deg, #ffe68d, #ffbd77); transition: width .72s ease-out .16s; }
#hp {
  width: 100%;
  z-index: 2;
  background: linear-gradient(90deg, #ff9b9c, #f0647d 78%, #dc4f70);
  box-shadow: inset 0 2px rgba(255, 255, 255, .35), 0 0 9px rgba(240, 100, 125, .32);
  transition: width .12s ease-out;
}
#xp {
  background: linear-gradient(90deg, #86e4ff, #6aaef4 72%, #9d8ce8);
  box-shadow: inset 0 2px rgba(255, 255, 255, .4), 0 0 9px rgba(107, 176, 244, .38);
  transition: width .2s ease-out;
}
#shield {
  background: linear-gradient(90deg, #8fe9ff, #75aef6 68%, #9a92f4);
  box-shadow: inset 0 2px rgba(255,255,255,.48), 0 0 10px rgba(117,174,246,.58);
  transition: width .15s ease-out;
}
.shield-stat .stat-label { color: #aeeaff; }
.shield-shine {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.72) 50%, transparent 72%);
  transform: translateX(-120%);
  animation: shield-flow 2.4s ease-in-out infinite;
}
@keyframes shield-flow { 55%, 100% { transform: translateX(120%); } }
.xp-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .6) 48%, transparent 70%);
  transform: translateX(-120%);
}
.xp-stat.gain .xp-shine { animation: xp-flow .48s ease-out; }
.xp-stat.breakthrough .stat-label, .xp-stat.breakthrough .stat-value { color: #ffe38a; }
.xp-stat.breakthrough .xpbar { animation: breakthrough-glow .75s ease-out; }
.xp-stat.breakthrough #xp { background: linear-gradient(90deg, #ffe58b, #e8a20c); }
@keyframes xp-flow { to { transform: translateX(120%); } }
@keyframes breakthrough-glow {
  0%, 100% { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .05); }
  45% { box-shadow: 0 0 16px rgba(255, 215, 94, .9), 0 0 0 1px #ffd75e; }
}

.panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 27%, rgba(82, 103, 161, .65), rgba(18, 27, 51, .92) 68%);
  backdrop-filter: blur(5px);
  text-align: center;
  padding: 20px;
}
.panel[hidden] { display: none; }
.panel h2 { font-size: 34px; letter-spacing: 4px; color: #ffe291; text-shadow: 0 3px 0 rgba(82, 57, 38, .35); }
.panel h2 .dev {
  font-size: 13px;
  letter-spacing: 1px;
  color: #10182a;
  background: #ffd75e;
  border-radius: 999px;
  padding: 3px 10px;
  vertical-align: middle;
  margin-left: 10px;
}
.panel p { font-size: 15px; line-height: 1.8; color: #dbe7f8; }

button {
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffe18a, #f4b85d);
  color: #4d3950;
  font-size: 17px;
  font-weight: 800;
  padding: 12px 26px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 5px 0 #b27a46, 0 8px 16px rgba(12,19,39,.2), inset 0 2px rgba(255,255,255,.45);
  transition: transform .13s cubic-bezier(.2,.85,.35,1.35), filter .13s ease, box-shadow .13s ease;
}
button:hover { filter: brightness(1.07); transform: translateY(-1px); }
button:active { transform: translateY(3px) scale(.98); box-shadow: 0 2px 0 #a66e41, 0 4px 8px rgba(12,19,39,.18); }

#upgrade {
  gap: 10px;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 22%, rgba(100, 129, 191, .62), rgba(18, 27, 51, .96) 66%);
}
#upgrade h2 {
  font-size: clamp(24px, 7vw, 31px);
  letter-spacing: 3px;
  text-shadow: 0 3px 0 rgba(93,64,45,.32), 0 0 18px rgba(255, 226, 145, .28);
}
.build-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: min(94vw, 410px);
  min-height: 24px;
}
.build-empty { color: #c5d5ec; font-size: 11px; }
.build-destiny {
  flex-basis: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(205, 218, 249, .26);
  border-radius: 10px;
  background: rgba(18, 29, 57, .42);
  color: #cbd8ef;
  text-align: center;
  font-size: 10px;
  letter-spacing: .3px;
}
.build-destiny.chosen {
  border-color: rgba(221, 176, 255, .52);
  background: rgba(102, 65, 136, .42);
  color: #f0d7ff;
  box-shadow: 0 0 13px rgba(209, 158, 255, .15);
}
.build-chip {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
  color: #e3edfb;
  font-size: 10px;
  line-height: 1;
}
.upgrade-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(94vw, 390px);
}
.upgrade-btns .upgrade-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(250, 246, 230, .96), rgba(220, 231, 249, .96));
  border: 2px solid #9fb5db;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  border-radius: 17px;
  box-shadow: 0 5px 0 rgba(55, 67, 106, .38), 0 9px 18px rgba(0, 0, 0, .15), inset 0 2px rgba(255, 255, 255, .7);
  transition: transform .13s ease, filter .13s ease, border-color .13s ease;
}
.upgrade-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upgrade-card-head b { color: #ffd75e; font-size: 15px; line-height: 1.2; }
.upgrade-card-head em {
  flex: none;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(70, 79, 117, .1);
  color: #5f6683;
  font-size: 10px;
  font-style: normal;
  letter-spacing: .4px;
}
.upgrade-card i { display: block; margin-top: 5px; color: #6e7592; font-size: 11px; font-style: normal; line-height: 1.35; }
.upgrade-card small { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; font-size: 10px; line-height: 1.25; }
.upgrade-card small span, .upgrade-card small strong { padding: 5px 6px; border-radius: 6px; font-weight: 600; }
.upgrade-card small span { background: rgba(76, 86, 120, .09); color: #747b94; }
.upgrade-card small strong { background: rgba(255, 194, 104, .2); color: #9a5f2d; }
.upgrade-card:active { transform: scale(.985); filter: brightness(1.16); }
.upgrade-card:disabled { opacity: .78; }
.upgrade-card.chosen { animation: card-pop .2s ease-out forwards; border-color: #ffe391; box-shadow: 0 0 28px rgba(255, 220, 132, .55); }
.upgrade-card.confirming {
  border-color: #d4a1ff;
  box-shadow: 0 0 22px rgba(190, 133, 242, .42), inset 0 2px rgba(255, 255, 255, .72);
}
.fusion-lock-note, .fusion-confirm {
  display: block;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 8px;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .25px;
}
.fusion-lock-note { background: rgba(126, 78, 166, .1); color: #805a9d; }
.fusion-confirm { background: linear-gradient(90deg, #9361bc, #6d72bd); color: #fff; }
.upgrade-card.school-剑阵, .build-chip.school-剑阵 { border-color: #dfb85c; background-color: rgba(255, 226, 139, .9); }
.upgrade-card.school-剑阵 .upgrade-card-head b, .build-chip.school-剑阵 { color: #92622b; }
.upgrade-card.school-剑气, .build-chip.school-剑气 { border-color: #73bfe2; background-color: rgba(208, 242, 255, .94); }
.upgrade-card.school-剑气 .upgrade-card-head b, .build-chip.school-剑气 { color: #287a9e; }
.upgrade-card.school-火焰, .build-chip.school-火焰 { border-color: #e69171; background-color: rgba(255, 224, 205, .94); }
.upgrade-card.school-火焰 .upgrade-card-head b, .build-chip.school-火焰 { color: #b95a3e; }
.upgrade-card.school-护体, .build-chip.school-护体 { border-color: #7abbd5; background-color: rgba(216, 244, 248, .95); }
.upgrade-card.school-护体 .upgrade-card-head b, .build-chip.school-护体 { color: #347b96; }
.upgrade-card.school-融合, .build-chip.school-融合 { border-color: #b88ee6; background-color: rgba(239, 220, 255, .95); }
.upgrade-card.school-融合 .upgrade-card-head b, .build-chip.school-融合 { color: #8050ac; }
.upgrade-card.school-身法, .build-chip.school-身法 { border-color: #76bd9c; background-color: rgba(216, 248, 228, .94); }
.upgrade-card.school-身法 .upgrade-card-head b, .build-chip.school-身法 { color: #3c8b67; }
.upgrade-card.school-剑步, .build-chip.school-剑步 { border-color: #58c9b1; background-color: rgba(214, 252, 242, .95); }
.upgrade-card.school-剑步 .upgrade-card-head b, .build-chip.school-剑步 { color: #228f79; }
.upgrade-card.school-无尽, .build-chip.school-无尽 { border-color: #9aa6d8; background-color: rgba(226, 232, 255, .95); }
.upgrade-card.school-无尽 .upgrade-card-head b, .build-chip.school-无尽 { color: #4c5896; }
.reroll-btn {
  padding: 8px 17px;
  border: 2px solid rgba(190, 217, 255, .42);
  border-radius: 999px;
  background: linear-gradient(180deg, #8fcff5, #6e9fe2);
  color: #fff;
  font-size: 12px;
}
.reroll-btn:disabled { opacity: .38; }
.upgrade-skip-btn {
  padding: 7px 15px;
  border: 1px solid rgba(202, 220, 250, .36);
  background: rgba(36, 48, 82, .68);
  color: #cddbf1;
  font-size: 11px;
  box-shadow: 0 3px 0 rgba(12, 20, 43, .35), inset 0 1px rgba(255,255,255,.08);
}
.upgrade-skip-btn:hover { background: rgba(49, 65, 106, .82); }
.dao-offer { background: radial-gradient(circle at 50% 22%, rgba(151, 114, 203, .68), rgba(28, 26, 57, .96) 66%) !important; }
.dao-offer h2 { color: #fff0a0; text-shadow: 0 0 25px rgba(220, 182, 255, .62) !important; }
.dao-offer .upgrade-card { border-width: 2px; box-shadow: 0 0 20px rgba(143, 102, 212, .13), inset 0 1px rgba(255, 255, 255, .08); }
@keyframes card-pop { 50% { transform: translateY(-4px) scale(1.035); } 100% { transform: scale(1.015); filter: brightness(1.08); } }

/* === 主菜单（上线版） === */
.panel.menu {
  background: radial-gradient(ellipse at 50% 25%, rgba(40, 55, 95, .04) 0%, rgba(20, 29, 54, .42) 63%, rgba(13, 20, 39, .75) 100%);
  justify-content: flex-end;
  padding-bottom: max(9vh, 48px);
}
.menu-body { display: flex; flex-direction: column; align-items: center; gap: 11px; filter: drop-shadow(0 8px 18px rgba(8,14,31,.2)); }
.panel.menu h2 {
  font-size: 54px;
  letter-spacing: 8px;
  background: linear-gradient(180deg, #fff3c6 10%, #ffc46d 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(123,73,53,.55)) drop-shadow(0 0 18px rgba(255, 203, 112, .38));
}
.tagline { color: #ffe8a5; letter-spacing: 6px; font-size: 15px; text-shadow: 0 2px 3px rgba(51,35,59,.5); }
.feats { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 6px 0; }
.feats li {
  background: linear-gradient(180deg, rgba(242,248,255,.2), rgba(181,207,244,.12));
  border: 1.5px solid rgba(207, 226, 255, .35);
  border-radius: 999px;
  padding: 7px 20px;
  font-size: 14px;
  color: #eff6ff;
  box-shadow: inset 0 1px rgba(255,255,255,.16);
}
.howto { padding: 5px 11px; border-radius: 999px; background: rgba(21,31,59,.38); font-size: 13px; color: #c8d9f3; }
button.primary {
  background: linear-gradient(180deg, #ffe69a, #ffbd69);
  border-color: #fff0bf;
  font-size: 19px;
  padding: 14px 42px;
  border-radius: 18px;
  box-shadow: 0 6px 0 #b87c4f, 0 10px 22px rgba(101,58,42,.28), inset 0 2px rgba(255,255,255,.5);
}
button.ghost { background: linear-gradient(180deg, #8fc7ed, #688fd2); border-color: #c9e9ff; color: #fff; box-shadow: 0 5px 0 #46649e, 0 8px 16px rgba(12,19,39,.22); }
.panel-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#over { background: radial-gradient(circle at 50% 35%, rgba(95,111,173,.72), rgba(21,29,54,.96) 68%); }
#over-title { color: #ffc4cd; }
.in-menu .hud, .in-menu .codex-fab, .in-menu .combo-pop, .in-menu .buff-bar, .in-menu .ultimate-btn, .in-menu .battle-menu-fab { display: none; }

/* === 连斩：短时状态放在战斗区左侧，不遮挡血条 === */
.combo-pop {
  --combo-time: 100%;
  position: fixed;
  z-index: 12;
  top: max(148px, calc(env(safe-area-inset-top) + 138px));
  left: 15px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 1px 5px;
  min-width: 105px;
  padding: 7px 10px 10px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 226, 139, .6);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(67, 52, 91, .88), rgba(40, 43, 77, .86));
  color: #fff2b6;
  box-shadow: 0 5px 14px rgba(15, 20, 44, .22), inset 0 1px rgba(255,255,255,.12);
  pointer-events: none;
  transform-origin: left center;
}
.combo-pop[hidden] { display: none; }
.combo-pop::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: var(--combo-time); height: 3px;
  background: linear-gradient(90deg, #ffb768, #fff099);
  box-shadow: 0 0 8px #ffd978;
}
.combo-pop b { font-size: 25px; line-height: .9; font-style: italic; color: #ffe078; }
.combo-pop span { font-size: 12px; font-weight: 900; letter-spacing: 1px; }
.combo-pop em { grid-column: 1 / -1; margin-top: 3px; font-size: 9px; font-style: normal; color: #d8eaff; }
.combo-pop.pulse { animation: combo-pulse .2s ease-out; }
.combo-pop.milestone { animation: combo-milestone .36s ease-out; border-color: #fff0a3; }
@keyframes combo-pulse { 50% { transform: scale(1.08) rotate(-1deg); } }
@keyframes combo-milestone { 40% { transform: scale(1.16) rotate(-2deg); filter: brightness(1.35); } }

.buff-bar {
  position: fixed;
  z-index: 12;
  top: max(148px, calc(env(safe-area-inset-top) + 138px));
  right: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
}
.buff-bar[hidden] { display: none; }
.buff-bar span {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(41, 47, 82, .86);
  color: #f4f7ff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 4px 11px rgba(13,18,39,.2), inset 0 1px rgba(255,255,255,.1);
}
.buff-bar .buff-sword { border-color: rgba(255,224,122,.62); color: #ffe693; }
.buff-bar .buff-wind { border-color: rgba(142,233,208,.62); color: #a7f3dc; }
.buff-bar .buff-flame { border-color: rgba(255,153,109,.65); color: #ffb28f; }

.ultimate-btn {
  --charge-angle: 0deg;
  position: fixed;
  left: 15px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 13;
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  padding: 5px;
  border: 2px solid rgba(255,239,176,.62);
  border-radius: 50%;
  background: conic-gradient(#ffe171 0 var(--charge-angle), rgba(76,85,128,.72) var(--charge-angle) 360deg);
  color: #514264;
  box-shadow: 0 5px 0 rgba(45,49,81,.62), 0 9px 20px rgba(12,17,38,.28), inset 0 1px rgba(255,255,255,.35);
}
.ultimate-btn > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #fff7d5, #bccfee 72%);
  box-shadow: inset 0 2px rgba(255,255,255,.72);
}
.ultimate-btn b { font-size: 13px; line-height: 1; }
.ultimate-btn small { margin-top: 2px; font-size: 9px; letter-spacing: 2px; }
.ultimate-btn em {
  position: absolute; right: -5px; bottom: -3px;
  min-width: 30px; padding: 2px 5px;
  border-radius: 999px;
  background: #39405f; color: #dfeaff;
  font-size: 8px; font-style: normal;
  box-shadow: 0 2px 5px rgba(9,13,31,.32);
}
.ultimate-btn:disabled { opacity: .68; filter: saturate(.6); cursor: default; }
.ultimate-btn:disabled:hover { transform: none; filter: saturate(.6); }
.ultimate-btn:disabled:active { transform: none; box-shadow: 0 5px 0 rgba(45,49,81,.62), 0 9px 20px rgba(12,17,38,.28); }
.ultimate-btn.ready { animation: ultimate-ready 1.1s ease-in-out infinite; filter: none; }
.ultimate-btn.ready em { background: #b56b45; color: #fff4c9; }
@keyframes ultimate-ready {
  0%, 100% { transform: scale(1); box-shadow: 0 5px 0 rgba(45,49,81,.62), 0 0 12px rgba(255,222,112,.38); }
  50% { transform: scale(1.07); box-shadow: 0 5px 0 rgba(45,49,81,.55), 0 0 25px rgba(255,222,112,.8); }
}

/* === 可暂停查看的功法图鉴 === */
.codex-fab {
  position: fixed;
  right: 15px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 12;
  padding: 8px 12px;
  border-width: 1.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(244, 237, 209, .96), rgba(203, 218, 239, .96));
  color: #51466a;
  font-size: 12px;
  box-shadow: 0 4px 0 rgba(62, 68, 105, .5), 0 8px 17px rgba(15,21,45,.22), inset 0 2px rgba(255,255,255,.7);
}
.codex-panel {
  z-index: 32;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 18%, rgba(99, 108, 159, .7), rgba(20, 27, 51, .95) 72%);
}
.codex-sheet {
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  max-height: min(780px, 100%);
  overflow: hidden;
  border: 2px solid rgba(213, 226, 255, .55);
  border-radius: 23px;
  background: linear-gradient(165deg, rgba(246, 242, 226, .98), rgba(220, 229, 247, .98));
  color: var(--ink);
  box-shadow: 0 10px 0 rgba(25, 31, 59, .28), 0 20px 45px rgba(7, 12, 30, .38), inset 0 2px #fff;
  text-align: left;
}
.codex-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.codex-head small { display: block; margin-bottom: 1px; color: #87849a; font-size: 9px; letter-spacing: 2px; }
.codex-head h2 { color: #5d4f71; font-size: 25px; letter-spacing: 3px; text-shadow: none; }
.codex-close {
  width: 36px; height: 36px; padding: 0;
  border: 1.5px solid rgba(107, 98, 136, .18); border-radius: 50%;
  background: rgba(96, 88, 129, .1); color: #716982;
  font-size: 24px; line-height: 1;
  box-shadow: none;
}
.codex-close:active { box-shadow: none; transform: scale(.92); }
.codex-tabs {
  display: flex;
  gap: 6px;
  padding: 4px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.codex-tabs::-webkit-scrollbar { display: none; }
.codex-tabs button {
  flex: none;
  padding: 6px 11px;
  border: 1px solid rgba(84, 86, 122, .16);
  border-radius: 999px;
  background: rgba(77, 78, 112, .08);
  color: #77758a;
  font-size: 11px;
  box-shadow: none;
}
.codex-tabs button.active { background: #635777; border-color: #635777; color: #fff8dc; transform: none; }
.codex-tabs button:active { box-shadow: none; transform: scale(.95); }
.codex-content { padding: 0 12px 16px; overflow-y: auto; overscroll-behavior: contain; }
.codex-progress {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; padding: 8px 10px;
  border-radius: 11px; background: rgba(94, 88, 128, .09);
}
.codex-progress b { color: #625974; font-size: 11px; }
.codex-progress span { color: #88859a; font-size: 9px; text-align: right; }
.codex-group + .codex-group { margin-top: 13px; }
.codex-group h3 { display: flex; align-items: center; gap: 6px; margin: 0 3px 7px; color: #5c5671; font-size: 13px; }
.codex-group h3 i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 7px currentColor; }
.codex-card {
  margin-bottom: 7px; padding: 9px 10px;
  border: 1.5px solid #a9b4d0; border-radius: 13px;
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 1px rgba(255,255,255,.8);
}
.codex-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.codex-card header b { color: #4f4862; font-size: 13px; }
.codex-card header span { flex: none; padding: 2px 6px; border-radius: 999px; background: rgba(75,75,110,.08); color: #7e7b90; font-size: 9px; }
.codex-card > em { display: inline-block; margin-top: 5px; padding: 2px 6px; border-radius: 999px; background: rgba(142,92,190,.12); color: #8653ae; font-size: 9px; font-style: normal; font-weight: 800; }
.codex-card p { margin-top: 5px; color: #706d82; font-size: 10px; line-height: 1.4; }
.codex-card small { display: block; margin-top: 5px; color: #54708c; font-size: 9px; line-height: 1.4; }
.codex-card.learned { border-color: #d7aa56; background: rgba(255, 245, 210, .78); }
.codex-card.learned header b { color: #8a5d2e; }
.codex-card.locked { opacity: .58; filter: saturate(.35); }
.codex-card.school-融合 { border-color: #b78cde; background: rgba(241, 225, 255, .76); }
.codex-card.school-无尽 { border-color: #9aa6d8; background: rgba(228, 234, 255, .76); }
.codex-card.school-无尽 > em { background: rgba(92, 108, 190, .14); color: #4c5896; }

@media (max-width: 340px) {
  .hud { left: 9px; right: 9px; padding-left: 9px; padding-right: 9px; }
  .stat-row { grid-template-columns: 29px 43px minmax(0, 1fr); gap: 5px; }
  #wave { font-size: 15px; }
  #upgrade { gap: 7px; padding-left: 9px; padding-right: 9px; }
  #upgrade h2 { font-size: 22px; }
  .upgrade-btns { gap: 6px; }
  .upgrade-btns .upgrade-card { padding: 8px 9px; }
  .upgrade-card i { margin-top: 3px; }
  .upgrade-card small { margin-top: 5px; }
  #stage-name { display: none; }
  .combo-pop { left: 9px; }
  .buff-bar { right: 9px; }
  .ultimate-btn { left: 9px; width: 62px; height: 62px; }
  .ultimate-btn > span { width: 49px; height: 49px; }
  .codex-fab { right: 9px; }
  .codex-head { padding-left: 12px; padding-right: 12px; }
}

/* === V1.0 洞府大厅 / 章节 / 局外成长 === */
.panel.menu.hall { z-index:30; padding:0; align-items:stretch; justify-content:center; overflow:hidden; background:linear-gradient(180deg,rgba(9,19,39,.1),rgba(5,14,31,.44)),url('./assets/images/hall-cloud-sanctuary-bg-v1.jpg') center / cover no-repeat; }
.panel.menu.hall::before { content:''; position:absolute; inset:0; pointer-events:none; background:linear-gradient(90deg,rgba(5,13,28,.45),transparent 22%,transparent 78%,rgba(5,13,28,.45)),linear-gradient(180deg,rgba(7,16,34,.02) 0%,rgba(6,15,32,.1) 58%,rgba(4,11,25,.72) 100%); }
.hall-shell { position:absolute; z-index:1; top:0; bottom:0; left:50%; display:flex; flex-direction:column; width:min(100%,520px); height:auto; max-height:960px; margin-block:auto; color:#edf4ff; overflow:hidden; background:linear-gradient(180deg,rgba(10,23,48,.14),rgba(7,17,35,.28)); box-shadow:0 0 70px rgba(3,9,23,.28); transform:translateX(-50%); }
.hall-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 14px 8px; }
.hall-brand small { display: block; color: #aebed8; font-size: 8px; letter-spacing: 2px; }
.hall-brand h1 { margin: 2px 0 0; color: #fff0a7; font-size: 25px; letter-spacing: 4px; text-shadow: 0 2px 9px rgba(255,214,87,.25); }
.hall-currencies { display: flex; align-items: center; gap: 5px; }
.hall-currencies > span { display: grid; grid-template-columns: auto auto; gap: 0 4px; padding: 5px 8px; border: 1px solid rgba(212,228,255,.2); border-radius: 10px; background: rgba(10,18,34,.42); color: #9fb0ca; font-size: 8px; }
.hall-currencies b { color: #fff1ae; font-size: 11px; }
.hall-currencies small { grid-column: 1 / -1; color: #8598b8; font-size: 7px; }
.hall-currencies button { width: 31px; height: 31px; padding: 0; border: 1px solid rgba(212,228,255,.22); border-radius: 10px; background: rgba(10,18,34,.42); box-shadow: none; }
.hall-currencies .hall-language { width:auto;min-width:31px;padding:0 6px;color:#d7e8ff;font-size:8px;letter-spacing:.3px; }
.gray-entry-minor-actions { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
.gray-entry-minor-actions .gray-text-button { width:100%; }
.hall-hero { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 10px; margin: 0 14px 9px; padding: 8px 11px; border: 1px solid rgba(184,220,255,.25); border-radius: 17px; background: linear-gradient(120deg, rgba(30,57,96,.68), rgba(11,29,58,.66)); box-shadow: inset 0 1px rgba(255,255,255,.11), 0 8px 25px rgba(5,11,26,.18); backdrop-filter:blur(9px); }
.hall-sword-rune { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid rgba(151,224,255,.35); border-radius: 50%; background: radial-gradient(circle, rgba(166,228,255,.25), rgba(75,110,168,.06) 70%); }
.hall-sword-rune span { color: #fff4b5; font-size: 20px; font-weight: 900; }
.hall-sword-rune[data-tier="1"] { box-shadow: 0 0 14px rgba(119,222,255,.34); }.hall-sword-rune[data-tier="2"] { box-shadow: 0 0 20px rgba(194,168,255,.48); border-color: rgba(213,189,255,.7); }.hall-sword-rune[data-tier="3"] { box-shadow: 0 0 26px rgba(255,224,114,.62); border-color: rgba(255,231,145,.82); background: radial-gradient(circle,rgba(255,232,140,.26),rgba(84,120,178,.08) 70%); }
.hall-sword-rune i { position: absolute; left: 26px; top: -3px; width: 4px; height: 18px; border-radius: 100% 100% 30% 30%; background: linear-gradient(#fff, #82dfff); transform-origin: 2px 31px; }
.hall-sword-rune i:nth-child(2) { transform: rotate(90deg); }.hall-sword-rune i:nth-child(3) { transform: rotate(180deg); }.hall-sword-rune i:nth-child(4) { transform: rotate(270deg); }
.hall-hero > div:nth-child(2) small,.hall-hero em { display: block; color: #9eafc9; font-size: 8px; font-style: normal; }
.hall-hero strong { display: block; margin: 2px 0; font-size: 12px; }.hall-hero strong b { color: #ffe789; font-size: 19px; }
.hall-hero > button { padding: 7px 9px; font-size: 9px; box-shadow: none; }
.hall-content { flex: 1; min-height: 0; padding: 0 14px 9px; overflow-y: auto; overscroll-behavior: contain; }
.hall-content.stage-view { overflow:hidden; }
.hall-stage-card { display:grid; grid-template-rows:auto auto minmax(178px,1fr) auto; height:100%; min-height:0; padding:10px; overflow:hidden; border:1px solid rgba(165,216,255,.28); border-radius:20px; background:linear-gradient(180deg,rgba(17,43,75,.82),rgba(7,24,48,.9)); color:#dcecff; box-shadow:0 12px 38px rgba(3,10,25,.4),inset 0 1px rgba(255,255,255,.12); text-align:left; backdrop-filter:blur(7px); }
.hall-sheet { min-height:100%; padding:13px; border:1px solid rgba(219,231,255,.2); border-radius:19px; background:linear-gradient(155deg,rgba(244,241,225,.98),rgba(214,226,244,.97)); color:#4f5269; box-shadow:0 10px 35px rgba(5,11,28,.25),inset 0 2px #fff; text-align:left; }
.hall-stage-card > header,.hall-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hall-stage-card header small { display:block; color:#91b7d3; font-size:8px; letter-spacing:1.5px; }
.hall-sheet header small { display:block; color:#8b8a9b; font-size:8px; letter-spacing:1px; }
.hall-stage-card h3 { margin:2px 0 0; color:#fff0aa; font-size:18px; letter-spacing:2px; text-shadow:0 2px 8px rgba(4,12,28,.45); }
.hall-sheet h3 { margin:2px 0 0; color:#56506d; font-size:20px; letter-spacing:2px; }
.hall-stage-card header span { padding:5px 9px; border:1px solid color-mix(in srgb,var(--chapter) 48%,transparent); border-radius:999px; background:color-mix(in srgb,var(--chapter) 15%,rgba(5,20,43,.8)); color:#e9f7ff; font-size:8px; box-shadow:0 0 16px color-mix(in srgb,var(--chapter) 15%,transparent); }
.hall-sheet header > b { padding:5px 8px; border-radius:999px; background:color-mix(in srgb,var(--chapter,#7cbddb) 18%,white); color:#697087; font-size:8px; }
.chapter-nav { display:grid; grid-template-columns:repeat(5,1fr); gap:5px; margin:8px 0; }
.chapter-nav button { min-width:0; padding:5px 2px; border:1px solid rgba(153,205,244,.16); border-radius:10px; background:rgba(7,24,48,.52); color:#7792ad; box-shadow:none; backdrop-filter:blur(5px); }
.chapter-nav b,.chapter-nav small { display:block; }.chapter-nav b { font-size:10px; }.chapter-nav small { margin-top:1px; overflow:hidden; font-size:6px; white-space:nowrap; text-overflow:ellipsis; }
.chapter-nav button.active { border-color:var(--chapter); background:color-mix(in srgb,var(--chapter) 22%,rgba(8,28,54,.88)); color:#f2fbff; box-shadow:0 0 14px color-mix(in srgb,var(--chapter) 22%,transparent),inset 0 1px rgba(255,255,255,.14); }.chapter-nav button:disabled { opacity:.34; }
.stage-route { position:relative; min-height:178px; margin:0; overflow:hidden; border:1px solid rgba(154,218,248,.22); border-radius:15px; background-image:linear-gradient(180deg,rgba(5,24,51,.2),rgba(5,21,43,.48)),url('./assets/images/chapter-route-qingyun-bg-v1.jpg'); background-position:center; background-size:cover; box-shadow:inset 0 0 34px rgba(4,14,34,.35); }
.stage-route::after { content:''; position:absolute; inset:0; pointer-events:none; background:linear-gradient(180deg,rgba(3,17,37,.08),transparent 28%,rgba(3,15,33,.25)); }
.route-scene-label { position:absolute; top:7px; left:50%; z-index:3; display:flex; align-items:center; gap:7px; max-width:76%; padding:4px 8px; border:1px solid rgba(188,228,255,.18); border-radius:999px; background:rgba(5,21,44,.58); color:#b8d9ed; transform:translateX(-50%); backdrop-filter:blur(5px); white-space:nowrap; }
.route-scene-label span { color:#fff0ad; font-size:7px; font-weight:900; letter-spacing:1px; }.route-scene-label b { overflow:hidden; font-size:6px; text-overflow:ellipsis; }
.stage-route svg { position:absolute; z-index:1; inset:0; width:100%; height:100%; overflow:visible; }.stage-route path { fill:none; stroke:color-mix(in srgb,var(--chapter) 82%,#dff8ff); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:7 7; filter:drop-shadow(0 0 3px color-mix(in srgb,var(--chapter) 60%,transparent)); }.stage-route .route-shadow { stroke:rgba(5,19,41,.52); stroke-width:9; stroke-dasharray:none; filter:none; }
.route-node { position:absolute; left:var(--x); top:var(--y); z-index:2; display:grid; grid-template-columns:32px auto; grid-template-rows:auto auto; align-items:center; column-gap:5px; width:80px; min-height:38px; padding:3px 5px; border:1px solid rgba(180,222,250,.3); border-radius:12px; background:rgba(7,24,49,.78); color:#bed4e7; text-align:left; box-shadow:0 5px 13px rgba(2,9,24,.4),inset 0 1px rgba(255,255,255,.09); transform:translate(-50%,-50%); backdrop-filter:blur(5px); }
.route-node b { grid-row:1/3; display:grid; place-items:center; width:30px; height:30px; border:1.5px solid rgba(175,224,250,.35); border-radius:50%; background:linear-gradient(145deg,rgba(90,151,193,.42),rgba(15,48,79,.72)); color:#e7f6ff; font-size:12px; box-shadow:inset 0 1px rgba(255,255,255,.2); }.route-node span { align-self:end; font-size:7px; font-weight:800; }.route-node small { align-self:start; margin-top:1px; color:#86a6bf; font-size:6px; }
.route-node.selected { border-color:#ffe29a; background:linear-gradient(135deg,rgba(48,88,126,.92),rgba(14,43,75,.94)); color:#fff3bb; box-shadow:0 0 0 2px rgba(255,221,132,.14),0 0 18px color-mix(in srgb,var(--chapter) 46%,transparent),0 7px 15px rgba(2,9,22,.42); transform:translate(-50%,-50%) scale(1.08); }.route-node.selected b { border-color:#ffe29a; background:linear-gradient(145deg,#fff0ac,#d89d4d); color:#3b3f56; }
.route-node.cleared b { border-color:#9be6c5; background:linear-gradient(145deg,#9ad9bd,#4c927d); color:white; }.route-node.cleared b::after { content:'✓'; position:absolute; margin:21px 0 0 21px; display:grid; place-items:center; width:12px; height:12px; border-radius:50%; background:#effff8; color:#43826d; font-size:7px; }.route-node:disabled { opacity:.36; filter:grayscale(.72); box-shadow:none; }
.stage-action { display:grid; grid-template-columns:1fr auto; gap:6px 8px; padding:8px 1px 0; }
.stage-action-meta { min-width:0; }.stage-brief { display:flex; gap:12px; padding:0; color:#9eb8cf; font-size:8px; }.stage-brief b { color:#dff7ff; }.stage-brief b.under { color:#ffad96; }.stage-action-meta p { margin:3px 0 0; overflow:hidden; color:#7899b5; font-size:7px; white-space:nowrap; text-overflow:ellipsis; }
.stage-action .hall-start { grid-column:1/-1; width:100%; margin:0; padding:10px; border-color:rgba(255,239,180,.65); border-radius:13px; background:linear-gradient(180deg,#ffe49a,#eeb65a); color:#493e51; font-size:11px; box-shadow:0 4px 0 #9d663d,0 8px 17px rgba(2,9,23,.28),inset 0 2px rgba(255,255,255,.56); }
.stage-action .hall-endless { grid-column:2; grid-row:1; align-self:center; padding:5px 8px; border:1px solid rgba(149,203,241,.2); border-radius:999px; background:rgba(7,25,49,.56); color:#a9c4da; box-shadow:none; font-size:7px; white-space:nowrap; }.stage-action .hall-endless span { color:#ffe7a3; }
.sheet-note { margin:8px 2px 11px; color:#858396; font-size:9px; line-height:1.5; }
.hall-tabs { display: grid; grid-template-columns: repeat(4,1fr); padding: 7px 13px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(218,230,255,.14); background: rgba(12,21,39,.78); backdrop-filter: blur(12px); }
.hall-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: none; background: none; color: #8394b0; box-shadow: none; font-size: 9px; }.hall-tab i { display: grid; place-items: center; width: 28px; height: 24px; border-radius: 9px; background: rgba(172,201,241,.08); font-size: 10px; font-style: normal; }.hall-tab.active { color: #ffea9e; }.hall-tab.active i { background: rgba(255,220,108,.18); box-shadow: 0 0 13px rgba(255,220,108,.13); }
.hall-toast { position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%); max-width: 86%; padding: 8px 13px; border: 1px solid rgba(255,240,177,.35); border-radius: 999px; background: rgba(23,30,51,.94); color: #fff0b0; font-size: 10px; white-space: nowrap; box-shadow: 0 6px 22px rgba(0,0,0,.3); }
.training-list,.task-list { display: grid; gap: 8px; margin-top: 14px; }
.training-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; width: 100%; padding: 10px; border: 1px solid color-mix(in srgb, var(--train) 45%, #aeb4ca); border-radius: 14px; background: color-mix(in srgb, var(--train) 10%, white); color: #5b596f; text-align: left; box-shadow: none; }
.training-card > i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--train); color: white; font-style: normal; }.training-card span b,.training-card span small,.training-card span em { display: block; }.training-card span b { font-size: 12px; }.training-card span small { margin-top: 2px; color: #858397; font-size: 8px; }.training-card span em { margin-top: 4px; color: var(--train); font-size: 8px; font-style: normal; letter-spacing: 1px; }.training-card strong { color: #8a6e3c; font-size: 10px; }
.daily-chests { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 13px 0; }.daily-chests button { padding: 8px 3px; border: 1px solid #bdc3d3; border-radius: 11px; background: #eef1f7; color: #8a8b9c; box-shadow: none; }.daily-chests b,.daily-chests small { display: block; }.daily-chests b { font-size: 9px; }.daily-chests small { margin-top: 2px; font-size: 7px; }.daily-chests .ready { border-color: #d0a755; background: #fff1c8; color: #8c6731; }.daily-chests .claimed { opacity: .5; }
.task-list article { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 11px; background: rgba(81,89,125,.07); }.task-list b,.task-list small { display: block; }.task-list b { color: #5c596e; font-size: 11px; }.task-list small { margin-top: 2px; color: #8b8999; font-size: 8px; }.task-list button { padding: 6px 9px; border-radius: 9px; box-shadow: none; font-size: 8px; }
.ad-supply { width: 100%; margin-top: 11px; padding: 9px; border: 1px dashed #78b9ba; border-radius: 11px; background: rgba(114,211,196,.12); color: #478481; font-size: 9px; box-shadow: none; }
.account-codex { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }.account-codex > p { grid-column: 1/-1; padding: 28px 10px; color: #92909f; font-size: 10px; text-align: center; }.account-codex article { display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 10px; background: rgba(86,95,133,.08); }.account-codex i { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #7782a4; color: white; font-size: 9px; font-style: normal; }.account-codex b,.account-codex small { display: block; }.account-codex b { font-size: 9px; }.account-codex small { margin-top: 2px; color: #8b899b; font-size: 7px; }
.achievement-head { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #b8bdcd; }.achievement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }.achievement-grid article { padding: 8px; border-radius: 9px; background: rgba(83,91,126,.06); color: #9998a4; }.achievement-grid article.done { background: #fff0c5; color: #826638; }.achievement-grid b,.achievement-grid small { display: block; }.achievement-grid b { font-size: 9px; }.achievement-grid small { margin-top: 3px; font-size: 7px; line-height: 1.35; }
.over-rewards { width: min(360px, 88vw); margin: 4px auto 12px; padding: 11px; border: 1px solid rgba(255,238,172,.25); border-radius: 14px; background: rgba(255,255,255,.07); color: #dbe8fc; font-size: 10px; line-height: 1.65; }
.over-rewards b { color: #ffe993; }.tutorial-tip { position: fixed; left: 50%; top: 34%; z-index: 25; transform: translate(-50%,-50%); padding: 9px 14px; border: 1px solid rgba(255,238,165,.5); border-radius: 999px; background: rgba(28,38,66,.9); color: #fff0af; font-size: 11px; pointer-events: none; animation: tutorial-float 1.5s ease-in-out infinite; }
.battle-menu-fab { position:fixed;right:15px;top:max(124px,calc(env(safe-area-inset-top) + 112px));z-index:14;width:38px;height:38px;padding:0;border:1.5px solid rgba(221,232,255,.52);border-radius:50%;background:linear-gradient(180deg,rgba(237,242,251,.94),rgba(183,202,229,.94));color:#56617b;font-size:12px;box-shadow:0 4px 0 rgba(41,50,77,.45),0 7px 15px rgba(10,16,34,.2); }
.battle-menu { z-index:50;justify-content:center;background:rgba(7,12,24,.7);backdrop-filter:blur(4px); }.battle-menu > section { width:min(330px,86vw);padding:18px;border:1.5px solid rgba(221,232,255,.4);border-radius:20px;background:linear-gradient(155deg,#f4f0df,#dce7f5);color:#5c5d70;box-shadow:0 16px 48px rgba(0,0,0,.42),inset 0 2px white;text-align:center; }.battle-menu small { color:#9692a1;font-size:8px;letter-spacing:3px; }.battle-menu h2 { margin-top:3px;color:#5a526c;text-shadow:none; }.battle-menu p { margin:8px 0 14px;color:#858394;font-size:9px;line-height:1.55; }.battle-menu button { width:100%;margin-top:8px; }.battle-menu .ghost { box-shadow:none; }
.tutorial-tip.upgrade-tip { top:max(18px,calc(env(safe-area-inset-top) + 8px)); }
.settings-panel { z-index: 55; justify-content: center; background: rgba(9,15,29,.72); }
.settings-panel > section { width: min(350px,88vw); padding: 15px; border: 1px solid rgba(219,231,255,.38); border-radius: 19px; background: linear-gradient(155deg,#f5f1df,#dce7f6); color: #55576c; box-shadow: 0 16px 45px rgba(0,0,0,.38),inset 0 2px white; }
.settings-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }.settings-panel h2 { color: #5b526e; text-shadow: none; }.settings-panel header button { width: 34px;height:34px;padding:0;border:none;border-radius:50%;background:rgba(79,82,111,.1);color:#77748a;box-shadow:none;font-size:20px; }
.setting-row { display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:8px;padding:11px;border:1px solid rgba(91,96,126,.13);border-radius:12px;background:rgba(255,255,255,.48);color:#5c5b70;text-align:left;box-shadow:none; }.setting-row b,.setting-row small { display:block; }.setting-row b { font-size:11px; }.setting-row small { margin-top:2px;color:#8a8999;font-size:8px; }.setting-row em { padding:4px 8px;border-radius:999px;background:#75ad96;color:white;font-size:8px;font-style:normal; }.setting-row.off em { background:#a7a8b2; }
.settings-panel p { margin-top:12px;color:#8c8a9b;font-size:8px;line-height:1.5;text-align:center; }
html[lang="en-US"] body { font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
html[lang="en-US"] .hall-brand small { max-width:125px;letter-spacing:.5px;line-height:1.2; }
html[lang="en-US"] .hall-brand h1 { font-size:20px;letter-spacing:.8px;white-space:nowrap; }
html[lang="en-US"] .hall-currencies { gap:3px; }
html[lang="en-US"] .hall-currencies > span { padding:4px 5px;font-size:6.5px; }
html[lang="en-US"] .hall-currencies b { font-size:9px; }
html[lang="en-US"] .hall-currencies small { font-size:6px; }
html[lang="en-US"] .hall-hero em { line-height:1.25; }
html[lang="en-US"] .hall-stage-card h3 { font-size:15px;letter-spacing:.3px; }
html[lang="en-US"] .hall-stage-card header span { max-width:42%;font-size:7px;line-height:1.15;text-align:center; }
html[lang="en-US"] .route-scene-label { max-width:90%; }
html[lang="en-US"] .route-node { grid-template-columns:30px 1fr;grid-template-rows:1fr;width:78px;padding-inline:4px; }
html[lang="en-US"] .route-node b { grid-row:1; }
html[lang="en-US"] .route-node span { display:none; }
html[lang="en-US"] .route-node small { align-self:center;font-size:6px;text-align:center; }
html[lang="en-US"] .stage-action-meta p { font-size:6.5px; }
html[lang="en-US"] .stage-action .hall-start { font-size:10px; }
html[lang="en-US"] .training-card span b,html[lang="en-US"] .task-list b { font-size:10px; }
html[lang="en-US"] .training-card span small,html[lang="en-US"] .task-list small { font-size:7px;line-height:1.25; }
html[lang="en-US"] .account-codex b { font-size:8px; }
html[lang="en-US"] .account-codex small,html[lang="en-US"] .achievement-grid small { font-size:6.5px; }
html[lang="en-US"] .upgrade-card .upgrade-card-head b { font-size:12px;letter-spacing:0; }
html[lang="en-US"] .upgrade-card > p { font-size:10px;line-height:1.35; }
html[lang="en-US"] .codex-tabs button { min-width:max-content; }
html[lang="en-US"] .codex-card header b { font-size:12px; }
html[lang="en-US"] .codex-card p { font-size:9px;line-height:1.45; }
html[lang="en-US"] .panel h2 { letter-spacing:1px; }
html[lang="en-US"] .gm-poster-preview::after { content:var(--gm-hold-tip); }
@keyframes tutorial-float { 50% { transform: translate(-50%,calc(-50% - 5px)); } }

@media (max-width: 370px) {
  .hall-head { padding-left: 9px; padding-right: 9px; }.hall-brand h1 { font-size: 21px; }.hall-currencies > span { padding: 4px 5px; }.hall-hero { margin-left: 9px; margin-right: 9px; }.hall-content { padding-left: 9px; padding-right: 9px; }.hall-stage-card,.hall-sheet { padding: 9px; }.route-node { width:74px;grid-template-columns:29px auto;column-gap:4px; }.route-node b { width:27px;height:27px; }.hall-hero { grid-template-columns: 52px 1fr auto; }.hall-sword-rune { width: 47px; height: 47px; }.account-codex,.achievement-grid { grid-template-columns: 1fr; }
}

@media (max-width: 410px) {
  html[lang="en-US"] .hall-head { gap:5px;padding-inline:9px; }
  html[lang="en-US"] .hall-brand small { display:none; }
  html[lang="en-US"] .hall-brand h1 { font-size:16px; }
  html[lang="en-US"] .hud-left { gap:5px; }
  html[lang="en-US"] #wave { font-size:14px; }
  html[lang="en-US"] #kills,html[lang="en-US"] #lv { font-size:9px; }
}

@media (max-height: 700px) {
  .hall-head { padding-top:max(8px,env(safe-area-inset-top));padding-bottom:5px; }
  .hall-brand small { display:none; }.hall-brand h1 { font-size:21px; }
  .hall-hero { margin-bottom:6px;padding-top:5px;padding-bottom:5px; }
  .hall-sword-rune { width:45px;height:45px; }.hall-sword-rune i { left:20px;height:14px;transform-origin:2px 24px; }
  .hall-content { padding-bottom:6px; }.hall-stage-card { padding:8px;grid-template-rows:auto auto minmax(150px,1fr) auto; }
  .chapter-nav { margin:5px 0; }.chapter-nav button { padding:3px 2px; }.chapter-nav small { display:none; }
  .stage-action { padding-top:6px; }.stage-action .hall-start { padding:8px; }
  .hall-tabs { padding-top:4px; }.hall-tab { padding:2px; }
}

/* === 美术精修 V2：玄玉、青锋、鎏金 === */
:root {
  --xuan: #07172a;
  --xuan-2: #0d2740;
  --jade: #6ee7e5;
  --jade-soft: #bff7f2;
  --gold: #f3d17d;
  --gold-deep: #b9803f;
  --paper: #edf1e7;
  --paper-ink: #24374a;
  --danger: #f27c83;
}

body { background:#07172a; }

button {
  border:1px solid rgba(255,239,181,.66);
  border-radius:11px;
  background:linear-gradient(180deg,#ffe7a3 0%,#e7b85f 100%);
  color:#2f3445;
  box-shadow:0 3px 0 #8e6039,0 8px 18px rgba(1,8,20,.28),inset 0 1px rgba(255,255,255,.7);
  letter-spacing:.4px;
}
button:active { box-shadow:0 1px 0 #805434,0 4px 9px rgba(1,8,20,.24); }
button.ghost,.ghost {
  border-color:rgba(129,222,228,.3);
  background:linear-gradient(180deg,rgba(28,68,91,.9),rgba(12,38,60,.94));
  color:#c6eeed;
  box-shadow:0 3px 0 rgba(3,21,37,.8),inset 0 1px rgba(255,255,255,.08);
}

/* 战斗 HUD：一块悬浮玄玉令牌，血/气/盾使用同一刻度系统 */
.hud {
  top:max(8px,env(safe-area-inset-top));
  left:10px;
  right:10px;
  gap:6px;
  padding:9px 11px 10px;
  border:1px solid rgba(138,225,228,.36);
  border-radius:12px;
  background:linear-gradient(145deg,rgba(9,31,52,.96),rgba(7,21,40,.94));
  box-shadow:0 1px 0 rgba(255,227,145,.34),0 9px 28px rgba(2,8,20,.34),inset 0 0 0 1px rgba(255,255,255,.035);
  text-shadow:0 1px 3px rgba(1,8,19,.72);
}
.hud::before,.hud::after {
  content:'';
  position:absolute;
  top:-1px;
  width:33px;
  height:3px;
  background:linear-gradient(90deg,transparent,var(--gold),transparent);
  opacity:.85;
}
.hud::before { left:17px; }.hud::after { right:17px; }
.hud-top { padding-bottom:3px;border-bottom:1px solid rgba(126,226,229,.13); }
#wave { color:#ffdfa0;font-size:16px;font-family:"Songti SC","STSong",serif; }
#stage-name { border-color:rgba(108,232,229,.3);background:rgba(47,146,161,.13);color:#aef0ee; }
#kills { border:1px solid rgba(243,209,125,.14);background:rgba(243,209,125,.08);color:#efe6ca; }
#lv { border:1px solid rgba(107,231,229,.18);background:rgba(107,231,229,.08);color:#96e8e6; }
.stat-row { grid-template-columns:29px 50px minmax(0,1fr);gap:6px; }
.stat-label { color:#a8c6d2;font-size:10px; }
.stat-value { color:#e5f0ef; }
.stat-track { border-color:rgba(189,246,243,.13);background:rgba(2,13,27,.76);box-shadow:inset 0 2px 4px rgba(0,0,0,.4); }
.hpbar { height:10px; }.xpbar { height:7px; }.shieldbar { height:7px; }
#hp { background:linear-gradient(90deg,#ce5c6b,#f58c82 76%,#ffd0a0);box-shadow:inset 0 1px rgba(255,255,255,.4),0 0 9px rgba(242,124,131,.25); }
#hp-loss { background:linear-gradient(90deg,#f1b86f,#ffe3a4); }
#xp { background:linear-gradient(90deg,#35b4c3,#72e4de 68%,#cef8ee);box-shadow:0 0 8px rgba(104,231,229,.36); }
#shield { background:linear-gradient(90deg,#658ed8,#92dff2 70%,#d7f5ff); }

.codex-fab,.battle-menu-fab {
  border:1px solid rgba(139,232,231,.38);
  background:linear-gradient(160deg,rgba(17,58,81,.96),rgba(6,27,48,.98));
  color:#d4f5ef;
  box-shadow:0 3px 0 #041a2d,0 7px 17px rgba(2,9,22,.3),inset 0 1px rgba(255,255,255,.1);
}
.codex-fab { display:flex;align-items:center;gap:5px;padding:6px 10px 6px 6px;border-radius:9px; }
.codex-fab i { display:grid;place-items:center;width:25px;height:25px;border:1px solid rgba(243,209,125,.3);border-radius:6px;background:rgba(243,209,125,.09);color:#ffe09a;font-family:"Songti SC","STSong",serif;font-size:12px;font-style:normal; }
.codex-fab span { font-size:10px;letter-spacing:1px; }
.ultimate-btn { border-color:rgba(255,220,126,.56);background:conic-gradient(#f4d476 var(--charge-angle),rgba(7,25,44,.9) 0);box-shadow:0 0 0 1px rgba(108,231,229,.22),0 9px 22px rgba(2,9,21,.36); }
.ultimate-btn > span { border-color:rgba(253,229,160,.44);background:radial-gradient(circle at 50% 38%,#17485f,#081d35 72%);color:#ffe2a0; }
.combo-pop,.buff-bar span { border-color:rgba(113,229,228,.3);border-radius:9px;background:linear-gradient(145deg,rgba(8,34,55,.95),rgba(5,20,37,.94));color:#d7f4ef;box-shadow:0 5px 16px rgba(2,9,20,.25); }

/* 大厅：主角成为视觉锚点，界面卡片退到第二层 */
.panel.menu.hall {
  background:linear-gradient(180deg,rgba(5,20,38,.06),rgba(3,14,29,.52)),url('./assets/images/hall-cloud-sanctuary-bg-v1.jpg') center/cover no-repeat;
}
.panel.menu.hall::before {
  background:radial-gradient(ellipse at 50% 9%,rgba(124,225,234,.12),transparent 42%),linear-gradient(90deg,rgba(3,12,26,.56),transparent 23%,transparent 77%,rgba(3,12,26,.56)),linear-gradient(180deg,rgba(3,14,30,.02),rgba(3,12,26,.25) 62%,rgba(2,9,21,.83));
}
.hall-shell { width:min(100%,500px);background:linear-gradient(180deg,rgba(5,23,42,.03),rgba(3,16,31,.24));box-shadow:0 0 80px rgba(0,7,17,.36); }
.hall-head { padding:max(12px,env(safe-area-inset-top)) 15px 7px; }
.hall-brand small { color:#8fbfc7;font-size:8px;letter-spacing:2.6px; }
.hall-brand h1 { color:#ffe3a0;font-family:"Songti SC","STSong",serif;font-size:27px;font-weight:900;letter-spacing:5px;text-shadow:0 2px 0 #5c3d2a,0 0 18px rgba(243,209,125,.24); }
.hall-currencies > span { border-color:rgba(117,220,223,.23);border-radius:8px;background:linear-gradient(145deg,rgba(7,31,51,.78),rgba(4,20,38,.72));color:#82aeb9;box-shadow:inset 0 1px rgba(255,255,255,.05); }
.hall-currencies b { color:#ffe4a1; }.hall-currencies small { color:#6e99aa; }
.hall-currencies button { border-color:rgba(117,220,223,.24);border-radius:8px;background:rgba(5,25,44,.78);color:#bfe8e7; }
.hall-hero {
  position:relative;
  grid-template-columns:88px 1fr auto;
  min-height:83px;
  margin:0 14px 9px;
  padding:7px 10px 7px 5px;
  overflow:hidden;
  border:1px solid rgba(122,226,227,.34);
  border-radius:13px;
  background:linear-gradient(110deg,rgba(9,42,65,.9),rgba(5,26,48,.82) 64%,rgba(20,45,61,.78));
  box-shadow:0 1px 0 rgba(255,222,143,.22),0 11px 28px rgba(1,8,20,.28),inset 0 0 28px rgba(86,220,221,.035);
}
.hall-hero::after { content:'';position:absolute;right:10%;bottom:-28px;width:140px;height:70px;border:1px solid rgba(111,231,229,.13);border-radius:50%;transform:rotate(-8deg); }
.hall-hero-portrait { position:relative;align-self:stretch;min-width:88px;z-index:1; }
.hall-portrait-halo { position:absolute;left:4px;top:4px;width:72px;height:72px;border:1px solid rgba(115,235,232,.25);border-radius:50%;background:radial-gradient(circle,rgba(78,218,226,.22),rgba(78,218,226,.04) 48%,transparent 68%);box-shadow:0 0 20px rgba(78,218,226,.14); }
.hall-hero-portrait img { position:absolute;z-index:2;left:-30px;top:-18px;width:145px;height:145px;object-fit:contain;filter:drop-shadow(0 6px 8px rgba(0,8,19,.45)); }
.hall-sword-rune { position:absolute;z-index:3;right:2px;bottom:1px;width:27px;height:27px;border-color:rgba(255,223,139,.55);background:radial-gradient(circle,#275c70,#0b2b49 72%);box-shadow:0 0 12px rgba(105,229,228,.38)!important; }
.hall-sword-rune i { display:none; }.hall-sword-rune span { color:#ffe19a;font-size:11px; }
.hall-hero-copy { position:relative;z-index:2; }
.hall-hero-copy small,.hall-hero em { color:#89b6c0!important;font-size:8px!important;letter-spacing:.6px; }
.hall-hero strong { margin:3px 0!important;color:#ddecdf;font-family:"Songti SC","STSong",serif;font-size:12px!important; }
.hall-hero strong b { color:#ffe099!important;font-size:22px!important;text-shadow:0 0 12px rgba(243,209,125,.28); }
.hall-hero > button { position:relative;z-index:2;padding:7px 9px;border-color:rgba(114,226,226,.25);background:rgba(5,27,46,.78);font-size:9px; }
.hall-content { padding:0 14px 9px; }
.hall-stage-card { border-color:rgba(114,226,226,.3);border-radius:14px;background:linear-gradient(165deg,rgba(8,41,63,.91),rgba(4,20,40,.95));box-shadow:0 12px 34px rgba(1,8,20,.38),inset 0 1px rgba(255,226,148,.12); }
.hall-stage-card h3 { color:#ffe09a;font-family:"Songti SC","STSong",serif;font-size:20px; }
.chapter-nav button { border-color:rgba(111,219,222,.14);border-radius:7px;background:rgba(3,22,42,.66);color:#759cac; }
.chapter-nav button.active { border-color:color-mix(in srgb,var(--chapter) 68%,var(--gold));background:linear-gradient(180deg,color-mix(in srgb,var(--chapter) 18%,rgba(11,44,65,.94)),rgba(4,25,44,.96));color:#edf9f5; }
.stage-route { border-color:rgba(117,226,226,.28);border-radius:10px;box-shadow:inset 0 0 40px rgba(2,12,29,.48),0 1px rgba(255,228,155,.13); }
.route-scene-label { border-color:rgba(117,226,226,.22);border-radius:6px;background:rgba(4,25,45,.72); }
.route-node { border-color:rgba(127,225,226,.3);border-radius:8px;background:linear-gradient(145deg,rgba(7,36,57,.9),rgba(4,22,42,.92));color:#bedbdc;box-shadow:0 5px 14px rgba(1,8,20,.48),inset 0 1px rgba(255,255,255,.07); }
.route-node b { border-color:rgba(126,229,229,.36);background:linear-gradient(145deg,#267184,#123b5a);color:#e3f7f1; }
.route-node.selected { border-color:#f2d17e;background:linear-gradient(145deg,rgba(27,81,93,.96),rgba(6,37,58,.97));color:#ffe5a2; }
.route-node.selected b { border-color:#ffe19a;background:linear-gradient(145deg,#ffe9a9,#c98e42);color:#243b4c; }
.stage-action .hall-start { border-radius:9px;background:linear-gradient(180deg,#ffe7a2,#dca74f);color:#2f3745;letter-spacing:1px; }
.hall-tabs { border-top-color:rgba(112,227,227,.2);background:linear-gradient(180deg,rgba(7,29,49,.94),rgba(3,17,33,.98));box-shadow:0 -8px 24px rgba(1,8,20,.2); }
.hall-tab { color:#7195a3; }.hall-tab i { border:1px solid transparent;border-radius:7px;background:rgba(94,206,209,.055); }
.hall-tab.active { color:#ffe09a; }.hall-tab.active i { border-color:rgba(243,209,125,.28);background:linear-gradient(145deg,rgba(38,99,108,.7),rgba(11,47,67,.72));box-shadow:0 0 14px rgba(102,231,228,.12); }

/* 纸卷页使用温润宣纸，非历练页仍与玄玉外框统一 */
.hall-sheet { border-color:rgba(255,231,170,.56);border-radius:12px;background:linear-gradient(145deg,rgba(245,242,221,.98),rgba(220,232,222,.98));color:var(--paper-ink);box-shadow:0 12px 36px rgba(1,8,20,.36),inset 0 0 0 1px rgba(104,144,137,.18),inset 0 2px white; }
.hall-sheet h3 { color:#283e50;font-family:"Songti SC","STSong",serif; }
.training-card { border-radius:9px;background:color-mix(in srgb,var(--train) 9%,#f4f2e5); }.training-card > i { border-radius:8px; }
.task-list article,.account-codex article,.achievement-grid article { border:1px solid rgba(52,91,96,.08);border-radius:8px;background:rgba(39,81,86,.06); }
.daily-chests button { border-radius:8px;background:#e9eee5; }

/* 功法、结算、暂停：统一为玄玉外框＋宣纸内容 */
.panel:not(.hall) { background:radial-gradient(circle at 50% 24%,rgba(21,70,91,.72),rgba(3,14,29,.96) 68%); }
.panel h2 { color:#ffe09b;font-family:"Songti SC","STSong",serif;text-shadow:0 2px 0 rgba(67,39,27,.55),0 0 20px rgba(243,209,125,.18); }
#upgrade { background:radial-gradient(circle at 50% 20%,rgba(21,77,98,.72),rgba(3,14,29,.97) 68%); }
.upgrade-btns .upgrade-card {
  border-color:rgba(133,173,167,.55)!important;
  border-radius:10px;
  background:linear-gradient(145deg,rgba(245,242,221,.98),rgba(220,232,222,.98))!important;
  color:#263c4d;
  box-shadow:0 4px 0 rgba(6,31,43,.62),0 10px 22px rgba(0,6,16,.25),inset 0 1px white;
}
.upgrade-btns .upgrade-card::before { content:'';position:absolute;left:0;top:7px;bottom:7px;width:3px;border-radius:0 3px 3px 0;background:#68cfd0; }
.upgrade-card-head b { color:#2f5261!important;font-family:"Songti SC","STSong",serif;font-size:16px; }
.upgrade-card i { color:#5f7276; }.upgrade-card small span { background:rgba(39,80,84,.08);color:#627276; }.upgrade-card small strong { background:rgba(205,159,71,.15);color:#8b612b; }
.build-chip { border-color:rgba(110,226,226,.28)!important;background:rgba(8,38,59,.84)!important;color:#cceae7!important; }
.build-destiny { border-color:rgba(110,226,226,.2);background:rgba(6,29,50,.6);color:#a9ced2; }
.reroll-btn { border-color:rgba(106,229,228,.42);background:linear-gradient(180deg,#3b9aaa,#1c687e);box-shadow:0 3px 0 #0a394f;color:#efffff; }
.upgrade-skip-btn { border-color:rgba(108,225,225,.22);background:rgba(5,28,49,.82);color:#a9cdd0; }
.battle-menu > section,.settings-panel > section { border-color:rgba(239,213,146,.62);border-radius:12px;background:linear-gradient(145deg,#f2efda,#dce9df);color:#2c4351; }
.battle-menu h2,.settings-panel h2 { color:#294050;text-shadow:none; }
.battle-menu p,.settings-panel p { color:#617276; }
.setting-row { border-radius:8px;background:rgba(255,255,255,.38);color:#344c58; }

@media (max-width:370px) {
  .hall-hero { grid-template-columns:76px 1fr auto; }
  .hall-hero-portrait { min-width:76px; }
  .hall-portrait-halo { width:64px;height:64px; }
  .hall-hero-portrait img { left:-26px;top:-14px;width:132px;height:132px; }
  .hall-brand h1 { font-size:22px;letter-spacing:3px; }
}

@media (max-height:700px) {
  .hall-hero { min-height:66px;grid-template-columns:72px 1fr auto; }
  .hall-hero-portrait { min-width:72px; }
  .hall-portrait-halo { width:58px;height:58px; }
  .hall-hero-portrait img { left:-24px;top:-14px;width:126px;height:126px; }
  .hall-sword-rune { width:24px;height:24px; }
}

/* === UI Design System V3：剑匣 / 青玉 / 剑铭 / 宣纸 === */
:root {
  --ds-iron:#071724;
  --ds-case:#0b2a3b;
  --ds-case-2:#103849;
  --ds-jade:#72d8d2;
  --ds-jade-hi:#d8f5ef;
  --ds-gold:#d6aa5d;
  --ds-gold-hi:#f2d68d;
  --ds-paper:#ece9d8;
  --ds-paper-2:#dfe4d7;
  --ds-ink:#263942;
  --ds-muted:#78959c;
  --ds-hp:#db7277;
  --ds-cut:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px);
  --ds-cut-sm:polygon(5px 0,calc(100% - 5px) 0,100% 5px,100% calc(100% - 5px),calc(100% - 5px) 100%,5px 100%,0 calc(100% - 5px),0 5px);
  --ds-shadow:0 8px 22px rgba(0,8,18,.36);
  --ds-press:cubic-bezier(.2,.72,.32,1);
}

button {
  clip-path:var(--ds-cut-sm);
  border:1px solid rgba(214,170,93,.72);
  border-radius:0;
  background:#c99a4f;
  color:#172b36;
  box-shadow:inset 0 1px rgba(255,246,210,.38),inset 0 -3px rgba(86,54,24,.24),0 4px 0 #68472b;
  transition:filter .14s ease,transform .1s var(--ds-press);
}
button:hover { filter:brightness(1.08);transform:none; }
button:active { transform:translateY(2px);box-shadow:inset 0 1px rgba(255,246,210,.28),inset 0 -1px rgba(86,54,24,.18),0 2px 0 #68472b; }
button.ghost,.ghost {
  border-color:rgba(114,216,210,.42);
  background:#0c3041;
  color:#bce5df;
  box-shadow:inset 0 1px rgba(218,255,250,.06),0 3px 0 #041a27;
}

/* 战斗抬头：剑匣横匾，不再使用玻璃卡片 */
.hud {
  gap:6px;
  padding:10px 12px 11px;
  clip-path:var(--ds-cut);
  border:1px solid rgba(114,216,210,.48);
  border-radius:0;
  background-color:rgba(6,28,43,.96);
  background-image:url('./assets/ui/xuan-weave.svg');
  box-shadow:var(--ds-shadow),inset 0 0 0 1px rgba(216,245,239,.035),inset 0 -3px rgba(0,8,17,.28);
  backdrop-filter:none;
}
.hud::before,.hud::after { top:0;width:46px;height:2px;opacity:1;background:var(--ds-gold); }
.hud::before { left:12px; }.hud::after { right:12px; }
.hud-top { padding:0 0 5px;border-bottom:0;background:url('./assets/ui/sword-divider.svg') center bottom/100% 10px no-repeat; }
#wave { color:var(--ds-gold-hi);font-family:"Songti SC","STSong",serif;font-size:16px; }
#stage-name,#kills,#lv {
  padding:2px 6px;
  border-radius:0;
  clip-path:var(--ds-cut-sm);
  background:#0a2435;
}
#stage-name { border-color:rgba(114,216,210,.3);color:#9eddd7; }
#kills { border-color:rgba(214,170,93,.24);color:#d8d4bd; }
#lv { border-color:rgba(114,216,210,.22);color:var(--ds-jade); }
.stat-label { color:#91adb2;font-family:"Songti SC","STSong",serif; }
.stat-value { color:#dceae6;font-family:"DIN Alternate",monospace; }
.stat-track { height:7px;border-radius:1px;border-color:rgba(159,211,209,.15);background:#03121e;box-shadow:inset 0 1px 2px rgba(0,0,0,.6); }
.hpbar { height:9px; }.shieldbar,.xpbar { height:6px; }
#hp,#hp-loss,#shield,#xp { border-radius:0; }
#hp { background:#d86e74;box-shadow:inset 0 1px rgba(255,222,211,.38); }
#hp-loss { background:#d7a75e; }
#xp { background:#67c9c4;box-shadow:0 0 7px rgba(114,216,210,.26); }
#shield { background:#73a8c8; }

.codex-fab,.battle-menu-fab {
  border-color:rgba(114,216,210,.46);
  border-radius:0;
  background-color:#092b3d;
  background-image:url('./assets/ui/xuan-weave.svg');
  box-shadow:0 4px 0 #031723,var(--ds-shadow);
}
.codex-fab { clip-path:var(--ds-cut-sm); }
.codex-fab i { border-radius:0;clip-path:var(--ds-cut-sm);background:#143d4b;color:var(--ds-gold-hi); }
.battle-menu-fab,.ultimate-btn,.ultimate-btn > span,.hall-sword-rune,.codex-close,.settings-panel header button { clip-path:none;border-radius:50%; }
.combo-pop {
  clip-path:var(--ds-cut);
  border:1px solid rgba(214,170,93,.55);
  border-radius:0;
  background-color:rgba(7,30,44,.95);
  background-image:url('./assets/ui/xuan-weave.svg');
  box-shadow:var(--ds-shadow);
}
.buff-bar span { clip-path:var(--ds-cut-sm);border-radius:0;background:#082b3c;box-shadow:0 4px 12px rgba(0,8,18,.28); }
.buff-bar span i { display:inline-grid;place-items:center;width:17px;height:17px;margin-right:5px;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);background:currentColor;color:#082b3c;font-family:"Songti SC","STSong",serif;font-size:8px;font-style:normal; }

/* 大厅：标题、资源、英雄、章节均服从同一套剑匣结构 */
.panel.menu.hall::before { background:linear-gradient(90deg,rgba(3,12,24,.46),transparent 24%,transparent 76%,rgba(3,12,24,.46)),linear-gradient(180deg,transparent 48%,rgba(2,10,21,.76)); }
.hall-shell { background:none;box-shadow:0 0 76px rgba(0,6,15,.32); }
.hall-head { padding-bottom:9px; }
.hall-brand small { color:#8eb4b8;letter-spacing:3px; }
.hall-brand h1 { color:var(--ds-gold-hi);font-family:"STKaiti","KaiTi","Songti SC",serif;letter-spacing:6px;text-shadow:0 2px #3e2c22; }
.hall-currencies > span,.hall-currencies button {
  clip-path:var(--ds-cut-sm);
  border-radius:0;
  border-color:rgba(114,216,210,.3);
  background-color:rgba(6,28,43,.9);
  background-image:url('./assets/ui/xuan-weave.svg');
  box-shadow:inset 0 1px rgba(220,255,249,.05);
}
.hall-currencies b { color:var(--ds-gold-hi);font-family:"DIN Alternate",monospace; }
.hall-hero {
  clip-path:var(--ds-cut);
  border-radius:0;
  border-color:rgba(114,216,210,.5);
  background-color:rgba(6,31,46,.94);
  background-image:url('./assets/ui/xuan-weave.svg');
  box-shadow:var(--ds-shadow),inset 0 -3px rgba(0,8,18,.25);
  backdrop-filter:none;
}
.hall-hero::before { content:'';position:absolute;left:8px;right:8px;top:0;height:2px;background:linear-gradient(90deg,var(--ds-gold),transparent 38%); }
.hall-hero::after { border-color:rgba(114,216,210,.12); }
.hall-portrait-halo { border-color:rgba(114,216,210,.28);background:radial-gradient(circle,rgba(114,216,210,.17),transparent 66%); }
.hall-hero-copy small,.hall-hero em { color:#84a8ad!important; }
.hall-hero strong b { color:var(--ds-gold-hi)!important;text-shadow:none; }
.hall-hero > button { background:#0b3041;border-color:rgba(114,216,210,.35); }
.hall-stage-card {
  clip-path:var(--ds-cut);
  border-radius:0;
  border-color:rgba(114,216,210,.42);
  background-color:rgba(5,28,43,.96);
  background-image:url('./assets/ui/xuan-weave.svg');
  box-shadow:var(--ds-shadow),inset 0 -3px rgba(0,8,18,.24);
  backdrop-filter:none;
}
.hall-stage-card > header { padding-bottom:5px;background:url('./assets/ui/sword-divider.svg') center bottom/100% 10px no-repeat; }
.hall-stage-card h3 { color:var(--ds-gold-hi);font-family:"STKaiti","KaiTi","Songti SC",serif; }
.hall-stage-card header span,.hall-sheet header > b { clip-path:var(--ds-cut-sm);border-radius:0;box-shadow:none; }
.chapter-nav { gap:4px;margin:7px 0; }
.chapter-nav button { clip-path:var(--ds-cut-sm);border-radius:0;background:#08273a;box-shadow:none; }
.chapter-nav button.active { background:#154557;color:#eaf7f3;box-shadow:inset 0 -2px var(--ds-gold); }
.stage-route { border-radius:2px;border-color:rgba(114,216,210,.32);box-shadow:inset 0 0 32px rgba(0,7,17,.46); }
.route-scene-label { clip-path:var(--ds-cut-sm);border-radius:0;background:#062437; }
.route-node { clip-path:var(--ds-cut-sm);border-radius:0;background:#082a3d;box-shadow:0 4px 10px rgba(0,7,17,.4);backdrop-filter:none; }
.route-node b { border-radius:2px;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);background:#1b6270; }
.route-node.selected { background:#12495a;box-shadow:0 0 0 1px rgba(214,170,93,.38),0 5px 12px rgba(0,7,17,.4); }
.route-node.selected b { background:var(--ds-gold);color:#15303b; }
.stage-action .hall-start { clip-path:var(--ds-cut-sm);border-radius:0;background:#d0a254;box-shadow:inset 0 1px rgba(255,244,199,.4),inset 0 -3px rgba(89,56,24,.2),0 4px 0 #654329; }
.stage-action .hall-endless { clip-path:var(--ds-cut-sm);border-radius:0;background:#082a3c; }

.hall-tabs { padding-top:6px;border-top:1px solid rgba(114,216,210,.22);background-color:rgba(4,22,35,.97);background-image:url('./assets/ui/xuan-weave.svg');box-shadow:0 -8px 20px rgba(0,7,16,.22); }
.hall-tab { position:relative;clip-path:none;border-radius:0;color:#738f95;box-shadow:none; }
.hall-tab i { border:0;border-radius:0;background:none; }
.hall-tab.active { color:var(--ds-gold-hi); }
.hall-tab.active::after { content:'';position:absolute;left:27%;right:27%;bottom:0;height:2px;background:var(--ds-gold); }
.hall-tab.active i { border:0;background:none;box-shadow:none;color:var(--ds-jade-hi); }

/* 宣纸信息层：任务、修行、功法与图鉴使用同一材质 */
.hall-sheet,.codex-sheet,.battle-menu > section,.settings-panel > section {
  clip-path:var(--ds-cut);
  border-radius:0;
  border-color:rgba(214,170,93,.62);
  background-color:var(--ds-paper);
  background-image:url('./assets/ui/paper-grain.svg');
  color:var(--ds-ink);
  box-shadow:var(--ds-shadow),inset 0 0 0 1px rgba(70,91,82,.12);
}
.hall-sheet > header,.codex-head { padding-bottom:8px;background:url('./assets/ui/sword-divider.svg') center bottom/100% 12px no-repeat; }
.hall-sheet h3,.codex-head h2,.battle-menu h2,.settings-panel h2 { color:#203943;font-family:"STKaiti","KaiTi","Songti SC",serif;text-shadow:none; }
.hall-sheet .sheet-note { color:#62756f; }
.training-card,.task-list article,.account-codex article,.achievement-grid article,.setting-row {
  clip-path:var(--ds-cut-sm);
  border-radius:0;
  background:rgba(54,91,88,.055);
  box-shadow:none;
}
.training-card > i,.account-codex i { border-radius:2px;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); }
.daily-chests button,.task-list button { border-radius:0;clip-path:var(--ds-cut-sm); }

/* 突破选功法：像三张剑诀，不像三张网页卡 */
.panel:not(.hall),#upgrade { background:rgba(2,13,24,.94);backdrop-filter:blur(3px); }
.panel h2 { color:var(--ds-gold-hi);font-family:"STKaiti","KaiTi","Songti SC",serif;text-shadow:0 2px #3a2920; }
#upgrade h2::after,#over h2::after { content:'';display:block;width:min(260px,70vw);height:14px;margin:2px auto 0;background:url('./assets/ui/sword-divider.svg') center/100% 14px no-repeat; }
.build-destiny,.build-chip { clip-path:var(--ds-cut-sm);border-radius:0; }
.build-chip { background:#092c3d!important;border-color:rgba(114,216,210,.28)!important; }
.upgrade-btns .upgrade-card {
  --school-color:#72b9b5;
  clip-path:var(--ds-cut);
  border:1px solid rgba(69,99,94,.42)!important;
  border-radius:0;
  background-color:var(--ds-paper)!important;
  background-image:url('./assets/ui/paper-grain.svg')!important;
  color:var(--ds-ink);
  box-shadow:0 5px 0 #092433,0 9px 18px rgba(0,6,15,.26),inset 0 0 0 1px rgba(255,255,255,.28);
}
.upgrade-btns .upgrade-card::before { left:0;top:0;bottom:0;width:4px;border-radius:0;background:var(--school-color); }
.upgrade-card.school-剑阵 { --school-color:#c89c4f; }.upgrade-card.school-剑气 { --school-color:#4ca9c5; }.upgrade-card.school-火焰 { --school-color:#d46f53; }.upgrade-card.school-护体 { --school-color:#62a6b4; }.upgrade-card.school-融合 { --school-color:#9173bd; }.upgrade-card.school-身法,.upgrade-card.school-剑步 { --school-color:#54a98d; }.upgrade-card.school-无尽 { --school-color:#6d78aa; }
.upgrade-card-head b { color:#294751!important;font-family:"STKaiti","KaiTi","Songti SC",serif; }
.upgrade-card-head em,.upgrade-card small span,.upgrade-card small strong,.fusion-lock-note,.fusion-confirm { border-radius:0;clip-path:var(--ds-cut-sm); }
.upgrade-card.chosen { border-color:var(--ds-gold)!important;box-shadow:0 0 0 2px rgba(214,170,93,.22),0 8px 20px rgba(0,6,15,.28); }
.reroll-btn,.upgrade-skip-btn { border-radius:0;clip-path:var(--ds-cut-sm); }
.reroll-btn { background:#176076;box-shadow:0 3px 0 #073446; }

.codex-tabs { position:relative;z-index:2;flex:none;gap:3px;min-height:38px;padding-top:4px;padding-bottom:7px; }
.codex-tabs button { min-height:27px;clip-path:var(--ds-cut-sm);border-radius:0;background:rgba(43,76,74,.07);box-shadow:none; }
.codex-tabs button.active { background:#124d5b;color:#eef9f5;box-shadow:inset 0 -2px var(--ds-gold); }
.codex-content { position:relative;z-index:1; }
.codex-progress { clip-path:var(--ds-cut-sm);border-radius:0;background:rgba(46,78,76,.07); }
.codex-card { clip-path:var(--ds-cut-sm);border-radius:0;background:rgba(52,88,84,.055); }
.codex-card header span,.codex-card > em { clip-path:var(--ds-cut-sm);border-radius:0; }
.over-rewards,.tutorial-tip { clip-path:var(--ds-cut-sm);border-radius:0; }
.over-rewards { background-color:#082a3b;background-image:url('./assets/ui/xuan-weave.svg'); }
.tutorial-tip { background:#0a2a3c;border-color:rgba(214,170,93,.55);color:var(--ds-gold-hi); }

@media (max-width:340px) {
  .hud { clip-path:var(--ds-cut-sm); }
  .hall-stage-card,.hall-hero,.hall-sheet { clip-path:var(--ds-cut-sm); }
}
