/* ══════════════════════════════════════════════════════════════
   火柴人快跑 · 成就面板样式
   · 与 .run-shop / .run-rank 同一套弹层规范（点遮罩 / ✕ / Esc 关闭）
   · 颜色复用 PaperMod 主题变量，明暗模式自动适配
   · 无外部字体 / 图片依赖（CSP 同源白名单）
   ══════════════════════════════════════════════════════════════ */

.run-ach {
  /* 档位色（入门/进阶/大师）已于 2026-10-05 随「成就合在一起」一并删除，只留金色高亮 */
  --ach-gold: #e8a70e;
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  background: rgba(8, 14, 24, 0.66);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  animation: run-ach-in 0.16s ease;
}
.run-ach.hidden { display: none; }

@keyframes run-ach-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.run-ach-box {
  width: min(640px, 100%);
  max-height: min(88vh, 900px);
  max-height: min(88dvh, 900px);
  overflow-y: auto;
  padding: 0 20px 18px;
  color: var(--primary, #1f1f1f);
  background: var(--theme, #ffffff);
  border: 1px solid var(--border, #e0e0e0);
  /* 暗色主题下 --border 比面板底还暗，框会糊在背景里 —— 统一换中性半透明描边（同个人中心） */
  border-color: rgba(128, 138, 152, 0.34);
  border-radius: 16px;
  box-shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.9);
  -webkit-overflow-scrolling: touch;
}

/* 头部吸顶：列表很长时 ✕ 始终在（作法同排行榜弹层） */
.run-ach-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  padding: 16px 20px 10px;
  background: var(--theme, #ffffff);
  border-bottom: 1px solid var(--border, #e0e0e0);
}
.run-ach-head strong { font-size: 16px; }
.run-ach-x {
  padding: 4px 10px;
  font-size: 15px;
  color: var(--secondary, #5b6470);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.run-ach-x:hover { background: var(--tertiary, #eef1f6); }

/* ── 总进度条 ── */
.ach-bar-outer {
  height: 10px;
  margin: 14px 0 8px;
  overflow: hidden;
  background: var(--tertiary, #eef1f6);
  border-radius: 999px;
}
.ach-bar-outer i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffcc4d, var(--ach-gold));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.ach-bar-text {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--secondary, #5b6470);
}
.ach-bar-text b { color: var(--primary, #1f1f1f); }

/* ── 面板顶部那行云状态（未接云 / 未登录 / 同步中 / 已同步 / 失败） ── */
.ach-cloud {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: -6px 0 14px;
  padding: 7px 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--secondary, #5b6470);
  background: var(--tertiary, #f3f5f9);
  border-radius: 8px;
}
.ach-cloud.is-ok { color: #1f7a4d; background: rgba(53, 160, 106, 0.12); }
.ach-cloud.is-err { color: #b03030; background: rgba(214, 69, 69, 0.12); }
.ach-cloud.is-busy { color: #8a6200; background: rgba(232, 167, 14, 0.14); }

/* ── 列表（整块平铺，已不分档） ── */
.ach-rows { margin: 0; padding: 0; list-style: none; }

.ach-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 6px;
  background: var(--tertiary, #eef1f6);
  border: 1px solid transparent;
  border-radius: 10px;
}
/* 已解锁：金边 + 亮一点的底 */
.ach-row.is-on {
  background: rgba(232, 167, 14, 0.12);
  border-color: rgba(232, 167, 14, 0.4);
}
.ach-txt { display: flex; flex-direction: column; min-width: 0; }
.ach-txt b { font-size: 13.5px; color: var(--primary, #1f1f1f); }
.ach-txt em {
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.5;
  color: var(--secondary, #6b7280);
}

.ach-got {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ach-gold);
  white-space: nowrap;
}
.ach-todo {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
  margin-left: auto;
  min-width: 96px;
}
.ach-mini {
  display: block;
  width: 96px;
  height: 5px;
  overflow: hidden;
  background: var(--border, #dfe3ea);
  border-radius: 999px;
}
.ach-mini b {
  display: block;
  height: 100%;
  background: var(--secondary, #9aa4b2);
  border-radius: 999px;
}
.ach-nums {
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: var(--secondary, #6b7280);
  white-space: nowrap;
}

.ach-foot {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--secondary, #6b7280);
}

/* ── 工具条里的「个人中心」按钮（商店/成就共用）：不再显示成就数量角标 ── */
/* 刚解锁时闪一下，提示「有新的」 */
.run-tools button.run-shop-btn.is-new { animation: ach-btn-flash 0.5s ease 2; }
@keyframes ach-btn-flash {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.35) saturate(1.3); }
}

@media (max-width: 560px) {
  .run-ach { padding: 10px; }
  .run-ach-box { padding: 0 14px 14px; border-radius: 14px; }
  .run-ach-head { margin: 0 -14px; padding: 13px 14px 9px; }
  .ach-todo { min-width: 70px; }
  .ach-mini { width: 70px; }
}

/* ══════════ 游戏页的轻量 toast（gameach.js 自建，2026-10-06） ══════════
   扫雷 / 井字棋 / 贪吃蛇没有跑酷那套 .run-toast，解锁成就时用这个从顶部飘一条。
   放在 ach.css 里：这三个页面都引了它。 */
.game-toast {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 120;
  max-width: min(88vw, 520px);
  padding: 8px 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #fff;
  background: rgba(20, 26, 40, 0.9);
  border-radius: 999px;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.game-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .game-toast { transition: opacity 0.25s ease; }
  .game-toast.show { transform: translate(-50%, 0); }
}
