/* ============================================================
   styles/achievements.css — 进度（成就）系统
   （原 styles/main.css 拆解而来：2204~2436 行）
   ============================================================ */

#achievement-panel {
  z-index: 82;
}

.achievement-panel {
  width: min(1400px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(180deg, #1c1f38, #141628);
  border: 1px solid rgba(255, 226, 150, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.ach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ach-head h2 {
  margin: 0;
  font-size: 16px;
  color: #ffe296;
  letter-spacing: 0.1em;
}

.ach-head button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #cfc6b8;
  font-size: 14px;
  cursor: pointer;
}

.ach-head button:hover {
  background: rgba(255, 120, 120, 0.2);
  color: #ffb3b3;
}

.ach-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}

.ach-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.ach-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.ach-body::-webkit-scrollbar-corner {
  background: transparent;
}

.ach-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  width: 240px;
}

.ach-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.12s;
  align-items: stretch;
  flex: 0 0 auto;
}

.ach-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* 转置后不再区分主支线宽度，用边框颜色区分 */
.ach-card.main {
  border-left: 3px solid rgba(255, 217, 122, 0.55);
}
.ach-card.sub {
  border-left: 3px solid rgba(140, 200, 255, 0.4);
}

.ach-card.unlocked {
  border-color: rgba(255, 217, 122, 0.45);
  background: rgba(255, 217, 122, 0.06);
}

.ach-card.unlocked:hover {
  background: rgba(255, 217, 122, 0.12);
}

.ach-card.locked { opacity: 0.72; }

.ach-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  align-self: flex-start;
}

.ach-icon canvas {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

.ach-body-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ach-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffe296;
}

.ach-card.locked .ach-name {
  color: #cfc6b8;
}

.ach-fun {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.ach-guide {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.ach-reward {
  font-size: 12px;
  color: #a3d47a;
  margin-top: 2px;
}

.ach-mark {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  align-self: flex-start;
  white-space: nowrap;
}

.ach-card.unlocked .ach-mark {
  background: rgba(255, 217, 122, 0.2);
  border: 1px solid rgba(255, 217, 122, 0.45);
  color: #ffe296;
}

.ach-card.locked .ach-mark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.4);
}

.ach-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.ach-foot b { color: #ffe296; }

/* ---- 进度解锁 toast ---- */
.toast-achievement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(60, 45, 15, 0.95), rgba(40, 30, 10, 0.95));
  border: 2px solid #ffd97a;
  box-shadow:
    0 0 24px rgba(255, 217, 122, 0.35),
    0 6px 20px rgba(0, 0, 0, 0.6);
  color: #ffe296;
  font-size: 14px;
  animation: toast-in 0.25s ease-out, toast-out 0.35s ease-in 2.5s forwards;
}

.ach-toast-emoji { font-size: 20px; }

.ach-toast-text b {
  color: #ffffff;
  font-weight: 700;
}

/* ---- 复用合成详情：z-index 提到最上（让进度页面点卡片时弹窗在上面）----
   注意：这条必须比 craft.css 里的 #craft-detail { z-index: 70 } 后加载，
   否则从进度页面点卡片弹出的合成详情会被面板压住。
   所以 index.html 里 achievements.css 必须排在 craft.css 之后。 */
#craft-detail {
  z-index: 95;
}
