:root {
      --bg-base: #0D0B1A;
      --bg-surface: #120F24;
      --bg-elevated: #1A1530;
      --bg-card: #1A1530;
      --bg-hover: #221D3A;
      --border-subtle: #2A2445;
      --border-default: rgba(196,184,224,.22);
      --border-strong: #F0D48A;
      --text-primary: #E8E4F0;
      --text-secondary: #A09AB0;
      --text-muted: #9389A5;
      --text-dim: #504868;

      --gold-primary: #C9A84C;
      --gold-light: #F0D48A;
      --gold-engraving: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Cpath d='M7 0 14 7 7 14 0 7Z' fill='none' stroke='%23362308' stroke-opacity='.085' stroke-width='.65'/%3E%3C/svg%3E");
      --tab-active-face: linear-gradient(180deg, #302829, #22202a);
      --gold-dark: #8B6E2A;
      --gold-glow: rgba(201, 168, 76, 0.15);
      --gold-glow-strong: rgba(201, 168, 76, 0.35);

      --exp: #34D399;
      --exp-dim: rgba(52, 211, 153, 0.15);
      --hp: #EF4444;
      --hp-dim: rgba(239, 68, 68, 0.15);
      --blue: #60A5FA;
      --blue-dim: rgba(96, 165, 250, 0.15);
      --purple: #8B5CF6;
      --orange: #F59E0B;
      --cyan: #22D3EE;
      --yellow: #F0D48A;

      /* v5.1: 移除 Google Fonts（Cinzel/Noto Sans SC/DM Mono）远程依赖，改用系统字体栈——
         覆盖 苹果(PingFang SC/Songti SC)、鸿蒙(HarmonyOS Sans SC)、安卓(MiSans/Noto CJK)、Windows(微软雅黑)，
         彻底避免字体 CDN 被墙/超时导致移动端进不去 */
      /* 注：--font-display 栈首保留 'Cinzel'——本机若已安装该字体则优先使用（装饰性标题），否则自动回退系统衬线 */
      --font-display: 'Cinzel', 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
      --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans CJK SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
      /* v5.1: 数字与文字统一字体——--font-mono/--fm 跟随 --font-body，数字不再用等宽字体（与正文观感一致） */
      --font-mono: var(--font-body);
      /* --fm 为数字显示别名（15+ 处 var(--fm) 使用），与 --font-mono 一致 */
      --fm: var(--font-body);

      --bg: var(--bg-surface);
      --bg-secondary: var(--bg-elevated);
      --bg-deep: var(--bg-base);
      --bd: var(--border-subtle);
      --mt: var(--text-muted);
      --red: var(--hp);
      --ac: var(--gold-primary);

      --text-3xs: 0.625rem;
      --text-2xs: 0.6875rem;
      --text-xs: 0.75rem;
      --text-sm: 0.8125rem;
      --text-md: 0.875rem;
      --text-base: 1rem;
      --text-lg: 1.125rem;   /* 18px */
      --text-xl: 1.375rem;   /* 22px */
      --text-2xl: 1.625rem;  /* 26px */
      --text-3xl: 2rem;      /* 32px (新增) */

      --space-1: 0.25rem; /* 4px */
      --space-2: 0.5rem;  /* 8px */
      --space-3: 0.75rem; /* 12px */
      --space-4: 1rem;    /* 16px */
      --space-5: 1.25rem; /* 20px */
      --space-6: 1.5rem;  /* 24px */
      --space-8: 2rem;    /* 32px */

      --radius-sm: 3px;
      --radius-md: 6px;
      --radius-lg: 10px;
      --radius-xl: 14px;

      --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
      --shadow-sm: 0 2px 4px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.2);
      --shadow-md: 0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.25);
      --shadow-lg: 0 8px 24px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.3);
      --shadow-xl: 0 12px 40px rgba(0,0,0,.6), 0 6px 16px rgba(0,0,0,.35);
      --shadow-glow: 0 0 20px var(--gold-glow), 0 0 40px var(--gold-glow-strong);

      --transition-fast: 120ms cubic-bezier(.4,0,.2,1);
      --transition-base: 200ms cubic-bezier(.4,0,.2,1);
      --transition-slow: 350ms cubic-bezier(.4,0,.2,1);
      --transition-bounce: 300ms cubic-bezier(.34,1.56,.64,1);

      --header-h: 44px;
      --nav-h: 52px;
      --safe-b: env(safe-area-inset-bottom, 0px);
      /* JS 会用 visualViewport/innerHeight 覆盖，兼容旧版鸿蒙 WebView 的 100vh 偏差 */
      --app-height: 100vh;

      /* 动态布局变量（由 JS 计算设置） */
      --header-total-h: 44px;     /* header 实际高度（含用户顶部偏移） */
      --nav-total-h: 60px;        /* nav 实际总高度（含 safe area） */

      /* z-index层级管理 */
      --z-base: 1;
      --z-card: 10;
      --z-nav: 100;
      --z-header: 200;
      --z-popup: 500;
      --z-overlay: 600;
      --z-modal: 700;
      --z-toast: 800;
      --z-dmg: 150;
    }

    *, *::before, *::after {
      margin: 0; padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }
    html, body {
      height: 100%; overflow: hidden;
      background: var(--bg-base);
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: var(--text-base);
      font-variant-numeric: tabular-nums;
      line-height: 1.5;
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    @supports (height: 100dvh) {
      :root { --app-height: 100dvh; }
    }
    body {
      padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
    }
    #app {
      display: flex; flex-direction: column;
      height: var(--app-height, 100vh);
      min-height: 0;
      --app-width: 100%;
      --app-max-width: 1200px;
      width: var(--app-width);
      max-width: var(--app-max-width);
      padding-top: env(safe-area-inset-top, 0px);
      margin: 0 auto;
      position: relative;
      background: radial-gradient(ellipse at 50% 0%, rgba(212,168,67,.03), transparent 70%);
    }
    ::selection { background: var(--gold-primary); color: #000; }

    /* --- Header --- */
    header {
      display: flex; align-items: center;
      justify-content: space-between;
      padding: 5px 12px;
      background: linear-gradient(180deg, var(--bg-elevated), var(--bg-surface));
      border-bottom: 1px solid var(--border-subtle);
      flex-shrink: 0; gap: 6px;
      min-height: var(--header-h); z-index: 10;
      box-shadow: 0 2px 8px rgba(0,0,0,.3);
      flex-wrap: wrap;
    }
    .gt {
      font-family: var(--font-display);
      font-size: 14px; font-weight: 900;
      color: var(--gold-primary);
      text-shadow: 0 0 20px var(--gold-glow), 0 0 40px var(--gold-glow);
      letter-spacing: 2px;
      white-space: nowrap;
      background: linear-gradient(135deg, var(--gold-light), var(--gold-primary), var(--gold-dark));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .hr {
      display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto;
    }
    .lb {
      background: linear-gradient(135deg, var(--bg-hover), var(--bg-card));
      border: 1px solid var(--gold-primary);
      border-radius: var(--radius-sm);
      padding: 1px 7px;
      font-family: var(--font-mono);
      font-size: 8px; font-weight: 500;
      color: var(--gold-primary);
      white-space: nowrap;
      box-shadow: 0 0 8px var(--gold-glow);
      min-width: 58px; text-align: center;
    }
    .ew {
      display: flex; align-items: center; gap: 4px;
      color: var(--text-muted); font-size: var(--text-3xs);
      white-space: nowrap;
      min-width: 0;
    }
    .ew #hET {
      white-space: nowrap;
      overflow: visible;
    }
    .bo {
      width: 52px; height: 4px;
      background: rgba(15,42,24,.6);
      border-radius: 2px; overflow: hidden;
      border: 1px solid rgba(255,255,255,.04);
    }
    .bi {
      height: 100%;
      background: linear-gradient(90deg, #16a34a, var(--exp));
      border-radius: 2px;
      box-shadow: 0 0 6px rgba(74,222,128,.3);
    }
    #hEB { transform: scaleX(0); transform-origin: left; }
    @media (prefers-reduced-motion: no-preference) {
      #hEB { transition: transform 0.3s ease; }
    }
    .game-header {
      position: relative;
      display: grid;
      z-index: var(--z-header);
      grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto;
      grid-template-areas: "identity resources actions";
      padding-bottom: 5px;
      gap: 2px 8px;
    }
    .game-header-identity, .game-header-resources {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      min-width: 0;
    }
    .game-header-identity { grid-area: identity; }
    .game-header-resources { grid-area: resources; }
    .game-header .hr { grid-area: actions; flex-wrap: nowrap; white-space: nowrap; }
    .game-header-identity #hPower {
      color: var(--gold-light);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .game-header .lb, .game-header .ew, .game-header #hPower, .game-header-resources {
      font-size: var(--text-xs);
    }
    .game-header-resources > span {
      padding: 0.125rem 0.375rem;
      border-radius: var(--radius-sm);
      background: var(--bg-hover);
      color: var(--text-muted);
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .game-header-resources strong { color: var(--text-primary); }
    .game-header-resources > [hidden] { display: none; }
    .game-header .bo {
      position: absolute;
      inset: auto 0 0;
      width: 100%;
      height: 3px;
      border: 0;
    }
    .game-header .lb { flex: none; min-width: 0; }
    .game-header .ew { display: block; flex: none; }
    .game-header .ew summary { cursor: pointer; }
    #hETDetail {
      position: absolute;
      top: calc(100% + 4px);
      left: 5px;
      padding: 4px 8px;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      background: var(--bg-elevated);
      color: var(--text-primary);
    }
    @media (max-width: 600px) {
      .game-header {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "identity actions" "resources resources";
        padding: 2px 5px 5px;
      }
      .game-header-resources > span { padding-block: 1px; }
    }
    @media (max-width: 400px) {
      .game-header-resources { font-size: var(--text-2xs); gap: 2px; }
      .game-header-resources > span { padding-inline: 3px; }
    }

    /* --- Main Content --- */
    main {
      flex: 1; overflow-y: auto; overflow-x: hidden;
      min-height: 0;
      width: 100%;
      background: var(--bg-surface);
      -webkit-overflow-scrolling: touch;
      display: flex; flex-direction: column;
      scroll-padding-bottom: 0.5rem;
    }

    /* --- Bottom Navigation --- */
    nav {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      flex: 0 0 auto;
      border-top: 1px solid #332b38;
      background: linear-gradient(180deg, #1a1722, #100e17);
      z-index: var(--z-nav);
      padding-bottom: var(--safe-b);
    }
    nav button {
      min-inline-size: 0;
      min-block-size: 44px;
      padding: 0.25rem 0.125rem;
      background: none; border: none;
      color: var(--text-secondary);
      font-weight: 700;
      font-family: var(--font-body);
      font-size: var(--text-xs);
      line-height: 1.2;
      cursor: pointer;
      position: relative;
      white-space: nowrap;
      transition: color var(--transition-fast), transform var(--transition-fast);
      outline: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
    }
    nav button iconify-icon,
    nav button .nav-local-icon {
      transition: transform var(--transition-bounce);
    }
    nav button .nav-local-icon {
      display: inline-flex;
      width: 16px;
      height: 16px;
      align-items: center;
      justify-content: center;
      font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
      font-size: 15px;
      line-height: 1;
      flex: 0 0 16px;
    }
    nav button.ac::after {
      content: '';
      position: absolute;
      top: 0;
      left: 50%;
      width: 1.5rem;
      height: 2px;
      border-radius: 0 0 2px 2px;
      background: currentColor;
      transform: translateX(-50%);
      pointer-events: none;
    }
    @media (hover: hover) {
      nav button:hover:not(.ac) { color: var(--text-primary); }
    }
    nav button.ac {
      color: var(--gold-light);
      background: linear-gradient(180deg, rgba(228,183,108,.16), transparent 90%);
    }
    nav button:active { transform: scale(.96); }
    nav button:focus-visible {
      outline: 2px solid var(--gold-primary);
      outline-offset: -2px;
    }

    .bg {
      display: inline-block;
      min-width: 16px; text-align: center;
      padding: 0 4px; margin-left: 2px;
      background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
      color: #0a0a0a;
      font-size: var(--text-3xs); font-weight: 700;
      border-radius: 3px;
      font-family: var(--font-mono);
      line-height: 1.5;
      position: relative; top: -1px;
      box-shadow: 0 0 6px var(--gold-glow);
    }

    /* --- Panels --- */
    .pn { display: none; }
    .pn.ac {
      display: flex;
      flex-direction: column;
      padding: 8px 10px 8px;
      animation: panelIn var(--transition-slow) ease;
      box-sizing: border-box;
    }
    #p-bat.pn.ac { animation: none; }
    @keyframes panelIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* --- Cards --- */
    .cd {
      background: var(--bg-card);
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      margin-bottom: 8px;
      box-shadow: var(--shadow-xs);
      position: relative;
      transition: box-shadow var(--transition-base), border-color var(--transition-base);
    }
    .cd::before {
      content: '';
      position: absolute; top: 0; left: 0; right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(212,168,67,.2), transparent);
      pointer-events: none;
    }
    .cd:hover {
      box-shadow: var(--shadow-sm);
      border-color: var(--border-strong);
    }
    .ct {
      font-size: var(--text-sm);
      font-weight: 700;
      color: var(--gold-primary);
      margin-bottom: 6px;
      letter-spacing: 0.5px;
      display: flex; align-items: center; gap: 4px;
    }

    /* --- Buttons --- */
    .btn {
      display: inline-flex;
      align-items: center; justify-content: center;
      gap: 4px;
      padding: 6px 12px;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      background: linear-gradient(180deg, var(--bg-hover), var(--bg-card));
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: var(--text-sm);
      cursor: pointer;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      white-space: nowrap;
      outline: none;
      -webkit-user-select: none;
      user-select: none;
      position: relative;
      overflow: hidden;
    }
    .btn::before {
      content: '';
      position: absolute; inset: 0;
      box-shadow: inset 0 1px rgba(255,255,255,.09), inset 0 -1px rgba(0,0,0,.34);
      pointer-events: none;
    }
    .btn:hover:where(:not(:disabled)) {
      border-color: var(--border-strong);
      background: linear-gradient(180deg, var(--bg-card), var(--bg-hover));
      transform: translateY(-1px);
      box-shadow: var(--shadow-sm);
    }
    .btn:active:where(:not(:disabled)) {
      transform: translateY(1px);
      transition-duration: 60ms;
      filter: brightness(0.9);
    }
    .btn:disabled {
      opacity: 0.25;
      cursor: not-allowed;
      pointer-events: none;
      transform: none;
      box-shadow: none;
    }
    .btn:focus-visible {
      outline: 2px solid var(--gold-primary);
      outline-offset: 2px;
    }

    /* --- 通用按压反馈 --- */
    .sb:active, .pet-card:active, .eq-card:active, .talent-card:active, .ach-card:active,
    .ms .btn:active, .en2:active {
      transform: scale(0.96);
      transition-duration: 60ms;
      filter: brightness(0.9);
    }
    .btn.ba {
      background: var(--gold-engraving), linear-gradient(180deg, #f2d8a6, #d6ac6c 56%, #ba8c50);
      color: #211504;
      border-color: var(--gold-primary);
      font-weight: 700;
      box-shadow: inset 0 1px #ffe9bc, inset 0 -1px #8c6339, 0 2px 4px rgba(0,0,0,.35);
    }
    .btn.ba:hover:where(:not(:disabled)) {
      background: var(--gold-engraving), linear-gradient(180deg, #ffe7b6, #e8bf7d 56%, #c99c5d);
      border-color: var(--gold-light);
      box-shadow: inset 0 1px #fff0c9, inset 0 -1px #9d7446, 0 2px 4px rgba(0,0,0,.35);
    }
    .btn.sm {
      padding: 0.25rem 0.5rem;
      font-size: var(--text-xs);
      border-radius: var(--radius-sm);
    }
    .btn.xs {
      padding: 0.125rem 0.3125rem;
      font-size: var(--text-2xs);
      border-radius: var(--radius-sm);
    }
    .btn.bd {
      border-color: var(--hp);
      color: #fca5a5;
      background: linear-gradient(180deg, #431f2b, #241019);
    }
    .btn.bd:hover:where(:not(:disabled)) {
      background: #792633;
      color: #fff;
      border-color: var(--hp);
    }
    .btn.bp, .btn.temple-draw-option {
      border-color: var(--purple);
      color: #ecdfff;
      background: linear-gradient(180deg, #352844, #231c30);
    }
    .btn:is(.bp, .temple-draw-option):hover:where(:not(:disabled)) {
      border-color: #d9c3ff;
      background: linear-gradient(180deg, #463658, #2c233b);
    }

    .ms {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.5rem), 1fr));
      gap: 0.25rem;
      padding: 0.375rem;
      margin-block-end: 0.5rem;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      background: var(--bg-surface);
    }
    @container (min-width: 42rem) {
      .ms { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    }
    .ms .btn {
      display: grid;
      align-content: center;
      justify-items: center;
      gap: 0.125rem;
      min-width: 0;
      min-block-size: 2.25rem;
      padding: 0.25rem;
      border-color: transparent;
      background: transparent;
      white-space: nowrap;
      font-size: var(--text-2xs);
    }
    .ms .btn::before { display: none; }
    .ms .btn:hover:where(:not(:disabled, .on)) {
      background: var(--bg-hover);
      transform: none;
    }
    .ms .btn.on {
      color: var(--gold-light);
      border-color: var(--gold-dark);
      background: var(--tab-active-face);
      box-shadow: inset 0 1px rgba(240,212,138,.18);
      font-weight: 700;
    }
    .ms .btn.sp-mode-btn.on {
      color: var(--sp-secondary);
      border-color: var(--sp-border);
      background: linear-gradient(180deg, #362a47, #251e32);
      box-shadow: inset 0 1px rgba(217,195,255,.22);
    }
    .ms .btn.sp-mode-btn[disabled] {
      opacity: 1;
      color: var(--text-muted);
      line-height: 1.2;
    }
    .ms .btn.sp-mode-btn[disabled] .lock-label { font-size: var(--text-3xs); }
    .btn.sm.spd-btn {
      background: linear-gradient(135deg, #1a3a1a, #2d5a2d);
      color: #4ade80;
      border-color: #4ade80;
      font-weight: 700;
      font-family: var(--font-mono);
      min-width: 2.5rem;
      text-align: center;
    }
    .btn.sm.spd-btn:active {
      transform: scale(0.95);
    }

    .ts { font-size: var(--text-xs); }
    .collection-toolbar { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
    .collection-toolbar > .ts { margin-right: auto; }
    .collection-toolbar > .btn { flex: none; white-space: nowrap; }
    .tm { color: var(--text-muted); }
    .ta { color: var(--gold-primary); }

    .r0 { --rc: #6B7280; --rc-glow: rgba(107,114,128,.15); }
    .r1 { --rc: #34D399; --rc-glow: rgba(52,211,153,.2); }
    .r2 { --rc: #60A5FA; --rc-glow: rgba(96,165,250,.2); }
    .r3 { --rc: #A78BFA; --rc-glow: rgba(167,139,250,.2); }
    .r4 { --rc: #F59E0B; --rc-glow: rgba(245,158,11,.2); }
    .r5 { --rc: #EF4444; --rc-glow: rgba(239,68,68,.25); }
    .r6 { --rc: #22D3EE; --rc-glow: rgba(34,211,238,.25); }
    .r7 { --rc: #C9A84C; --rc-glow: rgba(201,168,76,.3); }
    .r8 { --rc: #8B5CF6; --rc-glow: rgba(139,92,246,.3); }
    .r9 { --rc: #ff2d55; --rc-glow: rgba(255,45,85,.4); }

    .bl-main {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
      gap: 8px; margin-bottom: 8px;
    }

    .pl-side {
      background: linear-gradient(160deg, #221e25, #14121a 72%);
      border: 1.5px solid #706044;
      border-radius: var(--radius-lg);
      padding: 10px;
      text-align: center;
      position: relative;
      overflow: hidden;
      box-shadow: inset 0 1px rgba(240,212,138,.12);
      min-width: 0;
      min-height: 180px;
      contain: layout style;
    }
    .pl-side::before {
      content: '';
      position: absolute;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: radial-gradient(ellipse at 50% 0%, rgba(240,212,138,.10), transparent 60%);
      pointer-events: none;
    }
    .pl-icon {
      margin: 0 auto 4px;
      display: inline-block;
    }
    .player-portrait { display: block; object-fit: contain; }
    .avatar-img {
      max-width: 52px;
      max-height: 52px;
      display: block;
      border-radius: 2px;
      opacity: 0.92;
      filter: none;
    }

.pl-title {
font-size: var(--text-md);
font-weight: 700;
color: var(--gold-primary);
letter-spacing: 0.5px;
transition: color var(--transition-base);
}
    .pl-title.honor-glow {
      text-shadow: 0 0 12px var(--gold-glow), 0 0 24px var(--gold-glow-strong), 0 0 48px var(--gold-glow);
    }
    .pl-title.honor-glow-max {
      text-shadow: 0 0 12px var(--gold-glow), 0 0 24px var(--gold-glow-strong), 0 0 48px var(--gold-glow), 0 0 80px var(--gold-glow-strong);
    }

    .pl-hp { margin: 6px 0; }
    .pl-hp-bar {
      height: 12px;
      background: linear-gradient(180deg, rgba(8,20,35,0.9), rgba(15,30,50,0.7));
      border-radius: 6px;
      overflow: hidden;
      border: 1px solid rgba(96,165,250,0.2);
      box-shadow: inset 0 1px 3px rgba(0,0,0,0.4), 0 0 8px rgba(96,165,250,0.1);
      position: relative;
    }
    .pl-hp-bar::after {
      content: '';
      position: absolute; top: 0; left: 0; right: 0;
      height: 50%;
      background: linear-gradient(180deg, rgba(255,255,255,0.12), transparent);
      border-radius: 5px 5px 0 0;
      pointer-events: none;
    }
    .pl-hp-fill {
      height: 100%;
      width: 100%;
      background: linear-gradient(90deg, #a33345, #ed6877);
      border-radius: 5px;
      display: block;
      text-align: center;
      line-height: 12px;
      font-size: var(--text-3xs); font-weight: 700;
      font-family: var(--font-mono);
      color: #fff;
      text-shadow: 0 0 6px rgba(0,0,0,.7), 0 0 12px rgba(178,34,34,0.3);
      box-shadow: 0 0 10px rgba(178,34,34,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
      position: relative;
      z-index: 1;
      overflow: hidden;
      white-space: nowrap;
      transition: none;
      contain: layout style;
    }
    .pl-stats {
      font-size: var(--text-3xs);
      text-align: left;
      margin-top: 3px;
      line-height: 1.6;
      font-family: var(--font-mono);
      color: var(--text-muted);
    }
    .pl-stats span { color: var(--text-primary); }

    .mn-side {
      display: flex;
      flex-direction: column;
      gap: 4px;
      position: relative;
      min-height: 180px;
      max-height: 280px;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-gutter: stable;
    }
    .mn-card {
      background: linear-gradient(155deg, #211b25, #15121a);
      border: 1.5px solid #3d313e;
      border-inline-start: 3px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 4px 8px;
      display: grid;
      grid-template-columns: 1fr;
      gap: 4px;
      align-items: center;
      position: relative;
      min-height: 50px;
      width: 100%;
      box-sizing: border-box;
      transition: opacity 0.2s ease, box-shadow 0.2s ease;
      contain: layout style;
    }
    .mn-card:hover {
      border-color: rgba(255,255,255,.12);
      box-shadow: var(--shadow-sm);
    }
    .mn-info {
      min-width: 0;
      overflow: hidden;
    }
    .mn-info .mn-name {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-primary);
      overflow: hidden;
      line-height: 1.3;
      max-width: 100%;
      display: flex;
      align-items: center;
      gap: 2px;
    }
    .mn-info .mn-name .mn-name-text {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
      min-width: 0;
    }
    .mn-info .mn-name .mn-affix {
      font-size: var(--text-3xs);
      font-weight: 400;
      margin-left: 0;
      padding: 0 2px;
      border-radius: 2px;
      flex-shrink: 0;
      line-height: 1;
      white-space: nowrap;
      color: var(--text-muted);
      font-family: var(--font-mono);
      display: inline-block;
      max-width: 50px;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: middle;
    }
    .mn-info .mn-lv {
      font-size: 9px;
      color: var(--text-muted);
      margin-bottom: 2px;
    }
    .mn-hp {
      height: 8px;
      position: relative;
      background: linear-gradient(180deg, rgba(30,10,15,0.8), rgba(42,15,18,0.6));
      border-radius: 2px;
      overflow: hidden;
      border: 1px solid rgba(244,63,94,0.15);
      box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
    }
    .mn-hp-fill {
      height: 100%;
      background: linear-gradient(90deg, #862b3e, #cc4d5d);
      border-radius: 3px;
      transition: none;
      text-shadow: 0 0 4px rgba(0,0,0,.7);
      box-shadow: 0 0 6px rgba(239,68,68,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    }
    .mn-hp-fill, .mn-hp-trail, .sp-mn-hp-fill {
      position: absolute;
      inset: 0;
      transform: scaleX(var(--monster-hp, 0));
      transform-origin: left center;
    }
    .mn-hp-trail { background: rgba(255, 242, 218, .72); }
    @media (prefers-reduced-motion: no-preference) {
      .is-taking-damage > .mn-hp-trail { transition: transform 240ms ease-out 35ms; }
    }
    .mn-card.is-solo-boss, .sp-mn-card.is-solo-boss,
    .mn-side.is-boss-encounter .mn-card {
      border-block-start: 3px double var(--gold-dark);
      background: linear-gradient(160deg, #3a1c24, #19131c 68%);
    }
    .mn-card.is-solo-boss, .sp-mn-card.is-solo-boss {
      flex: 1 0 auto;
      min-height: 180px;
      border: 3px double #af8150;
      box-shadow: inset 0 0 0 1px #692f37;
    }
    .mn-card.is-solo-boss .mn-name, .sp-mn-card.is-solo-boss .sp-mn-name,
    .mn-side.is-boss-encounter .mn-name { font-size: var(--text-md); }
    .mn-card.is-solo-boss .mn-name-text, .sp-mn-card.is-solo-boss .sp-mn-name-text,
    .mn-side.is-boss-encounter .mn-name-text { max-width: none; }
    .mn-card.is-solo-boss .mn-hp, .sp-mn-card.is-solo-boss .sp-mn-hp,
    .mn-side.is-boss-encounter .mn-hp { height: 12px; }
    .mn-stats {
      font-size: 8px;
      color: var(--text-muted);
      margin-top: 1px;
      font-family: var(--font-mono);
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2px;
      overflow: hidden;
      white-space: nowrap;
      min-height: 1em;
    }
    .mn-stats+.mn-stats {
      margin-top: 0;
    }
    .mn-stats span { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* --- Stage Select --- */
    .st-sel { margin-bottom: 6px; }
    .cnv {
      display: flex; align-items: center;
      justify-content: center; gap: 8px;
      margin-bottom: 6px;
      font-size: var(--text-sm);
      flex-wrap: wrap;
    }
    .srw {
      display: flex;
      justify-content: center;
      gap: 4px; flex-wrap: wrap;
    }
    .sb {
      width: 32px; height: 26px;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      background: linear-gradient(180deg, var(--bg-surface), var(--bg-elevated));
      color: var(--text-muted);
      font-size: 8px;
      font-family: var(--font-mono);
      cursor: pointer;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      position: relative;
    }
    .sb:hover:not(.lk) {
      border-color: var(--gold-primary);
      background: var(--bg-hover);
      color: var(--text-primary);
      box-shadow: 0 0 8px var(--gold-glow);
    }
    .sb.cu {
      background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
      color: #0a0a0a;
      border-color: var(--gold-primary);
      font-weight: 700;
      box-shadow: 0 0 12px var(--gold-glow);
    }
    .sb.lk {
      opacity: 0.1;
      cursor: not-allowed;
    }


    .bl-wrap, .bl-wrap-fixed {
      border-radius: var(--radius-md);
      border: 1px solid var(--border-subtle);
      background: rgba(0,0,0,.3);
      overflow: hidden;
    }
    .bl-wrap-fixed {
      width: calc(100% - 16px);
      height: var(--bl-height, 180px);
      max-height: var(--bl-max-height, 40vh);
      margin: 0.25rem auto;
      z-index: var(--z-nav);
      flex: 0 0 auto;
      display: flex;
      flex-direction: column;
    }
    .bl-tabs {
      display: flex;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border-subtle);
      background: rgba(0,0,0,.2);
    }
    .bl-tab {
      flex: 1;
      padding: 4px 8px;
      min-height: 24px;
      font-size: var(--text-2xs);
      font-weight: 600;
      color: var(--text-muted);
      background: transparent;
      border: none;
      cursor: pointer;
      transition: all 0.2s;
      border-bottom: 2px solid transparent;
    }
    .bl-tab.on {
      color: var(--gold-primary);
      border-bottom-color: var(--gold-primary);
    }
    .bl-tab:hover {
      color: var(--text-primary);
    }
    .bl-tab-hide {
      flex: 0 0 auto;
    }
    .bl-tab-hide:hover {
      color: var(--gold-primary);
      opacity: 1;
    }
    .bl-wrap-fixed.bl-collapsed {
      height: auto;
    }
    .bl-collapsed .bl-tab-content {
      display: none;
    }
    .bl-tab-content {
      flex: 1;
      overflow-y: auto;
      min-height: 0;
    }
    #logTabLog { contain: layout style paint; }
    .stat-panel {
      padding: 0.375rem;
      font-size: var(--text-2xs);
      overflow-y: auto;
    }
    .bl {
      min-height: 100%;
      font-size: var(--text-2xs);
      font-family: var(--font-mono);
      line-height: 1.5;
      padding: 0.375rem 0.625rem;
      background: #100e16;
    }
    /* 技能栏 */
    .skill-bar {
      display: flex;
      gap: 6px;
      padding: 6px 8px;
      justify-content: center;
      background: rgba(0,0,0,.2);
      border-radius: var(--radius-md);
      border: 1px solid var(--border-subtle);
    }
    .skill-slot {
      inline-size: clamp(1.875rem, 7.4vw, 2.5rem);
      block-size: 2.625rem;
      display: grid;
      grid-template-rows: 1fr 0.75rem;
      place-items: center;
      background: linear-gradient(155deg, var(--bg-elevated), var(--bg-card));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
    }
    .skill-slot.locked { background: var(--bg-card); border-color: var(--border-subtle); }
    .skill-slot.locked .skill-icon { color: var(--text-muted); opacity: 0.42; filter: none; grid-row: 1 / -1; }
    .skill-slot.on-cd .skill-icon { opacity: 0.68; }
    .skill-icon {
      inline-size: 1.375rem;
      block-size: 1.375rem;
      filter: drop-shadow(0 0 3px currentColor);
    }
    .skill-icon::before {
      content: '';
      display: block;
      block-size: 100%;
      background: linear-gradient(135deg, var(--text-primary), currentColor 48%);
      clip-path: var(--skill-shape);
    }
    .skill-slot[data-skill="1"] { --skill-shape: polygon(48% 1%, 78% 36%, 70% 51%, 93% 43%, 90% 79%, 70% 96%, 30% 96%, 10% 76%, 14% 46%, 31% 60%, 30% 34%); }
    .skill-slot[data-skill="2"] { --skill-shape: polygon(57% 2%, 20% 54%, 47% 54%, 37% 98%, 82% 40%, 55% 40%, 70% 2%); }
    .skill-slot[data-skill="3"] { --skill-shape: polygon(50% 0, 76% 23%, 85% 62%, 50% 100%, 15% 62%, 24% 23%, 50% 0, 50% 24%, 33% 56%, 50% 80%, 67% 56%, 50% 24%); }
    .skill-slot[data-skill="4"] { --skill-shape: polygon(6% 76%, 75% 5%, 55% 50%, 94% 24%, 60% 69%, 91% 59%, 36% 94%, 43% 73%, 22% 91%, 27% 65%); }
    .skill-slot[data-skill="5"] { --skill-shape: polygon(50% 0, 96% 26%, 96% 74%, 50% 100%, 4% 74%, 4% 26%, 50% 0, 50% 24%, 25% 38%, 25% 62%, 50% 76%, 75% 62%, 75% 38%, 50% 24%); }
    .skill-slot[data-skill="6"] { --skill-shape: polygon(55% 6%, 38% 41%, 82% 20%, 63% 48%, 94% 37%, 91% 68%, 76% 90%, 49% 95%, 30% 80%, 28% 59%, 5% 73%, 23% 40%); }
    .skill-slot[data-skill="7"] { --skill-shape: polygon(50% 1%, 62% 34%, 86% 18%, 73% 43%, 99% 50%, 73% 58%, 86% 83%, 62% 69%, 50% 99%, 38% 69%, 14% 83%, 27% 58%, 1% 50%, 27% 43%, 14% 18%, 38% 34%); }
    .skill-cd-overlay, .skill-lv {
      max-inline-size: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font: 600 var(--text-3xs)/1 var(--font-mono);
      color: var(--gold-light);
    }
    .skill-cd-overlay { color: var(--text-secondary); }
    .le {
      padding-left: 8px;
      position: relative;
    }
    .le::before {
      content: '';
      position: absolute; left: 0; top: 50%;
      width: 3px; height: 3px;
      border-radius: 50%;
      background: var(--gold-primary);
      transform: translateY(-50%);
      opacity: 0.5;
    }

    /* --- Log Colors --- */
    .ld { color: #C9A84C; }
    .lx { color: var(--exp); }
    .lg { color: var(--yellow); }
    .ll { color: #34d399; }
    .lr { color: var(--blue); }
    .lp { color: #C9A84C; }
    .lo { color: var(--orange); }
    .lh { color: #34d399; }
/* 荣誉 Lv.6 解锁：装备掉落高亮边框 */
.ld.hl-drop {
  border-left: 2px solid var(--gold-primary);
  padding-left: 4px;
  text-shadow: 0 0 8px var(--gold-glow), 0 0 16px var(--gold-glow-strong);
}
#bL .log-drop {
  font-size: var(--text-3xs);
  font-weight: 400;
}
    .eg {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      width: 100%;
      margin: 0 0 8px;
    }
    .es {
      background: linear-gradient(180deg, rgba(30,20,40,0.9), rgba(20,15,30,0.95));
      border: 2px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 8px 6px;
      text-align: center;
      cursor: pointer;
      transition: transform var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
      min-height: 66px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
    }
    .es::before {
      content: '';
      position: absolute; inset: 0;
      background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.02));
      pointer-events: none;
    }
    @media (hover: hover) {
      .es:hover {
        border-color: var(--rc);
        background: linear-gradient(180deg, var(--bg-hover), var(--bg-card));
        transform: translateY(-2px) scale(1.03);
        box-shadow: var(--shadow-md), 0 0 12px var(--rc-glow);
      }
    }
    .es .sl {
      font-size: var(--text-3xs);
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: .8px;
      font-weight: 600;
    }
    .es .si {
      font-size: 16px;
      margin: 3px 0;
      filter: none;
    }
    .es .sn {
      font-size: 8px;
      font-weight: 600;
      color: var(--rc);
    }
    .es .eh {
      position: absolute; top: 3px; right: 4px;
      font-size: var(--text-3xs); font-family: var(--font-mono);
      color: var(--gold-primary);
      background: rgba(212,168,67,.15);
      padding: 0 3px;
      border-radius: 2px;
    }
    .es { border-color: var(--rc, var(--border-default)); }
    .es .eh { background: var(--gold-glow); }

    /* === 凡装背包 === */
    .equipment-bag-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 5.25rem), 1fr));
      gap: var(--space-2);
      width: 100%;
    }
    .equipment-bag-grid > .tm { grid-column: 1 / -1; }

    .ec {
      background: linear-gradient(180deg, rgba(30,20,40,0.9), rgba(20,15,30,0.95));
      border: 1px solid var(--border-default);
      border-inline-start: 2px solid var(--rc);
      border-radius: var(--radius-md);
      font: inherit;
      min-block-size: 44px;
      padding: var(--space-1) var(--space-2);
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
      text-align: start;
      cursor: pointer;
      justify-content: center;
    }
    .ec:hover {
      border-color: var(--rc);
      box-shadow: var(--shadow-sm), 0 0 8px var(--rc-glow);
    }
    .ec:focus-visible { outline: 2px solid var(--gold-light); outline-offset: -2px; }
    .ec .en {
      font-size: var(--text-sm);
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
      line-height: 1.2;
    }
    .ec .tg {
      font-size: var(--text-xs);
      color: var(--rc);
      line-height: 1.2;
    }
    /* --- Recycle Bar --- */
    .rcb {
      display: flex; flex-wrap: wrap; gap: 3px; align-items: center;
    }
    .rcb .btn.on {
      background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
      color: #0a0a0a;
      border-color: var(--gold-primary);
    }

    .eq-tab-bar {
      display: flex;
      gap: 0.125rem;
      margin-bottom: 0.25rem;
      background: var(--bg-elevated);
      border-radius: var(--radius-md);
      padding: 0.1875rem;
      border: 1px solid var(--border-subtle);
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      position: relative;
      z-index: 10;
    }

    .eq-tab {
      flex: 1;
      min-width: 0;
      padding: 0.25rem 0.3125rem;
      background: transparent;
      border: none;
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      font-family: var(--font-body);
      font-size: var(--text-2xs);
      font-weight: 500;
      cursor: pointer;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      outline: none;
      white-space: nowrap;
      text-align: center;
    }
    .eq-tab:hover {
      color: var(--text-secondary);
      background: rgba(255,255,255,.03);
    }

    .eq-tab-content {
      display: none;
      animation: panelIn var(--transition-slow) ease;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      max-height: calc(100vh - 140px);
      max-height: calc(100dvh - 140px);
      padding-top: 6px;
      padding-bottom: 8px;
      position: relative;
      z-index: 1;
    }
    .eq-tab-content.on {
      display: block;
    }

/* v2.8.0: 副Tab样式 — 用于仙界/神界装备tab内的装备/法器切换 */
.sub-tab-bar {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 2px;
  border: 1px solid var(--border-subtle);
  position: relative;
  z-index: 5;
}
.sub-tab {
  flex: 1;
  padding: 4px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-3xs);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  outline: none;
  white-space: nowrap;
  text-align: center;
  min-width: 0;
}
.sub-tab:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,.03);
}
.sub-tab.on {
  color: var(--gold-light);
  font-weight: 700;
  background: linear-gradient(var(--gold-primary), var(--gold-primary)) bottom / 1.25rem 1px no-repeat;
}
.sub-tab-content {
  display: none;
}
.sub-tab-content.on {
  display: block;
  animation: panelIn var(--transition-slow) ease;
}

    /* 强化界面Tab内容 */
    #enc-enhance, #enc-gem2 {
      max-height: calc(100vh - 180px);
      max-height: calc(100dvh - 180px);
    }
    @media (max-width: 600px) {
      #enc-enhance, #enc-gem2 {
        max-height: calc(100dvh - 140px);
      }
      #p-en .eq-tab-bar {
        margin-bottom: 4px;
      }
    }
    /* 强化界面Tab栏 */
    #p-en .eq-tab-bar {
      margin-bottom: 4px;
      position: relative;
      z-index: 10;
    }
    #p-en .eq-tab-content {
      position: relative;
      z-index: 1;
    }

    /* 宝石界面装备网格 */
    .gem-equip-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
    }
    .gem-equip-card {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      padding: 6px;
    }
    .gem-slots {
      display: flex;
      gap: 4px;
    }
    .gem-slot {
      flex: 1;
      padding: 3px 2px;
      border: 1px dashed var(--border-subtle);
      border-radius: 3px;
      text-align: center;
      font-size: var(--text-3xs);
      cursor: pointer;
      color: var(--text-muted);
    }
    .gem-slot.has {
      background: rgba(192, 132, 252, 0.1);
      border-style: solid;
    }
    .gem-slot.empty:hover {
      border-color: var(--gold-primary);
      color: var(--gold-primary);
    }

    .eq-bag-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 6px;
    }
    .eq-bag-actions {
      display: flex;
      gap: 4px;
      margin-inline-start: auto;
    }

    @media (max-width: 600px) {
      .eq-tab { font-size: var(--text-3xs); padding: 0.1875rem 0.1875rem; min-width: 0; }
      .eq-tab-content { max-height: calc(100dvh - 120px); padding-top: 4px; }
      #eqc-slots > div:last-child { margin-top: 8px; }
    }

    .ach-tab-bar {
      display: flex;
      gap: 2px;
      margin-bottom: 4px;
      background: var(--bg-elevated);
      border-radius: var(--radius-md);
      padding: 3px;
      border: 1px solid var(--border-subtle);
      overflow-x: auto;
      position: relative;
      z-index: 10;
    }
    .ach-tab {
      flex: 1;
      min-width: 52px;
      padding: 7px 5px;
      background: transparent;
      border: none;
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      font-family: var(--font-body);
      font-size: var(--text-sm);
      font-weight: 500;
      cursor: pointer;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      outline: none;
      white-space: nowrap;
      text-align: center;
    }
    .ach-tab:hover {
      color: var(--text-secondary);
      background: rgba(255,255,255,.03);
    }
    .ach-tab-content {
      display: none;
      animation: panelIn var(--transition-slow) ease;
      overflow-y: auto;
      flex: 1;
      min-height: 0;
      padding-top: 6px;
      position: relative;
      z-index: 1;
    }
    .ach-tab-content.on {
      display: block;
    }
    @media (max-width: 600px) {
      .ach-tab { font-size: var(--text-xs); padding: 6px 4px; min-width: 44px; }
      .ach-tab-content { padding-top: 8px; }
    }

    .eg2 {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 5px;
      align-content: start;
    }
    .en2 {
      background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 5px 4px;
      transition: border-color var(--transition-fast);
      text-align: center;
    }
    .en2:hover {
      border-color: var(--gold-primary);
      box-shadow: var(--shadow-sm);
    }
    .en2 .en {
      font-size: var(--text-xs);
      font-weight: 600;
      color: var(--text-secondary);
      line-height: 1.3;
    }
    .en2 .el {
      font-family: var(--font-mono);
      font-size: 14px;
      color: var(--gold-primary);
      font-weight: 700;
      text-shadow: 0 0 8px var(--gold-glow);
      line-height: 1.4;
    }
    .en2 .btn {
      font-size: var(--text-3xs);
      padding: 2px 4px;
    }

    /* 精炼布局 */
    .rf-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 4px;
    }
    .rf {
      background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 5px 4px;
      text-align: center;
      transition: border-color var(--transition-fast);
    }
    .rf:hover {
      border-color: var(--gold-primary);
      box-shadow: var(--shadow-sm);
    }
    .rf .rn {
      font-size: var(--text-xs);
      font-weight: 700;
      line-height: 1.3;
    }
    .rf .rb {
      height: 3px;
      background: var(--border-subtle);
      border-radius: 2px;
      overflow: hidden;
      margin: 2px 4px;
    }
    .rf .rb div {
      height: 100%;
      background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary));
      border-radius: 2px;
      box-shadow: 0 0 6px var(--gold-glow);
    }
    .rf .rl {
      font-family: var(--font-mono);
      font-size: var(--text-xs);
      color: var(--gold-primary);
      font-weight: 500;
      line-height: 1.3;
    }
    .rf .rl .ts {
      font-size: var(--text-3xs);
    }
    .rf .btn {
      font-size: var(--text-3xs);
      padding: 2px 4px;
    }

    /* --- Rebirth Panel --- */
    .rb2 {
      text-align: center;
      padding: 12px;
    }
    .rb2 .ri {
      font-size: 28px;
      margin-bottom: 2px;
      filter: drop-shadow(0 0 12px var(--gold-glow));
    }
    .rb2 .rt {
      font-size: 16px;
      font-family: var(--font-display);
      color: var(--gold-primary);
      margin-bottom: 2px;
      text-shadow: 0 0 12px var(--gold-glow);
    }
    .rb2 .rd {
      color: var(--text-muted);
      font-size: var(--text-sm);
      margin-bottom: 10px;
      line-height: 1.5;
    }
    .rbg {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 4px;
      max-width: 440px;
      margin: 0 auto 10px;
      text-align: left;
    }
    .rbb {
      background: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      padding: 3px 6px;
      font-size: var(--text-2xs);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .rbb .bv {
      color: var(--gold-primary);
      font-family: var(--font-mono);
    }

    .ctt {
      display: flex; gap: 4px;
      margin-bottom: 4px;
      flex-wrap: wrap;
      position: relative;
      z-index: 10;
    }
    .ctt button {
      flex: 1; min-width: 50px;
      padding: 5px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      font-size: var(--text-sm);
      cursor: pointer;
      font-family: var(--font-body);
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      outline: none;
    }
    #cC {
      position: relative;
      z-index: 1;
    }
    .ctt button:hover:not(.on) {
      color: var(--text-secondary);
      border-color: var(--border-strong);
    }

    .cgd {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
      gap: 5px;
    }
    .ccd {
      background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 8px;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
    }
    @media (hover: hover) {
      .ccd:hover {
        border-color: rgba(255,255,255,.1);
        box-shadow: var(--shadow-sm);
        transform: translateY(-1px);
      }
    }
    .ccd.ow { border-color: var(--exp); }
    .ccd .ch {
      display: flex; align-items: center; gap: 4px;
      margin-bottom: 3px;
    }
    .ccd .ci { font-size: 16px; }
    .ccd .cn { font-size: var(--text-xs); font-weight: 700; }
    .ccd .cd2 {
      font-size: 9px;
      color: var(--text-muted);
      line-height: 1.3;
      margin-bottom: 2px;
    }
    .ccd .cs {
      font-size: 9px;
      color: var(--exp);
      margin-bottom: 3px;
    }

    /* --- Shop --- */
    .sgd {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 6px;
    }
    .sgi {
      background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 10px 8px;
      text-align: center;
      transition: transform var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
    }
    @media (hover: hover) {
      .sgi:hover {
        border-color: rgba(255,255,255,.12);
        box-shadow: var(--shadow-md);
        transform: translateY(-2px) scale(1.02);
      }
    }
    .sgi .si {
      font-size: 28px;
      margin-bottom: 4px;
      filter: none;
    }
    .sgi .sn {
      font-size: var(--text-sm);
      font-weight: 600;
      margin-bottom: 3px;
    }
    .sgi .sd {
      font-size: var(--text-xs);
      color: var(--text-muted);
      margin-bottom: 5px;
      line-height: 1.4;
    }
    .sgi .sp {
      font-size: var(--text-xs);
      color: var(--gold-primary);
      font-family: var(--font-mono);
      margin-bottom: 5px;
    }
    .shop-qty {
      width: 50px;
      padding: 2px 4px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      font-family: var(--font-mono);
      font-size: var(--text-xs);
      outline: none;
      text-align: center;
    }
    .shop-qty:focus {
      border-color: var(--gold-primary);
    }

    /* --- Shop Tab Bar --- */
    .shop-tab-bar {
      display: flex;
      gap: 2px;
      margin-bottom: 4px;
      background: var(--bg-elevated);
      border-radius: var(--radius-md);
      padding: 3px;
      border: 1px solid var(--border-subtle);
      position: relative;
      z-index: 10;
    }
    .shop-tab {
      flex: 1;
      padding: 7px 4px;
      background: transparent;
      border: none;
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      font-family: var(--font-body);
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      outline: none;
      white-space: nowrap;
      text-align: center;
      min-width: 0;
    }
    .shop-tab:hover:not(.on) { color: var(--text-secondary); }

    :is(.eq-tab, .ach-tab, .shop-tab, .ctt button) {
      border-radius: 0.625rem;
      box-shadow: inset 0 0 0 1px rgba(211,174,99,.19);
    }
    :is(.eq-tab, .ach-tab, .shop-tab, .ctt button).on {
      color: var(--gold-light);
      font-weight: 700;
      background: linear-gradient(180deg, #131116, #0d0c10);
      box-shadow: inset 0 0 0 1px #aa8b51, inset 0 0 0 2px rgba(242,210,142,.13);
    }
    :is(.eq-tab, .ach-tab, .shop-tab, .ctt button, .sub-tab, .settings-sub-tab):focus-visible {
      outline: 2px solid var(--gold-light);
      outline-offset: -2px;
    }

    /* --- Welfare Tab Content --- */
    .welfare-grid {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .welfare-card {
      background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: transform var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
    }
    .welfare-card:hover {
      border-color: var(--border-strong);
      box-shadow: var(--shadow-sm);
    }
    .welfare-icon {
      font-size: 32px;
      flex-shrink: 0;
      filter: drop-shadow(0 0 6px var(--gold-glow));
    }
    .welfare-info { flex: 1; min-width: 0; }
    .welfare-name {
      font-size: var(--text-sm);
      font-weight: 700;
      color: var(--gold-primary);
      margin-bottom: 2px;
    }
    .welfare-desc {
      font-size: var(--text-xs);
      color: var(--text-muted);
      line-height: 1.4;
    }
    .welfare-status {
      font-size: 8px;
      color: var(--text-muted);
      font-family: var(--font-mono);
      margin-top: 2px;
    }

    /* --- Temple Tab Content --- */
    .temple-section {
      background: var(--bg-card);
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 8px;
      margin-bottom: 8px;
    }
    .temple-section-title {
      font-size: var(--text-xs);
      font-weight: 700;
      color: var(--gold-primary);
      margin-bottom: 6px;
      padding-bottom: 4px;
      border-bottom: 1px solid var(--border-subtle);
    }
    .temple-cele-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 4px;
    }
    .temple-cele-item {
      text-align: center;
      padding: 6px 2px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-subtle);
      background: rgba(0,0,0,.2);
      transition: all .2s;
    }
    .temple-cele-item.owned {
      border-color: #c9a84c;
      background: rgba(201,168,76,.12);
    }
    .temple-cele-name {
      font-size: 8px;
      color: var(--text-muted);
      line-height: 1.2;
    }
    .temple-cele-item.owned .temple-cele-name { color: #c9a84c; }
    .temple-cele-icon {
      font-size: 12px;
      margin: 2px 0;
      color: var(--text-muted);
    }
    .temple-cele-item.owned .temple-cele-icon { color: #c9a84c; }
    .temple-stat-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin-bottom: 6px;
    }
    .temple-stat-box {
      text-align: center;
      padding: 6px 4px;
      background: rgba(0,0,0,.2);
      border-radius: var(--radius-sm);
    }
    .temple-stat-label {
      font-size: var(--text-3xs);
      color: var(--text-muted);
      margin-bottom: 2px;
    }
    .temple-stat-val {
      font-size: 11px;
      font-family: var(--font-mono);
      font-weight: 700;
    }
    .temple-buff-row {
      font-size: var(--text-3xs);
      color: var(--text-muted);
      margin-bottom: 6px;
      line-height: 1.6;
    }
    .temple-buff-tag {
      display: inline-block;
      padding: 1px 4px;
      border-radius: 3px;
      margin: 1px 2px;
      font-family: var(--font-mono);
      font-weight: 600;
    }
    .temple-buff-tag.atk { color: #f87171; background: rgba(248,113,113,.1); }
    .temple-buff-tag.def { color: #60a5fa; background: rgba(96,165,250,.1); }
    .temple-buff-tag.crit { color: #fbbf24; background: rgba(251,191,36,.1); }
    .temple-buff-tag.cd { color: #f472b6; background: rgba(244,114,182,.1); }
    .temple-buff-tag.all { color: #c084fc; background: rgba(192,132,252,.1); }
    .temple-draw-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin-bottom: 8px;
    }
    .btn.temple-draw-option {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      font-size: 0.75rem;
    }
    .temple-draw-option span { font-size: 0.625rem; color: var(--text-secondary); }
    .temple-result-box {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--border-subtle);
    }
    .temple-result-title {
      font-size: 9px;
      color: var(--gold-primary);
      font-weight: 700;
      margin-bottom: 4px;
    }
    .temple-result-group {
      border-radius: var(--radius-sm);
      padding: 4px 6px;
      margin-bottom: 4px;
      font-size: 8px;
    }
    .info-pop.temple-popup {
      max-height: 80vh !important;
      max-height: 80dvh !important;
      overflow: hidden !important;
      display: flex !important;
      flex-direction: column !important;
    }
    .info-pop.temple-popup:not(.temple-draw-result) {
      height: 80vh !important;
      height: 80dvh !important;
    }
    .info-pop.temple-draw-result {
      width: min(90vw, 24rem);
      min-width: 0;
    }
    .info-pop.temple-popup .pop-body {
      flex: 1 !important;
      min-height: 0 !important;
      overflow-y: auto !important;
    }
    .info-pop.temple-popup .pop-footer {
      flex-shrink: 0 !important;
      padding-top: 8px !important;
    }
    .temple-jackpot {
      margin-block-end: 0.5rem;
      padding: 0.5rem 0.75rem;
      border: 1px solid var(--gold-primary);
      border-radius: var(--radius-md);
      background: linear-gradient(135deg, rgba(201,168,76,.16), rgba(139,92,246,.14));
      font-size: var(--text-xs);
    }
    .temple-common-result {
      margin-block-start: 0.5rem;
      padding-block-start: 0.375rem;
      border-top: 1px solid var(--border-subtle);
      font-size: var(--text-xs);
    }
    .temple-common-result summary {
      padding-block: 0.25rem;
      color: var(--text-primary);
      cursor: pointer;
    }
    #battleMilestone:not([hidden]) {
      margin-block: 0.25rem;
      color: var(--gold-light);
      font-size: var(--text-xs);
    }
    .offline-reward-heading {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
      font-family: var(--font-body);
      font-size: var(--text-2xs);
      font-weight: 700;
      color: var(--gold-primary);
    }
    .temple-pool-tabs {
      display: flex;
      gap: 2px;
      margin-bottom: 6px;
      background: var(--bg-elevated);
      border-radius: var(--radius-sm);
      padding: 2px;
      border: 1px solid var(--border-subtle);
      overflow-x: auto;
    }
    .temple-pool-tab {
      flex: 1;
      padding: 4px 6px;
      background: transparent;
      border: none;
      border-radius: 3px;
      color: var(--text-muted);
      font-size: 9px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      text-align: center;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
    }
    .temple-pool-tab.on {
      background: rgba(255,255,255,.08);
      color: var(--text-primary);
      font-weight: 600;
    }
    .temple-pool-tab:hover { color: var(--text-secondary); }
    .temple-pool-panel { display: none; }
    .temple-pool-panel.on { display: block; }

    /* --- Shop Tab Content --- */
    .shop-tab-content {
      display: none;
      animation: panelIn var(--transition-slow) ease;
      position: relative;
      z-index: 1;
    }
    .shop-tab-content.on {
      display: block;
    }

    /* --- Bag Grid --- */
    .bg-grid {
      display: flex; flex-direction: column; gap: 8px;
    }
    .ei {
      font-size: var(--text-xs);
      color: var(--text-muted);
      margin-bottom: 4px;
      font-family: var(--font-mono);
      text-align: center;
    }
    .ei b { color: var(--gold-primary); }
    .boss-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
      width: 100%;
    }
    .bg-card {
      background: linear-gradient(180deg, rgba(30,20,40,0.9), rgba(20,15,30,0.95));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 6px;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      text-align: center;
    }
    .bg-card:hover {
      border-color: rgba(255,255,255,.1);
      box-shadow: var(--shadow-sm);
    }
    .bg-card.has { border-color: var(--gold-primary); }
    .bg-card.has:hover {
      border-color: var(--gold-light);
      box-shadow: 0 0 8px var(--gold-glow);
    }

    /* --- 资源材料项 --- */
    .res-item {
      display: flex; align-items: center; gap: 4px;
      padding: 4px 5px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
    }
    .res-item.active {
      border-color: var(--border-default);
      background: var(--bg-elevated);
      border-color: color-mix(in srgb, var(--rc) 40%, transparent);
      background: color-mix(in srgb, var(--rc) 5%, var(--bg-elevated));
    }
    .res-icon { font-size: 14px; flex-shrink: 0; }
    .res-info { display: flex; flex-direction: column; min-width: 0; }
    .res-name { font-size: 8px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .res-val { font-family: var(--font-mono); font-size: 11px; font-weight: 700; line-height: 1.2; }
    .res-item.clickable { cursor: pointer; transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast); }
    .res-item.clickable:hover {
      border-color: var(--gold-primary);
      background: color-mix(in srgb, var(--rc) 10%, var(--bg-elevated));
      box-shadow: 0 0 8px color-mix(in srgb, var(--rc) 20%, transparent);
    }
    .res-item.clickable:active { transform: scale(0.96); }
    .bg-top {
      display: flex; align-items: flex-start; justify-content: space-between; gap: 5px;
      margin-bottom: 3px;
    }
    .bg-icon { font-size: 18px; }
    .bg-name { font-size: var(--text-sm); font-weight: 700; flex: 1; text-align: center; }
    .bg-count {
      font-family: var(--font-mono);
      font-size: var(--text-lg);
      color: var(--gold-primary);
      margin-left: auto;
    }
    .bg-desc {
      font-size: var(--text-xs);
      color: var(--text-muted);
      margin-bottom: 4px;
    }
    .bg-acts {
      display: flex; gap: 3px; flex-wrap: wrap;
    }

    /* --- Zodiac & Pet Equipment Slots --- */
    .zd-slots {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.375rem;
      margin: 0.3125rem 0;
      width: 100%;
    }
    .zd-slot {
      background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 0.3125rem 0.1875rem;
      text-align: center;
      font-size: var(--text-xs);
      min-height: 3rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
      position: relative;
      overflow: hidden;
    }
    .zd-slot::before {
      content: '';
      position: absolute; inset: 0;
      background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.02));
      pointer-events: none;
    }
    @media (hover: hover) {
      .zd-slot:hover {
        border-color: rgba(255,255,255,.2);
        background: var(--bg-hover);
        transform: translateY(-2px) scale(1.02);
        box-shadow: var(--shadow-sm);
      }
    }
    .zd-slot.has {
      border-color: var(--gold-primary);
      box-shadow: 0 0 12px var(--gold-glow);
    }
    .zd-slot .zs-i { font-size: 1rem; }
    .zd-slot .zs-n {
      font-size: var(--text-3xs);
      font-weight: 600;
      margin-top: 0.125rem;
    }
    .zd-slot .zs-stat {
      font-size: var(--text-3xs);
      color: var(--text-muted);
      margin-top: 0.125rem;
      font-family: var(--font-mono);
    }
    /* 升级/升10级/max 按钮行 — 三等分网格，不溢出卡片 */
    .zd-upg {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0.125rem;
      width: 100%;
      margin-top: 0.125rem;
    }
    .zd-upg .btn {
      padding: 0.125rem 0.0625rem;
      font-size: 0.625rem;
      min-height: 0;
      line-height: 1.3;
      width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* --- 秘境天赋行（紧凑双列布局）--- */
    .sr-talents { display: grid; grid-template-columns: 1fr 1fr; gap: 0.1875rem; width: 100%; }
    @media (max-width: 400px) {
      .sr-talents { grid-template-columns: 1fr; }
    }
    .sr-talent-row {
      display: flex; flex-direction: column; gap: 0.125rem;
      padding: 0.3125rem;
      background: var(--bg);
      border-radius: 0.25rem;
      width: 100%;
      box-sizing: border-box;
    }
    .sr-talent-header {
      display: flex; align-items: center; gap: 0.1875rem;
    }
    .sr-talent-info { flex: 1; min-width: 0; text-align: left; }
    .sr-talent-name {
      display: flex; justify-content: space-between; align-items: center;
      font-size: 0.5625rem; font-weight: 700; line-height: 1.2;
    }
    .sr-talent-bar {
      height: 0.1625rem; background: var(--bd);
      border-radius: 0.0625rem; margin: 0.0625rem 0;
      overflow: hidden;
    }
    .sr-talent-bar-fill { height: 100%; border-radius: 0.0625rem; transform-origin: left; }
    .sr-talent-desc { font-size: var(--text-3xs); color: var(--mt); line-height: 1.2; }
    .sr-talent-bt { font-size: var(--text-3xs); color: #f472b6; line-height: 1.2; }
    .sr-talent-locked { font-size: var(--text-3xs); color: #f87171; line-height: 1.2; }
    .sr-talent-btns { display: flex; flex-direction: row; gap: 0.0625rem; flex-wrap: wrap; margin-top: 0.0625rem; }
    .sr-talent-cost { font-size: var(--text-3xs); color: var(--mt); text-align: center; line-height: 1.2; word-break: break-all; overflow: hidden; flex: 1; min-width: 0; }
    .sr-talent-btn-row { display: flex; gap: 0.0625rem; flex-wrap: wrap; }
    .sr-talent-btn-row .btn { flex: 1 1 auto; min-width: 0; padding: 0.0625rem 0.1875rem; font-size: 0.625rem; }

    /* --- Pet Trial Bar --- */
    .pt-bar {
      display: flex; gap: 4px; margin-bottom: 5px; flex-wrap: wrap;
    }
    .pt-bar .btn { flex: 1; min-width: 50px; }

    /* 弹窗遮罩淡入。原来只写 to{opacity:0}，实际是在打开时淡出，
       ArkWeb 上可能在动画结束后仍保持透明，表现为闪烁或弹窗不可见。 */
    @keyframes fo {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    /* --- 升级仪式 --- */
    .levelup-fx {
      position: fixed; inset: 0; z-index: 200;
      display: flex; align-items: center; justify-content: center;
      pointer-events: none;
    }
    .levelup-fx .lvup-text {
      font-family: var(--font-display);
      font-size: 28px; font-weight: 900;
      background: linear-gradient(135deg, var(--gold-light), var(--gold-primary), var(--gold-dark));
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      background-clip: text;
      text-shadow: none;
      filter: drop-shadow(0 0 20px var(--gold-glow-strong)) drop-shadow(0 0 40px var(--gold-glow));
    }

    /* --- 怪物死亡淡出 --- */
    .mn-card.dead {
      opacity: 0.15;
      transition: opacity .4s ease;
    }

    /* --- HP条平滑过渡（已移除transition以消除抖动）--- */
    .mn-hp-fill {
      transition: none;
    }
    .pl-hp-fill {
      transition: none;
    }

    /* --- 连击计数 --- */
    .combo-display {
      font-family: var(--font-display);
      font-size: 20px; font-weight: 900;
      text-shadow: 0 0 12px currentColor, 0 0 24px currentColor;
      animation: comboPop .7s ease-out forwards;
      white-space: nowrap;
    }
    @keyframes comboPop {
      0% { opacity: 1; transform: translateX(-50%) scale(0.5); }
      30% { opacity: 1; transform: translateX(-50%) scale(1.2); }
      60% { opacity: .8; transform: translateX(-50%) scale(1); }
      100% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.8); }
    }

    /* --- 转生进度条 --- */
    .rb-progress {
      height: 6px; background: var(--border-subtle);
      border-radius: 3px; overflow: hidden;
      margin: 4px auto; max-width: 260px;
      border: 1px solid var(--border-default);
    }
    .rb-progress-fill {
      height: 100%; border-radius: 3px;
      background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary));
      transform-origin: left;
      box-shadow: 0 0 6px var(--gold-glow);
    }

    /* --- 宠物面板 --- */
    .pet-card {
      background: transparent;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-md);
      padding: 6px 4px;
      cursor: pointer;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      text-align: center;
      min-width: 0;
      overflow: hidden;
      word-break: break-all;
      overflow-wrap: anywhere;
    }
    @media (hover: hover) {
      .pet-card:hover {
        border-color: var(--gold-primary);
        box-shadow: 0 0 8px var(--gold-glow);
        transform: translateY(-2px);
      }
    }
    .pet-card.equipped {
      box-shadow: 0 0 12px var(--gold-glow-strong);
    }
    .pet-card img {
      filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
      background: transparent;
    }

    /* --- Toast --- */
    .tst {
      position: fixed; top: 16px; left: 50%;
      transform: translateX(-50%);
      background: rgba(26,21,48,.96);
      border: 1px solid var(--gold-primary);
      padding: 7px 16px;
      border-radius: var(--radius-md);
      z-index: var(--z-toast);
      font-size: var(--text-sm);
      animation: ti .2s ease, to2 .2s ease 1.8s forwards;
      pointer-events: none;
      max-width: 90vw;
      text-align: center;
      box-shadow: var(--shadow-lg), 0 0 20px var(--gold-glow);
    }
    @keyframes ti {
      from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
      to { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
    @keyframes to2 { to { opacity: 0; } }

    /* --- Jump Input --- */
.jump-input {
  width: 70px;
  padding: 3px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  outline: none;
  text-align: center;
  transition: border-color var(--transition-fast);
}
.jump-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}
.jump-input::placeholder {
  color: var(--text-muted);
  font-size: var(--text-3xs);
}

/* --- Auto-next Indicator --- */
    .auto-next-ind {
      display: inline-block;
      padding: 3px 12px;
      border-radius: 20px;
      font-size: var(--text-xs);
      font-weight: 700;
      background: var(--exp-dim);
      color: var(--exp);
      border: 1px solid rgba(74,222,128,.35);
      animation: pulse-an 1.8s ease infinite;
      cursor: pointer;
      white-space: nowrap;
    }
    .auto-next-ind.off {
      background: rgba(255,255,255,.03);
      color: var(--text-muted);
      border-color: var(--border-default);
      animation: none;
    }
    @keyframes pulse-an {
      0%, 100% { opacity: 1; }
      50% { opacity: .5; }
    }

    /* --- Info Popup --- */
    .info-pop {
      position: fixed; top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      background: linear-gradient(180deg, var(--bg-elevated), var(--bg-base));
      border: 1px solid #94794d;
      outline: 1px solid #51402f;
      outline-offset: 3px;
      border-radius: var(--radius-md);
      padding: 14px 18px;
      z-index: var(--z-modal);
      min-width: 180px;
      max-width: 90vw;
      max-height: 85vh;
      overflow-y: auto;
      text-align: center;
      animation: popin .25s cubic-bezier(.34,1.56,.64,1);
      box-shadow: var(--shadow-xl), inset 0 1px rgba(240,212,138,.16);
      pointer-events: auto;
      touch-action: manipulation;
    }
    @media (max-width: 360px) {
      .info-pop {
        min-width: 160px;
        max-width: 95vw;
        padding: 10px 12px;
      }
    }
    .info-pop.filter-pop {
      width: 90vw;
      max-width: 26em;
      min-width: 18em;
      display: flex;
      flex-direction: column;
      height: 60vh;
      height: 60dvh;
    }
    .info-pop.filter-pop .pop-body {
      flex: 1;
      overflow-y: auto;
      min-height: 0;
    }
    .info-pop.filter-pop .pop-close {
      flex-shrink: 0;
      margin-top: 8px;
    }
    .info-pop .pop-title {
      font-size: var(--text-lg);
      font-weight: 700;
      color: var(--gold-primary);
      margin-bottom: 8px;
      padding-bottom: 6px;
      border-bottom: 1px solid var(--border-default);
      text-shadow: 0 0 12px var(--gold-glow);
    }
    .info-pop .pop-body {
      font-size: var(--text-xs);
      color: var(--text-primary);
      line-height: 1.6;
      font-family: var(--font-mono);
    }
    .info-pop.pet-detail-pop {
      inline-size: min(92vw, 24rem);
      min-inline-size: 0;
      --pet-detail-button-height: 2rem;
    }
    @media (any-pointer: coarse) {
      .info-pop.pet-detail-pop {
        --pet-detail-button-height: max(44px, 2rem);
      }
    }
    .pet-detail-pop .pop-title {
      font-size: var(--text-base);
    }
    .pet-detail-info {
      text-align: left;
      font-size: var(--text-sm);
      line-height: 1.45;
      overflow-wrap: break-word;
    }
    .pet-detail-name {
      font-size: var(--text-md);
      font-weight: 700;
    }
    .pet-detail-affection-bonus {
      font-size: var(--text-xs);
      color: var(--mt);
    }
    .pet-detail-evolution {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-block: 4px;
    }
    .pet-detail-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-block-start: 8px;
    }
    .pet-detail-pop .pet-detail-actions > .btn,
    .pet-detail-pop .pet-detail-evolution > .btn,
    .info-pop.pet-detail-pop .pop-close {
      min-block-size: var(--pet-detail-button-height);
      min-inline-size: 44px;
      padding-inline: 0.75rem;
      font-size: var(--text-xs);
      line-height: 1.25;
    }
    .pet-detail-evolution > .btn {
      flex-shrink: 0;
    }
    .pet-detail-training {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .info-pop.equip-detail-pop {
      width: min(92vw, 30rem);
      min-width: 0;
    }
    .equip-compare {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
      gap: 0.5rem;
    }
    .equip-detail-card {
      min-width: 0;
      padding: 0.5rem 0.625rem;
      text-align: left;
      overflow-wrap: anywhere;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      background: var(--bg-surface);
    }
    .equip-detail-kicker {
      font-size: var(--text-3xs);
      font-weight: 700;
      margin-bottom: 0.25rem;
    }
    .equip-detail-name {
      font-size: var(--text-sm);
      font-weight: 700;
    }
    .equip-detail-meta {
      font-size: var(--text-3xs);
      color: var(--text-secondary);
    }
    .equip-detail-stat { color: var(--exp); }
    .equip-detail-affixes {
      margin-top: 0.375rem;
      padding-top: 0.375rem;
      border-top: 1px solid var(--border-subtle);
      font-size: var(--text-xs);
    }
    .equip-preview {
      display: grid;
      gap: 0.375rem;
      margin-top: 0.5rem;
      padding: 0.5rem 0.625rem;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      text-align: left;
      font-size: var(--text-xs);
    }
    .equip-preview h3 { margin: 0; font-size: inherit; }
    .equip-preview small { display: block; color: var(--text-secondary); overflow-wrap: anywhere; }
    .equip-preview-up { color: var(--exp); }
    .equip-preview-down { color: var(--hp); }
    .equip-detail-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.375rem;
      margin-top: 0.625rem;
      padding-top: 0.625rem;
      border-top: 1px solid var(--border-default);
    }
    .stat-tab-panel {
      text-align: left;
      font-size: 9px;
      line-height: 1.8;
      font-family: var(--font-body);
    }
    .offline-rate-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
      gap: 0.125rem 0.375rem;
      color: var(--text-primary);
      font: var(--text-2xs)/1.35 var(--font-body);
      overflow-wrap: anywhere;
    }
    .stat-tab.on {
      background: var(--gold-primary) !important;
      color: #0a0a0a !important;
      font-weight: 700;
    }
    .info-pop .pop-close {
      margin-top: 10px;
      font-size: var(--text-xs);
      cursor: pointer;
      padding: 4px 14px;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      background: var(--bg-hover);
      color: var(--text-primary);
      display: inline-block;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      font-family: inherit;
      line-height: inherit;
    }
    .info-pop .pop-close:hover {
      border-color: var(--gold-primary);
      background: var(--gold-glow);
    }
    .info-pop .pop-close:active {
      transform: scale(0.95);
      filter: brightness(0.9);
    }

    /* 洗炼弹窗 - 自适应宽度 */
    .info-pop.reroll-pop {
      width: 72vw;
      max-width: 21em;
      min-width: 14em;
    }
    @media (min-width: 480px) {
      .info-pop.reroll-pop {
        width: 64vw;
      }
    }
    @media (max-width: 360px) {
      .info-pop.reroll-pop {
        width: 76vw;
        min-width: 12em;
        padding: 10px 12px;
      }
    }

    /* v2.8.7: 图鉴详情弹窗 - 扩大宽度，适配移动端 */
    .info-pop.coll-detail {
      width: 94vw;
      max-width: 30em;
      min-width: 16em;
      padding: 10px 12px;
      text-align: left;
    }
    @media (min-width: 480px) {
      .info-pop.coll-detail {
        width: 80vw;
        max-width: 32em;
      }
    }
    @media (max-width: 360px) {
      .info-pop.coll-detail {
        width: 96vw;
        padding: 8px 10px;
      }
    }
    .info-pop.coll-detail .pop-title {
      font-size: 12px;
      margin-bottom: 6px;
    }
    .info-pop.coll-detail .pop-body {
      font-size: 9px;
      line-height: 1.5;
    }

    /* v2.8.7: 基础成就详情弹窗 - 同图鉴弹窗风格 */
    .info-pop.achv-detail {
      width: 94vw;
      max-width: 30em;
      min-width: 16em;
      padding: 10px 12px;
      text-align: left;
    }
    @media (min-width: 480px) {
      .info-pop.achv-detail {
        width: 80vw;
        max-width: 32em;
      }
    }
    @media (max-width: 360px) {
      .info-pop.achv-detail {
        width: 96vw;
        padding: 8px 10px;
      }
    }
    .info-pop.achv-detail .pop-title {
      font-size: 12px;
      margin-bottom: 6px;
    }
    .info-pop.achv-detail .pop-body {
      font-size: 9px;
      line-height: 1.5;
    }

    /* v2.8.7: 大成就详情弹窗 - 扩大宽度，减小字体，防止换行 */
    .info-pop.bigachv-detail {
      width: 96vw;
      max-width: 34em;
      min-width: 18em;
      padding: 10px 12px;
      text-align: left;
    }
    @media (min-width: 480px) {
      .info-pop.bigachv-detail {
        width: 82vw;
        max-width: 36em;
      }
    }
    @media (max-width: 360px) {
      .info-pop.bigachv-detail {
        width: 98vw;
        padding: 8px 10px;
      }
    }
    .info-pop.bigachv-detail .pop-title {
      font-size: 12px;
      margin-bottom: 6px;
    }
    .info-pop.bigachv-detail .pop-body {
      font-size: 9px;
      line-height: 1.5;
    }
    /* 阶段目标行：防止换行，紧凑布局 */
    .info-pop.bigachv-detail .achv-stage-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 3px 0;
      border-bottom: 1px solid #1a1520;
      gap: 4px;
      flex-wrap: nowrap;
      overflow: hidden;
    }
    .info-pop.bigachv-detail .achv-stage-row > div {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .info-overlay {
      position: fixed; inset: 0;
      z-index: var(--z-overlay);
      background: rgba(6,5,14,.78);
      animation: fo .2s ease;
      pointer-events: auto;
    }
@keyframes popin {
from { opacity: 0; transform: translate(-50%,-50%) scale(.85); }
to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
/* v2.9.2: 供 flex 居中弹窗使用的入场动画（无 translate，避免鸿蒙 WebView 偏移） */
@keyframes popin-center {
from { opacity: 0; transform: scale(.92); }
to { opacity: 1; transform: scale(1); }
}

    /* ===== 云存档弹窗 ===== */
    .cld-overlay {
      position: fixed; inset: 0;
      z-index: calc(var(--z-overlay) - 1);
      background: rgba(6,5,14,.78);
      display: flex;
      align-items: center;
      justify-content: center;
      animation: fo .15s ease;
    }
    /* 登录弹窗由设置弹窗内打开，显式提高层级，避免 ArkWeb 对同 z-index +
       backdrop-filter 的合成顺序不稳定。 */
    #cldOv { z-index: calc(var(--z-modal) + 1); }
.cld-box {
background: var(--bg-card);
border: 1px solid var(--border-default);
border-radius: var(--radius-lg);
padding: 1.1em 1.25em;
min-width: 16em;
max-width: 85vw;
box-shadow: var(--shadow-xl);
animation: popin-center .2s ease;
}
    .cld-title {
      font-size: var(--text-lg);
      font-weight: 700;
      color: var(--gold-primary);
      margin-bottom: 10px;
      text-align: center;
    }
    .cld-msg {
      font-size: var(--text-xs);
      color: var(--text-muted);
      text-align: center;
      margin-bottom: 10px;
      line-height: 1.5;
    }
    .cld-inp {
      width: 100%;
      padding: 7px 10px;
      margin-bottom: 6px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: var(--text-sm);
      outline: none;
      transition: border-color var(--transition-fast);
    }
    .cld-inp:focus {
      border-color: var(--gold-primary);
      box-shadow: 0 0 10px var(--gold-glow);
    }
    .cld-inp::placeholder { color: var(--text-muted); }
/* v3.2.1: 伪装密码字段 — 使用 -webkit-text-security 让 type="text" 显示为圆点 */
/* 这样浏览器不识别为密码字段，不会弹出"记住密码"提示 */
.cld-inp.cld-pass-fake {
  -webkit-text-security: disc;
  text-security: disc;
  font-family: var(--font-mono, monospace);
  letter-spacing: 2px;
}
/* Firefox 不支持 -webkit-text-security，使用 -moz-text-security 或 font 混淆 */
@supports not (-webkit-text-security: disc) {
  .cld-inp.cld-pass-fake {
    -moz-text-security: disc;
  }
}
    .cld-err {
      font-size: var(--text-xs);
      color: var(--hp);
      text-align: center;
      margin-bottom: 5px;
      min-height: 16px;
    }
    .cld-acts {
      display: flex; gap: 5px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .cld-acts .btn { min-width: 64px; }
    .cld-user {
      font-size: var(--text-xs);
      color: var(--exp);
      text-align: center;
      margin-bottom: 6px;
    }

    /* --- Settings Panel --- */
    .settings-btn {
      background: var(--bg-card); border: 1px solid var(--border-default);
      color: var(--text-primary);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      padding: 3px 8px;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      line-height: 1.2;
      outline: none;
      border-radius: var(--radius-sm);
      min-width: 32px;
      min-height: 22px;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }
    .settings-btn:hover {
      color: var(--gold-primary);
      background: var(--gold-glow);
      border-color: var(--gold-primary);
    }
    .settings-btn:active {
      transform: scale(0.95);
    }

    /* ArkWeb/HarmonyOS: 明确声明轻触行为，避免滚动手势吞掉合成 click。 */
    .tap-safe {
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      pointer-events: auto;
    }
    .settings-box {
      width: min(90vw, 17.5em);
      max-height: 85vh;
      overflow-y: auto;
    }
    .settings-content {
      text-align: left;
    }
    .settings-main-tabs {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(0, 1fr);
      border-bottom: 1px solid var(--border-subtle);
    }
    .settings-tab, .settings-sub-tab {
      min-height: 2rem;
      padding: 0.375rem 0.5rem;
      color: var(--text-secondary);
      background: transparent;
      font: 600 var(--text-xs)/1.35 var(--font-body);
      cursor: pointer;
    }
    .settings-tab {
      min-width: 0;
      border: 0;
      border-bottom: 2px solid transparent;
    }
    .settings-tab.on {
      color: var(--gold-light);
      border-bottom-color: var(--gold-primary);
    }
    .settings-sub-tab {
      border: 1px solid transparent;
      border-radius: var(--radius-sm);
    }
    .settings-sub-tab.on {
      color: var(--gold-light);
      font-weight: 700;
      background: linear-gradient(var(--gold-primary), var(--gold-primary)) bottom / 1.25rem 1px no-repeat;
    }
    #settingsOverlay .settings-box {
      display: flex;
      flex-direction: column;
      width: min(92vw, 28rem);
      min-width: 0;
      max-width: 100%;
      max-height: 88vh;
      max-height: 88dvh;
      padding: 0;
      border: 1px solid var(--border-default);
      overflow: hidden;
    }
    .settings-dialog-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex: 0 0 auto;
      gap: 0.5rem;
      padding: 0.625rem 0.875rem;
      background: var(--bg-surface);
      border-bottom: 1px solid var(--border-subtle);
    }
    .settings-dialog-header .cld-title { margin: 0; text-align: start; }
    #overlaySettingsContent {
      height: min(62vh, 28rem);
      height: min(62dvh, 28rem);
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior-y: contain;
      scrollbar-gutter: stable;
      padding: 0 0.875rem 0.625rem;
    }
    [data-settings-panel], [data-settings-subnav] { display: none; }
    [data-settings-panel].on, [data-settings-subnav].on { display: block; }
    .settings-toggle-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.35em 0.6em;
    }
    .settings-toggle-grid label { min-width: 0; }
    .settings-group {
      margin-bottom: 0.375em;
      padding-bottom: 0.3em;
      border-bottom: 1px solid var(--border-subtle);
    }
    .settings-group:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    .settings-label {
      font-size: var(--text-xs);
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 0.2em;
    }
    .settings-actions {
      display: flex;
      gap: 0.25em;
      flex-wrap: wrap;
    }
    .settings-slider-row {
      display: flex;
      align-items: center;
      gap: 0.375em;
    }
    .settings-slider-row input[type="range"] {
      flex: 1;
      -webkit-appearance: none;
      appearance: none;
      height: 0.2em;
      background: var(--border-default);
      border-radius: 2px;
      outline: none;
    }
    .settings-slider-row input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 0.875em;
      height: 0.875em;
      border-radius: 50%;
      background: var(--gold-primary);
      cursor: pointer;
      box-shadow: 0 0 6px var(--gold-glow);
    }
    .settings-slider-row input[type="range"]::-moz-range-thumb {
      width: 0.875em;
      height: 0.875em;
      border-radius: 50%;
      background: var(--gold-primary);
      cursor: pointer;
      border: none;
    }
    .settings-val {
      font-family: var(--font-mono);
      font-size: var(--text-3xs);
      color: var(--gold-primary);
      min-width: 30px;
      text-align: right;
    }
    .settings-ver {
      font-size: var(--text-3xs);
      color: var(--text-muted);
      font-family: var(--font-mono);
    }
    /* 天赋鎏金风格 */
    .achv-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
      gap: 5px;
    }
    .achv-card {
      background: linear-gradient(180deg, #1a1520, #0f0a18);
      border: 1px solid #3a3050;
      border-radius: var(--radius-md);
      padding: 8px 6px;
      text-align: center;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      box-shadow: 0 0 6px rgba(0,0,0,0.3);
      opacity: 0.6;
    }
    /* v2.8.3: 已完成卡片边框光晕 — 默认金色光晕，inline style 可覆盖为分类配色 */
    .achv-card.done {
      border-color: #8a6f25;
      opacity: 1;
      box-shadow: 0 0 12px rgba(212,168,67,0.15), inset 0 1px 0 rgba(212,168,67,0.1);
    }
    .achv-card.done:hover {
      border-color: #F0D48A;
      transform: translateY(-2px);
    }
    /* v2.8.3: 文字无光晕 — 移除渐变文字效果，改用纯色 */
    .achv-card .achv-name {
      font-size: var(--text-xs);
      font-weight: 700;
      color: #9aa4bf;
      margin-bottom: 2px;
    }
    .achv-card.done .achv-name {
      color: #F0D48A;
    }
    .achv-card .achv-desc {
      font-size: var(--text-3xs);
      color: #5d6f8f;
      line-height: 1.3;
      margin-bottom: 3px;
    }
    .achv-card .achv-reward {
      font-size: var(--text-3xs);
      color: var(--text-muted);
      line-height: 1.3;
      font-family: var(--font-mono);
    }
    .achv-card.done .achv-reward {
      color: #34d399;
    }
    .talent-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 5px;
    }
    .talent-card {
      background: linear-gradient(180deg, #1a1520, #0f0a18);
      border: 1px solid #8a6f25;
      border-radius: var(--radius-sm);
      padding: 4px 3px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
      box-shadow: 0 0 10px rgba(212,168,67,0.1), inset 0 1px 0 rgba(212,168,67,0.15);
    }
    .talent-card:hover {
      border-color: #F0D48A;
      box-shadow: 0 0 20px rgba(212,168,67,0.25), inset 0 1px 0 rgba(212,168,67,0.2);
      transform: translateY(-2px);
    }
    .talent-name {
      font-size: var(--text-sm);
      font-weight: 900;
      color: #F0D48A;
      text-shadow: none;
      letter-spacing: 1px;
      margin-bottom: 2px;
    }
    .talent-desc {
      font-size: var(--text-3xs);
      color: #9aa4bf;
      line-height: 1.4;
      margin-bottom: 3px;
    }
    .talent-lv {
      font-family: var(--font-mono);
      font-size: 16px;
      font-weight: 700;
      color: #F0D48A;
      text-shadow: 0 0 12px rgba(212,168,67,0.5), 0 0 24px rgba(212,168,67,0.2);
      margin: 3px 0;
    }
    .talent-card .btn {
      min-width: 20px;
      height: 18px;
      padding: 0 3px;
      font-size: 8px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      background: linear-gradient(135deg, #8B6914, #F0D48A);
      color: #0a0a0a;
      border-color: #F0D48A;
    }
    .talent-card .btn:disabled {
      opacity: 0.3;
    }
    .save-slot {
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      padding: 4px 6px;
      margin-bottom: 4px;
      font-size: var(--text-xs);
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .save-slot .slot-info {
      flex: 1;
      font-family: var(--font-mono);
      color: var(--text-muted);
      min-width: 80px;
      font-size: var(--text-3xs);
    }
    .save-slot .slot-info b {
      color: var(--text-primary);
    }
    .save-slot .slot-actions {
      display: flex;
      gap: 3px;
    }
    .save-slot .slot-actions .btn {
      font-size: var(--text-3xs);
      padding: 2px 6px;
    }

    /* ===== 响应式设计 ===== */

    /* 小型设备 ≤600px */
    @media (max-width: 600px) {
      .bl-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem;
      }
      .bl-main .pl-side { padding: 0.375rem 0.3125rem; }
      .bl-main .avatar-img { max-width: 2.625rem; max-height: 2.625rem; }
      .bl-main .pl-title { font-size: var(--text-md); }
      .bl-main .pl-hp-bar { height: 0.625rem; }
      .bl-main .pl-hp-fill { line-height: 0.625rem; }
      .bl-main .pl-stats {
        font-size: var(--text-sm);
        margin-top: 0.1875rem;
        line-height: 1.5;
      }
      .bl-main .mn-card {
        padding: 0.25rem 0.375rem;
        grid-template-columns: 1fr;
        gap: 0.25rem;
        min-height: 3.125rem;
      }
      .bl-main .mn-info .mn-name { font-size: var(--text-2xs); }
      .bl-main .mn-info .mn-lv { font-size: var(--text-2xs); }
      .bl-main .mn-stats { font-size: var(--text-2xs); }

      header {
        padding: 0.1875rem 0.5rem;
        gap: 0.1875rem;
        min-height: 2.375rem;
      }
      .gt {
        font-size: var(--text-lg);
        letter-spacing: 1px;
      }
      .hr { gap: 0.1875rem; font-size: var(--text-xs); }
      .lb { font-size: var(--text-2xs); padding: 0 0.3125rem; }
      .ew { font-size: var(--text-xs); }
      .bo { width: 2.625rem; height: 0.25rem; }
      .cur { font-size: var(--text-xs); gap: 0.1875rem; }

      nav button iconify-icon,
      nav button .nav-local-icon { width: 0.875rem !important; height: 0.875rem !important; font-size:0.8125rem; }
      .pn.ac { padding: 0.3125rem 0.3125rem 0.5rem; }
      .cd { padding: 0.375rem; margin-bottom: 0.25rem; border-radius: var(--radius-sm); }
      .btn:not(.xs):not(.sm) { padding: 0.25rem 0.5rem; font-size: var(--text-xs); border-radius: var(--radius-sm); }
      .btn.sm { padding: 0.125rem 0.375rem; font-size: var(--text-2xs); min-height: 1.5rem; }
      .btn.xs { padding: 0.0625rem 0.3125rem; font-size: var(--text-2xs); min-height: 1.125rem; }
      .ms .btn { padding: 0.25rem 0.125rem; font-size: var(--text-xs); }
      .ct { font-size: var(--text-xs); }

      .es { min-height: 2.75rem; }
      .es .si { font-size: 0.8125rem; }
      .es .sn { font-size: var(--text-3xs); }

      .eg2 { grid-template-columns: repeat(2, 1fr); gap: 0.1875rem; }
      .rf-grid { grid-template-columns: repeat(3, 1fr); gap: 0.1875rem; }
      .cgd { grid-template-columns: repeat(auto-fill, minmax(8.125rem, 1fr)); }
      .sgd { grid-template-columns: repeat(auto-fill, minmax(6.875rem, 1fr)); }
      .shop-tab { font-size: var(--text-sm); padding: 0.3125rem 0.125rem; }
      .welfare-card { padding: 0.5rem 0.375rem; gap: 0.5rem; }
      .welfare-icon { font-size: 1.625rem; }
      .bg-grid { grid-template-columns: repeat(auto-fill, minmax(8.125rem, 1fr)); }

      .zd-slots { grid-template-columns: repeat(2, 1fr); gap: 0.25rem; }

      /* 收集界面字体缩小 */
      .cgd { gap: 0.25rem; }
      .ccd { padding: 0.3125rem 0.25rem; }
      .ccd .ci { font-size: 1rem; }
      .ccd .cn { font-size: var(--text-md); }
      .ccd .cd2 { font-size: var(--text-2xs); }
      .ccd .cs { font-size: var(--text-2xs); }
      .ctt button { font-size: var(--text-md); padding: 0.25rem 0.1875rem; min-width: 2.75rem; }




      .settings-box { width: 92vw; padding: 0.75em 0.875em; }
      .settings-group { margin-bottom: 0.25em; padding-bottom: 0.25em; }
    }

    /* 超小型设备 ≤380px */
    @media (max-width: 380px) {
      .gt { font-size: var(--text-md); letter-spacing: .5px; }
      .hr { gap: 0.125rem; font-size: var(--text-3xs); }
      .lb { font-size: var(--text-3xs); padding: 0 0.25rem; }
      .bo { width: 1.875rem; height: 0.1875rem; }
      .cur { font-size: var(--text-3xs); gap: 0.125rem; }
      nav button iconify-icon,
      nav button .nav-local-icon { width: 0.75rem !important; height: 0.75rem !important; font-size:0.75rem; }
      .bg { font-size: var(--text-3xs); min-width: 0.75rem; padding: 0 0.125rem; }
      header { padding: 0.125rem 0.3125rem; min-height: 2.125rem; }
      .sb { width: 1.75rem; height: 1.375rem; font-size: var(--text-3xs); }
      .ms .btn { font-size: var(--text-2xs); padding: 0.1875rem 0.0625rem; }

      /* 怪物信息超小屏 */
      .bl-main .mn-info .mn-name { font-size: var(--text-2xs); }
      .bl-main .mn-info .mn-lv { font-size: var(--text-3xs); }
      .bl-main .mn-stats { font-size: 0.625rem; gap: 0.1875rem; }

      /* 收集界面超小屏 */
      .ctt button { font-size: var(--text-2xs); padding: 0.1875rem 0.125rem; min-width: 2.5rem; }
      .ccd .cn { font-size: var(--text-xs); }
      .ccd .cd2 { font-size: var(--text-2xs); }
      .ccd .cs { font-size: var(--text-2xs); }

      .settings-box { width: 95vw; padding: 0.625em 0.75em; }
      .settings-label { font-size: var(--text-3xs); }
    }

    /* 平板及以上 ≥768px */
    @media (min-width: 768px) {
      .bl-main { gap: 0.5rem; }
      .pl-side { padding: 0.875rem; }
      .avatar-img { max-width: 4rem; max-height: 4rem; }
      .pl-title { font-size: var(--text-xl); }
      .pl-stats { font-size: var(--text-sm); }

      .pn.ac { padding: 0.75rem 0.75rem 1rem; }
      .cd { padding: 0.875rem; margin-bottom: 0.625rem; }

      .eg { max-width: 24rem; margin-inline: auto; gap: 0.375rem; }
      .es { min-height: 4rem; }
      .es .si { font-size: 1.25rem; }
      .es .sn { font-size: var(--text-sm); }

      .eg2 { grid-template-columns: repeat(2, 1fr); gap: 0.375rem; }
      .cgd { grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr)); gap: 0.375rem; }
      .sgd { grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr)); gap: 0.5rem; }
      .bg-grid { gap: 0.375rem; }

      .zd-slots { gap: 0.375rem; }
      .zd-slot .zs-i { font-size: 1.25rem; }
      .zd-slot .zs-n { font-size: var(--text-2xs); }
    }


/* ================================================================
   METALLIC & GLOW EFFECTS — Premium dark-fantasy icon treatment
   ================================================================ */

/* --- Player icon: subtle depth --- */
.pl-icon {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.mn-card.elite-card { border-inline-start: 3px solid var(--gold-light); }
.mn-card.boss-card { border-inline-start: 4px solid var(--hp); }

/* --- Equipment slot icons (iconify SVG) --- */
.es .si {
  filter: none;
}

/* --- Zodiac & pet equipment icons --- */
.zd-slot .zs-i {
  filter: none;
}

/* --- Collection panel icons --- */
.ccd .ci {
  filter: none;
}

/* --- Bag item icons --- */
.bg-icon {
  filter: none;
}

/* --- Shop icons --- */
.sgi .si {
  filter: none;
}

/* ================================================================
   RARITY METALLIC TEXT — Gradient name labels per rarity tier
   ================================================================ */

/* Rarity 0: 普通 - 灰色 */
.r0 .sn, .r0 .en {
  background: linear-gradient(180deg, #9CA3AF 0%, #6B7280 50%, #4B5563 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 1: 优质 - 翠绿 */
.r1 .sn, .r1 .en {
  background: linear-gradient(180deg, #6EE7B7 0%, #34D399 40%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 2: 精良 - 蓝色 */
.r2 .sn, .r2 .en {
  background: linear-gradient(180deg, #93C5FD 0%, #60A5FA 40%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 3: 稀有 - 紫色 */
.r3 .sn, .r3 .en {
  background: linear-gradient(180deg, #C4B5FD 0%, #A78BFA 40%, #7C3AED 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 4: 史诗 - 琥珀 */
.r4 .sn, .r4 .en {
  background: linear-gradient(180deg, #FCD34D 0%, #F59E0B 40%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 5: 传说 - 红色 */
.r5 .sn, .r5 .en {
  background: linear-gradient(180deg, #FCA5A5 0%, #EF4444 40%, #DC2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 6: 神话 - 青色 */
.r6 .sn, .r6 .en {
  background: linear-gradient(180deg, #67E8F9 0%, #22D3EE 40%, #0891B2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 7: 远古 - 暗金 */
.r7 .sn, .r7 .en {
  background: linear-gradient(180deg, #F0D48A 0%, #C9A84C 30%, #8B6E2A 70%, #5C4A1A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 8: 不朽 - 深紫 */
.r8 .sn, .r8 .en {
  background: linear-gradient(180deg, #A78BFA 0%, #8B5CF6 40%, #6D28D9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rarity 9: 混沌 - 亮红 */
.r9 .sn, .r9 .en {
  background: linear-gradient(180deg, #ff6b8a 0%, #ff2d55 40%, #cc0033 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================================
   PANEL TITLE GRADIENT — Collection & shop name labels
   ================================================================ */
.ccd .cn, .bg-name, .zd-slot .zs-n, .sgi .sn { font-weight: 700; }

/* Achievement badges - metallic gold icon */
#achc-list [style*="font-size:14px"] {
  filter: drop-shadow(0 0 3px rgba(212,168,67,0.4))
          drop-shadow(0 0 8px rgba(240,212,138,0.2));
}

/* ================================================================
   BOSS ICON ENHANCEMENT
   ================================================================ */
#stCtrl [style*="font-size:9px"] {
  text-shadow: 0 0 4px var(--gold-glow),
               0 0 10px rgba(212,168,67,0.2);
}

/* ================================================================
   RARITY BORDER GLOW — Elevated card edge treatment
   ================================================================ */
.es.r5, .es.r6, .es.r7, .es.r8, .es.r9 {
  box-shadow: 0 0 8px var(--rc-glow),
              0 0 16px var(--rc-glow),
              var(--shadow-xs);
}

.ec.r5, .ec.r6, .ec.r7, .ec.r8, .ec.r9 {
  box-shadow: 0 0 6px var(--rc-glow),
              var(--shadow-xs);
}

/* ================================================================
   HONOR RANK SYSTEM — 荣誉等级
   ================================================================ */
.honor-cd {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 7px;
}
.honor-current-title {
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(135deg, #F0D48A, #F0D48A, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}
.honor-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(212,168,67,0.2);
  margin: 0 auto 4px;
  max-width: 260px;
}
.honor-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B5CF6, #F0D48A, #F0D48A);
  border-radius: 3px;
  transform-origin: left;
  box-shadow: 0 0 6px rgba(212,168,67,0.3);
}
.honor-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 6px;
}
.honor-box-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.honor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.honor-grid span b { color: var(--gold-primary); }
.honor-scroll {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}
.honor-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  opacity: 0.35;
  filter: grayscale(0.7);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}
.honor-row.unlocked { opacity: 1; filter: none; border-color: var(--border-default); }
.honor-row.current {
  border-color: var(--gold-primary);
  background: linear-gradient(135deg, var(--bg-card), rgba(212,168,67,0.08));
  box-shadow: 0 0 8px var(--gold-glow);
}
.honor-badge {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  flex-shrink: 0;
}
.honor-row.unlocked .honor-badge {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  border-color: var(--gold-primary);
  color: #0a0a0a;
  box-shadow: 0 0 6px var(--gold-glow);
}
.honor-n {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 48px;
}
.honor-row.unlocked .honor-n {
  background: linear-gradient(135deg, #F0D48A, #F0D48A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.honor-b { font-size: var(--text-3xs); color: var(--exp); font-family: var(--font-mono); flex:1; }
.honor-b.locked { color: var(--text-muted); opacity: 0.6; }
.honor-ut { font-size: var(--text-3xs); color: var(--blue); font-family: var(--font-mono); margin-left:2px; }
.honor-nt {
  display: inline-block;
  font-size: var(--text-3xs);
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--gold-glow);
  color: var(--gold-primary);
  font-weight: 700;
  margin-left: 3px;
}

/* =========== Reduced Motion =========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }


}

/* =========== 触控目标增强 =========== */
.btn:not(.xs):not(.sm) { min-height: 2.25rem; }
.btn.xs { min-height: 1.125rem; padding: 0.0625rem 0.3125rem; font-size: var(--text-2xs); }
.btn.sm { min-height: 1.5rem; padding: 0.125rem 0.375rem; font-size: var(--text-2xs); }
.btn.sm.on {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  color: #0a0a0a;
  font-weight: 700;
  box-shadow: 0 0 8px var(--gold-glow);
}
.lft-panel {
  min-height: 40px;
}
/* v4.2.8: 日志过滤子tab样式 */
.lft-subtabs {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
  padding: 2px;
  background: var(--bg-elevated, rgba(255,255,255,0.03));
  border-radius: 4px;
}
.lft-subtabs .btn {
  flex: 1;
  font-size: 8px;
}
.lft-subtabs .btn.on {
  background: linear-gradient(135deg, var(--sp-primary-dark, #4a3f6b), var(--sp-primary, #6b5b95));
  color: #fff;
  border-color: var(--sp-primary, #6b5b95);
  font-weight: 700;
}
.lfts-panel {
  min-height: 30px;
}
.sb { min-width: 32px; min-height: 32px; }
.pet-card { min-height: 36px; }
.res-item { min-height: 36px; }

/* =========== 滚动优化 =========== */
main {
  overscroll-behavior: contain;
}

/* =========== 焦点可见性 =========== */
:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}
.pet-card:focus-visible, .sb:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

/* =========== 空状态样式 =========== */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
}
.empty-state .bag-empty-icon {
  display: block;
  margin: 0 auto 8px;
  opacity: 0.5;
}
.empty-state p {
  font-size: var(--text-xs);
  line-height: 1.6;
}

/* =========== 面板滚动修复 =========== */
/* v4.2.7: 灵界面板(p-fish/p-divw/p-farm/p-alch/p-art)加入滚动修复，解决底部内容被挡住不能下滑 */
#p-bat, #p-pet, #p-cl, #p-sh, #p-en, #p-bag, #p-ach, #p-sr, #p-eq,
#p-fish, #p-divw, #p-farm, #p-alch, #p-art {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  min-height: 0;
  max-height: calc(100vh - var(--header-h) - var(--nav-total-h) - 20px);
  max-height: calc(100dvh - var(--header-h) - var(--nav-total-h) - 20px);
}
/* v2.7.5: 修复 flex 布局下子元素 shrink 导致部分设备无法滚动 */
#p-bat > *, #p-pet > *, #p-cl > *, #p-sh > *, #p-en > *, #p-bag > *, #p-ach > *, #p-sr > *, #p-eq > *,
#p-fish > *, #p-divw > *, #p-farm > *, #p-alch > *, #p-art > * {
  flex-shrink: 0;
}

/* v5.0: 统一由 main 承担纵向滚动，取消功能面板的嵌套滚动。
   嵌套 max-height 会在秘境/福利/渔场等短页面底部留下黑色空带，
   且部分移动浏览器只能滚动外层或内层之一。 */
main > .pn.ac {
  overflow: visible !important;
  max-height: none !important;
  min-height: min-content;
  flex-shrink: 0;
  background: var(--bg-surface);
  padding-bottom: 24px;
}

/* 主面板由 main 统一滚动，避免移动端嵌套滚动区截断底部内容。
   仅放开当前功能内容；弹窗、帮助页和长列表仍保留各自的滚动边界。 */
main > .pn.ac > .eq-tab-content.on,
main > .pn.ac .realm-content.on,
main > .pn.ac .sp-farm-content {
  overflow: visible !important;
  max-height: none !important;
  min-height: min-content;
}

/* =========== v3.2.0 游戏内弹窗系统（替代浏览器 confirm/alert/prompt） =========== */
.info-pop.gd-pop {
  width: 90vw;
  max-width: 22em;
  min-width: 16em;
  padding: 14px 16px 10px;
  text-align: center;
  border-color: var(--gold-primary);
  background: linear-gradient(180deg, #1a1520 0%, #100a18 100%);
  box-shadow: var(--shadow-xl), 0 0 40px var(--gold-glow);
}
.info-pop.gd-pop.gd-pop-danger {
  border-color: var(--hp);
  outline-color: var(--hp-dim);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(239, 68, 68, 0.35);
}
.info-pop.gd-pop.gd-pop-danger .gd-title {
  color: var(--hp);
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}
.info-pop.gd-pop.gd-pop-accent {
  border-color: var(--sp-primary, #a78bfa);
  outline-color: var(--blue-dim);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(167, 139, 250, 0.35);
}
.info-pop.gd-pop.gd-pop-success {
  border-color: var(--exp);
  outline-color: var(--exp-dim);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(52, 211, 153, 0.3);
}
.info-pop.gd-pop .gd-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 8px;
  text-shadow: 0 0 12px var(--gold-glow);
  letter-spacing: 0.5px;
}
.info-pop.gd-pop .gd-body {
  font-size: var(--text-xs);
  color: var(--text-primary);
  line-height: 1.7;
  font-family: var(--font-body);
  text-align: left;
  margin-bottom: 8px;
}
.info-pop.gd-pop .gd-msg {
  font-size: var(--text-xs);
  color: var(--text-primary);
  line-height: 1.7;
  text-align: center;
  padding: 4px 2px;
  white-space: pre-wrap;
  word-break: break-word;
}
.info-pop.gd-pop .gd-msg-danger { color: #fca5a5; }
.info-pop.gd-pop .gd-msg-success { color: #6ee7b7; }
.info-pop.gd-pop .gd-hint {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
  text-align: center;
}
.info-pop.gd-pop .gd-input {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}
.info-pop.gd-pop .gd-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}
.info-pop.gd-pop .gd-footer {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
  margin-bottom: 4px;
}
.info-pop.gd-pop .gd-btn {
  padding: 6px 18px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: var(--bg-hover);
  color: var(--text-primary);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  font-family: var(--font-body);
  min-width: 64px;
  min-height: 30px;
}
.info-pop.gd-pop .gd-btn:active { transform: scale(0.96); }
.info-pop.gd-pop .gd-btn-primary {
  background: linear-gradient(135deg, var(--gold-light, #d9b85a), var(--gold-primary));
  border-color: var(--gold-primary);
  color: #0a0a0a;
  box-shadow: 0 0 10px var(--gold-glow);
}
.info-pop.gd-pop .gd-btn-primary:hover { box-shadow: 0 0 16px var(--gold-glow-strong); }
.info-pop.gd-pop .gd-btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: var(--hp);
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}
.info-pop.gd-pop .gd-btn-danger:hover { box-shadow: 0 0 16px rgba(239, 68, 68, 0.5); }
.info-pop.gd-pop .gd-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: var(--exp);
  color: #fff;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}
.info-pop.gd-pop .gd-btn-default {
  background: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-muted);
}
.info-pop.gd-pop .gd-btn-default:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}
.info-pop.gd-pop .gd-close {
  display: block;
  margin: 6px auto 0;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 10px;
  background: none;
  border: none;
  font-family: inherit;
}
.info-pop.gd-pop .gd-close:hover { color: var(--text-primary); }

/* 游戏内选项菜单 */
.info-pop.gd-pop .gd-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
}
.info-pop.gd-pop .gd-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: var(--bg-hover);
  color: var(--text-primary);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  font-family: var(--font-body);
  text-align: left;
  min-height: 36px;
  justify-content: center;
}
.info-pop.gd-pop .gd-menu-item:hover {
  border-color: var(--gold-primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 8px var(--gold-glow);
}
.info-pop.gd-pop .gd-menu-item:active { transform: scale(0.98); }
.info-pop.gd-pop .gd-menu-item-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.info-pop.gd-pop .gd-menu-item-disabled:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
  box-shadow: none;
}
.info-pop.gd-pop .gd-menu-item-text { font-size: var(--text-xs); }
.info-pop.gd-pop .gd-menu-item-desc {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* =========== v3.2.0 自定义下拉筛选（替代原生 select） =========== */
.gd-dropdown {
  position: relative;
  display: inline-block;
  min-width: 100px;
}
.gd-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  font-size: var(--text-2xs);
  border-radius: var(--radius-sm);
  border: 1px solid #3a3050;
  background: #0f0a18;
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  min-height: 24px;
}
.gd-dropdown-trigger:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-glow);
}
.gd-dropdown-trigger .gd-dd-arrow {
  font-size: 8px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  margin-left: 2px;
}
.gd-dropdown.gd-dd-open .gd-dropdown-trigger .gd-dd-arrow { transform: rotate(180deg); }
.gd-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, #1a1520, #100a18);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl), 0 0 20px var(--gold-glow);
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
  display: none;
  margin-top: 2px;
  min-width: 120px;
}
.gd-dropdown.gd-dd-open .gd-dropdown-panel { display: block; animation: popin-dropdown 0.15s ease; }
@keyframes popin-dropdown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.gd-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 8px;
  font-size: var(--text-2xs);
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 3px;
  font-family: var(--font-body);
  transition: background var(--transition-fast);
}
.gd-dropdown-item:hover { background: var(--bg-hover); }
.gd-dropdown-item.gd-dd-item-active {
  background: linear-gradient(135deg, var(--gold-dark, #8a6f25), var(--gold-primary));
  color: #0a0a0a;
  font-weight: 700;
}

/* 装备导航按文字宽度排布，窄屏可横滑。 */
#p-eq > .eq-tab-bar > .eq-tab {
  flex: 0 0 auto;
  min-block-size: 2rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
}
#p-eq .sub-tab {
  min-block-size: 1.75rem;
  font-size: 0.75rem;
}
#p-eq :is(.eq-tab, .sub-tab):focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: -2px;
}
#eqc-slots .eq-actions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-block: 0.375rem;
}

#batMortal .pl-hp-fill { height: 100%; }
#pH,
#batMortal .mn-stats {
  font: 0.6875rem/1.35 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
#pH {
  margin-top: 0.125rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
#batMortal .pl-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  font-size: 0.6875rem;
  overflow-wrap: anywhere;
}
#batMortal .pl-stats > div {
  padding: 0.125rem 0.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
#batMortal .pl-stats b { display: block; color: var(--gold-light); }
#batMortal .mn-stats {
  grid-template-columns: minmax(0, 1fr);
}
#batMortal .mn-stats + .mn-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#batMortal .mn-stats span {
  white-space: normal;
  overflow-wrap: anywhere;
}
#p-eq .zs-stat {
  font-size: 0.6875rem;
  overflow-wrap: anywhere;
}

/* 窄屏和矮窗使用单行模式栏，为战斗区域留出空间。 */
@media (max-width: 480px), (max-height: 540px) {
  #p-bat .ms {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  #p-bat .ms .btn { flex: 0 0 auto; padding-inline: 0.625rem; }
}

/* 全局滚动条与 RGB 使用相同的细金色视觉，保留系统滚动交互。 */
:root {
  --scroll-thumb: #9d8052;
  --scroll-track: transparent;
}
:root,
main, .bl-tab-content, .pop-body, .sp-farm-content {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
@supports selector(::-webkit-scrollbar) {
  :root,
  main, .bl-tab-content, .pop-body, .sp-farm-content { scrollbar-width: auto; scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track,
  ::-webkit-scrollbar-corner { background: var(--scroll-track); }
  ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
  ::-webkit-scrollbar-button,
  ::-webkit-scrollbar-button:single-button { display: none; width: 0; height: 0; }
}

.info-pop:is(.stat-pop, .sp-char-pop, .unified-char-pop) {
  --stat-frame: #94794d;
  --stat-section-edge: #5d4c3d;
  width: min(92vw, 29rem);
  min-width: 0;
  max-width: 92vw;
  height: 82vh;
  height: 82dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--stat-frame);
  outline: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #1d182b, var(--bg-base));
  box-shadow: var(--shadow-xl), 0 0 0 3px #0b0912, 0 0 0 4px #51402f;
  text-align: left;
}
.info-pop:is(.stat-pop, .sp-char-pop, .unified-char-pop)::before {
  content: '';
  position: absolute;
  inset: 2px;
  background:
    linear-gradient(var(--gold-light), var(--gold-light)) top left / 12px 2px,
    linear-gradient(var(--gold-light), var(--gold-light)) top left / 2px 12px,
    linear-gradient(var(--gold-light), var(--gold-light)) top right / 12px 2px,
    linear-gradient(var(--gold-light), var(--gold-light)) top right / 2px 12px,
    linear-gradient(var(--gold-light), var(--gold-light)) bottom left / 12px 2px,
    linear-gradient(var(--gold-light), var(--gold-light)) bottom left / 2px 12px,
    linear-gradient(var(--gold-light), var(--gold-light)) bottom right / 12px 2px,
    linear-gradient(var(--gold-light), var(--gold-light)) bottom right / 2px 12px;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}
.info-pop:is(.stat-pop, .sp-char-pop, .unified-char-pop) .pop-title {
  flex-shrink: 0;
  padding: 0.625rem 4.5rem 0.625rem 0.875rem;
  min-block-size: 2.75rem;
  margin: 0;
  border-bottom: 1px solid var(--stat-section-edge);
  background: linear-gradient(90deg, #332739, #191525);
  color: var(--gold-light);
  font-family: var(--font-display);
}
.info-pop:is(.stat-pop, .sp-char-pop, .unified-char-pop) .pop-close {
  position: absolute;
  inset: 0.625rem 0.75rem auto auto;
  margin: 0;
  border-color: var(--stat-frame);
}
.info-pop:is(.stat-pop, .sp-char-pop, .unified-char-pop) .pop-close:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
.info-pop:is(.stat-pop, .sp-char-pop, .unified-char-pop) .pop-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0.625rem 0.875rem;
}
.char-stat-summary {
  padding: 0.5rem 0.625rem;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.char-stat-section {
  margin-block: 0.5rem;
  padding: 0.5rem 0.625rem;
  background: var(--bg-surface);
  border: 1px solid var(--stat-section-edge, var(--border-default));
  border-radius: var(--radius-sm);
}
.char-stat-section > .char-stat-heading:first-child {
  margin-top: 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--stat-section-edge, var(--border-default));
}
.char-stat-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text-primary);
}
.char-stat-summary-line strong { color: var(--gold-primary); }
.char-stat-progress {
  height: 0.375rem;
  overflow: hidden;
  margin-block: 0.375rem;
  border-radius: 1rem;
  background: var(--bg-hover);
}
.char-stat-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary));
}
.char-stat-summary-detail { color: var(--text-secondary); }
.char-stat-tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-block: 0.5rem;
}
.char-stat-tabs button {
  flex: 1 0 auto;
  min-block-size: 1.875rem;
  padding: 0.25rem 0.375rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font: 600 0.6875rem/1.3 var(--font-body);
  cursor: pointer;
}
.char-stat-heading {
  margin: 0.625rem 0 0.25rem;
  color: var(--gold-primary);
  font: 700 0.75rem/1.4 var(--font-body);
}
:is(.char-stat-grid, .char-stat-section, .stat-tab-panel, .sp-char-tab-panel, #spBonusSubContent) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.375rem;
}
:is(.char-stat-grid, .char-stat-section, .stat-tab-panel, .sp-char-tab-panel, #spBonusSubContent) > :not(.char-stat-row) {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.char-stat-grid {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.char-stat-wide { padding: 0.25rem 0.375rem; }
#spBonusSubContent .char-stat-heading { color: var(--sp-primary); }
.char-stat-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.125rem 0.375rem;
  min-width: 0;
  padding: 0.25rem 0.375rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font: 0.6875rem/1.35 var(--font-body);
  overflow-wrap: anywhere;
}
.char-stat-value {
  min-width: 0;
  margin-inline-start: auto;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

/* 战斗控件随游戏内容宽度调整，宽度滑块也会触发重排。 */
#p-bat { container-type: inline-size; }
@supports (width: 1cqi) {
  #p-bat .ms .btn,
  #p-bat .st-sel .btn,
  #p-bat .st-sel .sb {
    font-size: clamp(0.6875rem, calc(0.5625rem + 0.5cqi), 0.875rem);
  }
}
#p-bat .st-sel .btn { overflow-wrap: anywhere; }

#tb [data-nav-group] { display: none; }
.nav-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 5rem), 1fr));
  gap: 0.375rem;
  min-width: min(65vw, 16rem);
}
#endSweepShortcut[hidden] { display: none; }
#quickActionsButton[hidden] { display: none; }
#quickActionsClaimAll[hidden] { display: none; }
#rareDropBanner {
  position: fixed;
  inset: calc(var(--header-total-h) + 8px) 1rem auto;
  z-index: var(--z-dmg);
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  background: linear-gradient(110deg, transparent 32%, rgba(255, 218, 128, .22) 50%, transparent 68%) 0 0 / 240% 100%,
              linear-gradient(90deg, #17121a, #3b2920 50%, #17121a);
  box-shadow: 0 0 14px var(--gold-glow), inset 0 1px rgba(255, 227, 163, .24);
  overflow-wrap: anywhere;
  pointer-events: none;
}
#rareDropBanner:not([hidden]), #rareDropsList li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--text-sm);
  line-height: 1.35;
}
#rareDropBanner button { pointer-events: auto; flex: 0 0 auto; }
#hPowerGain, #battleStreak { color: var(--green, #86efac); }
#hPowerGain { display: inline-block; font-size: var(--text-xs); }
#hPowerGain[hidden] { display: none; }
#battleStreak { white-space: nowrap; }
#battleStall:not([hidden]) { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem; }
.is-boss-low > .mn-hp-fill, .is-boss-low > .sp-mn-hp-fill { background: linear-gradient(90deg, #bc861e, #f4cc60); }
button[data-repeat-upgrade] { touch-action: pan-y; user-select: none; }
#rareDropBanner strong, #rareDropsList strong { font-weight: 650; }
.rare-drop-quality {
  flex-shrink: 0;
  color: var(--drop-accent);
  font-size: var(--text-2xs);
  font-weight: 700;
}
@media (prefers-reduced-motion: no-preference) {
  #rareDropBanner:not([hidden]) { animation: rare-drop-shine 1.2s ease-out; }
}
@keyframes rare-drop-shine {
  from { background-position: 100% 0, 0 0; transform: translateY(-5px); opacity: 0; }
  18% { transform: translateY(0); opacity: 1; }
  to { background-position: 0 0, 0 0; }
}
#rareDropsDialog:not([hidden]) { display: flex; flex-direction: column; }
#rareDropsDialog .quick-actions-header { flex: 0 0 auto; }
#rareDropsList {
  min-height: 0;
  overflow-y: auto;
  padding: 0.375rem 0.75rem 0.625rem;
  list-style: none;
  overflow-wrap: anywhere;
}
#rareDropsList li {
  padding: 0.375rem;
  border-bottom: 1px solid var(--border-subtle);
}
#rareDropsList li:last-child { border-bottom: 0; }
#rareDropsList li.rare-drops-empty { color: var(--text-muted); }
#tb button.has-pending > span::after,
#adventureOmen.has-pending::after {
  content: '';
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-inline-start: 0.25rem;
  border-radius: 50%;
  background: var(--gold-light);
  vertical-align: 0.22em;
}
.quick-actions-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(calc(100% - 2rem), 22rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 0.875rem;
  box-shadow: 0 1rem 3rem rgba(0,0,0,.46);
}
.game-panel-backdrop { position: fixed; inset: 0; z-index: calc(var(--z-modal) + 1); background: rgba(8,6,17,.68); }
.quick-actions-dialog { z-index: calc(var(--z-modal) + 2); height: max-content; overflow: auto; overscroll-behavior: contain; }
.quick-actions-dialog[hidden] { display: none; }
.material-drop-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.material-drop-heading > .char-stat-heading { margin: 0; }
.material-drop-heading > button { flex-shrink: 0; }
.material-drop-help-body {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem 0.875rem;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}
#tb [hidden], .eq-tab-bar [hidden], #p-bat [hidden], .eq-actions [hidden] { display: none; }
.progression-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#dailyAutoOptions:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.625rem 1rem;
  color: var(--text-secondary);
  font: var(--text-xs)/1.4 var(--font-body);
}
#dailyAutoCheck {
  appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 1rem;
  block-size: 1rem;
  margin: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
#dailyAutoCheck:checked { background: var(--gold-primary); border-color: var(--gold-primary); }
#dailyAutoCheck:checked::after { content: '✓'; color: var(--bg-base); font: 700 var(--text-xs)/1 var(--font-body); }
.progression-dialog {
  width: min(calc(100% - 1.5rem), 22rem);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-block-start-color: var(--gold-dark);
  border-radius: var(--radius-lg);
  font: var(--text-sm)/1.4 var(--font-body);
  scrollbar-color: var(--gold-dark) var(--bg-card);
}
.progression-dialog .quick-actions-header { padding: 0.375rem 0.75rem; gap: 0.375rem; }
.progression-dialog .quick-actions-header h2 { font: 700 var(--text-md)/1.3 var(--font-body); }
.cave-recipes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.375rem;
}
.cave-recipes p { margin-block: 0.25rem 0; }
.progression-body { display: grid; gap: 0.4375rem; padding: 0.625rem 0.75rem 0.75rem; }
.progression-body p, .progression-cave p { margin: 0; overflow-wrap: anywhere; }
.progression-body .btn, .progression-cave .btn { min-block-size: 1.875rem; }
.progression-body :is(.btn, summary):focus-visible, #dailyAutoCheck:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
.progression-title { color: var(--text-primary); font-size: var(--text-sm); font-weight: 700; }
.progression-note { color: var(--text-secondary); font-size: var(--text-xs); }
.progression-section-title { color: var(--gold-light); font-size: var(--text-xs); font-weight: 700; }
.build-summary, .build-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.build-row {
  padding: 0.375rem 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.build-row.active { border-color: var(--gold-dark); }
.build-row.active .btn:disabled { color: var(--gold-light); opacity: 1; }
.build-row .btn { flex-shrink: 0; }
.build-row > .progression-actions { justify-content: end; }
.progression-cave {
  display: grid;
  gap: 0.25rem;
  font: var(--text-xs)/1.4 var(--font-body);
  color: var(--text-secondary);
}
.progression-cave > strong { color: var(--gold-light); font-size: var(--text-sm); }
.quick-actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem 0.5rem 1rem;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.quick-actions-header h2 {
  margin: 0;
  color: var(--gold-light);
  font-size: 1rem;
  line-height: 1.35;
}
.quick-actions-close {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.375rem;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  font: 1.375rem/1 var(--font-body);
}
.quick-actions-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.quick-actions-close:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 1px;
}
.quick-actions-list {
  padding-inline: 1rem;
}
.quick-actions-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.25rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}
.quick-actions-list > div:last-child { border-bottom: 0; }
.quick-actions-list strong { font-size: 0.9375rem; }
.quick-actions-list small {
  display: block;
  margin-block-start: 0.1875rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}
.quick-actions-list .btn {
  min-height: 2.25rem;
  padding-inline: 0.75rem;
  font-size: 0.75rem;
}

.stage-controls,
.stage-controls-fields {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
  white-space: nowrap;
}
.stage-controls {
  justify-content: safe center;
  overflow-x: auto;
  margin: 0.25rem 0;
}
.stage-controls-fields[hidden] { display: none; }
.stage-controls .jump-input {
  flex: 0 1 5.25rem;
  min-width: 3rem;
  width: 5.25rem;
  font-variant-numeric: tabular-nums;
}
.stage-controls .btn { flex: 0 0 auto; }
.stage-controls .btn[aria-pressed="true"] { color: var(--gold-light); }

#stCtrl:empty { display: none; }

.lock-label { color: #fca5a5; white-space: nowrap; }

.growth-achievements { width: 100%; }
.growth-achv-head,
.growth-achv-filters,
.growth-achv-card-head,
.growth-achv-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.growth-achv-head { flex-wrap: wrap; }
.growth-achv-head strong { color: var(--gold-light); }
.growth-achv-bonuses {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}
.growth-achv-bonuses summary {
  width: fit-content;
  cursor: pointer;
}
.growth-achv-bonuses > div { margin-block-start: 0.25rem; }
.growth-achv-categories {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  margin: 0.5rem 0;
  padding-block-end: 0.25rem;
}
.growth-achv-categories button { flex: 0 0 auto; white-space: nowrap; }
.growth-achv-categories button[aria-pressed="true"] {
  color: var(--gold-light);
  border-color: var(--gold-primary);
}
.growth-achv-filters { flex-wrap: wrap; margin-block-end: 0.625rem; }
.growth-achv-filters input[type="search"] {
  flex: 1 1 10rem;
  min-width: 0;
  min-block-size: 1.875rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  background: var(--bg-base);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-xs);
}
#bigAchvGrid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: 0.5rem;
}
.growth-achv-card {
  min-width: 0;
  padding: 0.625rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  overflow-wrap: anywhere;
}
.growth-achv-card.is-claimable { border-color: var(--gold-dark); }
.growth-achv-name {
  background: none;
  border: 0;
  color: var(--text-primary);
  text-align: start;
  font: 700 var(--text-xs)/1.35 var(--font-body);
  cursor: pointer;
}
.growth-achv-name:hover { text-decoration: underline; }
.growth-achv-status {
  color: var(--text-secondary);
  font-size: var(--text-3xs);
  white-space: nowrap;
}
.is-claimable .growth-achv-status { color: var(--gold-light); }
.growth-achv-progress {
  height: 0.25rem;
  margin-block: 0.5rem 0.25rem;
  background: var(--bg-hover);
  border-radius: 1rem;
  overflow: hidden;
}
.growth-achv-progress > span { display: block; height: 100%; background: var(--gold-primary); }
.growth-achv-metrics {
  flex-wrap: wrap;
  font-size: var(--text-3xs);
  color: var(--text-secondary);
}
.growth-achv-card > .btn { margin-block-start: 0.375rem; }
.growth-achv-card .achv-reward { font-size: var(--text-3xs); margin-block-start: 0.25rem; }

.equipment-toolbar {
  display: grid;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 0.5rem;
}
#eqc-slots .equipment-toolbar .eq-actions { margin: 0; }
.equipment-auto-downgrade {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--text-xs);
}
.equipment-set {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.625rem;
  color: var(--text-secondary);
  font: var(--text-xs)/1.35 var(--font-body);
}
.equipment-set > span { white-space: nowrap; }
.equipment-set-name { color: var(--gold-light); }
.equipment-set-name strong { color: var(--exp); }
.equipment-recycle {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-subtle);
  padding-block-start: 0.5rem;
}
.equipment-recycle summary { cursor: pointer; color: var(--text-secondary); font-size: var(--text-xs); }
.equipment-recycle .rcb { margin-block-start: 0.375rem; }

#bagSettingsContent {
  height: auto;
  min-height: 0;
  overflow: visible;
}
.settings-sub-tabs[data-settings-subnav].on {
  display: flex;
  flex-wrap: wrap;
  position: static;
  gap: 0.375rem;
  border: 0;
  margin-block: 0.125rem 0.5rem;
  background: transparent;
}
.settings-sub-tab { padding-inline: 0.625rem; }
.settings-content .settings-group {
  margin-block-end: 0.5rem;
  padding: 0.625rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.settings-content .settings-label { margin-block-end: 0.375rem; }
.settings-main-tabs .settings-tab { padding-inline: .25rem; }
.settings-guide { color: var(--text-secondary); font: var(--text-sm)/1.55 var(--font-body); overflow-wrap: anywhere; }
.settings-guide details + details { border-block-start: 1px solid var(--border-subtle); }
.settings-guide summary { padding-block: .55rem; color: var(--text-primary); cursor: pointer; font-weight: 600; }
.settings-guide h3 { margin: 0 0 .55rem; font: 700 var(--text-sm)/1.4 var(--font-body); color: var(--gold-light); }
.settings-guide p { margin: 0 0 .55rem; }
.settings-guide ul { margin: 0; padding-inline-start: 1.2rem; }
.settings-guide li + li { margin-block-start: .45rem; }
.settings-toggle-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.settings-toggle-grid label {
  min-block-size: 2rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}
.settings-toggle-grid input { accent-color: var(--gold-primary); }
.settings-content .settings-slider-row { margin-block: 0.25rem; min-block-size: 1.75rem; }
.combat-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.375rem;
}
.combat-stat-grid > div {
  display: grid;
  gap: 0.125rem;
  padding: 0.375rem;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}
.combat-stat-grid strong { color: var(--text-primary); }
.combat-stat-total { margin-block-start: 0.375rem; }

#batCtrlBar,
.endless-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 0.25rem;
}
#batCtrlBar #skillBar {
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  justify-content: flex-start;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  scrollbar-width: none;
}
#batCtrlBar .skill-slot { flex: 0 0 auto; }
.battle-objective {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-block: 0.25rem 0.5rem;
}
.battle-objective #battleMilestone {
  flex: 1 1 10rem;
  margin: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.battle-objective .btn { flex: 0 0 auto; }
#p-bat.is-spirit-battle #spdBtn { display: none; }

.startup-save-picker {
  position: fixed;
  inset: 0;
  z-index: 99998;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  min-block-size: 0;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 65% 0%, #3d2d37, #141120 55%, #0d0b14);
}
.startup-save-picker[hidden], .startup-save-warning[hidden] { display: none; }
.startup-save-content { max-inline-size: 30rem; margin: clamp(.5rem, 6svh, 4rem) auto; }
.startup-save-heading {
  display: grid;
  align-content: end;
  gap: .4rem;
  min-block-size: clamp(5rem, 20svh, 11rem);
  margin-block-end: .75rem;
  color: #eacf92;
  background: url("../assets/image/people/swordsman.png") 93% center / auto 100% no-repeat;
}
.startup-save-heading h1 { font: 700 clamp(1.8rem, 7vw, 3rem)/1.1 var(--font-display); margin: 0; }
.startup-save-heading > span { justify-self: start; color: #c3aff0; font-size: .875rem; }
.startup-saves { min-inline-size: 0; padding: 0; margin: 0; border: 0; }
.startup-saves legend { margin-block-end: .5rem; color: #eacf92; font-size: 1rem; font-weight: 650; }
#startupSlots { display: grid; gap: .5rem; }
#startupSlots label {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: .6rem;
  min-block-size: 3.5rem;
  padding: .6rem .75rem;
  border: 1px solid #51435b;
  border-radius: .5rem;
  background: #1c1729;
  cursor: pointer;
}
#startupSlots label.is-selected { border-color: #e0b769; background: #312638; }
#startupSlots label.is-disabled { opacity: .55; cursor: default; }
#startupSlots input { accent-color: #dcbb75; }
#startupSlots strong, #startupSlots small { display: block; overflow-wrap: anywhere; }
#startupSlots strong { font-size: .95rem; color: #f2edf6; }
#startupSlots small { margin-block-start: .2rem; color: #c8bacd; font-size: .75rem; }
.startup-slot-version { color: #dfc48e; font-size: .75rem; text-align: end; }
.startup-enter { inline-size: 100%; min-block-size: 2.75rem; margin-block-start: .75rem; font-size: 1rem; }
.startup-save-warning { color: #f5c87e; font-size: .8rem; }

/* 主滚动区承接秘境面板手势，内容层不再形成独立裁剪区。 */
#app > main { touch-action: pan-y; overscroll-behavior-y: contain; }
#p-sr.ac, #p-sr.ac > .eq-tab-content.on { flex: 0 0 auto; min-block-size: auto; overflow: visible; }

.pet-roster-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.pet-roster-card.pet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  padding: 1.4rem .45rem .4rem;
  text-align: center;
  border-color: var(--pet-quality);
}
.pet-roster-level, .pet-roster-stars {
  position: absolute;
  inset-block-start: .35rem;
  color: var(--text-muted);
  font-size: .65rem;
}
.pet-roster-level { inset-inline-start: .4rem; }
.pet-roster-stars { inset-inline-end: .4rem; color: var(--pet-quality); }
.pet-roster-portrait {
  display: grid;
  justify-items: center;
  gap: .2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pet-quality);
  font: inherit;
  cursor: pointer;
}
.pet-roster-portrait img { inline-size: min(100%, 6rem); block-size: clamp(3rem, 15vw, 6rem); object-fit: contain; }
.pet-roster-card.is-reserve img { block-size: clamp(2.4rem, 11vw, 4.5rem); }
.pet-roster-portrait strong { font-size: .8rem; overflow-wrap: anywhere; }
.pet-roster-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .2rem; margin-top: .35rem; color: var(--text-muted); font-size: .62rem; }
.pet-roster-footer .btn { margin-inline-start: auto; }
.pet-roster-empty, .pet-roster-empty-slot { color: var(--text-muted); font-size: .75rem; }
.pet-roster-empty-slot { min-block-size: 3.2rem; }
[data-skill-art] { position: relative; }
[data-skill-art]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: .2rem;
  background: url("../assets/image/skill-atlas-v1.webp") var(--skill-atlas-x, 0%) var(--skill-atlas-y, 0%) / 400% 200% no-repeat;
  pointer-events: none;
}
[data-skill-art="2"], [data-skill-art="6"] { --skill-atlas-x: 33.3333%; }
[data-skill-art="3"], [data-skill-art="7"] { --skill-atlas-x: 66.6667%; }
[data-skill-art="4"] { --skill-atlas-x: 100%; }
[data-skill-art="5"], [data-skill-art="6"], [data-skill-art="7"] { --skill-atlas-y: 100%; }
.skill-collection-icon { display: inline-grid; place-items: center; inline-size: 1.65rem; block-size: 1.65rem; margin-inline-end: .3rem; flex: 0 0 auto; }
@media (max-width: 380px) {
  .pet-roster-grid { gap: .3rem; }
  .pet-roster-card.pet-card { padding-inline: .3rem; }
}
#mnSide.is-overlord {
  min-block-size: 0;
  max-block-size: none;
  overflow: visible;
  scrollbar-gutter: auto;
}
#mnSide .overlord-card {
  --overlord-accent: #edbda0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.3125rem;
  padding: clamp(0.5rem, 2.25vw, 0.875rem);
  border: 1px solid #745148;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 8%, #4a2631, transparent 72%), linear-gradient(155deg, #291b24, #17131d);
}
.overlord-crest {
  align-self: center;
  display: grid;
  place-items: center;
  inline-size: 2.875rem;
  block-size: 2.875rem;
  margin: 0.25rem 0 0.375rem;
  transform: rotate(45deg);
  border: 3px double #a86b59;
  border-radius: 0.375rem;
  background: #241722;
  color: var(--overlord-accent);
}
.overlord-crest span { transform: rotate(-45deg); font: 700 1.375rem/1 var(--font-display); }
.overlord-heading, .overlord-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.375rem; flex-wrap: wrap; }
.overlord-heading .mn-name { font: 700 var(--text-sm)/1.3 var(--font-body); color: var(--overlord-accent); }
.overlord-progress, .overlord-profile, .overlord-foot span { color: var(--text-secondary); font-size: var(--text-2xs); }
.overlord-profile { min-block-size: 1em; overflow-wrap: anywhere; }
.overlord-card .mn-hp { block-size: 0.5rem; }
.overlord-hp { color: var(--text-primary); text-align: center; font: var(--text-2xs)/1.3 var(--font-mono); overflow-wrap: anywhere; }
.overlord-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem; }
.overlord-stats > div { padding: 0.1875rem 0.3125rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary); font-size: var(--text-2xs); }
.overlord-stats b { display: block; color: var(--overlord-accent); font-family: var(--font-mono); overflow-wrap: anywhere; }
.overlord-foot .btn { margin-inline-start: auto; }
#endSweepShortcut,
#endSweep {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  white-space: nowrap;
}
#endInfo { min-width: 0; overflow-wrap: anywhere; }

/* 静态金属顶光与分段血条。 */
.pl-side {
  background: radial-gradient(ellipse 80% 45% at 50% 0%, #d5ab4826, transparent 72%), linear-gradient(165deg,#241d2e,#110e19);
  border-top-color: #c9a84c;
  box-shadow: inset 0 1px rgba(255,236,179,.2);
}
.pl-icon { background: radial-gradient(circle,#d5ab4833,transparent 72%); }
.pl-hp-fill, .sp-pl-hp-fill { position: relative; }
.pl-hp-fill::after, .mn-hp-fill::after, .sp-pl-hp-fill::after, .sp-mn-hp-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  height: auto;
  background: repeating-linear-gradient(90deg, transparent 0 19%, rgba(0,0,0,.26) 19% 20%);
  pointer-events: none;
}
.es.r5, .es.r6, .es.r7, .es.r8, .es.r9 {
  background: linear-gradient(135deg,rgba(255,255,255,.09),transparent 45%,var(--rc-glow,transparent)), var(--bg-card);
  box-shadow: inset 0 1px rgba(255,255,255,.15);
}
.mn-card.elite-card, .sp-mn-card.elite-card {
  border-top-color: #d0af71;
  background-image: radial-gradient(ellipse at 100% 0%, #d5ab4826, transparent 65%);
}
.mn-card.boss-card, .sp-mn-card.boss-card {
  border-top-color: #ed6877;
  background-image: radial-gradient(ellipse at 100% 0%, #ef44553b, transparent 65%);
}

@media (prefers-reduced-motion: no-preference) {
  .honor-fill, .sr-talent-bar-fill, .rb-progress-fill { transition: transform 0.24s ease; }
}
.adventure-actions { display: grid; gap: .5rem; }
.adventure-actions p { margin: 0; }

.info-pop.adventure-pop {
  width: min(92vw, 23rem);
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
}
.adventure-pop .pop-title { text-align: center; }
.info-pop.adventure-pop .pop-body { font-family: var(--font-body); }
.info-pop.adventure-pop .pop-close {
  display: block;
  min-width: 5.5rem;
  margin: .5rem auto 0;
}
.adventure-omen {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4375rem .5rem;
  border: 1px solid var(--gold-dark);
  border-inline-start: 3px solid var(--gold-primary);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--gold-glow), var(--bg-surface) 75%);
  color: var(--text-secondary);
  line-height: 1.4;
}
.adventure-omen span {
  flex: none;
  padding: .125rem .375rem;
  border-radius: var(--radius-sm);
  background: var(--gold-glow);
  color: var(--gold-light);
  font-size: var(--text-2xs);
  font-weight: 700;
}
.adventure-omen strong { color: var(--gold-light); }
.adventure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .375rem;
}
.adventure-grid .adventure-entry {
  display: grid;
  align-content: center;
  gap: .125rem;
  min-height: 3rem;
  padding: .375rem .5rem;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
  background: var(--bg-surface);
}
.adventure-entry strong { font-size: var(--text-sm); }
.adventure-entry small,
.adventure-bounty-row small {
  font-size: var(--text-2xs);
  color: var(--text-secondary);
}
.adventure-grid .adventure-entry.is-ready {
  border-color: var(--gold-dark);
  background: linear-gradient(180deg, var(--bg-hover), var(--bg-surface));
}
.adventure-entry.is-ready small { color: var(--gold-light); }
.adventure-grid .adventure-entry:disabled { opacity: .65; }
.adventure-grid .adventure-entry.is-utility {
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 2.25rem;
  border-color: var(--border-subtle);
}
.adventure-section-head {
  display: flex;
  justify-content: space-between;
  padding-top: .375rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--gold-primary);
  font-weight: 700;
}
.adventure-section-head span { color: var(--text-secondary); }
.adventure-bounty-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
  padding: .3125rem .5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  line-height: 1.3;
}
.adventure-bounty-row small { display: block; }
.adventure-bounty-row.is-claimable { border-color: var(--gold-primary); }
.adventure-bounty-row .btn { min-width: 4.25rem; min-height: 1.875rem; }
.adventure-bounty-row .btn:disabled {
  opacity: 1;
  color: var(--text-secondary);
  border-color: var(--border-default);
  background: var(--bg-base);
}
.adventure-bounty-row.is-done .btn:disabled {
  color: var(--exp);
  background: var(--exp-dim);
}
.crypt-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .25rem; }
.crypt-grid button { min-height: 2.5rem; padding-inline: .15rem; }
@media (prefers-reduced-motion: no-preference) {
  .adventure-drunk #batMortal .bl-main { animation: adventure-sway 1.8s ease-in-out infinite alternate; }
  @keyframes adventure-sway { from { transform: translateX(-2px); } to { transform: translateX(2px); } }
}
.gem-nirvana, .red-affix { color: #fb7185; }
.pet-nirvana { display: inline-block; border-radius: .35rem; box-shadow: 0 0 .5rem #fbbf24; }

#elePairButton { margin-block: .25rem .5rem; }
.element-pair-form { display: grid; gap: .75rem; text-align: left; }
.element-pair-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
.element-pair-fields label { display: block; margin-bottom: .2rem; }
.element-pair-fields select {
  width: 100%;
  min-height: 2.5rem;
  padding-inline: .4rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.element-pair-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.element-pair-recipes { display: grid; gap: .3rem; }
