/* =========================================================
 * 1000亿分之一 · 本地增强样式（F1 卡包栏 / F2 连开多包 / P2 存档与图鉴）
 * ========================================================= */

/* --- F1: 底部卡包栏桌面端滚轮、拖拽、左右箭头与全部卡包入口 --- */
.tray-wrap {
  gap: 6px;
  align-items: center;
}
.mod-tray-nav {
  flex: none;
  width: 28px;
  height: 44px;
  border: 1px solid #d4c8b2;
  border-radius: 12px;
  background: linear-gradient(180deg, #faf6ee, #ece4d5);
  color: #3f3448;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(34, 27, 37, 0.1);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  user-select: none;
}
.mod-tray-nav:hover:not(:disabled) {
  background: #fffdf8;
  transform: translateY(-1px);
}
.mod-tray-nav:active:not(:disabled) {
  transform: scale(0.94);
}
.mod-tray-nav:disabled {
  opacity: 0.32;
  cursor: default;
}
.mod-tray-nav[hidden] {
  display: none !important;
}

.tray {
  cursor: grab;
  user-select: none;
  contain: layout style;
}
.tray.mod-dragging {
  cursor: grabbing;
}
.tray.mod-dragging * {
  pointer-events: none;
}
/* 帧率优化：滚出视口的卡包跳过重绘与动画，避免 20+ 卡包同时跑 drop-shadow 滤镜掉帧 */
.tray-pack {
  content-visibility: auto;
  contain-intrinsic-size: 52px 70px;
  contain: layout style;
}
.tray-art {
  filter: none !important;
}
.tray-pack.mod-offscreen .mini-sway {
  animation-play-state: paused !important;
}

.mod-all-packs-btn {
  flex: none;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #d4c8b2;
  border-radius: 12px;
  background: linear-gradient(180deg, #faf6ee, #ece4d5);
  color: #3f3448;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 0 2px 6px rgba(34, 27, 37, 0.1);
  transition: transform 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.mod-all-packs-btn:hover {
  background: #fffdf8;
  transform: translateY(-1px);
}
.mod-all-packs-btn small {
  font-size: 9.5px;
  opacity: 0.72;
  font-weight: 600;
}
.mod-all-packs-btn[hidden] {
  display: none !important;
}

/* 全部卡包选择网格 */
.mod-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.mod-pack-item {
  border: 1px solid #dfd4c0;
  border-radius: 12px;
  background: #fbf7ef;
  padding: 10px 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #221b25;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.mod-pack-item:hover {
  border-color: #b48a46;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 27, 37, 0.08);
}
.mod-pack-item.active {
  border-color: #96672c;
  background: linear-gradient(180deg, #fff9ec, #f4e7cb);
  box-shadow: 0 0 0 1px #96672c44;
}
.mod-pack-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.mod-pack-item-name {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}
.mod-pack-item-meta {
  font-size: 11px;
  color: #7d7282;
}
.mod-pack-item-count {
  font-size: 11px;
  font-weight: 750;
  padding: 1px 6px;
  border-radius: 99px;
  background: #2b233d;
  color: #fff;
}

/* --- 左上角跳过动画按钮（固定左上角安全距，避免被折叠的 topbar 裁切） --- */
.mod-skip-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  height: 34px;
  padding: 0 13px;
  border: 1px solid #c9a76a;
  border-radius: 99px;
  background: linear-gradient(180deg, #fffaf0, #f0e3c7);
  color: #3a2614;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(24, 16, 36, 0.22);
  transition: transform 0.14s ease, background 0.14s ease;
  z-index: 55;
}
.mod-skip-btn:hover {
  background: #fffdf8;
  transform: translateY(-1px);
}
.mod-skip-btn:active {
  transform: scale(0.95);
}
.mod-skip-btn[hidden] {
  display: none !important;
}
.mod-summary-filter {
  margin-left: auto;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid #d4c4a8;
  background: #fffdf8;
  color: #362a3d;
  cursor: pointer;
  font-weight: 700;
}
.mod-summary-filter[aria-pressed="true"] {
  background: #3b2d59;
  color: #f6e6bd;
  border-color: #5a4685;
}

/* --- F2: 连开多包按钮与结果总览 --- */
.mod-multi-open-btn {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 6;
  border: 1px solid #c9a76a;
  border-radius: 99px;
  padding: 6px 13px;
  background: linear-gradient(180deg, #fffaf0, #efe1c2);
  color: #3a2614;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 27, 37, 0.18), inset 0 1px 0 #ffffffcc;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.mod-multi-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(34, 27, 37, 0.24), inset 0 1px 0 #fff;
}
.mod-multi-open-btn:active {
  transform: scale(0.95);
}
.mod-multi-open-btn[hidden] {
  display: none !important;
}
.mod-multi-open-btn .mod-badge-num {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 99px;
  background: #3a2614;
  color: #f8e9c8;
}

.mod-batch-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mod-batch-info {
  margin: 0;
  font-size: 13px;
  color: #5c5064;
}
.mod-batch-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mod-btn {
  border: 1px solid #d4c4a8;
  border-radius: 10px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #fffdf8, #f2e8d4);
  color: #2b2131;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.mod-btn:hover:not(:disabled) {
  border-color: #96672c;
  background: #fff;
  transform: translateY(-1px);
}
.mod-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mod-btn.primary {
  width: auto;
  height: auto;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.04em;
  text-indent: 0;
  font-size: 13px;
  box-shadow: none;
  overflow: visible;
  background: linear-gradient(135deg, #3b2d59, #221938);
  color: #f6e6bd;
  border-color: #5a4685;
}
.mod-btn.primary::before,
.mod-btn.primary::after {
  display: none;
  content: none;
}
.mod-btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b3a70, #2b2046);
  border-color: #dcbd84;
}
.mod-btn.primary:active {
  transform: scale(0.97);
  box-shadow: none;
}
.mod-btn.danger {
  border-color: #d89b9b;
  background: #fff5f5;
  color: #9c2b2b;
}
.mod-btn.danger:hover:not(:disabled) {
  border-color: #c43c3c;
  background: #ffe9e9;
}

.mod-batch-custom {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.mod-batch-custom .mod-input {
  flex: 1 1 120px;
  min-width: 96px;
}
.mod-batch-custom .mod-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.mod-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #d4c8b2;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fffdf9;
  color: #221b25;
  font-size: 14px;
  font-family: inherit;
  user-select: text;
  -webkit-user-select: text;
}
@media (pointer: coarse) {
  .mod-input {
    font-size: 16px;
  }
}
.mod-input:focus {
  outline: 2px solid #96672c55;
  border-color: #96672c;
}

/* 连开结果总览 */
.mod-summary-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.mod-summary-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: #efe7d8;
  color: #362a3d;
}
.mod-summary-pill.lvup {
  background: linear-gradient(135deg, #f3d27a, #d89b2c);
  color: #2c1a05;
}
.mod-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 8px;
  max-height: 56vh;
  overflow-y: auto;
  padding: 2px;
}
.mod-result-card {
  position: relative;
  border: 1px solid #dfd4c0;
  border-radius: 12px;
  background: #fbf7ef;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.mod-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(34, 27, 37, 0.12);
}
.mod-result-card.UR { border-color: #a855f7; background: linear-gradient(180deg, #fdf7ff, #f3e6ff); }
.mod-result-card.SSR { border-color: #e69d24; background: linear-gradient(180deg, #fffbf0, #faecc8); }
.mod-result-card.SR { border-color: #8b5cf6; background: linear-gradient(180deg, #f8f5ff, #ede6ff); }
.mod-result-card.R { border-color: #3b82f6; background: linear-gradient(180deg, #f4f9ff, #e5f0ff); }
.mod-result-thumb {
  width: 100%;
  aspect-ratio: 336 / 176;
  border-radius: 8px;
  overflow: hidden;
  background: #e6dfd2;
}
.mod-result-thumb canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.mod-result-name {
  font-size: 12.5px;
  font-weight: 750;
  color: #221b25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-result-sub {
  font-size: 10.5px;
  color: #7d7282;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 2px;
}
.mod-new-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 6px;
  background: #e11d48;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.mod-result-card.mod-result-card-focus {
  border-color: #c79538;
  box-shadow: 0 0 0 2.5px #d9a94e, 0 8px 20px rgba(167, 119, 47, 0.34);
  animation: mod-card-focus-pulse 1.35s ease-out 1;
}
@keyframes mod-card-focus-pulse {
  0% { transform: scale(1.03); box-shadow: 0 0 0 4px #f3cf68, 0 10px 24px rgba(167, 119, 47, 0.45); }
  100% { transform: scale(1); box-shadow: 0 0 0 2px #d9a94e88, 0 4px 12px rgba(167, 119, 47, 0.18); }
}

/* --- 档位 A: 结果总览单卡详情切换条 --- */
.mod-batch-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.mod-batch-nav[hidden] {
  display: none !important;
}
.mod-batch-nav-btn {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 8px 14px;
  border-radius: 99px;
}
.mod-batch-nav-pos {
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: #5a4d63;
}

/* --- P2-10: 本地存档管理面板 --- */
.mod-save-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mod-save-panel code {
  overflow-wrap: anywhere;
}
.mod-method-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5eee1;
  border: 1px solid #dfd4c0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #3e3246;
}
.mod-method-title {
  font-weight: 800;
  font-size: 13px;
  color: #2f1f0c;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mod-method-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8d8b8;
  color: #5b3b0e;
}
.mod-step-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mod-step-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.mod-step-num {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: #3a2614;
  color: #fffdf8;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mod-tip-note {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(158, 121, 57, 0.12);
  font-size: 11.5px;
  line-height: 1.5;
  color: #5c4524;
}
.mod-fold {
  border: 1px dashed #d5c5ab;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbf6ec;
  font-size: 12px;
  color: #4e4058;
}
.mod-fold summary {
  cursor: pointer;
  font-weight: 700;
  color: #6b4e1e;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mod-fold summary::-webkit-details-marker {
  display: none;
}
.mod-fold summary::after {
  content: '▸';
  font-size: 11px;
  transition: transform 0.16s ease;
}
.mod-fold[open] summary::after {
  transform: rotate(90deg);
}
.mod-fold-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mod-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}
.mod-inapp-tip {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(calc(100vw - 20px), 460px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: #fff4df;
  border: 1px solid rgba(180, 120, 24, 0.45);
  box-shadow: 0 8px 24px rgba(34, 27, 37, 0.2);
  color: #4a2e08;
  font-size: 12.5px;
  line-height: 1.45;
  box-sizing: border-box;
}
.mod-inapp-tip-text {
  flex: 1;
  min-width: 0;
}
.mod-inapp-tip-close {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(74, 46, 8, 0.1);
  color: #4a2e08;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mod-inapp-tip-link {
  border: 0;
  padding: 0 2px;
  background: none;
  color: #8a4b08;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.mod-save-status {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5eee1;
  border: 1px solid #dfd4c0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #3e3246;
}
.mod-save-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mod-save-paste {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed #d8ccb8;
}
.mod-save-paste textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
}
.mod-save-msg {
  margin: 0;
  font-size: 12px;
  min-height: 1.3em;
  color: #6b4e1e;
}
.mod-save-msg.err {
  color: #b42318;
}

/* --- P2-11 + 官方同款胶囊风：图鉴搜索与 11 项多维排序栏 --- */
.mod-binder-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 12px;
  width: 100%;
  max-width: 560px;
}
.mod-binder-search-wrap {
  position: relative;
  flex: 1 1 175px;
  min-width: 0;
  display: flex;
  align-items: center;
  color: var(--ink);
}
.mod-binder-search-ico {
  position: absolute;
  inset-inline-start: 11px;
  width: 14px;
  height: 14px;
  pointer-events: none;
  color: var(--dim);
}
.mod-binder-search-wrap .mod-binder-search-input {
  min-height: 36px;
  width: 100%;
  padding: 0 28px 0 32px;
  border: 1px solid #221b2514;
  border-radius: 18px;
  box-shadow: 0 2px 6px #00000014;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.mod-binder-search-wrap .mod-binder-search-input::placeholder {
  color: var(--dim);
  font-weight: 500;
}
.mod-binder-search-wrap .mod-binder-search-input:focus,
.mod-binder-search-wrap .mod-binder-search-input:not(:placeholder-shown) {
  border-color: #9e79395c;
  background: #fff9ec;
}
.mod-binder-search-wrap .mod-binder-search-input:focus-visible {
  outline: 2px solid #8a6333;
  outline-offset: 2px;
}
.mod-binder-clear {
  position: absolute;
  inset-inline-end: 8px;
  border: 0;
  background: none;
  color: #7d7282;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
}
.mod-binder-clear[hidden] {
  display: none !important;
}
.mod-binder-sort-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
}
.mod-binder-sort {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  max-width: 100%;
  padding: 0 28px 0 30px;
  border: 1px solid #221b2514;
  border-radius: 18px;
  box-shadow: 0 2px 6px #00000014;
  background: #fff;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-overflow: ellipsis;
}
.mod-binder-sort-ico {
  position: absolute;
  inset-inline-start: 10px;
  width: 14px;
  height: 14px;
  pointer-events: none;
  color: var(--dim);
}
.mod-binder-sort-chevron {
  position: absolute;
  inset-inline-end: 10px;
  width: 11px;
  height: 11px;
  pointer-events: none;
  color: var(--dim);
}
.mod-binder-sort-wrap.sorted .mod-binder-sort,
.mod-binder-sort-wrap:has(select[data-sorted]) .mod-binder-sort {
  border-color: #9e79395c;
  background: #fff9ec;
}
.mod-binder-sort-wrap.sorted svg,
.mod-binder-sort-wrap:has(select[data-sorted]) svg {
  color: #80591e;
}
.mod-binder-sort-wrap .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mod-binder-sort:focus-visible {
  outline: 2px solid #8a6333;
  outline-offset: 2px;
}
@supports (appearance: base-select) {
  .mod-binder-sort,
  .mod-binder-sort::picker(select) {
    appearance: base-select;
  }
  .mod-binder-sort-chevron {
    display: none;
  }
  .mod-binder-sort {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 12px 0 30px;
    min-width: 126px;
    transition: border-color 0.16s ease, background-color 0.16s ease;
  }
  .mod-binder-sort::picker-icon {
    color: var(--dim);
    font-size: 11px;
    margin-inline-start: 2px;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mod-binder-sort:open::picker-icon {
    transform: rotate(180deg);
  }
  .mod-binder-sort-wrap.sorted .mod-binder-sort::picker-icon,
  .mod-binder-sort-wrap:has(select[data-sorted]) .mod-binder-sort::picker-icon {
    color: #80591e;
  }
  .mod-binder-sort::picker(select) {
    background: #fffdf8;
    color: #221b25;
    border: 1px solid rgba(158, 121, 57, 0.34);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(34, 27, 37, 0.16), 0 2px 8px rgba(34, 27, 37, 0.08);
    padding: 6px;
    margin-top: 6px;
    min-width: max(anchor-size(width), 178px);
    max-height: min(62dvh, 420px);
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transition:
      display 0.18s cubic-bezier(0.16, 1, 0.3, 1),
      overlay 0.18s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    transition-behavior: allow-discrete;
  }
  .mod-binder-sort:open::picker(select) {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  @starting-style {
    .mod-binder-sort:open::picker(select) {
      opacity: 0;
      transform: translateY(-4px) scale(0.98);
    }
  }
  .mod-binder-sort optgroup {
    margin: 2px 0;
    padding: 2px 0;
  }
  .mod-binder-sort optgroup + optgroup {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(158, 121, 57, 0.18);
  }
  .mod-binder-sort optgroup legend,
  .mod-binder-sort optgroup::before {
    font-size: 11px;
    font-weight: 700;
    color: #8c6a32;
    padding: 2px 10px 4px;
  }
  .mod-binder-sort option {
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #221b25;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
  }
  .mod-binder-sort option:hover,
  .mod-binder-sort option:focus-visible {
    background: #f8eed9;
    color: #5b3b0e;
  }
  .mod-binder-sort option:checked {
    background: #f3e2bb;
    color: #5b3b0e;
    font-weight: 700;
  }
  .mod-binder-sort option::checkmark {
    color: #8a5e1a;
    font-weight: 700;
  }
  @media (prefers-reduced-motion: reduce) {
    .mod-binder-sort::picker(select),
    .mod-binder-sort::picker-icon {
      transition: none !important;
    }
  }
}
.mod-binder-hit-tip {
  width: 100%;
  margin: 0;
  font-size: 11.5px;
  color: #7d7282;
}
.mod-binder-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  align-items: center;
}
.mod-binder-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #221b2514;
  border-radius: 16px;
  box-shadow: 0 2px 6px #00000014;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.mod-binder-pill[aria-pressed='true'] {
  border-color: #9e793966;
  background: #fff4d8;
  color: #6b450f;
}
.mod-binder-stats {
  width: 100%;
  max-width: 560px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fffaf0;
  border: 1px solid rgba(158, 121, 57, 0.28);
  box-shadow: 0 4px 14px rgba(34, 27, 37, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}
.mod-binder-stats[hidden] {
  display: none !important;
}
.mod-stats-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mod-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: #3a2614;
}
.mod-stats-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(158, 121, 57, 0.16);
  overflow: hidden;
}
.mod-stats-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c9973e, #e5be67);
  transition: width 0.25s ease;
}
.mod-stats-rarities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mod-stats-champs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 6px;
}
.mod-stat-champ-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(158, 121, 57, 0.24);
  background: #fffdf8;
  color: #221b25;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.mod-stat-champ-btn:hover {
  background: #f8eed9;
  border-color: rgba(158, 121, 57, 0.45);
}
.mod-stat-champ-label {
  font-size: 11px;
  font-weight: 700;
  color: #8c6a32;
}
.mod-stat-champ-val {
  font-size: 12.5px;
  font-weight: 700;
  color: #221b25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mod-has-domain-tip #frame > main {
  padding-top: 64px;
}
body.mod-has-notice-bar #frame > main {
  padding-top: 68px;
}
body.mod-has-domain-tip.mod-has-notice-bar #frame > main {
  padding-top: 126px;
}
body.mod-has-update-bar #frame > main {
  padding-top: 62px;
}
body.mod-has-notice-bar.mod-has-update-bar #frame > main,
body.mod-has-domain-tip.mod-has-update-bar #frame > main {
  padding-top: 120px;
}
.mod-notice-bar {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(calc(100vw - 16px), 520px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6d1e15, #942e1b);
  border: 1px solid rgba(240, 200, 118, 0.55);
  box-shadow: 0 10px 26px rgba(68, 18, 12, 0.28);
  color: #fff9ed;
  font-size: 12.5px;
  line-height: 1.38;
  box-sizing: border-box;
}
.mod-notice-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: #ffd166;
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.28);
  animation: mod-sync-pulse 1.2s ease-in-out infinite;
}
.mod-notice-bar-text {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  cursor: pointer;
}
.mod-notice-bar-btn {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 5px 11px;
  background: #ffd166;
  color: #3d180a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}
.mod-notice-bar-close {
  flex: none;
  background: none;
  border: 0;
  padding: 2px 6px;
  color: #fff9ed;
  opacity: 0.88;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.mod-notice-bar.calm {
  background: linear-gradient(135deg, #2d2134, #46324d);
  border-color: rgba(232, 198, 126, 0.52);
  box-shadow: 0 10px 24px rgba(34, 24, 42, 0.24);
}
.mod-notice-tldr {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6d1e15, #892919);
  border: 1px solid rgba(240, 200, 118, 0.6);
  color: #fff9ed;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 6px 16px rgba(68, 18, 12, 0.18);
}
.mod-update-bar {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: min(calc(100vw - 20px), 460px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #163b36, #1f534c);
  border: 1px solid rgba(232, 198, 126, 0.56);
  box-shadow: 0 10px 26px rgba(13, 38, 34, 0.28);
  color: #f4fbf8;
  font-size: 12.5px;
  line-height: 1.35;
  box-sizing: border-box;
}
.mod-update-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: #6ee7b7;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.25);
  animation: mod-sync-pulse 1.4s ease-in-out infinite;
}
.mod-update-bar-text {
  flex: 1;
  min-width: 0;
  font-weight: 650;
}
.mod-update-bar-btn {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  background: #e8c67e;
  color: #241908;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.mod-update-bar-btn:disabled {
  opacity: 0.72;
  cursor: default;
}
.mod-update-bar-close {
  flex: none;
  background: none;
  border: 0;
  padding: 2px 6px;
  color: #f4fbf8;
  opacity: 0.85;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 420px) {
  .mod-notice-bar {
    padding: 8px 8px 8px 10px;
    gap: 6px;
    font-size: 12px;
  }
  .mod-notice-bar-btn {
    padding: 4px 9px;
    font-size: 11.5px;
  }
  .mod-update-bar {
    padding: 7px 8px 7px 11px;
    gap: 6px;
    font-size: 11.5px;
  }
  .mod-update-bar-btn {
    padding: 4px 9px;
    font-size: 11.5px;
  }
}
.mod-domain-tip {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  width: min(calc(100vw - 20px), 460px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 14px;
  background: #fff9ec;
  border: 1px solid rgba(158, 121, 57, 0.42);
  box-shadow: 0 8px 22px rgba(34, 27, 37, 0.16);
  color: #3a2614;
  font-size: 12.5px;
  line-height: 1.4;
  box-sizing: border-box;
}
.mod-domain-tip-text {
  flex: 1;
  min-width: 0;
}
.mod-domain-tip-go {
  flex: none;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: #3a2614;
  color: #fffdf8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mod-disk-drop {
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.mod-disk-drop.dragover {
  border-color: #9e7939;
  background: #fff6df;
}
.mod-disk-candidates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

/* --- 云同步状态点 & 历史快照列表 & 市场一键领取 --- */
.mod-sync-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.22);
}
.mod-sync-dot.syncing {
  background: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25);
  animation: mod-sync-pulse 1s ease-in-out infinite;
}
.mod-sync-dot.offline,
.mod-sync-dot.conflict {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.24);
}
@keyframes mod-sync-pulse {
  50% { opacity: 0.4; transform: scale(0.85); }
}

.mod-snap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.mod-snap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fffdf8;
  border: 1px solid #dfd4c0;
}
.mod-snap-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  color: #2b2131;
}
.mod-snap-time {
  font-size: 11px;
  color: #7d7282;
  font-variant-numeric: tabular-nums;
}
.mod-snap-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  background: #f1e6d2;
  color: #6b4e1e;
}

.mod-market-claim-all {
  height: 30px;
  padding: 0 13px;
  border: 1px solid #c9a76a;
  border-radius: 99px;
  background: linear-gradient(180deg, #fff6dc, #ecc878);
  color: #3a2206;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 3px 10px rgba(106, 74, 26, 0.2), inset 0 1px 0 #ffffffaa;
  transition: transform 0.14s ease, opacity 0.14s ease;
}
.mod-market-claim-all:active {
  transform: scale(0.95);
}
.mod-market-claim-all[hidden] {
  display: none !important;
}

/* --- 手机窄屏长用户名防挤压 & 升级宝箱秒开按钮 --- */
#modCloudAuthBtn {
  max-width: 132px;
  min-width: 0;
}
#modCloudAuthBtn .mod-cloud-name {
  display: inline-block;
  max-width: 102px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 420px) {
  #modCloudAuthBtn {
    max-width: 96px;
    padding: 0 8px 0 7px;
  }
  #modCloudAuthBtn .mod-cloud-name {
    max-width: 68px;
  }
}
@media (max-width: 360px) {
  #modCloudAuthBtn {
    max-width: 78px;
  }
  #modCloudAuthBtn .mod-cloud-name {
    max-width: 52px;
  }
}

.mod-chest-instant-btn {
  flex: none;
  height: 22px;
  padding: 0 8px;
  margin-left: 2px;
  border: 1px solid #c9a76a;
  border-radius: 99px;
  background: linear-gradient(180deg, #fff6dc, #ecc878);
  color: #3a2206;
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(106, 74, 26, 0.18);
}
.mod-chest-instant-btn:active {
  transform: scale(0.94);
}
.mod-chest-instant-btn[hidden] {
  display: none !important;
}

/* --- 底部右侧站点声明按钮与声明条款弹窗 --- */
.mod-foot-right {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mod-notice-btn {
  position: relative;
  color: #8a5a1c !important;
  box-shadow: inset 0 0 0 1px rgba(138, 90, 28, 0.32) !important;
  background: rgba(246, 230, 189, 0.28) !important;
}
.mod-notice-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 2px #fffdf8;
  animation: mod-sync-pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
@media (max-width: 360px) {
  .mod-foot-right {
    gap: 3px;
  }
}

.mod-terms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 54vh;
  overflow-y: auto;
  padding-right: 2px;
}
.mod-notice-tldr + .mod-terms-list {
  max-height: min(32vh, 240px);
}
.mod-terms-item {
  padding: 9px 11px;
  border-radius: 10px;
  background: #fffdf8;
  border: 1px solid #dfd4c0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #362a3d;
}
.mod-terms-item > strong:first-child {
  display: block;
  margin-bottom: 2px;
  color: #221b25;
  font-size: 13px;
}
.mod-terms-foot {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #6c6074;
  text-align: center;
}
.mod-terms-link {
  background: none;
  border: 0;
  padding: 0 2px;
  font: inherit;
  font-weight: 700;
  color: #7d5218;
  text-decoration: underline;
  cursor: pointer;
}
