/* 三角洲行动游乐场 —— 深色军事风：墨黑底 + 战术绿 + 信号橙 */
:root {
  --bg: #14171c;
  --bg-deep: #0f1216;
  --card: #1d2129;
  --card-hi: #252b35;
  --ink: #e8e6df;
  --ink-soft: #9aa3ad;
  --olive: #8ba05e;
  --olive-deep: #6d8048;
  --orange: #e08a3c;
  --orange-deep: #b5691f;
  --line: #313844;
  --green: #5fae63;
  --green-bg: rgba(95, 174, 99, .15);
  --red: #cf6a55;
  --red-bg: rgba(207, 106, 85, .15);
  --radius: 12px;
  --radius-sm: 10px;
  /* 统一阴影语言：平面卡 / 橙边卡 / 浮起 / 弹层 */
  --shadow-card: 0 2px 0 rgba(0, 0, 0, .35);
  --shadow-gold: 0 2px 0 var(--orange-deep);
  --shadow-hover: 0 6px 16px rgba(0, 0, 0, .45), 0 4px 0 var(--orange);
  --shadow-layer: 0 8px 24px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 战术质感：细颗粒噪点 + 斜向织纹 + 顶部橙光 */
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(224, 138, 60, .12), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .008) 0 2px, transparent 2px 8px);
}

/* 顶部 */
.site-header { text-align: center; padding: 30px 16px 8px; }
.site-header h1 { font-size: 32px; letter-spacing: 4px; }
.site-header h1 a { color: var(--ink); text-decoration: none; }
.site-header .accent {
  color: var(--orange);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
.tagline { color: var(--ink-soft); margin-top: 6px; font-size: 12px; letter-spacing: 6px; }
.tagline::before, .tagline::after { content: "—"; color: var(--olive); margin: 0 8px; }

main { width: 100%; max-width: 720px; padding: 16px 12px 40px; flex: 1; }
.hidden { display: none !important; }

/* ---------- 首页：主打横幅 + 编号索引列表 ---------- */
.home-grid { display: block; }

/* 主打横幅（鼠鼠摸金）：大排印 + 幽灵序号 + 数据行 */
.home-card.hot {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 28px;
  margin-bottom: 34px; padding: 34px 34px 28px;
  text-decoration: none; color: var(--ink);
  background:
    radial-gradient(120% 180% at 88% -20%, rgba(224, 138, 60, .16), transparent 55%),
    linear-gradient(120deg, var(--card-hi), var(--card) 60%);
  border: 1px solid var(--orange); border-radius: var(--radius);
  box-shadow: var(--shadow-gold), 0 0 26px rgba(224, 138, 60, .12);
  transition: transform .15s, box-shadow .15s;
}
.home-card.hot:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover), 0 0 34px rgba(224, 138, 60, .2); }
.hot-main { flex: 1; min-width: 0; }
.hot-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: .3em; color: var(--orange); margin-bottom: 14px;
}
.home-card.hot h2 { font-size: 30px; font-weight: 700; letter-spacing: .04em; margin-bottom: 10px; }
.home-card.hot p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.8; max-width: 460px; }
.hot-stats {
  display: flex; flex-wrap: wrap; gap: 0; margin-top: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: .12em; color: var(--olive);
}
.hot-stats span { padding: 0 14px; border-left: 1px solid var(--line); }
.hot-stats span:first-child { padding-left: 0; border-left: none; }
.hot-no {
  flex: none; align-self: flex-end;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 130px; font-weight: 700; line-height: .78;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(224, 138, 60, .35);
  user-select: none;
}
.hot-badge {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  font-size: 11px; font-weight: 700; letter-spacing: 3px; line-height: 1; text-indent: 1.5px;
  color: #1a1206; background: linear-gradient(135deg, #f2a54f, var(--orange) 55%, var(--orange-deep));
  padding: 6px 9px; border-radius: 6px;
  box-shadow: 0 2px 0 var(--orange-deep), 0 0 12px rgba(224, 138, 60, .5);
  animation: hotpulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hotpulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 索引行：编号 + 标题/英文小标/描述 + 箭头，细分隔线，无盒子 */
.home-card {
  display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 20px;
  padding: 22px 10px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background .15s, padding-left .15s;
}
.home-card.hot + .home-card { border-top: 1px solid var(--line); }
.home-card:hover { background: rgba(255, 255, 255, .025); padding-left: 18px; }
.hc-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; letter-spacing: .15em; color: var(--ink-soft); opacity: .65;
}
.home-card h2 { font-size: 17px; font-weight: 600; letter-spacing: .03em; }
.hc-en {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px; letter-spacing: .22em; color: var(--olive);
  margin-left: 12px; vertical-align: 2px;
}
.home-card p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.65; margin-top: 6px; max-width: 520px; }
.hc-arrow {
  font-size: 18px; color: var(--ink-soft);
  transition: transform .15s, color .15s;
}
.home-card:hover .hc-arrow { color: var(--orange); transform: translateX(6px); }

.dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #3a4150; margin-left: 8px; vertical-align: 2px;
}
.dot.done { background: var(--green); box-shadow: 0 0 0 3px rgba(95, 174, 99, .25); }
.home-note { margin-top: 20px; text-align: center; color: var(--ink-soft); font-size: 13px; }

@media (max-width: 560px) {
  .home-card.hot { flex-direction: column; align-items: flex-start; gap: 18px; padding: 26px 22px 22px; }
  .home-card.hot h2 { font-size: 25px; }
  .hot-no { display: none; }
  .home-card { grid-template-columns: 1fr auto; gap: 12px; }
  .hc-no { display: none; }
  .hc-en { display: inline; margin-left: 10px; }
}

/* ---------- 游戏通用 ---------- */
.game-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.game-head h2 { font-size: 21px; letter-spacing: 1px; }
.mode-tabs { display: flex; gap: 6px; }
.mode-tab {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.mode-tab.active { background: var(--bg-deep); color: var(--orange); border-color: var(--orange-deep); font-weight: 600; }
.mode-banner { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 12px 0 14px; }
.mode-banner b { color: var(--orange); }

button.btn {
  border: none; border-radius: 10px; padding: 10px 20px; font-size: 15px; cursor: pointer;
  background: var(--bg-deep); color: var(--orange); font-weight: 600;
  border: 1px solid var(--orange-deep);
  border-bottom: 3px solid var(--orange-deep);
  transition: transform .08s, border-bottom-width .08s;
}
button.btn:active { transform: translateY(2px); border-bottom-width: 1px; }
button.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--olive-deep); border-bottom: 3px solid var(--olive-deep); }

.tries-left { padding: 10px 4px; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.tries-left b { color: var(--orange); font-size: 18px; }

/* 输入 + 自动补全 */
.guess-bar { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.input-wrap { position: relative; flex: 1; }
.guess-bar input, .input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); outline: none;
  transition: border-color .15s;
}
.guess-bar input:focus, .input:focus { border-color: var(--orange); }
.guess-bar input:disabled, .input:disabled { opacity: .5; }
.suggest-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  list-style: none; background: var(--card-hi); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-layer);
  max-height: 300px; overflow-y: auto;
}
.suggest-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.suggest-list li.active, .suggest-list li:hover { background: var(--bg-deep); }
.suggest-list img, .suggest-list .avatar-fallback { width: 48px; height: 24px; border-radius: 6px; object-fit: contain; }
.suggest-list .s-name { font-size: 15px; }
.suggest-list .s-meta { margin-left: auto; font-size: 12px; color: var(--ink-soft); }

/* 枪械图与占位块（300×150 白底 PNG，contain 展示） */
.gun-img {
  width: 96px; height: 48px; object-fit: contain; display: block;
  background: #fff; border-radius: 8px;
}
.gun-img.sm { width: 64px; height: 32px; border-radius: 6px; }
.gun-img.lg { width: 180px; height: 90px; border-radius: 10px; }

/* chips（已猜记录） */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; border: 1px solid; }
.chip.wrong { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.chip.hit { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.chip.skip { background: var(--card-hi); border-color: var(--line); color: var(--ink-soft); }

/* 结算卡 */
.result {
  margin-top: 18px; background: var(--card); border: 1px solid var(--orange-deep);
  border-radius: var(--radius); padding: 18px; text-align: center;
  box-shadow: var(--shadow-gold);
}
.result { animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.result .r-portrait { width: 220px; height: 110px; margin: 0 auto; }
.result h2 { margin: 10px 0 4px; font-size: 21px; }
.result .r-meta { color: var(--ink-soft); font-size: 13px; margin-bottom: 8px; }
.result .r-quote {
  font-size: 14px; color: var(--ink); background: var(--bg-deep);
  border-left: 3px solid var(--olive); border-radius: 6px;
  padding: 8px 12px; margin: 8px auto 10px; max-width: 480px; text-align: left;
}
.result .r-grade { font-size: 15px; margin-bottom: 4px; }
.result .r-grade b { color: var(--orange); font-size: 20px; }
.result .r-guide { color: var(--g5); font-size: 14px; font-weight: 700; margin: 10px 0 4px; }
.result .btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* 图例 */
.legend { margin-top: 20px; font-size: 13px; color: var(--ink-soft); }
.legend summary { cursor: pointer; }
.legend ul { padding: 8px 0 0 18px; display: flex; flex-direction: column; gap: 4px; line-height: 1.6; }

/* ---------- 改枪大师 ---------- */
.seg-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 12px; }
.seg {
  height: 30px; border-radius: 8px; border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-soft); background: var(--card);
  transition: all .2s;
}
.seg.on { background: var(--bg-deep); color: var(--orange); border: 1px solid var(--orange-deep); font-weight: 600; }
.seg.hit { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.seg.miss { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.smith-question {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-align: center; font-size: 15px; line-height: 1.7;
  box-shadow: var(--shadow-card);
}
.smith-question b { color: var(--orange); }
.smith-question .q-slot { color: var(--olive); font-weight: 700; }
.smith-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.smith-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 10px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform .12s, border-color .12s;
}
.smith-card:hover { transform: translateY(-2px); border-color: var(--orange); }
.smith-card .gun-img { margin: 0 auto 8px; width: 120px; height: 60px; }
.smith-card .sc-name { font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 2.8em; }
.smith-card .sc-stat {
  margin-top: 8px; font-size: 16px; font-weight: 800;
  font-variant-numeric: tabular-nums; animation: pop .2s ease both;
}
.smith-card .sc-effects { margin-top: 6px; font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.smith-card .sc-effects .pro { color: var(--green); }
.smith-card .sc-effects .con { color: var(--red); }
.smith-card.correct { border-color: var(--green); background: var(--green-bg); cursor: default; }
.smith-card.correct .sc-stat { color: var(--green); }
.smith-card.wrong { border-color: var(--red); background: var(--red-bg); cursor: default; }
.smith-card.wrong .sc-stat { color: var(--red); }
.smith-card.reveal { cursor: default; }
.smith-card.reveal:not(.correct):not(.wrong) .sc-stat { color: var(--ink-soft); }
.smith-actions { display: flex; justify-content: center; margin-top: 14px; }

/* ---------- 猜枪械（七维比对表格） ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.guess-table { min-width: 680px; }
.guess-grid { display: grid; grid-template-columns: 1.4fr repeat(7, 1fr); gap: 6px; align-items: center; }
.grid-head { font-size: 12px; color: var(--ink-soft); margin: 14px 0 6px; text-align: center; }
.grid-head .c-name { text-align: left; padding-left: 6px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row .cell {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 52px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  font-size: 13px; padding: 4px 2px; text-align: center; line-height: 1.25;
  font-variant-numeric: tabular-nums;
  animation: pop .2s ease both;
}
/* 逐格 stagger 入场（≤300ms） */
.row .cell:nth-child(2) { animation-delay: .03s; }
.row .cell:nth-child(3) { animation-delay: .06s; }
.row .cell:nth-child(4) { animation-delay: .09s; }
.row .cell:nth-child(5) { animation-delay: .12s; }
.row .cell:nth-child(6) { animation-delay: .15s; }
.row .cell:nth-child(7) { animation-delay: .18s; }
.row .cell:nth-child(8) { animation-delay: .21s; }
.row .cell .arrow { font-size: 15px; line-height: 1; }
.row .cell.name {
  flex-direction: row; gap: 8px; justify-content: flex-start; padding: 4px 8px; font-weight: 600;
}
.row .cell.name img { width: 48px; height: 24px; border-radius: 6px; object-fit: contain; background: #fff; }
.cell.green { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.cell.red, .cell.up, .cell.down { background: var(--red-bg); border-color: var(--red); color: var(--red); }

/* ---------- 枪械对决 ---------- */
.duel-stat {
  text-align: center; font-size: 15px; margin-bottom: 12px; color: var(--ink-soft);
}
.duel-stat b { color: var(--orange); font-size: 18px; }
.pop-arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.pop-vs { align-self: center; font-weight: 800; color: var(--orange); font-size: 18px; letter-spacing: 1px; }
.pop-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; box-shadow: var(--shadow-card);
}
.pop-card .gun-img { margin: 0 auto 8px; width: 140px; height: 70px; }
.pop-name { font-size: 16px; font-weight: 700; }
.pop-type { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.pop-play { font-size: 24px; font-weight: 800; color: var(--orange); margin-top: 8px; font-variant-numeric: tabular-nums; }
.pop-play small { font-size: 12px; color: var(--ink-soft); font-weight: 400; display: block; }
.pop-play.unknown { color: var(--ink-soft); letter-spacing: 4px; }
.pop-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.pop-streak { text-align: center; margin-top: 10px; font-size: 14px; color: var(--ink-soft); }
.pop-streak b { color: var(--orange); font-size: 18px; }
.data-note { margin-top: 16px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; text-align: center; }
.data-note.warn {
  background: rgba(224, 138, 60, .08); border: 1px dashed var(--orange-deep);
  border-radius: 8px; padding: 8px 12px;
}
.data-note.warn b { color: var(--orange); }

/* ---------- 火力排排坐 ---------- */
.tl-list { display: flex; flex-direction: column; gap: 8px; }
.tl-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; cursor: pointer; box-shadow: var(--shadow-card);
  transition: all .12s;
}
.tl-card:hover { border-color: var(--orange); }
.tl-card.sel { border-color: var(--orange); background: var(--card-hi); box-shadow: 0 2px 0 var(--orange-deep); }
.tl-card .pos { font-size: 18px; font-weight: 800; color: var(--orange); width: 24px; text-align: center; }
.tl-card .tname { font-size: 16px; font-weight: 600; }
.tl-card .ttype { font-size: 12px; color: var(--ink-soft); margin-left: 6px; }
.tl-card .tdate { margin-left: auto; font-size: 14px; color: var(--orange); font-variant-numeric: tabular-nums; font-weight: 700; }
.tl-card.done { cursor: default; }
.tl-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.tl-attempts { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.tl-marks { font-size: 18px; letter-spacing: 4px; text-align: center; }

/* ---------- 页脚 / 提示条 ---------- */
.site-footer {
  text-align: center; color: var(--ink-soft); font-size: 12px; line-height: 1.8;
  padding: 18px 16px 28px; border-top: 1px solid var(--line); width: 100%; max-width: 720px;
}
/* toast：顶部滑入，2s 后由 JS 隐藏 */
.toast {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  background: var(--bg-deep); color: var(--orange); padding: 10px 20px; border-radius: 999px;
  font-size: 14px; z-index: 70; box-shadow: var(--shadow-layer); /* 压过庆祝卡(55)与撒花(60) */
  border: 1px solid var(--orange-deep);
  animation: toast-in .25s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.shake { animation: shake .3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

/* 动效收口：系统要求减少动态时全部关闭 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 560px) {
  .site-header h1 { font-size: 25px; }
  .home-grid { grid-template-columns: 1fr; }
  .guess-bar { flex-wrap: wrap; }
  .guess-bar .input-wrap { flex: 1 1 100%; }
  .smith-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .smith-card .sc-name { font-size: 13px; }
  .pop-card { padding: 12px 6px; }
  .pop-card .gun-img { width: 100px; height: 50px; }
  .pop-name { font-size: 14px; }
  .pop-play { font-size: 19px; }
  .tl-card { padding: 8px 10px; gap: 8px; }
  .tl-card .tname { font-size: 14px; }
}

/* ================================================================
 * 玩法 7：鼠鼠摸金（2D 摸金撤离）
 * 品质配色：1灰 2绿 3蓝 4紫 5金 6红
 * ================================================================ */
:root {
  --g1: #8a8f98; --g2: #5fae63; --g3: #5b8dd9;
  --g4: #a06ee0; --g5: #e0a83c; --g6: #d04b3a;
  --bagcell: 44px;
  --rpcell: 44px; /* 搜索浮层容器格尺寸（手机端 34px） */
}
.raid-credit {
  font-size: 12px; color: var(--ink-soft); line-height: 1.7; text-align: center;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px; margin: 0 0 12px;
}
.raid-howto {
  font-size: 14px; color: var(--ink); line-height: 1.8; text-align: center;
  background: var(--card); border: 1px solid var(--orange-deep); border-radius: var(--radius);
  padding: 10px 14px; margin: 0 0 12px; box-shadow: var(--shadow-card);
}
.raid-howto b { color: var(--orange); }
.raid-hud {
  display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 10px; font-size: 14px; color: var(--ink-soft);
  box-shadow: var(--shadow-card); font-variant-numeric: tabular-nums;
}
.raid-hud b { color: var(--orange); font-size: 16px; }
.raid-hud b.danger { color: var(--red); }

.raid-stage { position: relative; }
#raidCanvas {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-deep);
  box-shadow: var(--shadow-card); cursor: crosshair;
  touch-action: manipulation;
}
.raid-extract {
  position: absolute; left: 10%; right: 10%; bottom: 12px; height: 26px;
  background: rgba(15, 18, 22, .88); border: 1px solid var(--green); border-radius: 999px;
  overflow: hidden; box-shadow: var(--shadow-layer);
}
.raid-extract .re-fill {
  position: absolute; inset: 0; width: 0%;
  background: linear-gradient(90deg, var(--olive-deep), var(--green));
  transition: width .1s linear;
}
.raid-extract .re-text {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
/* 被抓：红闪 + 震屏 */
.raid-stage.death { animation: deathflash .7s ease; }
@keyframes deathflash {
  0% { box-shadow: none; transform: translateX(0); }
  20% { box-shadow: inset 0 0 60px 18px rgba(208, 75, 58, .55); transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); box-shadow: inset 0 0 60px 18px rgba(208, 75, 58, .35); }
  100% { box-shadow: none; transform: translateX(0); }
}
.raid-tip { text-align: center; font-size: 13px; color: var(--ink-soft); margin-top: 10px; min-height: 1.6em; }
.raid-tip b { color: var(--orange); }
.raid-story {
  text-align: center; font-size: 14px; color: var(--olive);
  margin: 4px 0 14px; font-weight: 600;
}

/* 背包 */
.raid-bags { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.raid-bag h3 { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.raid-bag h3 small { color: var(--ink-soft); font-weight: 400; margin-left: 6px; font-size: 11px; }
.bag-grid {
  position: relative; width: calc(var(--bagcell) * var(--bw, 6)); height: calc(var(--bagcell) * var(--bh, 4));
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius-sm);
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: var(--bagcell) var(--bagcell);
}
.bag-grid.small { border-color: var(--orange-deep); }
.bag-item {
  position: absolute; border-radius: 6px; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid; padding: 1px; text-align: center;
  transition: transform .1s;
}
.bag-item:hover { transform: scale(1.04); z-index: 3; }
.bag-item img, .rit-fb { width: 60%; max-height: 55%; object-fit: contain; }
.bag-item .bi-name {
  font-size: 10px; line-height: 1.1; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; padding: 0 2px;
}
.bag-item .bi-val { font-size: 9px; opacity: .85; font-variant-numeric: tabular-nums; }

/* 品质配色（背包 / 待拾取 / 图鉴共用） */
.g1 { border-color: var(--g1) !important; background: rgba(138, 143, 152, .16); color: #c7ccd4; }
.g2 { border-color: var(--g2) !important; background: rgba(95, 174, 99, .16); color: #a8d8ab; }
.g3 { border-color: var(--g3) !important; background: rgba(91, 141, 217, .16); color: #a9c6ef; }
.g4 { border-color: var(--g4) !important; background: rgba(160, 110, 224, .18); color: #cdb1f2; }
.g5 { border-color: var(--g5) !important; background: rgba(224, 168, 60, .18); color: #f0cd8d; }
.g6 { border-color: var(--g6) !important; background: rgba(208, 75, 58, .2); color: #f0a89d; }
.rit-fb { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; border-radius: 4px; }

/* 搜索浮层 */
.raid-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 12, 15, .72);
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.raid-panel {
  background: var(--card); border: 1px solid var(--orange-deep); border-radius: var(--radius);
  box-shadow: var(--shadow-layer); padding: 16px; max-width: 860px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  animation: rise .25s ease both;
}
.raid-panel.flash-gold { animation: flash-gold .6s ease; }
.raid-panel.flash-red { animation: flash-red .8s ease; }
@keyframes flash-gold {
  0%, 100% { box-shadow: var(--shadow-layer); }
  40% { box-shadow: 0 0 34px 6px rgba(224, 168, 60, .75); border-color: var(--g5); }
}
@keyframes flash-red {
  0%, 100% { box-shadow: var(--shadow-layer); }
  30%, 60% { box-shadow: 0 0 44px 10px rgba(208, 75, 58, .85); border-color: var(--g6); }
}
.rp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rp-head h3 { font-size: 17px; }
.rp-head h3 .rp-tier { font-size: 12px; color: var(--ink-soft); margin-left: 8px; font-weight: 400; }
.rp-value { font-size: 16px; font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; }
.rp-grid-wrap { display: flex; justify-content: center; margin: 12px 0 6px; }
.rp-grid { display: grid; gap: 3px; grid-auto-rows: 44px; }
/* 搜索浮层：物品剪影（未鉴定）→ 点击放大镜转圈 → 揭晓（还原官方形态） */
.rp-item.rp-silhouette {
  border: 1px dashed #4a5262; background: rgba(16, 19, 24, .9); color: #78818f;
  cursor: pointer; position: relative; z-index: 2; animation: none;
}
.rp-item.rp-silhouette:hover { border-color: var(--orange); transform: scale(1.03); }
.rp-item.rp-silhouette .rp-unknown { font-size: 18px; font-weight: 800; opacity: .75; }
.rp-item.rp-silhouette.searching { border-style: solid; border-color: var(--orange); cursor: wait; }
.rp-item.rp-silhouette.searching:hover { transform: none; }
.rp-item.rp-silhouette.searching .rp-unknown { visibility: hidden; }
.rp-item.rp-silhouette.searching::before {
  content: "🔍"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 18px; animation: rp-spin 1s linear infinite;
}
.rp-item.rp-silhouette.searching::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 4px; height: 3px;
  background: var(--orange); border-radius: 2px; transform-origin: left;
  animation: rp-prog var(--rd, .6s) linear both;
}
@keyframes rp-spin { to { transform: rotate(360deg); } }
@keyframes rp-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rp-item.revealed { z-index: 2; cursor: pointer; }
.rp-item.revealed.taken { cursor: default; }
.rp-item.taken { opacity: .35; filter: grayscale(.7); }
.rp-empty { border-radius: 6px; background: rgba(255, 255, 255, .02); border: 1px solid rgba(255, 255, 255, .05); }

/* 搜索浮层：容器 + 背包并排 */
.rp-body { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.rp-left { flex: 1 1 240px; min-width: 0; }
.rp-bags { flex: 0 0 auto; }
.rp-bags .raid-bag { margin-bottom: 12px; }
.rp-bags .raid-bag h3 { font-size: 13px; }
.rp-bag-value { font-size: 14px; font-weight: 800; color: var(--orange); text-align: right; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.rp-bag-tip { font-size: 11px; color: var(--ink-soft); text-align: center; margin: 2px auto 0; max-width: calc(var(--bagcell) * var(--bw, 6) + 4px); }

/* 背包浮层（Tab/ESC 呼出） */
.bag-panel { max-width: 560px; }
.bag-ov-body { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: flex-start; margin-top: 8px; }

/* 拖拽（幽灵跟随 + 落点高亮） */
.bag-item, .rp-stage-item { touch-action: none; user-select: none; -webkit-user-select: none; }
.drag-ghost {
  position: fixed; z-index: 99; pointer-events: none; opacity: .88;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.drag-ghost { z-index: 99 !important; } /* 压过 .rp-item.revealed 的 z-index:2，否则容器格幽灵垫在浮层下看不见 */
.drag-ghost img, .drag-ghost .rit-fb { width: 60%; max-height: 55%; object-fit: contain; }
.drag-ghost.rot img { transform: rotate(90deg); } /* 拖动中按 R 横竖切换 */
.bag-item.rot img, .rp-item.rot img { transform: rotate(90deg); } /* 横放的物品，图片跟着横 */
.bag-grid.drop-ok { border-color: var(--green, #5fae63); box-shadow: 0 0 0 2px rgba(95, 174, 99, .55); }
.bag-grid.drop-bad { border-color: var(--red); box-shadow: 0 0 0 2px rgba(208, 75, 58, .5); }
/* 拖拽丢弃指示：红色垃圾桶徽章跟随指针（松手即丢区域） */
#dragTrash {
  position: fixed; z-index: 100; width: 40px; height: 40px; border-radius: 50%;
  background: var(--red); display: none; align-items: center; justify-content: center;
  pointer-events: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}
#dragTrash.show { display: flex; }
#dragTrash svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drag-ghost.discarding { opacity: .55; }
.rp-staging.drop-ok, .rp-grid-wrap.drop-ok { outline: 2px dashed rgba(224, 138, 60, .7); outline-offset: 4px; border-radius: 8px; }
.bag-item.drag-src, .rp-stage-item.drag-src { opacity: .35; }

/* 撤离撒花 */
.confetti-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti-pc {
  position: absolute; top: -16px; border-radius: 2px;
  animation: confetti-fall var(--cfd, 3s) cubic-bezier(.2, .6, .6, 1) var(--cfdl, 0s) both;
}
@keyframes confetti-fall {
  0% { transform: translate3d(0, -4vh, 0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate3d(var(--cfsw, 0px), 108vh, 0) rotate(var(--cfr, 720deg)); opacity: 0; }
}

/* 撤离庆祝卡（鼠鼠表情包弹卡） */
.raid-celeb {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(10, 12, 15, .6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.celeb-card {
  background: var(--card); border: 2px solid var(--g5); border-radius: 18px;
  box-shadow: 0 0 44px 8px rgba(224, 168, 60, .45), var(--shadow-layer);
  padding: 22px 28px; max-width: 480px; width: 100%; text-align: center;
  animation: celeb-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes celeb-pop {
  0% { transform: scale(.4) rotate(-6deg); opacity: 0; }
  70% { transform: scale(1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}
.celeb-card img { width: 240px; max-width: 80%; border-radius: 12px; display: block; margin: 0 auto 10px; }
.celeb-card.fail { border-color: var(--g6); box-shadow: 0 0 44px 8px rgba(208, 75, 58, .4), var(--shadow-layer); }
.celeb-grade { font-size: 44px; font-weight: 900; color: var(--g5); line-height: 1.1; text-shadow: 0 2px 12px rgba(224, 168, 60, .5); }
.celeb-grade.gC { color: var(--g1); text-shadow: none; }
.celeb-text { font-size: 15px; font-weight: 700; color: var(--ink); margin: 6px 0 14px; }
/* 弹卡按钮：两列网格，奇数个时最后一个通栏 */
.celeb-card .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.celeb-card .btn-row .btn { width: 100%; padding: 11px 10px; }
.celeb-card .btn-row .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .celeb-card { max-width: 340px; padding: 16px 18px; }
  .celeb-card img { width: 190px; }
  .celeb-grade { font-size: 34px; }
}

/* 关卡选择：等宽网格，四行结构逐行对齐 */
.raid-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 auto 14px; max-width: 760px; }
.raid-level {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; cursor: pointer; color: var(--ink); font-size: 12px; width: 100%;
  transition: border-color .15s, transform .1s;
}
.raid-level:hover { transform: translateY(-1px); border-color: var(--orange-deep); }
.raid-level.active { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.raid-level b { font-size: 13px; }
.raid-level .rl-desc { color: var(--ink-soft); min-height: 2.4em; line-height: 1.2; }
.raid-level .rl-stats { color: var(--ink-soft); opacity: .75; font-size: 11px; font-variant-numeric: tabular-nums; }
.raid-level .rl-best { color: var(--g5); font-variant-numeric: tabular-nums; margin-top: auto; }
.raid-level .rl-best.none { color: var(--ink-soft); opacity: .6; }
.rp-item {
  border-radius: 6px; border: 1px solid; z-index: 1; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: pop .25s ease both; padding: 1px; text-align: center;
}
.rp-item img, .rp-item .rit-fb { width: 62%; max-height: 58%; object-fit: contain; }
.rp-item .bi-name { font-size: 10px; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.rp-msg { min-height: 1.5em; text-align: center; font-size: 14px; color: var(--g5); font-weight: 700; margin: 4px 0; }
.rp-staging { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.rp-stage-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--bg-deep); border: 1px solid; border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 13px;
}
.rp-stage-item .si-btns .btn { cursor: pointer; }
.rp-stage-item img, .rp-stage-item .rit-fb { width: 34px; height: 34px; object-fit: contain; flex: none; }
.rp-stage-item .si-name { font-weight: 700; }
.rp-stage-item .si-meta { color: var(--ink-soft); font-size: 12px; margin-left: 6px; }
.rp-stage-item .si-btns { margin-left: auto; display: flex; gap: 6px; flex: none; }
.rp-stage-item .si-btns .btn { padding: 5px 10px; font-size: 12px; }
.rp-actions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }

/* 得吃记录图鉴 */
.raid-coll-summary { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 8px 0 10px; }
.raid-coll-summary b { color: var(--orange); }
.raid-coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.raid-coll-item {
  border: 1px solid; border-radius: var(--radius-sm); padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
}
.raid-coll-item img, .raid-coll-item .rit-fb { width: 40px; height: 40px; object-fit: contain; }
.raid-coll-item .ci-name { font-size: 11px; line-height: 1.2; }
.raid-coll-item .ci-count { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  :root { --bagcell: 40px; --rpcell: 34px; }
  .raid-hud { gap: 12px; font-size: 13px; }
  .raid-bags { gap: 12px; }
  .raid-levels { grid-template-columns: repeat(2, 1fr); }
  .raid-level { padding: 8px 10px; }
}

/* ---------- 触屏适配（pointer: coarse = 手机/平板） ---------- */
.raid-touch-ui { display: none; }
@media (pointer: coarse) {
  .raid-touch-ui {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-top: 10px; padding: 0 6px; user-select: none; -webkit-user-select: none;
    position: relative; z-index: 45; /* 浮层开着时按钮仍可点（背包再按=关闭） */
  }
  /* 浮层打开时收起操控条：不挡「收工走人/收起」，浮层自身有关闭按钮 */
  body.ov-open .raid-touch-ui { display: none; }
  .raid-joy {
    position: relative; width: 104px; height: 104px; flex: none; border-radius: 50%;
    background: rgba(255, 255, 255, .04); border: 1.5px solid rgba(255, 255, 255, .14);
    touch-action: none;
  }
  .raid-joy-knob {
    position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border-radius: 50%;
    background: rgba(224, 138, 60, .35); border: 2px solid var(--orange);
    transform: translate(-50%, -50%);
  }
  .raid-joy.active .raid-joy-knob { background: rgba(224, 138, 60, .6); }
  .raid-touch-btns { display: flex; gap: 10px; flex: none; }
  .raid-touch-btns .btn { padding: 14px 20px; font-size: 16px; border-radius: 12px; touch-action: manipulation; }
  .raid-btn-f { min-width: 88px; }
  /* 浮层更贴边、内容更紧凑 */
  .raid-overlay { padding: 6px; }
  .raid-panel { padding: 10px; }
  .rp-stage-item { padding: 4px 8px; font-size: 12px; gap: 8px; }
  .rp-stage-item img, .rp-stage-item .rit-fb { width: 28px; height: 28px; }
  .rp-msg { font-size: 12px; }
  .rp-head h3 { font-size: 15px; }
  .bag-panel { max-width: 100%; }
}
