  .tray {
    position: absolute; left: 0; right: 0; bottom: 0;
    z-index: 30;
    display: flex; flex-direction: column;
    pointer-events: none;            /* 收起时不挡住地表操作 */
    border-radius: 18px 18px 0 0;
  }
  .tray > * { pointer-events: auto; }
  .tray.open { background: var(--surface); }

  .tray-handle {
    position: absolute;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: block;
    width: 48px; height: 44px;
    min-width: 44px; min-height: 44px;   /* 触摸目标 ≥ 44px */
    margin: 0;                             /* 位置交给 right / bottom，不再用外边距 */
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .18s ease .30s, transform .18s ease .30s;
  }
  .tray-handle:active { transform: scale(.92); transition-delay: 0s; }
  .tray.open .tray-handle {
    opacity: 0;
    transform: scale(.86);
    pointer-events: none;
    transition-delay: 0s;
  }
  .th-badge {
    position: absolute;
    right: -8px; bottom: -10px;
    height: 59px; width: auto;          /* 59px 高时可见星形约 44px（留白占 25%） */
    pointer-events: none;
    filter: drop-shadow(0 4px 10px rgba(60, 34, 20, .22));
  }
  .th-count {
    position: absolute; top: 0; right: 0;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff; font-size: 10px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(60, 34, 20, .25);
    pointer-events: none;
  }

  .tray-body {
    max-height: 0; opacity: 0; overflow: hidden;
    padding: 0 12px;
    background: var(--surface);      /* 实底：不用半透明 + 模糊，避免漏出背景 */
    border-radius: 18px 18px 0 0;
    transition: max-height .28s cubic-bezier(.2, .8, .2, 1), opacity .18s ease, padding .28s ease;
  }
  .tray.open .tray-body {
    height: calc(176px + env(safe-area-inset-bottom));
    max-height: calc(176px + env(safe-area-inset-bottom));
    opacity: 1;
    overflow: hidden;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }

  .tray-fly {
    position: absolute; left: 0; top: 0;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    pointer-events: none;
    z-index: 70;
    will-change: transform, opacity;
  }
  .tray-fly .item-ico { width: 36px; height: 36px; filter: drop-shadow(0 2px 5px rgba(94, 56, 38, .3)); }
  /* 新入包的那一格闪一下，告诉玩家"东西在这里" */
  .chip.flash { animation: chipFlash .8s ease-out; }
  @keyframes chipFlash {
    0%   { box-shadow: 0 0 0 0 rgba(240, 160, 60, .75); background: #fff3d6; }
    40%  { box-shadow: 0 0 0 6px rgba(240, 160, 60, 0); background: #fff3d6; }
    100% { box-shadow: 0 0 0 0 rgba(240, 160, 60, 0); background: var(--white); }
  }
  .link-btn {
    border: 0; background: none; padding: 8px 2px;
    min-height: 36px;
    font-size: 12px; color: var(--ink-2);
    display: inline-flex; align-items: center;
    cursor: pointer;
  }
  .link-btn:active { color: var(--ink); }
  /* ---------- 物品图标：直接用美术素材（同物品不同变体只换图，图案保持素材原色） ---------- */
  .item-ico { width: 22px; height: 22px; flex: 0 0 auto; object-fit: contain; }
  /* 名字后缀数字：只有它按变体色着色（颜色由 itemNameHtml 内联下发），字号字重随名字 */
  .item-vnum { font: inherit; }
  /* 雨滴素材是纯白：在白色背包底上会消失，加一圈暖棕描边把它托出来（所有变体一致） */
  .item-ico[data-item="raindrop"] {
    filter:
      drop-shadow(0 0 1px rgba(74,42,24,.9))
        drop-shadow(0 0 2px rgba(74,42,24,.48))
        drop-shadow(0 3px 6px rgba(94,56,38,.28));
  }
  .chip .item-ico { width: 36px; height: 36px; }
  .bait .item-ico { width: 34px; height: 34px; }
  .ii-head { display: flex; align-items: center; gap: 6px; }
  .ii-head .item-ico { width: 30px; height: 30px; }
  .item-intro .ii-head { margin-top: 2px; }
  .item-intro .ii-head .ii-name { margin-top: 0; }

  .chips {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-columns: 64px;
    gap: 8px;
    height: 160px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip {
    position: relative;
    width: 64px; min-height: 0; height: 100%;
    padding: 4px 3px 3px;
    flex-direction: column; justify-content: center; gap: 1px;
    border: 1.5px solid var(--line); border-radius: 13px;
    font-size: 9px; line-height: 1.1;
    display: inline-flex; align-items: center;
    background: var(--white); cursor: pointer;
    touch-action: pan-x;               /* 左右滑 = 翻物品；上下拖 = 放到地表 */
    overflow: hidden;
  }
  .chip:active { background: var(--accent-deep); color: #fff; }
  .chip-name {
    max-width: 56px;
    color: var(--ink-2);
    white-space: normal;
    word-break: break-all;
    text-align: center;
    line-height: 1.1;
  }
  .chip-n {
    position: absolute; top: 2px; right: 2px;
    display: grid; place-items: center;
    min-width: 15px; height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 9px; font-weight: 700; line-height: 1;
  }
  .chip:active .chip-name { color: #fff; }
  .chip:active .chip-n { background: var(--accent-deep); }
  .drag-ghost {
    position: absolute; left: 0; top: 0;
    width: 68px; height: 68px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle,
      rgba(255,226,150,.6) 0%,
      rgba(255,186,86,.26) 44%,
      rgba(255,186,86,0) 72%);
    filter: drop-shadow(0 6px 16px rgba(40,20,10,.25));
    pointer-events: none;
    z-index: 60;
    will-change: transform;
  }
  .drag-ghost .item-ico {
    width: 52px; height: 52px;
    filter: drop-shadow(0 3px 6px rgba(94,56,38,.35));
  }
  .chips .empty {
    grid-row: 1 / span 2;
    align-self: center;
    white-space: nowrap;
    color: var(--ink-3); font-size: 12px;
  }

