/* ============================================================
   Gram Hero · 月夜提取主题
   设计原则：深蓝黑夜色 + 鎏金点缀 + 六阶稀有度色
   ============================================================ */

:root {
  /* 底色 */
  --bg: #060a10;
  --bg-raise: #0b1220;
  --panel: rgba(13, 20, 32, 0.92);
  --panel-strong: rgba(9, 14, 24, 0.97);
  --panel-soft: rgba(20, 30, 46, 0.72);
  --line: #24344a;
  --line-soft: #1a2637;

  /* 文本 */
  --text: #e9edf3;
  --text-dim: #9db0c4;
  --text-faint: #64788e;

  /* 品牌色 */
  --gold: #e8c15a;
  --gold-deep: #b78f2e;
  --moon: #7fd4c1;
  --primary: #46b06c;
  --primary-bright: #5ecb84;
  --danger: #e0553f;
  --danger-bright: #ff7259;
  --info: #58a6ff;

  /* 稀有度 */
  --r-white: #c9d4de;
  --r-green: #6fd18a;
  --r-blue: #58a6ff;
  --r-purple: #b980f0;
  --r-gold: #e8c15a;
  --r-red: #ff5d52;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI",
    "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Noto Serif CJK SC",
    "STZhongsong", "FZShuSong-Z01", "Georgia", "SimSun", serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(1200px 500px at 75% -10%, rgba(52, 88, 128, 0.20), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, rgba(232, 193, 90, 0.05), transparent 55%),
    var(--bg);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2b3d55; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

button { font-family: inherit; }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(var(--gold), var(--gold-deep));
}
.panel-body { padding: 14px 16px; }

/* ---------- 按钮 ---------- */
.btn {
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1b2a40, #141f31);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.12s ease, box-shadow 0.12s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: saturate(0.4);
}
.btn-primary {
  border-color: #2f6d45;
  background: linear-gradient(180deg, #2c7a4b, #1f5c38);
  box-shadow: 0 2px 12px rgba(70, 176, 108, 0.25);
}
.btn-gold {
  border-color: #8a6a20;
  background: linear-gradient(180deg, #8a6a20, #6b5117);
  color: #ffe9ad;
  box-shadow: 0 2px 12px rgba(232, 193, 90, 0.22);
}
.btn-danger {
  border-color: #7c3428;
  background: linear-gradient(180deg, #8a3a2b, #6b2d21);
  color: #ffd9d0;
}
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: #3a5273; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 16px; letter-spacing: 0.08em; }
.btn-block { width: 100%; }

/* ---------- 输入 ---------- */
.input, select.input {
  width: 100%;
  padding: 10px 12px;
  background: #0a1220;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--moon); box-shadow: 0 0 0 2px rgba(127, 212, 193, 0.15); }
.input::placeholder { color: var(--text-faint); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; color: var(--text-dim); }

/* ---------- 标签徽章 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text-dim);
}
.chip-gold { color: var(--gold); border-color: rgba(232, 193, 90, 0.4); }
.chip-green { color: var(--primary-bright); border-color: rgba(94, 203, 132, 0.4); }
.chip-red { color: var(--danger-bright); border-color: rgba(255, 114, 89, 0.4); }
.chip-blue { color: var(--info); border-color: rgba(88, 166, 255, 0.35); }

/* ---------- 稀有度 ---------- */
.rar-white { color: var(--r-white); }
.rar-green { color: var(--r-green); }
.rar-blue { color: var(--r-blue); }
.rar-purple { color: var(--r-purple); }
.rar-gold { color: var(--r-gold); }
.rar-red { color: var(--r-red); }

.rb-white { border-color: rgba(201, 212, 222, 0.5) !important; }
.rb-green { border-color: rgba(111, 209, 138, 0.55) !important; }
.rb-blue { border-color: rgba(88, 166, 255, 0.55) !important; }
.rb-purple { border-color: rgba(185, 128, 240, 0.6) !important; }
.rb-gold { border-color: rgba(232, 193, 90, 0.65) !important; box-shadow: 0 0 10px rgba(232,193,90,.12); }
.rb-red { border-color: rgba(255, 93, 82, 0.65) !important; box-shadow: 0 0 10px rgba(255,93,82,.14); }

/* ---------- 物品格 ---------- */
.item-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(38, 56, 82, 0.35), rgba(10, 16, 26, 0.55));
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.item-cell:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.5); z-index: 2; }
.item-cell img {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}
.item-cell .qty {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
}
.item-cell .bound-dot {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger-bright);
  box-shadow: 0 0 4px rgba(255, 114, 89, 0.8);
}
.item-cell.empty { cursor: default; opacity: 0.45; }
.item-cell.empty:hover { transform: none; box-shadow: none; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fade-in 0.15s ease;
}
.modal {
  width: min(480px, 100%);
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--panel-strong);
  border: 1px solid #33507a;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: pop-in 0.18s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 700;
  color: var(--gold);
}
.modal-close {
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 99px;
  background: rgba(12, 20, 32, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  animation: toast-in 0.22s cubic-bezier(0.2, 1.2, 0.4, 1);
  max-width: min(92vw, 480px);
  text-align: center;
}
.toast.ok { border-color: rgba(94, 203, 132, 0.5); color: var(--primary-bright); }
.toast.err { border-color: rgba(255, 114, 89, 0.5); color: var(--danger-bright); }
.toast.gold { border-color: rgba(232, 193, 90, 0.5); color: var(--gold); }
.toast.leaving { animation: toast-out 0.25s ease forwards; }

/* ---------- 通用 ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--text-dim); font-size: 13px; }
.faint { color: var(--text-faint); font-size: 12px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gold-text { color: var(--gold); font-weight: 700; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.divider { height: 1px; background: var(--line-soft); margin: 12px 0; }

.progress {
  height: 8px;
  border-radius: 99px;
  background: #0a1424;
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width 0.5s ease;
}
.progress.green > i { background: linear-gradient(90deg, #2c7a4b, var(--primary-bright)); }
.progress.red > i { background: linear-gradient(90deg, #8a3a2b, var(--danger-bright)); }
.progress.blue > i { background: linear-gradient(90deg, #2b5a8f, var(--info)); }

/* ---------- 页签 ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1;
  padding: 8px 14px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(180deg, #24405f, #1a2f49);
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 2px;
}
.pager .pg-info { font-size: 13px; color: var(--text-dim); min-width: 72px; text-align: center; }

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 34px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}
.empty-state::before {
  content: "☾";
  display: block;
  font-size: 30px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* ============================================================
   深度视觉打磨
   ============================================================ */

/* 屏幕入场 */
.screen { animation: screen-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
}

/* 面板：顶部高光描边 + 更深的层次 */
.panel {
  background:
    linear-gradient(180deg, rgba(70, 100, 140, 0.10), transparent 42px),
    var(--panel);
  position: relative;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(150, 190, 235, 0.22), transparent);
  pointer-events: none;
}

/* 金色/主要按钮：流光扫过 */
.btn-gold, .btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-gold::after, .btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.45s ease;
  pointer-events: none;
}
.btn-gold:hover::after, .btn-primary:hover::after { left: 130%; }

/* 物品格：稀有度底色渐变 + 高稀有度呼吸辉光 */
.item-cell.rb-green { background: linear-gradient(160deg, rgba(111,209,138,.14), rgba(10,16,26,.6)); }
.item-cell.rb-blue { background: linear-gradient(160deg, rgba(88,166,255,.16), rgba(10,16,26,.6)); }
.item-cell.rb-purple { background: linear-gradient(160deg, rgba(185,128,240,.18), rgba(10,16,26,.6)); }
.item-cell.rb-gold {
  background: linear-gradient(160deg, rgba(232,193,90,.20), rgba(10,16,26,.6));
  animation: cell-glow-gold 2.6s ease-in-out infinite;
}
.item-cell.rb-red {
  background: linear-gradient(160deg, rgba(255,93,82,.20), rgba(10,16,26,.6));
  animation: cell-glow-red 2.6s ease-in-out infinite;
}
@keyframes cell-glow-gold {
  0%, 100% { box-shadow: 0 0 6px rgba(232,193,90,.10); }
  50% { box-shadow: 0 0 14px rgba(232,193,90,.30); }
}
@keyframes cell-glow-red {
  0%, 100% { box-shadow: 0 0 6px rgba(255,93,82,.12); }
  50% { box-shadow: 0 0 14px rgba(255,93,82,.32); }
}

/* 顶栏货币变化跳动 */
.currency .num { transition: color 0.2s; }
.currency.bump { animation: currency-bump 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes currency-bump {
  30% { transform: scale(1.14); }
}

/* Toast 图标 */
.toast.ok::before { content: "✓ "; color: var(--primary-bright); }
.toast.err::before { content: "✕ "; color: var(--danger-bright); }
.toast.gold::before { content: "★ "; color: var(--gold); }

/* 路线卡缩略图悬停微缩放 */
.route-card img.thumb { transition: transform 0.25s ease; }
.route-card:hover img.thumb { transform: scale(1.06); }
.route-card.active img.thumb { transform: scale(1.04); }

/* ============================================================
   质感升级 v3 · 去廉价感
   ============================================================ */

/* 展示级标题字体 */
.screen-title, .panel-title, .modal-head > span, .boot-logo,
.login-card h1, .nav-logo, .case-title, .settle-banner, .case-reveal-name {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}
.screen-title {
  position: relative;
  padding-bottom: 10px;
}
.screen-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 220px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(232, 193, 90, 0.25) 60%, transparent);
}
.screen-title small { font-family: var(--font); letter-spacing: normal; }

/* 面板鎏金角饰（内嵌 SVG，四角） */
.panel {
  border-color: #2b3d55;
}
.panel > .panel-title::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-left: 10px;
  background: linear-gradient(90deg, rgba(232, 193, 90, 0.4), transparent);
}
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26'><path d='M2 14 V6 Q2 2 6 2 H14' fill='none' stroke='%23bf9b46' stroke-width='1.6'/><circle cx='5' cy='5' r='1.3' fill='%23e8c15a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26'><path d='M12 24 H20 Q24 24 24 20 V12' fill='none' stroke='%23bf9b46' stroke-width='1.6'/><circle cx='21' cy='21' r='1.3' fill='%23e8c15a'/></svg>");
  background-repeat: no-repeat;
  background-position: top left, bottom right;
  opacity: 0.75;
}

/* 金属按钮浮雕 */
.btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 6px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.btn-gold {
  background:
    linear-gradient(180deg, rgba(255, 236, 170, 0.28), transparent 40%),
    linear-gradient(180deg, #a37f2a, #6b5117);
  border-color: #c9a24a;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 190, 0.45),
    inset 0 -2px 4px rgba(60, 42, 8, 0.6),
    0 3px 10px rgba(232, 193, 90, 0.22);
  color: #fff2cf;
}
.btn-primary {
  background:
    linear-gradient(180deg, rgba(190, 255, 210, 0.2), transparent 40%),
    linear-gradient(180deg, #2c7a4b, #1c5232);
  box-shadow:
    inset 0 1px 0 rgba(210, 255, 225, 0.35),
    inset 0 -2px 4px rgba(8, 40, 20, 0.6),
    0 3px 10px rgba(70, 176, 108, 0.2);
}

/* 顶栏玻璃 + 金发丝 */
.topbar {
  background: linear-gradient(180deg, rgba(14, 22, 36, 0.92), rgba(8, 13, 22, 0.85));
  border-bottom: 1px solid rgba(232, 193, 90, 0.22);
  box-shadow: 0 1px 0 rgba(150, 190, 235, 0.06), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.currency {
  background: linear-gradient(180deg, rgba(30, 44, 66, 0.8), rgba(16, 24, 38, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* 导航栏织纹 */
.nav-rail {
  background:
    linear-gradient(180deg, rgba(20, 30, 48, 0.5), transparent 140px),
    var(--panel-strong);
  border-right: 1px solid rgba(232, 193, 90, 0.12);
}
.nav-logo {
  background: linear-gradient(180deg, #ffe9ad, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 6px rgba(232, 193, 90, 0.25));
}

/* 弹窗头部饰线 */
.modal-head {
  background: linear-gradient(180deg, rgba(232, 193, 90, 0.06), transparent);
}
.modal { border-color: rgba(191, 155, 70, 0.45); }

/* 输入框内嵌质感 */
.input, select.input {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* 空状态月亮呼吸 */
.empty-state::before { animation: moon-breathe 3.2s ease-in-out infinite; display: block; }
@keyframes moon-breathe { 50% { opacity: 0.25; transform: translateY(-3px); } }

/* SVG 图标 */
.svgi { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.nav-item .svgi svg { transition: transform 0.15s ease; }
.nav-item:hover .svgi svg { transform: scale(1.15) rotate(-5deg); }
.nav-item.active .svgi { filter: drop-shadow(0 0 5px rgba(232, 193, 90, 0.55)); }
.tabbar .tb-item .svgi { margin-bottom: 1px; }
.tabbar .tb-item.active .svgi { filter: drop-shadow(0 0 5px rgba(232, 193, 90, 0.55)); }

/* 键盘可达性 */
:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; border-radius: 4px; }
button:focus:not(:focus-visible) { outline: none; }

/* 战报滚动条弱化 */
.battle-log::-webkit-scrollbar-thumb { background: #22314a; }

/* ============================================================
   空间格子网格（真实占格库存）
   ============================================================ */
.sgrid {
  display: grid;
  gap: 3px;
  padding: 8px;
  width: max-content;
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent calc(var(--cell) + 3px - 1px), rgba(70, 100, 140, 0.14) calc(var(--cell) + 3px - 1px), rgba(70, 100, 140, 0.14) calc(var(--cell) + 3px)),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--cell) + 3px - 1px), rgba(70, 100, 140, 0.14) calc(var(--cell) + 3px - 1px), rgba(70, 100, 140, 0.14) calc(var(--cell) + 3px)),
    rgba(7, 12, 20, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.sgrid-scroll { overflow: auto; max-height: 560px; border-radius: var(--radius-sm); }
.warehouse-sgrid { max-height: 620px; }
.sgrid-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(38, 56, 82, 0.4), rgba(10, 16, 26, 0.65));
  cursor: pointer;
  overflow: hidden;
  animation: sgrid-pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.sgrid-item:hover {
  transform: scale(1.045);
  z-index: 3;
  filter: brightness(1.2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}
.sgrid-item:active { transform: scale(0.98); }
.sgrid-item img, .sgrid-item > div:first-of-type { position: absolute; inset: 10%; width: 80%; height: 80%; object-fit: contain; pointer-events: none; }
.sgrid-item .qty {
  position: absolute; right: 4px; bottom: 2px;
  font-size: 11px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
}
.sgrid-item .bound-dot {
  position: absolute; left: 5px; top: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger-bright);
  box-shadow: 0 0 4px rgba(255, 114, 89, 0.8);
}
.sgrid-item .sgrid-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2px 5px;
  font-size: 10.5px; font-weight: 600;
  color: var(--text-dim);
  background: linear-gradient(transparent, rgba(3, 6, 10, 0.85));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.sgrid.compact .sgrid-item { border-radius: 5px; }
.sgrid-item.rb-gold, .sgrid-item.rb-red { animation: sgrid-pop 0.3s cubic-bezier(0.2,1.4,0.4,1) backwards, cell-glow-gold 2.6s ease-in-out 0.3s infinite; }
.sgrid-item.rb-red { animation-name: sgrid-pop, cell-glow-red; }
.container-block { margin-bottom: 4px; }
@keyframes sgrid-pop {
  from { opacity: 0; transform: scale(0.7); }
}

/* ============================================================
   交互动画升级包
   ============================================================ */

/* 卡片统一悬停浮起 */
.listing-row, .mail-row, .mission-row, .stat-tile, .job-card, .recipe-item, .season-node {
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.18s ease;
}
.listing-row:hover, .mail-row:hover, .mission-row:hover, .job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: #3a5273;
}
.stat-tile:hover { transform: translateY(-2px); border-color: #3a5273; }

/* 物品格错落入场 */
.wh-grid .item-cell, .settle-items .item-cell, .collection-grid .coll-card {
  animation: sgrid-pop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}
.wh-grid .item-cell:nth-child(n) { animation-delay: calc(18ms * min(var(--i, 0), 20)); }

/* 战报条目滑入 */
.battle-log .ev { animation: log-slide 0.28s ease backwards; }
@keyframes log-slide {
  from { opacity: 0; transform: translateX(-10px); }
}

/* 引导/进度条纹流动（远征中/打造中） */
.progress.striped > i {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.14) 0 8px,
    transparent 8px 16px
  ), linear-gradient(90deg, var(--gold-deep), var(--gold));
  background-size: 22px 100%, 100% 100%;
  animation: stripes-flow 0.9s linear infinite;
}
@keyframes stripes-flow { to { background-position: 22px 0, 0 0; } }

/* 页签底部辉光 */
.tab.active { position: relative; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 22%; right: 22%; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: fade-in 0.3s ease;
}

/* 模态弹性入场（已有 pop-in）+ 蒙层柔化 */
.modal-mask { animation: fade-in 0.18s ease; }
.modal { animation: modal-spring 0.26s cubic-bezier(0.2, 1.5, 0.35, 1); }
@keyframes modal-spring {
  from { opacity: 0; transform: scale(0.9) translateY(18px); }
}

/* 导航项图标微动 */
.nav-item .ico { transition: transform 0.15s ease; }
.nav-item:hover .ico { transform: scale(1.18) rotate(-6deg); }
.nav-item.active .ico { transform: scale(1.12); }

/* 底部标签按压反馈 */
.tabbar .tb-item:active .ico { transform: scale(0.85); }
.tabbar .tb-item .ico { transition: transform 0.1s ease; }

/* 顶栏货币悬停 */
.currency { transition: border-color 0.15s, transform 0.15s; }
.currency:hover { border-color: #3a5273; transform: translateY(-1px); }

/* 路线卡选中呼吸 */
.route-card.active { animation: route-active-glow 2.4s ease-in-out infinite; }
@keyframes route-active-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(232, 193, 90, 0.35), var(--shadow); }
  50% { box-shadow: 0 0 14px 1px rgba(232, 193, 90, 0.30), var(--shadow); }
}

/* 装备槽悬停 */
.slot-row { transition: background 0.14s ease; }
.slot-row:hover { background: rgba(45, 68, 100, 0.18); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94) translateY(10px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(0.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(0.96); } }
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 193, 90, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(232, 193, 90, 0); }
}
