/* ============================================================================
   Project: NOVA · 深空联机探索装置 V4（单屏零滚动 · 四大传世皮肤 3D 精雕柜台）
   覆盖机台：
     1. classic:plinko  ⚡ 量子引力坍缩仪 (Quantum Drop)
     2. classic:mines   💎 亚特兰蒂斯星图 (5×5 Relic Grid)
     3. classic:tower   🗼 巴别星际太空电梯 (Dual-Shaft 10-Floor Panoramic Rack)
     4. classic:wheel   🎡 全球同服·远古星门罗盘 (54-Sector Stargate Compass)
   严格铁律：
     - 100% 单屏零外层滚动轴（100dvh 锁定，隐藏外层 topbar / #appNav / #ahStageTopBar）
     - 4 套旗舰皮肤实时同步（默认古陆星象 obsidian / 千里江山 qianli / 黑金皇冠 royal / 星月苍穹 starry）
     - 无字 3D 精雕机柜底图 + 同材质 3D 嵌入式说明框 + V16 自定义比例/固定充能 + 长按加速
   ============================================================================ */

/* 进入经典 4 台探索装置舞台时：全屏锁死 100dvh，彻底消除页面滚动条 */
body.in-classic-stage .topbar,
body.in-classic-stage #appNav,
body.in-classic-stage #ahMainLobbyHeader,
body.in-classic-stage #ahStageTopBar {
  display: none !important;
}

body.in-classic-stage,
html.in-classic-stage {
  overflow: hidden !important;
  height: 100vh !important;
  height: var(--app-vh, 100vh) !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: var(--app-vh, 100vh) !important;
  max-height: 100dvh !important;
}

body.in-classic-stage .shell {
  padding: 0 !important;
  margin: 0 auto !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: var(--app-vh, 100vh) !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

body.in-classic-stage #view-arcade {
  padding: 0 !important;
  margin: 0 !important;
  height: 100vh !important;
  height: var(--app-vh, 100vh) !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

body.in-classic-stage {
  background: radial-gradient(ellipse at 50% 24%, #101935 0%, #050814 75%) !important;
}
html[data-nova-skin="qianli"] body.in-classic-stage {
  background: radial-gradient(ellipse at 50% 24%, #0f3d36 0%, #051c19 78%) !important;
}
html[data-nova-skin="royal"] body.in-classic-stage {
  background: radial-gradient(ellipse at 50% 24%, #380712 0%, #140206 78%) !important;
}
html[data-nova-skin="starry"] body.in-classic-stage {
  background: radial-gradient(ellipse at 50% 24%, #102a63 0%, #050d24 78%) !important;
}

#ahShellBox.in-stage-classic {
  max-width: 500px !important;
  width: 100% !important;
  height: 100vh !important;
  height: var(--app-vh, 100vh) !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: var(--app-vh, 100vh) !important;
  max-height: 100dvh !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: transparent !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

#ahShellBox.in-stage-classic > .ah-layer,
#ahShellBox.in-stage-classic #ahGameStage {
  height: 100% !important;
  max-height: 100% !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* 主舞台根容器：移除自带废框/下半截空凹槽的旧底图，升级为四皮肤纯净全屏星象羽化底纹 */
#ahClassicWrap.cm-cabinet-root {
  position: relative;
  width: 100%;
  height: 100vh;
  height: var(--app-vh, 100vh);
  height: 100dvh;
  max-height: 100vh;
  max-height: var(--app-vh, 100vh);
  max-height: 100dvh;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 5px) 8px calc(env(safe-area-inset-bottom, 0px) + 6px);
  box-sizing: border-box;
  color: var(--nova-skin-ink, #f8fafc);
  user-select: none;
  z-index: 2;
}

/* 四大旗舰皮肤纯净无废框深空底纹绑定 */
#ahClassicWrap.cm-cabinet-root.skin-obsidian {
  background:
    radial-gradient(circle at 50% 48%, rgba(246, 200, 95, 0.08) 0%, rgba(56, 189, 248, 0.04) 36%, transparent 68%),
    linear-gradient(180deg, #0b1329 0%, #070c1b 52%, #050812 100%);
  --cm-accent: #f6c85f;
  --cm-accent-2: #38bdf8;
  --cm-glass: rgba(10, 16, 34, 0.48);
  --cm-border: rgba(246, 200, 95, 0.56);
  --cm-slot-bg: rgba(9, 15, 32, 0.66);
  --cm-btn-main: url("../assets/ui/jackpot_wheel/btn_obs_gold.jpg");
  --cm-btn-alt: url("../assets/ui/jackpot_wheel/btn_obs_emerald.jpg");
  --cm-panel-bg: url("../assets/ui/fruit_machine/panel_obsidian.jpg");
}

#ahClassicWrap.cm-cabinet-root.skin-qianli {
  background:
    radial-gradient(circle at 50% 46%, rgba(45, 212, 191, 0.14) 0%, rgba(212, 175, 55, 0.08) 42%, transparent 72%),
    linear-gradient(180deg, #103e36 0%, #0a2b26 55%, #061c19 100%);
  --cm-accent: #fde68a;
  --cm-accent-2: #2dd4bf;
  --cm-glass: rgba(10, 44, 40, 0.42);
  --cm-border: rgba(212, 175, 55, 0.66);
  --cm-slot-bg: rgba(8, 36, 32, 0.72);
  --cm-btn-main: url("../assets/ui/jackpot_wheel/btn_qianli_cinnabar.jpg");
  --cm-btn-alt: url("../assets/ui/jackpot_wheel/btn_qianli_celadon.jpg");
  --cm-panel-bg: url("../assets/ui/fruit_machine/panel_qianli.jpg");
  font-family: "NovaJadeCallig", "NovaKai", "Microsoft YaHei", serif;
}

#ahClassicWrap.cm-cabinet-root.skin-royal {
  background:
    radial-gradient(circle at 50% 46%, rgba(251, 191, 36, 0.10) 0%, rgba(225, 29, 72, 0.08) 40%, transparent 70%),
    linear-gradient(180deg, #320712 0%, #1e040b 55%, #120206 100%);
  --cm-accent: #fbbf24;
  --cm-accent-2: #34d399;
  --cm-glass: rgba(38, 6, 14, 0.46);
  --cm-border: rgba(251, 191, 36, 0.62);
  --cm-slot-bg: rgba(32, 5, 11, 0.72);
  --cm-btn-main: url("../assets/ui/jackpot_wheel/btn_royal_ruby.jpg");
  --cm-btn-alt: url("../assets/ui/jackpot_wheel/btn_royal_emerald.jpg");
  --cm-panel-bg: url("../assets/ui/fruit_machine/panel_royal.jpg");
}

#ahClassicWrap.cm-cabinet-root.skin-starry {
  background:
    radial-gradient(circle at 50% 46%, rgba(96, 165, 250, 0.14) 0%, rgba(252, 211, 77, 0.07) 42%, transparent 72%),
    linear-gradient(180deg, #102659 0%, #09173a 55%, #050d24 100%);
  --cm-accent: #fcd34d;
  --cm-accent-2: #60a5fa;
  --cm-glass: rgba(10, 24, 58, 0.46);
  --cm-border: rgba(251, 191, 36, 0.62);
  --cm-slot-bg: rgba(8, 18, 46, 0.72);
  --cm-btn-main: url("../assets/ui/jackpot_wheel/btn_starry_amber.jpg");
  --cm-btn-alt: url("../assets/ui/jackpot_wheel/btn_starry_sapphire.jpg");
  --cm-panel-bg: url("../assets/ui/fruit_machine/panel_starry.jpg");
}

/* ==================== 1. 顶部无死框轻透导航栏（根除长余额星币图标被裁切问题） ==================== */
.cm-topbar-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 25;
}

.cm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 30px;
  padding: 2px 2px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(4, 8, 20, 0.46), rgba(4, 8, 20, 0.08));
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  flex-shrink: 0;
  overflow: visible;
  z-index: 12;
}

#ahClassicWrap.skin-qianli .cm-topbar {
  background: linear-gradient(180deg, rgba(12, 50, 44, 0.52), rgba(8, 34, 30, 0.12));
  border-bottom-color: rgba(212, 175, 55, 0.25);
}
#ahClassicWrap.skin-royal .cm-topbar {
  background: linear-gradient(180deg, rgba(48, 6, 15, 0.52), rgba(24, 3, 8, 0.12));
}
#ahClassicWrap.skin-starry .cm-topbar {
  background: linear-gradient(180deg, rgba(14, 34, 78, 0.52), rgba(7, 16, 42, 0.12));
}

.cm-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 25px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.cm-top-btn:active {
  transform: scale(0.96);
}

.cm-top-right-grp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cm-top-menu-drawer {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  display: none;
  flex-direction: column;
  gap: 5px;
  min-width: 132px;
  padding: 8px;
  border-radius: 11px;
  background: rgba(8, 13, 28, 0.96);
  border: 1px solid var(--cm-border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.82);
  z-index: 40;
}

.cm-top-menu-drawer.open {
  display: flex;
}

.cm-top-menu-drawer .cm-top-btn {
  width: 100%;
  justify-content: flex-start;
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

/* 无死框完整星币余额区：左星币图标 + 完整两位小数 + 右补币钮，绝不居中挤丢两侧图标 */
.cm-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
  height: 25px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  border: none;
  font-family: "NovaNumeral", var(--mono, monospace);
  font-size: 11px;
  font-weight: 900;
  color: var(--cm-accent);
  overflow: visible;
}

#ahClassicWrap.skin-qianli .cm-wallet-pill {
  background: rgba(255, 253, 247, 0.9);
  color: #991b1b;
}

.cm-wallet-pill .nova-coin-ico {
  flex-shrink: 0;
}

.cm-wallet-pill .cm-wallet-val {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  min-width: 0;
}

.cm-wallet-add {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--cm-accent);
  background: rgba(246, 200, 95, 0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
#ahClassicWrap.skin-qianli .cm-wallet-add {
  background: #b91c1c;
  border-color: #fde68a;
  color: #fffbeb;
}

/* ==================== 2. 4 机台快捷切换微雕芯片栏 ==================== */
.cm-mode-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 3px;
  flex-shrink: 0;
  z-index: 10;
}

.cm-mode-chip {
  height: 25px;
  padding: 0 2px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 10, 22, 0.62);
  color: rgba(241, 245, 249, 0.85);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

#ahClassicWrap.skin-qianli .cm-mode-chip {
  background: rgba(10, 44, 38, 0.72);
  border-color: rgba(212, 175, 55, 0.36);
  color: #e2e8f0;
}

.cm-mode-chip.active {
  background-image: var(--cm-btn-main) !important;
  background-size: 100% 100% !important;
  border: 1.5px solid #fef08a !important;
  color: #fffbeb !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
  box-shadow: 0 0 10px rgba(246, 200, 95, 0.28);
}

/* ==================== 3. C-1 中奖算式无死框暗影带 + 3D 同材质三态解析浮窗 ==================== */
.cm-plaque-wrap {
  position: relative;
  margin-top: 3px;
  flex-shrink: 0;
  z-index: 18;
}

.cm-formula-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 27px;
  padding: 2px 7px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(6, 11, 26, 0.72), rgba(12, 20, 42, 0.56));
  border: none;
  box-shadow: none;
}

.cm-formula-text {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}

.cm-formula-text b {
  color: var(--cm-accent);
  font-family: var(--mono, monospace);
}

.cm-trial-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(245, 158, 11, 0.28));
  border: 1px solid rgba(52, 211, 153, 0.7);
  color: #a7f3d0;
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
  flex-shrink: 0;
}

.cm-explain-btn {
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--cm-border);
  background: rgba(246, 200, 95, 0.16);
  color: var(--cm-accent);
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 同材质 3D 嵌入式非阻塞解析浮窗（绝对定位悬浮，绝不挤高单屏、绝不挡底部按钮） */
.cm-explain-drawer {
  position: absolute;
  top: calc(100% + 4px);
  left: 2%;
  right: 2%;
  padding: 12px 14px 10px;
  border-radius: 14px;
  background-image: var(--cm-panel-bg);
  background-size: 100% 100%;
  background-position: center;
  border: 1.5px solid var(--cm-border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.86);
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 30;
  pointer-events: auto;
}

.cm-explain-drawer.open {
  display: flex;
}

.cm-exp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cm-exp-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--cm-accent);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.cm-exp-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cm-exp-pin,
.cm-exp-close {
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--cm-border);
  background: rgba(6, 10, 22, 0.78);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}

.cm-exp-pin.pinned {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #a7f3d0;
}

.cm-exp-body {
  font-size: 11.5px;
  line-height: 1.45;
  color: #f8fafc;
  background: rgba(4, 8, 18, 0.72);
  border-radius: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ==================== 4. 中央主舞台视窗（移除外层套娃死框，自适应弹性撑满，零内部滚动） ==================== */
.cm-viewport {
  flex: 1 1 0;
  min-height: 0;
  margin: 2px 0;
  padding: 2px 1px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

#ahClassicWrap .ah-pane {
  display: none;
  flex: 1 1 0;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  overflow: hidden;
}

#ahClassicWrap .ah-pane.active {
  display: flex;
}

/* 紧凑参数控制带（移除无效外死框，改用无边柔和暗影带） */
.cm-param-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px 6px;
  flex-wrap: wrap;
  padding: 3px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.30);
  border: none;
  flex-shrink: 0;
}

/* 星图专属单行锁死裂隙控制条：1~24 滑动永不折行、永不掉到下一行 */
.cm-param-bar.cm-mines-rift-bar {
  flex-wrap: nowrap !important;
  gap: 6px;
  padding: 4px 7px;
  min-height: 30px;
}

.cm-rift-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.cm-rift-num {
  display: inline-block;
  min-width: 2.1ch;
  text-align: right;
  font-family: "NovaNumeral", var(--mono, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--cm-accent);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.cm-rift-slider {
  flex: 1 1 54px;
  min-width: 44px;
  height: 18px;
  margin: 0;
  accent-color: var(--cm-accent);
  cursor: pointer;
}

.cm-seg-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.cm-seg-group.cm-rift-presets {
  flex-wrap: nowrap !important;
  flex-shrink: 0;
  gap: 3px;
}

.cm-seg-lbl {
  font-size: 10px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.84);
  margin-right: 1px;
  white-space: nowrap;
}

#ahClassicWrap .ah-seg-btn {
  padding: 2px 5.5px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: rgba(248, 250, 252, 0.85) !important;
  white-space: nowrap;
}

#ahClassicWrap .ah-seg-btn.active {
  background: linear-gradient(180deg, rgba(246, 200, 95, 0.36), rgba(15, 23, 42, 0.92)) !important;
  border-color: var(--cm-accent) !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(246, 200, 95, 0.28);
}

/* ---------- 机台 1：⚡ 量子引力坍缩仪 (Plinko · 清理外层无效边框) ---------- */
.cm-plinko-canvas-box {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#ahClassicWrap #ahPlinkoCanvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 12px !important;
  border: none !important;
  background: radial-gradient(circle at 50% 24%, rgba(20, 34, 72, 0.45), rgba(4, 7, 18, 0.55)) !important;
}

/* ---------- 机台 2：💎 亚特兰蒂斯 5×5 星图 (Mines · 无框读数带 + 步数倍率阶梯 + 满幅大棋盘) ---------- */
.cm-mines-telemetry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 4px 5px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(6, 11, 26, 0.52), rgba(6, 11, 26, 0.24));
  flex-shrink: 0;
}

.cm-mines-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  flex-shrink: 0;
}

.cm-mini-stat {
  padding: 2px 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  text-align: center;
}

.cm-mini-stat:last-child {
  border-right: none;
}

.cm-mini-stat .k {
  font-size: 9.5px;
  color: rgba(226, 232, 240, 0.76);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-mini-stat .v {
  font-family: "NovaNumeral", var(--mono, monospace);
  font-size: 13px;
  font-weight: 900;
  color: var(--cm-accent);
  white-space: nowrap;
}

/* 步数倍率预览阶梯条：消除上方空白，直观查看每步倍率并支持一键点选自动目标步数 */
.cm-mines-step-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 1px 2px;
  min-height: 22px;
}
.cm-mines-step-strip::-webkit-scrollbar {
  display: none;
}

.cm-mn-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(226, 232, 240, 0.82);
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.cm-mn-step-pill b {
  font-family: "NovaNumeral", var(--mono, monospace);
  color: var(--cm-accent);
}

.cm-mn-step-pill.passed {
  border-color: rgba(52, 211, 153, 0.52);
  background: rgba(16, 185, 129, 0.16);
  color: #d1fae5;
}

.cm-mn-step-pill.target {
  border-color: #34d399;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.34), rgba(246, 200, 95, 0.24));
  color: #ecfdf5;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.26);
}

.cm-mines-board-stage {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px 0;
}

#ahClassicWrap #ahMinesGrid.ah-mines-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
  /* 解除原 34dvh/300px 枷锁：随视口净高与屏宽自适应撑满中央黄金视野，且全视口零溢出 */
  width: min(96%, calc(100vh - 332px), 388px) !important;
  width: min(96%, calc(var(--app-vh, 100vh) - 332px), 388px) !important;
  width: min(96%, calc(100dvh - 332px), 388px) !important;
  max-width: 388px !important;
  margin: 0 auto !important;
}

#ahClassicWrap .ah-mine-tile {
  position: relative;
  aspect-ratio: 1 / 1 !important;
  border-radius: 10px !important;
  padding: 2px !important;
  background: radial-gradient(circle at 50% 35%, rgba(30, 46, 86, 0.92), rgba(7, 11, 24, 0.96)) !important;
  border: 1.3px solid var(--cm-border) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 10px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden;
}

/* 自动模式「📌固定阵型」预选准星高亮态 */
#ahClassicWrap .ah-mine-tile.auto-preset {
  border: 1.8px solid #2dd4bf !important;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.45), inset 0 0 10px rgba(246, 200, 95, 0.25) !important;
}

#ahClassicWrap .ah-mine-tile.auto-preset .heat {
  color: #5eead4 !important;
  font-weight: 900 !important;
}

.cm-tile-3d-img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

#ahClassicWrap .ah-mine-tile .heat {
  font-size: 8.5px !important;
  line-height: 1 !important;
  margin-top: -1px;
  color: rgba(248, 250, 252, 0.84) !important;
}

/* ---------- 机台 3：🗼 巴别星际太空电梯（单屏双列 F1-F5 | F6-F10 全景舱架 · 清理外层无效边框） ---------- */
.cm-tower-stage {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

#ahClassicWrap #ahTowerLadder.ah-tower-ladder {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(5, minmax(0, 1fr)) !important;
  grid-auto-flow: column !important;
  gap: 5px 7px !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

#ahClassicWrap .ah-tower-row {
  padding: 3px 5px !important;
  gap: 4px !important;
  border-radius: 8px !important;
  min-height: 0 !important;
  background: rgba(8, 14, 32, 0.66) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  display: flex !important;
  align-items: center !important;
}

#ahClassicWrap .ah-tower-row.cur {
  border-color: var(--cm-accent) !important;
  background: linear-gradient(90deg, rgba(246, 200, 95, 0.24), rgba(14, 24, 52, 0.92)) !important;
  box-shadow: 0 0 12px rgba(246, 200, 95, 0.34) !important;
}

#ahClassicWrap .ah-tower-row.passed {
  border-color: rgba(52, 211, 153, 0.55) !important;
  background: rgba(6, 42, 34, 0.72) !important;
}

.cm-tw-meta {
  display: flex;
  flex-direction: column;
  width: 44px;
  flex-shrink: 0;
  line-height: 1.1;
}

.cm-tw-fl {
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 900;
  color: var(--cm-accent);
}

.cm-tw-mult {
  font-family: var(--mono, monospace);
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
}

#ahClassicWrap .ah-tw-doors {
  flex: 1 !important;
  gap: 3px !important;
  height: 100%;
  align-items: center;
}

#ahClassicWrap .ah-tw-door {
  height: 100% !important;
  min-height: 24px !important;
  max-height: 38px !important;
  padding: 1px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid var(--cm-border) !important;
}

.cm-door-3d-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
}

/* ---------- 机台 4：🎡 全球同服·远古星门罗盘 (Wheel · 清理外层无效死框) ---------- */
.cm-wheel-stage {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(96px, 32%) 1fr;
  gap: 6px;
  align-items: center;
  overflow: hidden;
}

.cm-wheel-dial-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 0;
}

#ahClassicWrap #ahWheelCanvas {
  width: min(100%, 22vh, 142px) !important;
  width: min(100%, calc(var(--app-vh, 100vh) * 0.22), 142px) !important;
  width: min(100%, 22dvh, 142px) !important;
  height: min(100%, 22vh, 142px) !important;
  height: min(100%, calc(var(--app-vh, 100vh) * 0.22), 142px) !important;
  height: min(100%, 22dvh, 142px) !important;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid var(--cm-border);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.75);
}

.cm-wh-phase {
  font-size: 10px;
  font-weight: 900;
  color: var(--cm-accent);
  text-align: center;
  line-height: 1.2;
}

#ahClassicWrap #ahWheelQuads.ah-quad-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px !important;
}

#ahClassicWrap .ah-quad-card {
  padding: 4px 5px !important;
  border-radius: 8px !important;
  gap: 2px !important;
  background: rgba(7, 12, 28, 0.88) !important;
  border: 1.2px solid rgba(246, 200, 95, 0.32) !important;
}

#ahClassicWrap .cm-quad-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}
#ahClassicWrap .cm-quad-name {
  font-size: 10px;
  font-weight: 900;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ahClassicWrap .cm-quad-mult {
  font-family: "NovaNumeral", var(--mono, monospace);
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
  flex-shrink: 0;
}
#ahClassicWrap .cm-quad-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: #cbd5e1;
}
#ahClassicWrap .cm-quad-act {
  font-weight: 800;
  color: #94a3b8;
  white-space: nowrap;
}
#ahClassicWrap .ah-quad-card.mounted .cm-quad-act {
  color: var(--cm-accent, #f6c85f);
}

.cm-wh-hist-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.32);
  border: none;
  flex-shrink: 0;
  overflow: hidden;
}

#ahWhHistStrip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  flex: 1;
}

/* ==================== 5. 底部无死框主控台 + 星图自动勘探中枢 + V16 自定义充能托盘 ==================== */
.cm-console-dock {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 4px 2px;
  margin: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(6, 10, 24, 0.42), rgba(4, 7, 16, 0.86));
  border: none;
  border-top: 1px solid rgba(246, 200, 95, 0.22);
  box-shadow: none;
  flex-shrink: 0;
  z-index: 12;
}

/* 星图专属单行紧凑自动勘探控制条 */
.cm-mn-auto-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 26px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.cm-auto-mode-seg {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1px;
  flex-shrink: 0;
}

.cm-am-btn {
  height: 22px;
  padding: 0 7px;
  border-radius: 5.5px;
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.cm-am-btn.active {
  background: linear-gradient(180deg, rgba(246, 200, 95, 0.34), rgba(16, 185, 129, 0.28));
  color: #fff;
  box-shadow: 0 0 6px rgba(246, 200, 95, 0.25);
}

.cm-auto-inline-hint {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 10px;
  color: rgba(203, 213, 225, 0.72);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-auto-inline-controls {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.cm-auto-inline-controls::-webkit-scrollbar {
  display: none;
}

.cm-auto-mini-chip {
  height: 24px;
  padding: 0 5.5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cm-auto-mini-chip.active {
  background: linear-gradient(180deg, rgba(246, 200, 95, 0.36), rgba(15, 23, 42, 0.92));
  border-color: var(--cm-accent);
  color: #fffbeb;
}

.cm-auto-mini-chip.strat-on {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.34), rgba(16, 185, 129, 0.26));
  border-color: #fbbf24;
  color: #fef08a;
}

.cm-auto-picks-stepper {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.42);
  flex-shrink: 0;
  overflow: hidden;
}

.cm-auto-step-btn {
  width: 18px;
  height: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cm-accent);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}

.cm-auto-picks-val {
  padding: 0 4px;
  font-size: 9.5px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.cm-stake-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.cm-stake-box {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid var(--cm-border);
  min-width: 66px;
  max-width: 124px;
  flex: 1 1 78px;
  overflow: hidden;
  box-sizing: border-box;
}

.cm-stake-box .lbl {
  font-size: 9.5px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.78);
  white-space: nowrap;
}

#ahClassicWrap #ahStakeInput.ah-stake-inp {
  width: 100% !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 22px !important;
  padding: 0 2px !important;
  border: none !important;
  background: transparent !important;
  color: var(--cm-accent) !important;
  font-family: "NovaNumeral", var(--mono, monospace) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-align: right !important;
  outline: none;
  box-sizing: border-box !important;
}

.cm-chip-btn {
  height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid var(--cm-border);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: "NovaNumeral", var(--mono, monospace);
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 430px) {
  .cm-stake-box .lbl {
    display: none !important;
  }
  .cm-chip-btn {
    padding: 0 5px;
    font-size: 10px;
  }
}

/* ==================== 6. 千里江山(白玉松烟) / 黑金皇冠(酒红) / 星月苍穹(钴蓝) 盘面真材质复刻 ==================== */
#ahClassicWrap.skin-qianli .cm-formula-bar {
  background: linear-gradient(90deg, rgba(255, 253, 247, 0.94) 0%, rgba(243, 235, 217, 0.96) 50%, rgba(255, 253, 247, 0.94) 100%);
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
#ahClassicWrap.skin-qianli .cm-formula-text {
  color: #103029;
  text-shadow: none;
}
#ahClassicWrap.skin-qianli .cm-formula-text b {
  color: #991b1b;
}
#ahClassicWrap.skin-qianli .cm-trial-pill {
  background: #0f766e;
  border-color: #d4af37;
  color: #fef9c3;
}
#ahClassicWrap.skin-qianli .cm-explain-btn {
  background: #134e48;
  border-color: #c59b27;
  color: #fef08a;
}
#ahClassicWrap.skin-qianli .cm-exp-body {
  background: rgba(255, 253, 247, 0.95);
  border-color: #c59b27;
  color: #103029;
}
#ahClassicWrap.skin-qianli .cm-exp-body b {
  color: #991b1b;
}

#ahClassicWrap.skin-qianli .cm-mines-telemetry {
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.92), rgba(238, 228, 204, 0.88));
}
#ahClassicWrap.skin-qianli .cm-mini-stat {
  border-right-color: rgba(16, 48, 41, 0.16);
}
#ahClassicWrap.skin-qianli .cm-mn-step-pill {
  background: rgba(16, 48, 41, 0.08);
  border-color: rgba(197, 155, 39, 0.45);
  color: #103029;
}
#ahClassicWrap.skin-qianli .cm-mn-step-pill b {
  color: #991b1b;
}
#ahClassicWrap.skin-qianli .cm-mn-step-pill.target {
  background: #0f766e;
  border-color: #d4af37;
  color: #fffbeb;
}
#ahClassicWrap.skin-qianli .cm-mn-step-pill.target b {
  color: #fef08a;
}

#ahClassicWrap.skin-qianli .ah-mine-tile:not(.safe):not(.rift):not(.shielded),
#ahClassicWrap.skin-qianli .ah-tower-row:not(.cur):not(.passed),
#ahClassicWrap.skin-qianli .ah-quad-card {
  background: linear-gradient(180deg, #ffffff 0%, #f4ecda 68%, #ded1b5 100%) !important;
  border: 1.4px solid #c59b27 !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 6px rgba(16, 48, 41, 0.22) !important;
}
#ahClassicWrap.skin-qianli .ah-quad-card.mounted {
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 100%) !important;
  border: 1.5px solid #b91c1c !important;
}
#ahClassicWrap.skin-qianli .cm-mini-stat .k,
#ahClassicWrap.skin-qianli .ah-mine-tile .heat,
#ahClassicWrap.skin-qianli .cm-quad-bot {
  color: #265348 !important;
  font-weight: 800;
}
#ahClassicWrap.skin-qianli .cm-mini-stat .v,
#ahClassicWrap.skin-qianli .cm-tw-fl,
#ahClassicWrap.skin-qianli .ah-quad-card.mounted .cm-quad-act {
  color: #991b1b !important;
}
#ahClassicWrap.skin-qianli .cm-tw-mult,
#ahClassicWrap.skin-qianli .cm-quad-name {
  color: #103029 !important;
}
#ahClassicWrap.skin-qianli .cm-quad-act {
  color: #0f766e !important;
}
#ahClassicWrap.skin-qianli .ah-tw-door {
  background: rgba(16, 68, 62, 0.14) !important;
  border-color: #c59b27 !important;
}
#ahClassicWrap.skin-qianli #ahPlinkoCanvas {
  background: radial-gradient(circle at 50% 22%, rgba(20, 78, 70, 0.55), rgba(6, 28, 25, 0.65)) !important;
}
#ahClassicWrap.skin-qianli .cm-console-dock {
  background: linear-gradient(180deg, rgba(14, 56, 50, 0.55), rgba(8, 34, 30, 0.92));
  border-top-color: rgba(212, 175, 55, 0.35);
}
#ahClassicWrap.skin-qianli .cm-stake-box {
  background: #fffdf7;
  border-color: #c59b27;
}
#ahClassicWrap.skin-qianli #ahStakeInput.ah-stake-inp {
  color: #991b1b !important;
}
#ahClassicWrap.skin-qianli .cm-chip-btn {
  background: linear-gradient(180deg, #fffdf7 0%, #eae0c8 100%);
  border-color: #c59b27;
  color: #103029;
}
#ahClassicWrap.skin-qianli .cm-chip-btn.custom {
  background: #134e48;
  color: #fef08a;
}

#ahClassicWrap.skin-royal .ah-mine-tile:not(.safe):not(.rift):not(.shielded),
#ahClassicWrap.skin-royal .ah-tower-row:not(.cur):not(.passed),
#ahClassicWrap.skin-royal .ah-quad-card {
  background: radial-gradient(circle at 50% 38%, #5c0d1c 0%, #2d050d 72%, #180207 100%) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
}
#ahClassicWrap.skin-royal #ahPlinkoCanvas {
  background: radial-gradient(circle at 50% 22%, rgba(76, 10, 24, 0.48), rgba(20, 3, 8, 0.62)) !important;
}
#ahClassicWrap.skin-royal .cm-console-dock {
  background: linear-gradient(180deg, rgba(52, 7, 16, 0.50), rgba(26, 3, 8, 0.90));
}

#ahClassicWrap.skin-starry .ah-mine-tile:not(.safe):not(.rift):not(.shielded),
#ahClassicWrap.skin-starry .ah-tower-row:not(.cur):not(.passed),
#ahClassicWrap.skin-starry .ah-quad-card {
  background: radial-gradient(circle at 50% 38%, #1e4294 0%, #0d2052 72%, #06102b 100%) !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
}
#ahClassicWrap.skin-starry #ahPlinkoCanvas {
  background: radial-gradient(circle at 50% 22%, rgba(26, 58, 138, 0.48), rgba(7, 16, 42, 0.62)) !important;
}
#ahClassicWrap.skin-starry .cm-console-dock {
  background: linear-gradient(180deg, rgba(14, 34, 78, 0.50), rgba(7, 16, 42, 0.90));
}

.cm-chip-btn.custom {
  background: linear-gradient(135deg, rgba(246, 200, 95, 0.24), rgba(56, 189, 248, 0.2));
  color: var(--cm-accent);
  font-family: inherit;
}

/* 3D 精雕双宝石主动作按钮排 */
.cm-cta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cm-3d-btn {
  flex: 1 1 auto;
  height: 39px;
  border-radius: 10px;
  border: 1.5px solid var(--cm-border);
  background-image: var(--cm-btn-main);
  background-size: 100% 100%;
  background-position: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-3d-btn.alt {
  flex: 0 0 auto;
  background-image: var(--cm-btn-alt);
  font-size: 11.5px;
  padding: 0 11px;
}

.cm-3d-btn.cash {
  border-color: #34d399;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.42);
}

.cm-3d-btn.auto-run {
  background-image: linear-gradient(135deg, #065f46 0%, #047857 48%, #0f766e 100%);
  border-color: #6ee7b7;
}

.cm-3d-btn.auto-stop {
  background-image: linear-gradient(135deg, #991b1b 0%, #b45309 100%);
  border-color: #fde68a;
}

.cm-3d-btn:disabled {
  opacity: 0.48;
  filter: grayscale(0.45);
  cursor: not-allowed;
}

.cm-3d-btn:not(:disabled):active {
  transform: translateY(1px) scale(0.985);
}

/* ==================== 7. ⚡ 自动调能与风控策略浮窗（还原审核预览图 2） ==================== */
#cmAutoStratModal .cm-strat-card {
  max-width: 392px;
  width: 92vw;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cm-strat-base-pill {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(246, 200, 95, 0.14);
  border: 1px solid rgba(246, 200, 95, 0.45);
  color: #fde68a;
  font-size: 10.5px;
  font-weight: 800;
  margin-top: -4px;
}

.cm-strat-sec {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(4, 8, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cm-strat-sec-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.cm-strat-sec-title small {
  font-size: 10px;
  font-weight: 700;
  color: rgba(203, 213, 225, 0.72);
}

.cm-strat-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.cm-strat-opt-btn {
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.cm-strat-opt-btn.active {
  background: linear-gradient(180deg, rgba(246, 200, 95, 0.34), rgba(15, 23, 42, 0.92));
  border-color: #fbbf24;
  color: #fffbeb;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.24);
}

.cm-strat-opt-btn.active.emerald {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.34), rgba(6, 46, 38, 0.92));
  border-color: #34d399;
  color: #ecfdf5;
}

.cm-strat-pct-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.cm-strat-pct-row.dim {
  opacity: 0.48;
}

.cm-strat-pct-chip {
  height: 27px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.cm-strat-pct-chip.active {
  background: linear-gradient(180deg, #fde68a, #d97706);
  border-color: #fef08a;
  color: #1e1b4b;
  font-weight: 900;
}

.cm-strat-pct-inp-wrap {
  flex: 1 1 auto;
  min-width: 66px;
  height: 27px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(246, 200, 95, 0.42);
  background: rgba(0, 0, 0, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  font-size: 10px;
  color: #cbd5e1;
}

.cm-strat-pct-inp-wrap input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fde68a;
  font-family: "NovaNumeral", var(--mono, monospace);
  font-size: 11.5px;
  font-weight: 900;
  text-align: right;
  outline: none;
}

.cm-strat-guards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.cm-strat-guard-box {
  padding: 6px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.cm-strat-guard-box.win {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(52, 211, 153, 0.35);
}

.cm-strat-guard-box.loss {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(251, 191, 36, 0.35);
}

.cm-strat-guard-box label {
  font-size: 9.5px;
  font-weight: 800;
  color: #cbd5e1;
  white-space: nowrap;
}

.cm-strat-guard-box input {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #ffffff;
  font-family: "NovaNumeral", var(--mono, monospace);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  outline: none;
  padding: 1px 0;
}

.cm-strat-guard-box.win input {
  color: #34d399;
}
.cm-strat-guard-box.loss input {
  color: #fbbf24;
}

.cm-strat-guard-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(246, 200, 95, 0.18);
  color: #fde68a;
  font-weight: 800;
}

.cm-strat-note {
  font-size: 10px;
  line-height: 1.4;
  color: rgba(203, 213, 225, 0.78);
  text-align: center;
}

.cm-strat-trial-tip {
  font-size: 10px;
  line-height: 1.35;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  text-align: center;
}

.cm-strat-foot {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
  margin-top: 2px;
}

/* 大字护眼模式兼容：放大字号但单行裂隙栏与 100dvh 单屏绝不撑破 */
body.nova-bigfont-on #ahClassicWrap .cm-formula-text {
  font-size: 12.5px;
}
body.nova-bigfont-on #ahClassicWrap .cm-3d-btn {
  font-size: 14px;
}
body.nova-bigfont-on #ahClassicWrap .cm-tw-fl,
body.nova-bigfont-on #ahClassicWrap .cm-tw-mult {
  font-size: 10.5px;
}
body.nova-bigfont-on #ahClassicWrap .cm-mines-rift-bar {
  flex-wrap: nowrap !important;
}

/* 超矮屏幕（高度 <= 740px / <= 700px）自适应压缩间距，确保 360×692 / 360×740 零滚动条 */
@media (max-height: 740px) {
  #ahClassicWrap #ahMinesGrid.ah-mines-grid {
    width: min(96%, calc(100vh - 322px), 344px) !important;
    width: min(96%, calc(var(--app-vh, 100vh) - 322px), 344px) !important;
    width: min(96%, calc(100dvh - 322px), 344px) !important;
    gap: 5px !important;
  }
}

@media (max-height: 700px) {
  #ahClassicWrap.cm-cabinet-root {
    padding-top: 2px;
    padding-bottom: 3px;
  }
  .cm-topbar { min-height: 28px; }
  .cm-mode-chip { height: 22px; font-size: 10px; }
  .cm-formula-bar { min-height: 24px; }
  .cm-mines-telemetry { padding: 2px 4px 3px; gap: 2px; }
  .cm-3d-btn { height: 34px; font-size: 12px; }
  #ahClassicWrap #ahMinesGrid.ah-mines-grid {
    width: min(94%, calc(100vh - 300px), 296px) !important;
    width: min(94%, calc(var(--app-vh, 100vh) - 300px), 296px) !important;
    width: min(94%, calc(100dvh - 300px), 296px) !important;
    gap: 4px !important;
  }
}
