/* 成就树页样式 —— 参考 MC 原版进度界面 */
.ach-page { position: relative; }
.layout { display: block; }
.ach-page { width: 100%; max-width: none; }

.ach-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.ach-stat { text-align: center; min-width: 7.5rem; }
.ach-stat b { display: block; font-size: 1.5rem; color: var(--pink); }
.ach-stat span { font-size: 0.8rem; opacity: 0.75; }
.ach-stat.mid { justify-self: center; }
.ach-head .ach-stat:first-child { justify-self: start; text-align: left; }
.ach-head .ach-stat:last-child { justify-self: end; text-align: right; }

/* MC 标签页：蹲在面板顶上；白边盖住未选中标签的脚，选中的踩在顶层连体 */
.ach-panel::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 0;
  right: 0;
  height: 7px;
  background: linear-gradient(to bottom, #000 0 3px, #ffffff 3px 7px);
  pointer-events: none;
  z-index: 2;
}
.ach-panel {
  position: relative;
  margin-top: 4.4rem;
  padding: 2.6rem 20px 20px;
  background: #c6c6c6;
  border: 4px solid;
  border-color: #ffffff #555555 #555555 #ffffff;
  outline: 3px solid #000;
}
.ach-mc-title {
  position: absolute;
  top: 0.55rem;
  left: 20px;
  z-index: 1;
  color: #3f3f3f;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-shadow: 1px 1px 0 #ffffff;
  pointer-events: none;
}
.ach-tabs {
  position: absolute;
  bottom: 100%;
  left: 0.8rem;
  right: 0.8rem;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.45rem;
}
.ach-arrow {
  flex: none;
  width: 2rem;
  height: 2rem;
  align-self: center;
  margin-bottom: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 3px solid;
  border-color: #ffffff #555555 #555555 #ffffff;
  outline: 2px solid #000;
  background: #c6c6c6;
  color: #3f3f3f;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}
.ach-arrow:active { border-color: #555555 #ffffff #ffffff #555555; }
.ach-d-reward {
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: 2px solid;
  border-color: #ffffff #555555 #555555 #ffffff;
  background: #1d1d1d;
  color: #ffd76e;
  font-size: 0.85rem;
}
.ach-tabslot { flex: 1; align-self: stretch; display: flex; justify-content: flex-end; align-items: center; }
.ach-tabstrip {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.ach-tabstrip::-webkit-scrollbar { display: none; }
.ach-tab {
  width: 3.8rem;
  height: 3.9rem;
  flex: none;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  border: 3px solid #000;
  background: #c6c6c6;
  cursor: pointer;
  font: inherit;
  transition: transform 0.1s ease;
}
.ach-tab::after { content: none; }
.ach-tab .ico {
  width: 2.4rem;
  height: 2.4rem;
  display: block;
  border: 2px solid rgba(0, 0, 0, 0.55);
  background-size: cover;
  image-rendering: pixelated;
}
.ach-tab:hover { transform: translateY(-2px); }
.ach-tab.on:hover { transform: none; }
.ach-tab.on {
  border-bottom: none;
  background: #c6c6c6;
  z-index: 3;
  position: relative;
}
.ach-tab.on::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 5px;
  box-sizing: border-box;
  background: #c6c6c6;
  border-left: 3px solid #000;
  border-right: 3px solid #000;
}

/* 树视口：黑底 + 深灰石纹面板 */
.ach-viewport {
  position: relative;
  overflow: hidden;
  height: 26rem;
  height: clamp(26rem, 58vh, 40rem);
  border: 2px solid #000;
  background: #595959 url(/achv-bg.png) repeat;
  background-size: 112px 112px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.ach-viewport:active { cursor: grabbing; }

.ach-canvas { position: absolute; inset: 0; }

/* 连接线：白色细直角折线（MC 风格），斜线是拖动容错 */
.ach-line {
  position: absolute;
  height: 4px;
  background: rgba(255, 255, 255, 0.85);
  transform-origin: 0 50%;
  image-rendering: pixelated;
}
.ach-line.on { background: #ffffff; }

/* 图标框：金褐底 + 粗深褐边 + 直角 */
.ach-node {
  position: absolute;
  width: 84px;
  padding: 0.42rem 0.3rem 0.4rem;
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  border: 3px solid #2a1b0a;
  border-radius: 0;
  background: #8b6e1e;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.12s ease;
}
.ach-node:hover { transform: translateY(-2px); }
/* 未获得：深灰底细灰边、灰字（原版未完成样式） */
.ach-node.got { background: #8b6e1e; }
.ach-node:not(.got) {
  background: #3f3f3f;
  border-color: #1f1f1f;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08);
}
.ach-node:not(.got) b { color: #9a9a9a; }
.ach-node.sel { outline: 3px solid #fff; outline-offset: 2px; }

.ach-ico {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ach-ico img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.ach-ico.noicon img { display: none; }
.ach-ico.noicon::after { content: "★"; opacity: 0.55; }
.ach-ico.big { width: 54px; height: 54px; }

.ach-node b { font-size: 0.76rem; line-height: 1.25; text-align: center; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,0.7); }

/* 介绍卡：MC 悬浮提示样式（金芥末标题条 + 近黑描述框） */
.ach-detail {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: min(20rem, 78%);
  border: 3px solid #2a1b0a;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 5;
}
.ach-detail.open { opacity: 1; transform: none; pointer-events: auto; }
.ach-d-group { font-size: 0.72rem; letter-spacing: 0.12em; color: #c9c9c9; margin: 0 0 0.35rem; text-shadow: 1px 1px 0 #000; }
.ach-detail .ach-d-titlebar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: #c99c2e;
  border: 3px solid #2a1b0a;
  border-bottom: none;
  padding: 0.55rem 0.75rem;
}
.ach-detail .ach-d-desc {
  margin: 0;
  background: #101010;
  border: 3px solid #2a1b0a;
  border-top: none;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #55ff55;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.9);
}
.ach-d-type { font-size: 0.76rem; color: #fff; opacity: 0.85; margin-top: 0.15rem; }

.ach-empty { padding: 2rem; text-align: center; color: #ddd; }

@media (max-width: 640px) {
  .ach-head { justify-content: center; }
  .ach-detail { left: 0.9rem; width: auto; }
}

/* 组图标 + 绑定包标签（2026-09-29） */
.ach-tab .ach-pack-tag {
  position: absolute; left: 0.15rem; right: 0.15rem; bottom: 0.1rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.58rem; line-height: 1.25; text-align: center; font-weight: normal;
  background: rgba(0, 0, 0, 0.72); color: #e8d9a0; border: 1px solid #55492a;
  pointer-events: none; z-index: 2;
}
.ach-d-group .ach-g-ico {
  width: 1.1em; height: 1.1em; object-fit: cover; image-rendering: pixelated;
  vertical-align: -0.18em; margin-right: 0.25em; border: 1px solid rgba(0, 0, 0, 0.5);
}

/* 右侧缩放拉杆（2026-09-29，杆子显形版） */
.ach-zoombar {
  position: absolute; right: 0.55rem; top: 50%;
  width: 2.2rem; height: 10.5rem; margin-top: -5.25rem;
  z-index: 6;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.ach-zoombar input[type="range"] {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 10rem; height: 2rem;
  margin: 0; padding: 0;
  transform: rotate(-90deg);
  background: transparent;
  cursor: pointer;
}
.ach-zoombar input[type="range"]:focus { outline: none; }
/* 轨道（杆子本体）：深色槽 + 像素描边 */
.ach-zoombar input[type="range"]::-webkit-slider-runnable-track {
  height: 0.45rem;
  background: #3a3a3a;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.18);
}
.ach-zoombar input[type="range"]::-moz-range-track {
  height: 0.45rem;
  background: #3a3a3a;
  border: 2px solid #000;
}
/* 滑钮：MC 石质方块 */
.ach-zoombar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.05rem; height: 1.05rem;
  margin-top: -0.47rem;
  background: #c6c6c6;
  border: 2px solid #000;
  box-shadow: inset -2px -2px 0 #8b8b8b, inset 2px 2px 0 #f0f0f0;
}
.ach-zoombar input[type="range"]::-moz-range-thumb {
  width: 1.05rem; height: 1.05rem;
  background: #c6c6c6;
  border: 2px solid #000;
  border-radius: 0;
}
@media (max-width: 640px) {
  .ach-zoombar { right: 0.25rem; height: 8.5rem; margin-top: -4.25rem; }
  .ach-zoombar input[type="range"] { width: 8rem; }
}
