  :root {
    --bg: #0b1120;
    --panel: #111a2e;
    --border: #24324d;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --gold: #fbbf24;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    background: radial-gradient(1200px 600px at 50% -10%, #1b2b4a 0%, var(--bg) 60%);
    color: var(--text);
    font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
  }
  .shell { width: min(100%, 1020px); }
  header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
  }
  h1 {
    margin: 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: .08em;
    font-weight: 800;
    background: linear-gradient(90deg, #f8fafc, #7dd3fc);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .tagline { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
  .records { display: flex; gap: 10px; align-items: center; }
  .chip {
    border: 1px solid var(--border); background: #0e1729;
    border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .chip b { color: var(--gold); font-size: 15px; margin-left: 6px; }
  .chip.speed b { color: var(--accent); }
  .coin-dot {
    display: inline-grid; place-items: center; width: 16px; height: 16px;
    margin-right: 5px; border-radius: 50%; background: #fbbf24;
    color: #92400e; font-size: 10px; font-weight: 900; vertical-align: -2px;
    box-shadow: inset 0 -1px 2px rgba(146,64,14,.4);
  }
  .icon-btn {
    width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--border); background: #0e1729; color: var(--text);
    font-size: 17px; line-height: 1; display: grid; place-items: center;
  }
  .icon-btn:hover { border-color: var(--accent); }
  .icon-btn.hub-link {
    width: auto; padding: 0 12px; font-size: 12px; font-weight: 700;
    letter-spacing: .02em; text-decoration: none;
  }
  .icon-btn.dev-btn {
    font-size: 10px; font-weight: 900; letter-spacing: .06em; color: #86efac;
  }
  .icon-btn.dev-btn:hover { border-color: #4ade80; }
  .card {
    position: relative; border-radius: 20px; overflow: hidden;
    border: 1px solid var(--border); background: #0d1627;
    box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  }
  canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; touch-action: manipulation; }
  .hud {
    position: absolute; top: 16px; left: 20px; right: 20px;
    display: flex; justify-content: space-between; pointer-events: none;
    font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
  }
  .hud .label { opacity: .65; font-size: 11px; font-weight: 600; margin-right: 6px; }
  .hud > div {
    background: rgba(15, 23, 42, .62);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: 5px 12px;
  }
  .overlay {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(8, 15, 30, .62); backdrop-filter: blur(3px);
    text-align: center; padding: 20px; transition: opacity .22s ease;
  }
  .overlay.hidden { opacity: 0; pointer-events: none; }
  .panel { max-width: 460px; }
  .panel .eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .25em; margin-bottom: 10px; }
  .panel h2 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 38px); letter-spacing: .05em; }
  .panel p { margin: 0 0 20px; color: #cbd5e1; font-size: 14px; line-height: 1.8; }
  .panel .final { color: var(--gold); font-weight: 800; font-size: 22px; }
  button.primary {
    appearance: none; border: 0; cursor: pointer; padding: 13px 28px;
    border-radius: 999px; font-weight: 800; font-size: 15px; letter-spacing: .05em;
    color: #052033; background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: 0 8px 24px rgba(56,189,248,.28);
  }
  button.primary:hover { filter: brightness(1.08); }
  button.primary:active { transform: translateY(1px); }
  .panel-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
  button.secondary {
    appearance: none; cursor: pointer; padding: 12px 24px;
    border-radius: 999px; font-weight: 800; font-size: 15px; letter-spacing: .05em;
    color: var(--text); background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.2);
  }
  button.secondary:hover { background: rgba(255,255,255,.13); }
  button.secondary:active { transform: translateY(1px); }
  /* 复活币复活按钮：粉色强调 */
  button#reviveCoinBtn {
    color: #fda4af; border-color: rgba(244,63,94,.55);
    background: rgba(244,63,94,.12);
  }
  button#reviveCoinBtn:hover { background: rgba(244,63,94,.24); }
  button.hidden { display: none; }
  kbd {
    background: #1e293b; border: 1px solid #334155; border-bottom-width: 2px;
    border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: inherit;
  }
  .footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-top: 14px; flex-wrap: wrap;
  }
  .hint { color: var(--muted); font-size: 13px; line-height: 1.8; }
  .hint .mobile { display: none; }
  .touch { display: none; gap: 10px; }
  .touch button {
    min-width: 92px; padding: 12px 18px; border-radius: 14px; cursor: pointer;
    border: 1px solid var(--border); background: #16223a; color: var(--text);
    font-weight: 700; font-size: 14px; touch-action: manipulation;
  }
  .touch button:active { background: #243a5e; }

  /* ---- 主页 ------------------------------------------------------------ */
  .home-ui {
    position: absolute; inset: 0; pointer-events: none;
    display: flex; align-items: flex-end; justify-content: space-between;
    padding: 18px 22px; transition: opacity .25s ease;
  }
  .home-ui.hidden { opacity: 0; pointer-events: none; }
  .hud.hidden { display: none; }
  .home-title { position: absolute; top: 16px; left: 22px; text-shadow: 0 2px 8px rgba(0,0,0,.65); }
  .home-eyebrow { color: #fcd34d; font-size: 10px; letter-spacing: .3em; font-weight: 800; }
  .home-sub { margin-top: 5px; color: #f8fafc; font-size: 15px; font-weight: 700; }
  .home-coins {
    margin-top: 8px; color: #fde68a; font-size: 13px; font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,.65);
  }
  .home-coins b { font-size: 16px; color: #fbbf24; }
  /* 主页背包：默认收成一个按钮，点开才展开物品列表 */
  .home-inventory {
    position: absolute; left: 22px; bottom: 76px; width: auto;
    padding: 6px; border-radius: 14px;
    background: rgba(12,20,34,.76); border: 1px solid rgba(148,163,184,.24);
    backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .home-inventory.expanded { width: 288px; padding: 10px 12px; }
  .inv-toggle {
    pointer-events: auto; cursor: pointer; font-family: inherit; white-space: nowrap;
    font-size: 12px; font-weight: 800; color: #e0f2fe;
    background: rgba(56,189,248,.12); border: 1px solid rgba(125,211,252,.3);
    border-radius: 9px; padding: 6px 10px;
  }
  .inv-toggle:hover { background: rgba(56,189,248,.24); }
  .inv-badge {
    display: inline-block; min-width: 18px; margin-left: 4px; padding: 1px 5px;
    border-radius: 999px; background: #38bdf8; color: #052033; font-size: 10px; text-align: center;
  }
  .inv-body { display: none; margin-top: 9px; }
  .home-inventory.expanded .inv-body { display: block; }
  .inv-title { color: #93c5fd; font-size: 11px; font-weight: 800; letter-spacing: .08em; margin-bottom: 7px; }
  .inv-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; max-height: 128px; overflow: auto; }
  .inv-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #e2e8f0; }
  .inv-icon { font-size: 13px; line-height: 1; }
  .inv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inv-count { color: #fbbf24; font-weight: 800; font-variant-numeric: tabular-nums; }
  .inv-empty { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
  /* 签到币重签按钮：放在墙上日历下方 */
  .resign-btn {
    position: absolute; right: 2.2%; top: 52%; pointer-events: auto; cursor: pointer;
    padding: 6px 10px; border-radius: 10px; font: 800 11px/1.2 inherit; font-family: inherit;
    color: #fde68a; background: rgba(12,30,48,.82);
    border: 1px solid rgba(253,224,71,.45); backdrop-filter: blur(6px);
    transition: filter .15s ease, transform .12s ease;
  }
  .resign-btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
  .resign-btn:disabled { opacity: .45; cursor: not-allowed; }
  .resign-cost { opacity: .8; font-size: 10px; margin-left: 3px; }
  .resign-cost b { color: #fbbf24; }
  .home-left { display: flex; gap: 10px; }
  .home-right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
  /* 隐藏装备：开始按钮上方的复选框式小开关 */
  .hide-gear {
    pointer-events: auto; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 2px; background: none; border: 0; font-family: inherit;
    font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #94a3b8;
    transition: color .16s ease;
  }
  .hide-gear:hover { color: #cbd5e1; }
  .hide-gear-box {
    width: 15px; height: 15px; border-radius: 4px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid rgba(148,163,184,.7); background: rgba(15,23,42,.6);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
  }
  .hide-gear-box::after {
    content: '✓'; font-size: 12px; font-weight: 900; line-height: 1; color: #062033;
    opacity: 0; transform: scale(.55);
    transition: opacity .14s ease, transform .14s ease;
  }
  .hide-gear.on { color: #e2e8f0; }
  .hide-gear.on .hide-gear-box {
    border-color: #38bdf8; background: #38bdf8;
    box-shadow: 0 0 10px rgba(56,189,248,.45);
  }
  .hide-gear.on .hide-gear-box::after { opacity: 1; transform: scale(1); }
  .home-btn {
    pointer-events: auto; cursor: pointer; border-radius: 12px;
    padding: 10px 18px; font-weight: 800; font-size: 14px; font-family: inherit;
    color: #f8fafc; background: rgba(18,26,42,.74);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0,0,0,.3);
    transition: transform .12s ease, background .18s ease, filter .18s ease;
  }
  .home-btn:hover { background: rgba(32,47,74,.92); transform: translateY(-1px); }
  .home-btn:active { transform: translateY(1px); }
  /* 天赋 / 装备 / 改造：加大按钮与图标 */
  .home-btn.menu-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 22px; font-size: 16px; border-radius: 14px;
  }
  .home-btn.menu-btn .btn-icon {
    font-size: 20px; line-height: 1; color: var(--gold);
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
  }
  .home-btn.start {
    padding: 12px 26px; font-size: 15px; color: #052033; border: 0;
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: 0 8px 24px rgba(56,189,248,.35);
  }
  .home-btn.start:hover { filter: brightness(1.08); }
  .home-toast {
    position: absolute; top: 52px; left: 50%;
    transform: translateX(-50%) translateY(-6px);
    padding: 7px 16px; border-radius: 999px; white-space: nowrap;
    font-size: 12px; color: #cbd5e1;
    background: rgba(15,23,42,.8); border: 1px solid rgba(255,255,255,.16);
    opacity: 0; transition: opacity .25s ease, transform .25s ease;
  }
  .home-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .home-toast b { color: var(--gold); font-size: 14px; }
  /* 局内事件提示：独立于主页 UI，主页隐藏时仍可见 */
  .game-toast {
    position: absolute; top: 64px; left: 50%;
    transform: translateX(-50%) translateY(-6px);
    padding: 8px 18px; border-radius: 999px; white-space: nowrap;
    font-size: 13px; font-weight: 600; color: #e2e8f0;
    background: rgba(15,23,42,.86); border: 1px solid rgba(125,211,252,.45);
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
  }
  .game-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .game-toast b { color: var(--gold); }
  /* BOSS 登场提示：红底 + 骷髅标志 */
  .boss-banner {
    position: absolute; top: 96px; left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(.94);
    padding: 9px 22px; border-radius: 12px; white-space: nowrap;
    font-size: 14px; font-weight: 800; color: #fff1f2;
    background: linear-gradient(135deg, rgba(127,29,29,.94), rgba(69,10,10,.94));
    border: 1px solid rgba(248,113,113,.75);
    box-shadow: 0 8px 28px rgba(127,29,29,.6), inset 0 0 18px rgba(248,113,113,.18);
    opacity: 0; pointer-events: none; z-index: 4;
    transition: opacity .3s ease, transform .3s ease;
  }
  .boss-banner.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  .boss-banner b { color: #fecaca; font-size: 16px; letter-spacing: .04em; }
  /* 局内道具快捷栏：屏幕右下角 */
  .item-bar {
    position: absolute; right: 16px; bottom: 14px; z-index: 3;
    display: flex; gap: 8px; pointer-events: auto;
  }
  .item-bar.hidden { display: none; }
  .item-slot {
    position: relative; width: 50px; height: 50px; padding: 0; cursor: pointer;
    border-radius: 12px; font-family: inherit;
    background: rgba(15,23,42,.82); border: 1px solid rgba(125,211,252,.4);
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    transition: transform .12s ease, border-color .18s ease, background .18s ease;
  }
  .item-slot:hover:not(.empty) { transform: translateY(-2px); background: rgba(30,47,78,.92); }
  .item-slot.empty { opacity: .45; cursor: not-allowed; }
  .item-slot.active {
    border-color: #fde68a; background: rgba(120,90,20,.55);
    box-shadow: 0 0 16px rgba(253,224,71,.5);
  }
  .item-key {
    position: absolute; top: -6px; left: -6px; width: 17px; height: 17px;
    border-radius: 5px; color: #0f172a; background: #7dd3fc;
    font: 800 10px/17px inherit; text-align: center;
  }
  .item-icon { display: block; font-size: 22px; line-height: 34px; }
  .item-count {
    position: absolute; right: 3px; bottom: 1px; color: #fbbf24;
    font: 800 10px/1 inherit;
  }
  /* 道具生效剩余秒数：贴在图标下方，随倒计时逐秒刷新 */
  .item-timer {
    position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
    min-width: 30px; padding: 0 3px; border-radius: 6px;
    color: #fffbeb; background: rgba(120,53,15,.92);
    border: 1px solid rgba(253,224,71,.55);
    font: 900 10px/13px ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: center; white-space: nowrap;
  }
  .item-slot.active .item-count { display: none; }
  /* 天赋技能冷却条：局内右下角、道具栏上方 */
  .skill-bar {
    position: absolute; right: 16px; bottom: 74px; z-index: 3;
    display: flex; gap: 8px; pointer-events: none;
  }
  .skill-bar.hidden { display: none; }
  .skill-slot {
    position: relative; width: 46px; height: 54px; overflow: hidden;
    border-radius: 11px; text-align: center;
    background: rgba(15,23,42,.85); border: 1px solid rgba(251,113,133,.55);
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
  }
  .skill-key {
    position: absolute; top: 2px; left: 3px; z-index: 2;
    color: #fecdd3; font: 800 10px/1 inherit;
  }
  .skill-icon { display: block; font-size: 22px; line-height: 34px; }
  .skill-name { display: block; color: #cbd5e1; font: 800 9px/1.2 inherit; }
  .skill-cd {
    position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
    color: #fff; font: 900 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    text-shadow: 0 1px 3px #000;
  }
  .skill-cd.hidden { display: none; }
  .skill-mask {
    position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 1;
    background: rgba(2,6,23,.72); pointer-events: none;
  }
  .skill-slot.cooling { border-color: rgba(100,116,139,.5); filter: saturate(.5); }
  /* 墙上日历的签到热区：与 canvas 里的日历对齐（按画布 960×420 换算成百分比） */
  .checkin-hit {
    position: absolute; left: 83.5%; top: 11.9%; width: 12%; height: 38%;
    pointer-events: auto; cursor: pointer; border-radius: 4px;
    transition: background .18s ease;
  }
  .checkin-hit:hover { background: rgba(253, 230, 138, .12); }
  .checkin-hit:active { background: rgba(253, 230, 138, .2); }

  /* ---- 实验室 ---------------------------------------------------------- */
  .lab-ui { position: absolute; inset: 0; pointer-events: none; transition: opacity .25s ease; }
  .lab-ui.hidden { opacity: 0; pointer-events: none; }
  .lab-back {
    position: absolute; bottom: 16px; left: 16px; pointer-events: auto; cursor: pointer;
    padding: 8px 16px; border-radius: 10px; font: 800 13px/1 inherit; font-family: inherit;
    color: #e0f2fe; background: rgba(12,30,48,.86); border: 1px solid rgba(125,211,252,.4);
    backdrop-filter: blur(6px);
  }
  .lab-back:hover { background: rgba(20,52,80,.96); }
  .lab-title { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; }
  .lab-eyebrow { color: #7dd3fc; font-size: 10px; letter-spacing: .3em; font-weight: 800; }
  .lab-sub { margin-top: 3px; color: #e0f2fe; font-size: 14px; font-weight: 700; }
  .lab-balance {
    position: absolute; top: 14px; right: 16px; color: #fde68a; font-size: 13px; font-weight: 700;
    background: rgba(12,30,48,.8); border: 1px solid rgba(253,224,71,.25);
    padding: 6px 12px; border-radius: 10px; backdrop-filter: blur(6px);
  }
  .lab-balance b { font-size: 15px; color: #fbbf24; }

  /* ---- 改造进化面板 ---------------------------------------------------- */
  .lab-evo {
    position: absolute; left: 56px; top: 56px; width: 236px; max-height: 172px;
    overflow-y: auto; pointer-events: auto; padding: 9px 11px 11px; border-radius: 12px;
    background: rgba(9,22,38,.88); border: 1px solid rgba(253,224,71,.36);
    backdrop-filter: blur(8px); box-shadow: 0 10px 26px rgba(0,0,0,.42);
    scrollbar-width: thin;
  }
  .lab-evo.hidden { display: none; }
  .evo-eyebrow { color: #fde68a; font-size: 9px; letter-spacing: .2em; font-weight: 800; }
  .evo-title { margin-top: 2px; color: #f8fafc; font-size: 13px; font-weight: 800; }
  .evo-title span { color: #fbbf24; font-size: 11px; margin-left: 4px; }
  .evo-current { margin-top: 2px; color: #93c5fd; font-size: 10px; font-weight: 700; }
  .evo-desc, .evo-hint { margin-top: 5px; color: #94a3b8; font-size: 10px; line-height: 1.45; }
  .evo-row {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 3px 5px; margin-top: 3px; border-radius: 6px;
    background: rgba(255,255,255,.04); color: #cbd5e1; font-size: 10px;
  }
  .evo-row.short { background: rgba(248,113,113,.12); }
  .evo-have { color: #86efac; font-weight: 800; }
  .evo-have.short { color: #fda4af; }
  .evo-bar { height: 6px; margin-top: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
  .evo-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fbbf24, #f472b6); transition: width .4s linear; }
  .evo-clock { margin-top: 5px; color: #fde68a; font: 900 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
  .evo-go {
    width: 100%; margin-top: 7px; padding: 6px 8px; border: 0; border-radius: 8px;
    cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 800;
    color: #3b1d05; background: linear-gradient(135deg, #fde68a, #fbbf24);
    box-shadow: 0 4px 12px rgba(251,191,36,.3);
  }
  .evo-go:hover:not(:disabled) { filter: brightness(1.08); }
  .evo-go:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }

  .lab-part {
    position: absolute; pointer-events: auto; cursor: pointer;
    display: flex; align-items: center; gap: 7px;
    padding: 8px 12px; border-radius: 12px; font-family: inherit;
    color: #e2e8f0; background: rgba(12,30,48,.86);
    border: 1px solid var(--pc); backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0,0,0,.35), inset 0 0 14px color-mix(in srgb, var(--pc) 12%, transparent);
    transition: transform .12s ease, background .18s ease, box-shadow .18s ease;
  }
  .lab-part:hover { transform: translateY(-1px); background: rgba(20,48,74,.95); box-shadow: 0 8px 22px rgba(0,0,0,.45), 0 0 16px color-mix(in srgb, var(--pc) 45%, transparent); }
  .lab-part:active { transform: translateY(1px); }
  .lab-part.maxed { opacity: .72; }
  .lab-part.top { top: 62px; left: 50%; transform: translateX(-50%); }
  .lab-part.top:hover { transform: translateX(-50%) translateY(-1px); }
  .lab-part.bottom { bottom: 16px; left: 50%; transform: translateX(-50%); }
  .lab-part.bottom:hover { transform: translateX(-50%) translateY(-1px); }
  .lab-part.left { left: 18px; top: 50%; transform: translateY(-50%); }
  .lab-part.left:hover { transform: translateY(-50%) translateX(-2px); }
  .lab-part.right { right: 18px; top: 50%; transform: translateY(-50%); }
  .lab-part.right:hover { transform: translateY(-50%) translateX(2px); }
  .lab-part-icon { font-size: 18px; line-height: 1; color: var(--pc); }
  .lab-part-name { font-size: 13px; font-weight: 800; }
  .lab-part-pips { display: inline-flex; gap: 3px; }
  .lab-part-pips i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.2); }
  .lab-part-pips i.on { background: var(--pc); box-shadow: 0 0 6px var(--pc); }
  .lab-part-cost { font-size: 11px; font-weight: 800; color: #fde68a; margin-left: 2px; }

  /* ---- 实验室：选中部位后的详情视图 ------------------------------------ */
  .lab-ui.detail .lab-part:not(.selected) { display: none; }
  .lab-ui.detail .lab-part.selected {
    top: 58px; right: 18px; left: auto; bottom: auto;
    transform: none; padding: 9px 14px;
  }
  .lab-ui.detail .lab-part.selected:hover { transform: translateY(-1px); }
  .lab-detail {
    position: absolute; top: 108px; right: 18px; width: 352px;
    pointer-events: auto; padding: 12px 14px 14px; border-radius: 14px;
    background: rgba(9,22,38,.88); border: 1px solid rgba(125,211,252,.28);
    backdrop-filter: blur(8px); box-shadow: 0 12px 32px rgba(0,0,0,.4);
  }
  .lab-detail.hidden { display: none; }
  .detail-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 10px;
  }
  .detail-head-main { min-width: 0; }
  .detail-eyebrow { color: #7dd3fc; font-size: 9px; letter-spacing: .2em; font-weight: 800; }
  .detail-name { margin-top: 3px; color: #f8fafc; font-size: 15px; font-weight: 800; }
  .detail-name span { color: var(--gold); font-size: 12px; margin-left: 6px; }
  .detail-back {
    flex: none; cursor: pointer; font-family: inherit; font-size: 10px; font-weight: 700;
    color: #bae6fd; background: rgba(56,189,248,.12);
    border: 1px solid rgba(125,211,252,.32); border-radius: 8px; padding: 5px 8px;
  }
  .detail-back:hover { background: rgba(56,189,248,.24); }
  .level-table { display: grid; gap: 3px; }
  .level-head, .level-row {
    display: grid; grid-template-columns: 34px 46px 1fr 72px;
    align-items: center; gap: 4px; font-size: 10px;
  }
  .level-head { color: #7dd3fc; font-weight: 800; padding: 0 2px 3px; border-bottom: 1px solid rgba(125,211,252,.18); }
  .level-row {
    padding: 4px 2px; border-radius: 6px; color: #cbd5e1;
    background: rgba(255,255,255,.03);
  }
  .level-row.done { opacity: .48; }
  .level-row.next { background: rgba(56,189,248,.14); color: #f8fafc; outline: 1px solid rgba(56,189,248,.35); }
  .level-lv { font-weight: 800; color: #e0f2fe; }
  .level-cost { color: #fbbf24; font-weight: 800; }
  .level-mat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .level-mat.short { color: #fda4af; }
  .level-stat { color: #86efac; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .detail-action {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px;
  }
  .detail-hint { color: #94a3b8; font-size: 10px; }
  .detail-upgrade {
    cursor: pointer; font-family: inherit; font-weight: 800; font-size: 12px;
    padding: 8px 14px; border-radius: 9px; border: 0;
    color: #052033; background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: 0 6px 16px rgba(56,189,248,.25);
  }
  .detail-upgrade:hover:not(:disabled) { filter: brightness(1.1); }
  .detail-upgrade:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

  /* ---- 实验室：装备视图 ------------------------------------------------ */
  .lab-ui.equip-mode .lab-parts, .lab-ui.equip-mode .lab-detail { display: none; }
  .lab-equip {
    position: absolute; top: 92px; right: 18px; width: 330px;
    pointer-events: auto; padding: 12px 14px 14px; border-radius: 14px;
    background: rgba(9,22,38,.88); border: 1px solid rgba(125,211,252,.28);
    backdrop-filter: blur(8px); box-shadow: 0 12px 32px rgba(0,0,0,.4);
  }
  .lab-ui:not(.equip-mode) .lab-equip { display: none; }
  .equip-head { margin-bottom: 10px; }
  .equip-eyebrow { color: #7dd3fc; font-size: 9px; letter-spacing: .2em; font-weight: 800; }
  .equip-title { margin-top: 3px; color: #f8fafc; font-size: 15px; font-weight: 800; }
  .equip-list { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; padding-right: 2px; }
  .equip-item {
    display: grid; grid-template-columns: 26px 1fr auto auto auto; align-items: center; gap: 6px;
    padding: 8px 10px; border-radius: 10px; font-size: 12px; color: #e2e8f0;
    background: var(--rank-soft, rgba(255,255,255,.05));
    border: 1px solid var(--rank, rgba(125,211,252,.18));
    border-left: 3px solid var(--rank, #7dd3fc);
    cursor: grab;
  }
  .equip-item:active { cursor: grabbing; }
  .equip-item.empty { opacity: .42; cursor: not-allowed; }
  .equip-icon { font-size: 17px; line-height: 1; }
  .equip-name { font-weight: 700; }
  .equip-count { color: #fbbf24; font-weight: 800; }
  .equip-state { color: #86efac; font-size: 10px; font-weight: 800; }
  .equip-item.selected { outline: 2px solid var(--rank, #fde68a); outline-offset: 1px; }
  .equip-rank {
    font-style: normal; font-size: 9px; font-weight: 900; color: #0b1220;
    background: var(--rank, #fde68a); border-radius: 4px;
    padding: 1px 4px; line-height: 1.2; text-align: center;
  }
  .equip-detail {
    margin-top: 10px; padding: 10px 11px; border-radius: 10px;
    background: rgba(30,41,59,.85); border: 1px solid var(--rank, rgba(148,163,184,.28));
  }
  .ed-head { display: flex; align-items: center; gap: 8px; }
  .ed-icon { font-size: 22px; line-height: 1; }
  .ed-name { font-size: 13px; font-weight: 800; color: var(--rank, #f8fafc); }
  .ed-meta { font-size: 10px; color: #94a3b8; margin-top: 2px; }
  .ed-effect { margin: 8px 0; font-size: 11px; line-height: 1.5; color: #cbd5e1; }
  .ed-effect span {
    display: inline-block; margin-right: 5px; padding: 0 4px; border-radius: 4px;
    color: #0f172a; background: #7dd3fc; font-size: 9px; font-weight: 800;
  }
  .ed-action {
    width: 100%; padding: 6px 0; border: 0; border-radius: 8px; cursor: pointer;
    font: 800 11px/1 inherit; font-family: inherit; color: #0b1220;
    background: var(--rank, #5eead4);
  }
  .ed-action:disabled { opacity: .4; cursor: not-allowed; }
  .equip-tip { margin: 10px 0 0; color: #94a3b8; font-size: 10px; line-height: 1.6; }
  /* 4 个装备槽：每槽只放一件，升阶后外观随阶位变化 */
  .equip-slots { position: absolute; inset: 0; pointer-events: none; }
  .lab-ui:not(.equip-mode) .equip-slots { display: none; }
  .equip-slot {
    position: absolute; pointer-events: auto; width: 86px; min-height: 62px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 2px dashed rgba(125,211,252,.5); border-radius: 12px;
    background: rgba(8,20,34,.78); color: #bae6fd; text-align: center;
    backdrop-filter: blur(4px); transition: background .15s ease, border-color .15s ease;
  }
  .equip-slot.filled {
    border-style: solid; border-color: var(--tier-color, #86efac);
    background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tier-color, #86efac) 22%, transparent), rgba(8,20,34,.9) 72%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--tier-color, #86efac) 38%, transparent);
  }
  .equip-slot.dragover { background: rgba(56,189,248,.28); border-color: #7dd3fc; }
  .slot-label { font-size: 9px; font-weight: 800; opacity: .75; letter-spacing: .06em; }
  .slot-icon { font-size: 25px; line-height: 1; filter: drop-shadow(0 0 8px var(--tier-color, #fbbf24)); }
  .slot-name { font-size: 9px; font-weight: 800; color: #e2e8f0; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .slot-tier {
    font-size: 8px; font-weight: 900; color: #0b1220; padding: 1px 4px; border-radius: 5px;
    background: var(--tier-color, #fbbf24);
  }
  .slot-remove {
    margin-top: 2px; cursor: pointer; font-family: inherit; font-size: 8px; font-weight: 800;
    color: #fda4af; background: rgba(248,113,113,.12);
    border: 1px solid rgba(248,113,113,.35); border-radius: 6px; padding: 1px 5px;
  }
  .equip-slot[data-slot="head"] { left: 36%; top: 27%; }
  .equip-slot[data-slot="body"] { left: 38%; top: 49%; }
  .equip-slot[data-slot="legs"] { left: 34%; top: 72%; }
  .equip-slot[data-slot="tail"] { left: 12%; top: 52%; }

  /* ---- 淬炼工坊：实验室场景 + 中央大罐子 -------------------------------- */
  .lab-ui.refine-mode .lab-parts, .lab-ui.refine-mode .lab-detail,
  .lab-ui.refine-mode .lab-equip, .lab-ui.refine-mode .equip-slot { display: none; }
  .lab-ui:not(.refine-mode) .refine-ui { display: none; }
  .refine-ui { position: absolute; inset: 0; pointer-events: none; }
  .refine-ui.hidden { display: none; }
  .refine-panel {
    position: absolute; top: 82px; bottom: 70px; width: 286px;
    pointer-events: auto; overflow-y: auto; padding: 12px 13px 14px; border-radius: 14px;
    background: rgba(9,22,38,.9); border: 1px solid rgba(232,121,249,.32);
    backdrop-filter: blur(8px); box-shadow: 0 12px 32px rgba(0,0,0,.42);
  }
  /* 左侧数值/用途栏：稍向右挪并拉长，减少纵向滚动即可看到底部 */
  .refine-stats { left: 34px; top: 60px; bottom: 96px; width: 300px; }
  .refine-cost { right: 18px; }
  .rp-eyebrow { color: #f0abfc; font-size: 9px; letter-spacing: .2em; font-weight: 800; }
  .rp-title { margin-top: 3px; color: #f8fafc; font-size: 15px; font-weight: 800; }
  .rp-icon { font-size: 26px; line-height: 1; filter: drop-shadow(0 0 8px var(--tier-color, #fbbf24)); }
  .rp-head { display: flex; align-items: center; gap: 9px; margin: 10px 0 8px; }
  .rp-head-name { font-size: 13px; font-weight: 800; color: var(--tier-color, #f8fafc); }
  .rp-head-meta { margin-top: 2px; color: #94a3b8; font-size: 10px; }
  .rp-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
    padding: 6px 8px; margin-top: 5px; border-radius: 8px;
    background: rgba(255,255,255,.04); color: #cbd5e1; font-size: 11px;
  }
  .rp-row .rp-label { color: #94a3b8; font-size: 10px; }
  .rp-row .rp-old { color: #cbd5e1; font-weight: 800; }
  .rp-row .rp-arrow { color: #f0abfc; font-weight: 900; margin: 0 3px; }
  .rp-row .rp-new { color: #4ade80; font-weight: 900; text-shadow: 0 0 8px rgba(74,222,128,.35); }
  .rp-use {
    margin-top: 9px; padding: 8px 9px; border-radius: 8px; font-size: 10px; line-height: 1.55;
    color: #cbd5e1; background: rgba(232,121,249,.08); border-left: 2px solid #e879f9;
  }
  .rp-use b { color: #f5d0fe; }
  .rp-empty { margin-top: 14px; color: #94a3b8; font-size: 11px; line-height: 1.7; }
  .cost-row {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 6px 8px; margin-top: 5px; border-radius: 8px;
    background: rgba(255,255,255,.04); font-size: 11px; color: #cbd5e1;
  }
  .cost-row.short { background: rgba(248,113,113,.12); }
  .cost-have { font-weight: 800; color: #86efac; }
  .cost-have.short { color: #fda4af; }
  .cost-hint { margin-top: 8px; color: #94a3b8; font-size: 10px; line-height: 1.5; }
  .refine-go {
    width: 100%; margin-top: 10px; cursor: pointer; font-family: inherit;
    font-weight: 800; font-size: 13px; padding: 10px 14px; border: 0; border-radius: 10px;
    color: #2a0630; background: linear-gradient(135deg, #f5d0fe, #e879f9);
    box-shadow: 0 5px 14px rgba(232,121,249,.3);
  }
  .refine-go:hover:not(:disabled) { filter: brightness(1.08); }
  .refine-go:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
  .refine-job {
    margin-top: 11px; padding: 9px 10px 10px; border-radius: 9px;
    background: rgba(232,121,249,.08); border: 1px solid rgba(232,121,249,.28);
  }
  .rj-head { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #f5d0fe; }
  .rj-head b { color: #fff; }
  .rj-spinner { display: inline-block; font-size: 15px; animation: rjSpin 1.6s linear infinite; }
  @keyframes rjSpin { to { transform: rotate(360deg); } }
  .rj-bar { height: 7px; margin-top: 8px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.1); }
  .rj-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e879f9, #7dd3fc); transition: width .4s linear; }
  .rj-clock { margin-top: 6px; color: #93c5fd; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
  .cost-details { margin-top: 10px; border-top: 1px solid rgba(148,163,184,.2); padding-top: 8px; }
  .cost-summary { cursor: pointer; color: #93c5fd; font-size: 10px; font-weight: 800; }
  .cost-details .refine-item {
    display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 6px;
    margin-top: 5px; padding: 5px 7px; border-radius: 8px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(232,121,249,.2);
  }
  .cost-details .refine-icon { font-size: 16px; }
  .cost-details .refine-name { font-size: 11px; font-weight: 800; color: #e2e8f0; }
  .cost-details .mini-cost { margin-top: 2px; color: #93c5fd; font-size: 10px; }
  .cost-details .refine-go { margin-top: 0; padding: 5px 9px; font-size: 10px; }
  .refine-jar {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 176px; height: 186px; pointer-events: auto; display: grid; place-items: center;
    border: 1px dashed rgba(232,121,249,.38); border-radius: 48% 48% 42% 42% / 22% 22% 34% 34%;
    transition: background .15s ease;
  }
  .refine-jar.dragover { background: rgba(232,121,249,.14); border-color: #f5d0fe; }
  .jar-placeholder { color: #e9d5ff; font-size: 12px; font-weight: 800; text-shadow: 0 0 10px rgba(232,121,249,.7); }
  .jar-item { text-align: center; }
  .jar-item.hidden { display: none; }
  .jar-icon { display: block; font-size: 50px; line-height: 1; filter: drop-shadow(0 0 14px var(--tier-color, #fbbf24)); animation: jarFloat 2.6s ease-in-out infinite; }
  .jar-name { display: block; margin-top: 8px; font-size: 12px; font-weight: 900; color: #f8fafc; }
  .jar-tier { display: inline-block; margin-top: 5px; font-size: 10px; font-weight: 900; color: #0b1220; padding: 2px 7px; border-radius: 6px; background: var(--tier-color, #fbbf24); }
  .jar-state { display: block; margin-top: 5px; font-size: 10px; font-weight: 800; color: #f0abfc; }
  /* 罐口倒计时：淬炼进行中悬在罐子上方，醒目且不遮挡装备 */
  .jar-timer {
    position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
    width: 150px; text-align: center; pointer-events: none;
  }
  .jar-timer.hidden { display: none; }
  .jar-clock {
    display: inline-block; padding: 2px 10px; border-radius: 8px;
    color: #fdf4ff; background: rgba(76,29,90,.92);
    border: 1px solid rgba(232,121,249,.65);
    font: 900 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .08em; text-shadow: 0 0 8px rgba(232,121,249,.8);
    box-shadow: 0 0 16px rgba(232,121,249,.35);
  }
  .jar-bar { display: block; height: 4px; margin-top: 3px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
  .jar-bar b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #e879f9, #7dd3fc); transition: width .4s linear; }
  @keyframes jarFloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }
  .refine-picker-wrap {
    position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    width: 430px; pointer-events: auto; display: flex; align-items: stretch; gap: 4px;
  }
  .refine-picker {
    flex: 1; min-width: 0; max-height: 54px; overflow-x: auto; overflow-y: hidden;
    display: flex; gap: 5px; scroll-behavior: smooth; scrollbar-width: none;
    padding: 6px; border-radius: 11px;
    background: rgba(9,22,38,.9); border: 1px solid rgba(232,121,249,.28);
  }
  .refine-picker::-webkit-scrollbar { display: none; }
  .picker-nav {
    flex: none; width: 26px; cursor: pointer; font-family: inherit;
    font-size: 20px; line-height: 1; color: #f0abfc; border-radius: 10px;
    background: rgba(9,22,38,.9); border: 1px solid rgba(232,121,249,.28);
  }
  .picker-nav:hover { background: rgba(232,121,249,.22); }
  .picker-nav:disabled { opacity: .35; cursor: default; }
  .refine-chip {
    flex: none; cursor: grab; display: flex; align-items: center; gap: 3px;
    padding: 4px 7px; border-radius: 8px; font-size: 11px; font-weight: 800;
    color: #e2e8f0; background: rgba(255,255,255,.06);
    border: 1px solid var(--tier-color, rgba(148,163,184,.4));
  }
  .refine-chip.selected { background: rgba(232,121,249,.22); box-shadow: 0 0 10px rgba(232,121,249,.4); }
  .refine-chip b { color: #fbbf24; font-size: 10px; }

  /* ---- 开发者模式 ------------------------------------------------------ */
  .dev-panel {
    position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
    background: rgba(4,14,14,.74); backdrop-filter: blur(4px); padding: 18px;
  }
  .dev-panel.hidden { display: none; }
  .dev-box {
    position: relative; width: min(100%, 560px); max-height: 90%; overflow: auto;
    border-radius: 16px; padding: 18px 20px 20px;
    background: linear-gradient(160deg, #142b27, #0d1a24);
    border: 1px solid #2f6b57; box-shadow: 0 18px 50px rgba(0,0,0,.55);
  }
  .dev-close {
    position: absolute; top: 10px; right: 12px; width: 30px; height: 30px;
    border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1;
    color: var(--text); background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
  }
  .dev-close:hover { background: rgba(255,255,255,.14); }
  .dev-eyebrow { color: #86efac; font-size: 10px; letter-spacing: .24em; font-weight: 800; }
  .dev-box h3 { margin: 5px 0 14px; font-size: 20px; }
  .dev-amount {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-bottom: 12px; font-size: 12px; color: #cbd5e1;
  }
  .dev-amount button {
    cursor: pointer; font-family: inherit; font-weight: 800; font-size: 11px;
    padding: 5px 9px; border-radius: 8px; border: 1px solid rgba(134,239,172,.3);
    color: #bbf7d0; background: rgba(134,239,172,.1);
  }
  .dev-amount button:hover { background: rgba(134,239,172,.22); }
  .dev-amount input {
    width: 96px; padding: 5px 8px; border-radius: 8px; font-family: inherit;
    font-size: 12px; font-weight: 700; color: #f8fafc;
    background: rgba(6,18,18,.75); border: 1px solid rgba(134,239,172,.35);
  }
  .dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .dev-resource {
    display: grid; grid-template-columns: 22px 1fr auto 64px; align-items: center; gap: 6px;
    padding: 7px 9px; border-radius: 10px; font-size: 12px; color: #e2e8f0;
    background: rgba(255,255,255,.04); border: 1px solid rgba(134,239,172,.14);
  }
  .dev-icon { font-size: 15px; line-height: 1; }
  .dev-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dev-count { color: #fbbf24; font-weight: 800; font-variant-numeric: tabular-nums; }
  .dev-resource button {
    cursor: pointer; font-family: inherit; font-weight: 800; font-size: 11px;
    padding: 5px 6px; border-radius: 7px; border: 0;
    color: #052e16; background: #86efac;
  }
  .dev-resource button:hover { filter: brightness(1.08); }
  .dev-note { margin: 12px 0 0; color: #94a3b8; font-size: 11px; line-height: 1.6; }
  .dev-jump {
    margin-top: 14px; padding-top: 13px; display: flex; flex-direction: column; gap: 7px;
    border-top: 1px dashed rgba(134,239,172,.22);
  }
  .dev-jump-btn {
    cursor: pointer; font-family: inherit; font-weight: 900; font-size: 13px;
    padding: 10px 12px; border-radius: 10px; color: #fecaca;
    background: rgba(248,113,113,.14); border: 1px solid rgba(248,113,113,.42);
  }
  .dev-jump-btn:hover { background: rgba(248,113,113,.24); border-color: #f87171; }
  .dev-jump-btn:active { transform: translateY(1px); }
  .dev-jump-hint { margin: 0; color: #94a3b8; font-size: 11px; line-height: 1.6; }

  .modal {
    position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
    background: rgba(8,15,30,.72); backdrop-filter: blur(4px);
    padding: 18px; transition: opacity .2s ease;
  }
  .modal.hidden { opacity: 0; pointer-events: none; }
  .modal-box {
    position: relative; width: min(100%, 520px); max-height: 88%; overflow: auto;
    border-radius: 16px; padding: 18px 20px 20px;
    background: linear-gradient(160deg, #1b2740, #121b2e);
    border: 1px solid #2e4266; box-shadow: 0 18px 50px rgba(0,0,0,.5);
  }
  .modal-close {
    position: absolute; top: 10px; right: 12px; width: 30px; height: 30px;
    border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1;
    color: var(--text); background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
  }
  .modal-close:hover { background: rgba(255,255,255,.14); }
  .modal-eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .24em; font-weight: 800; }
  .modal-box h3 { margin: 5px 0 14px; font-size: 20px; }
  .modal-list { display: grid; gap: 8px; }
  .modal-item {
    display: flex; gap: 12px; align-items: center; padding: 10px 12px;
    border-radius: 12px; background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
  }
  .modal-item-icon {
    width: 32px; height: 32px; flex: none; border-radius: 9px;
    background: rgba(56,189,248,.14); color: var(--accent);
    display: grid; place-items: center; font-size: 15px;
  }
  .modal-item-main { flex: 1; min-width: 0; }
  .modal-item-name { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
  .modal-item-name span { color: var(--gold); font-size: 11px; font-weight: 600; white-space: nowrap; }
  .modal-item-desc { margin-top: 3px; color: var(--muted); font-size: 11px; }

  /* ---- 天赋树状图 ------------------------------------------------------ */
  .modal-box:has(.talent-tree) { width: min(100%, 680px); }
  .talent-tree { gap: 0; }
  /* 天赋点余额 */
  .tt-balance {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
    margin: 0 auto 10px; padding: 6px 12px; width: fit-content; border-radius: 9px;
    color: #fde68a; font-size: 12px; font-weight: 800;
    background: rgba(253,224,71,.09); border: 1px solid rgba(253,224,71,.3);
  }
  .tt-balance b { font-size: 15px; }
  .tt-balance-note { color: #94a3b8; font-size: 10px; font-weight: 500; }
  /* 核心节点 */
  .tt-root {
    display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 2px auto 0;
    padding: 9px 22px; width: fit-content; border-radius: 14px;
    background: radial-gradient(circle at 50% 0%, rgba(56,189,248,.28), rgba(30,41,59,.9) 72%);
    border: 1px solid rgba(125,211,252,.55);
    box-shadow: 0 0 22px rgba(56,189,248,.32), inset 0 0 12px rgba(125,211,252,.18);
  }
  .tt-root-icon { font-size: 26px; line-height: 1; color: #bae6fd; text-shadow: 0 0 12px #38bdf8; }
  .tt-root-name { color: #e0f2fe; font-size: 12px; font-weight: 800; letter-spacing: .1em; }
  /* 核心往下的主干 */
  .tt-stem { width: 2px; height: 20px; margin: 0 auto; background: linear-gradient(#7dd3fc, #475569); }
  /* 三条分支 */
  .tt-branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; }
  .tt-branches::before {
    content: ''; position: absolute; top: 0; left: 16.66%; right: 16.66%; height: 2px;
    background: linear-gradient(90deg, #7dd3fc, #c4b5fd, #fcd34d); opacity: .7;
  }
  .tbranch {
    position: relative; padding-top: 14px; display: flex; flex-direction: column; align-items: center;
  }
  /* 每个分支顶部连到主干横线的竖线 */
  .tbranch::before {
    content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 14px;
    background: var(--bc, #7dd3fc); opacity: .7;
  }
  .tb-head {
    display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 20px;
    background: color-mix(in srgb, var(--bc, #7dd3fc) 16%, rgba(15,23,42,.92));
    border: 1px solid color-mix(in srgb, var(--bc, #7dd3fc) 60%, transparent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--bc, #7dd3fc) 28%, transparent);
  }
  .tb-icon { font-size: 14px; }
  .tb-name { color: #f8fafc; font-size: 12px; font-weight: 800; }
  .tb-count { color: var(--bc, #7dd3fc); font-size: 10px; font-weight: 800; }
  /* 分支内串联的天赋节点 */
  .tb-nodes { list-style: none; margin: 0; padding: 6px 0 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
  .tnode { position: relative; padding-left: 18px; display: flex; align-items: flex-start; }
  /* 竖向连线：每节点左侧一条线，末节点缩短 */
  .tnode::before {
    content: ''; position: absolute; left: 5px; top: -8px; bottom: -8px; width: 2px;
    background: color-mix(in srgb, var(--bc, #7dd3fc) 45%, transparent);
  }
  .tb-nodes .tnode:first-child::before { top: 50%; }
  .tb-nodes .tnode:last-child::before { bottom: 50%; }
  .tn-dot {
    position: absolute; left: 1px; top: 15px; width: 10px; height: 10px; border-radius: 50%;
    background: #1e293b; border: 2px solid color-mix(in srgb, var(--bc, #7dd3fc) 60%, #475569);
    z-index: 1;
  }
  .tnode.on .tn-dot, .tnode.ready .tn-dot {
    background: var(--bc, #7dd3fc);
    box-shadow: 0 0 9px var(--bc, #7dd3fc);
  }
  .tn-card {
    flex: 1; min-width: 0; padding: 7px 9px; border-radius: 9px;
    background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08);
    opacity: .62; transition: opacity .15s ease, border-color .15s ease;
  }
  .tnode.on .tn-card { opacity: 1; border-color: color-mix(in srgb, var(--bc, #7dd3fc) 55%, transparent); background: color-mix(in srgb, var(--bc, #7dd3fc) 10%, rgba(255,255,255,.035)); }
  .tnode.ready .tn-card { opacity: .95; border-color: color-mix(in srgb, var(--bc, #7dd3fc) 38%, transparent); }
  .tnode.clickable { cursor: pointer; }
  .tnode.clickable:hover .tn-card { opacity: 1; border-color: var(--bc, #7dd3fc); transform: translateX(1px); }
  .tnode.on .tn-desc { color: #cbd5e1; }
  /* 点亮状态提示 */
  .tn-state { margin-top: 4px; font-size: 9px; font-weight: 800; color: #64748b; }
  .tnode.on .tn-state { color: var(--bc, #7dd3fc); }
  .tnode.ready .tn-state { color: #86efac; }
  .tn-top { display: flex; align-items: center; gap: 5px; }
  .tn-icon { font-size: 13px; }
  .tn-name { color: #e2e8f0; font-size: 11px; font-weight: 800; flex: 1; }
  .tn-prog { color: var(--bc, #7dd3fc); font-size: 10px; font-weight: 800; }
  .tn-bar { height: 4px; margin: 5px 0 4px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
  .tn-bar i { display: block; height: 100%; border-radius: 99px; background: var(--bc, #7dd3fc); }
  .tn-desc { color: var(--muted); font-size: 10px; line-height: 1.4; }
  .tt-tip { margin-top: 14px; text-align: center; color: var(--muted); font-size: 10px; }

  @media (max-width: 720px) {
    body { padding: 16px 12px; align-items: flex-start; }
    .touch { display: flex; }
    .hint .desktop { display: none; }
    .hint .mobile { display: inline; }
    .hud { top: 10px; left: 12px; right: 12px; font-size: 13px; }
    .home-ui { padding: 12px 14px; }
    .home-title { top: 12px; left: 14px; }
    .home-btn { padding: 9px 12px; font-size: 12px; }
    .home-btn.menu-btn { gap: 4px; padding: 10px 9px; font-size: 12px; }
    .home-btn.menu-btn .btn-icon { font-size: 16px; }
    .home-btn.start { padding: 10px 16px; font-size: 13px; }
    .home-left { gap: 6px; }
    .hide-gear { font-size: 11px; gap: 5px; }
    .hide-gear-box { width: 14px; height: 14px; }
    .item-bar { right: 10px; bottom: 62px; gap: 6px; }
    .item-slot { width: 44px; height: 44px; }
    .skill-bar { right: 10px; bottom: 114px; gap: 5px; }
    .skill-slot { width: 38px; height: 46px; }
    .skill-icon { font-size: 18px; line-height: 28px; }
    .skill-name { font-size: 8px; }
    .skill-cd { font-size: 15px; }
    .item-icon { font-size: 19px; line-height: 30px; }
    .home-inventory { left: 14px; bottom: 66px; width: auto; padding: 5px; }
    .home-inventory.expanded { width: 218px; padding: 8px 9px; }
    .inv-list { gap: 3px 6px; }
    .resign-btn { padding: 5px 7px; font-size: 10px; }
    .lab-detail { right: 8px; top: 92px; width: 300px; padding: 9px 10px 11px; }
    .lab-evo { left: 26px; top: 58px; width: 196px; max-height: 152px; padding: 7px 8px 9px; }
    .level-head, .level-row { grid-template-columns: 28px 40px 1fr 60px; font-size: 9px; }
    .lab-equip { right: 8px; top: 80px; width: 250px; padding: 9px 10px 11px; }
    .equip-slot { width: 64px; min-height: 54px; }
    .slot-icon { font-size: 20px; }
    .slot-name { font-size: 8px; }
    .refine-panel { top: 74px; bottom: 62px; width: 210px; padding: 8px 9px 10px; }
    .refine-stats { left: 16px; top: 62px; bottom: 74px; width: 232px; }
    .refine-cost { right: 8px; }
    .refine-jar { width: 116px; height: 130px; }
    .jar-icon { font-size: 34px; }
    .jar-name { font-size: 10px; margin-top: 4px; }
    .refine-picker-wrap { width: 290px; bottom: 6px; }
    .dev-panel { padding: 10px; }
    .dev-box { padding: 14px 12px 16px; }
    .dev-grid { grid-template-columns: 1fr; }
    .lab-part { padding: 6px 8px; gap: 4px; }
    .lab-part-icon { font-size: 15px; }
    .lab-part-name { font-size: 11px; }
    .lab-part-cost { font-size: 10px; }
    .lab-part-pips { gap: 2px; }
    .lab-part.left { left: 8px; }
    .lab-part.right { right: 8px; }
    /* 天赋树窄屏：三列收紧 */
    .tt-branches { gap: 6px; }
    .tt-branches::before { left: 16.66%; right: 16.66%; }
    .tb-head { padding: 4px 6px; gap: 3px; }
    .tb-name { font-size: 10px; }
    .tb-count { font-size: 9px; }
    .tnode { padding-left: 14px; }
    .tn-card { padding: 6px; }
    .tn-name { font-size: 10px; }
    .tn-desc { font-size: 9px; }
  }
