:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa0aa;
  --accent: #4f8cff;
  --accent-2: #7ee787;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { font-size: 20px; letter-spacing: 1px; white-space: nowrap; }
.brand-logo { height: 34px; width: auto; display: block; }
.game-tabs { display: flex; gap: 8px; flex: 1; overflow-x: auto; }
.game-tab {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5px;
}
.game-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.game-tab-logo { height: 20px; width: auto; display: block; }
.header-actions { display: flex; gap: 8px; }

main {
  display: grid;
  grid-template-columns: 200px 300px 1fr;
  gap: 20px;
  padding: 20px 28px;
  width: 100%;
  align-items: start;
}
@media (max-width: 980px) { main { grid-template-columns: 1fr; } }

.panel { background: rgba(23, 26, 33, .75); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.panel:last-child { margin-bottom: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; }

.btn {
  border: none; border-radius: 8px; padding: 8px 14px;
  cursor: pointer; font-size: 13px; color: #fff;
}
.btn.primary { background: var(--accent); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 12px; }

.sidebar { min-width: 0; align-self: start; position: sticky; top: 20px; }
.cats .panel { height: fit-content; min-height: 65vh; max-height: calc(100vh - 60px); overflow-y: auto; }
.category-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
@keyframes catUnfold {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
.category-item, .sub-item {
  overflow: hidden;
}
/* 仅切换作品时播放展开动画（由 .replay 类控制） */
.category-list.replay .category-item,
.category-list.replay .sub-item { animation: catUnfold .35s ease both; }
.category-item {
  padding: 18px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.category-item:hover { background: var(--panel-2); }
.category-item.active { background: var(--panel-2); color: var(--text); border-left: 3px solid var(--accent); padding-left: 9px; }
.category-item .count { font-size: 11px; background: var(--bg); border-radius: 10px; padding: 1px 8px; }
.sub-item {
  padding: 6px 12px 6px 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sub-item:hover { background: var(--panel-2); color: var(--text); }
.sub-item.active { background: var(--panel-2); color: var(--accent); }
.sub-item .check { color: var(--accent-2); font-size: 13px; }

.filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
input[type="text"], select, input[type="file"] {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 13px;
}
.filter-row input { flex: 1; min-width: 0; width: 100%; }

.weapon-list { list-style: none; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 200px); overflow-y: auto; }
.weapon-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 12px 8px; border-radius: 12px; cursor: pointer;
  background: rgba(30, 34, 43, .85);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  transition: transform .15s, border-color .15s;
}
.weapon-item:hover { transform: translateY(-2px); border-color: var(--accent); }
.weapon-item.active { background: rgba(79, 140, 255, .15); border-color: var(--accent); }
.weapon-item .info { width: 100%; }
.weapon-item .mini { margin-top: 2px; }
.weapon-item .check { position: absolute; }
.weapon-item { position: relative; }
.weapon-thumb { width: 48px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--panel-2); flex-shrink: 0; }
.weapon-thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--muted); }
.weapon-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.weapon-item .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weapon-item .mini { font-size: 11px; color: var(--muted); }
.weapon-item .check { color: var(--accent-2); font-size: 15px; }

.overall { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* 武器列表展开动画：大框右滑 + 气泡逐个滑入（仅在选择武器类型时由 .enter 触发） */
@keyframes panelSlide {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
#weaponsCol.enter .panel { animation: panelSlide .35s ease both; }
#weaponsCol.enter .weapon-item { animation: bubbleIn .3s ease both; }

.progress-bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width .3s; }

.empty { color: var(--muted); text-align: center; padding: 80px 0; }

.weapon-header { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.weapon-img { width: 180px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); }
.weapon-meta { flex: 1; min-width: 200px; }
.weapon-tags { display: flex; gap: 8px; margin: 6px 0; }
.tag { font-size: 11px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 2px 10px; color: var(--muted); }
.progress-text { font-size: 12px; color: var(--muted); }
.weapon-actions { display: flex; flex-direction: column; gap: 8px; }

.camo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.camo-card {
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.camo-card.done { border-color: var(--accent-2); background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.camo-top { display: flex; align-items: flex-start; gap: 8px; }
.camo-check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border);
  background: transparent; cursor: pointer; flex-shrink: 0; color: #fff; font-size: 13px; line-height: 1;
}
.camo-card.done .camo-check { background: var(--accent-2); border-color: var(--accent-2); color: #0f1115; }
.camo-name { font-size: 15px; font-weight: 600; flex: 1; }
.camo-task { font-size: 13px; color: var(--muted); line-height: 1.5; }
.camo-foot { display: flex; gap: 8px; margin-top: auto; }
.camo-foot .btn { padding: 4px 10px; font-size: 12px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; width: min(420px, 92vw); display: flex; flex-direction: column; gap: 12px;
}
.modal-box h3 { font-size: 17px; }
.modal-box label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.modal-box input[type="text"], .modal-box select { width: 100%; color: var(--text); }
.hint { font-size: 11px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 60;
}
