/* 卡组构建 · 样式（只组合 styles.css 既有令牌：颜色/背景/间距/字号/圆角一律取变量） */

.bd-page { max-width: 1500px; }

.bd-head { margin-bottom: 14px; }
.bd-title { font-size: var(--fs-7); font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.bd-sub { font-size: var(--fs-3); color: var(--muted); margin-top: 4px; line-height: 1.6; }

/* ---------- 卡组管理条 ---------- */
.bd-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 12px 16px; margin-bottom: 16px;
}
.bd-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bd-field > span { font-size: var(--fs-1); color: var(--muted); letter-spacing: 0.12em; }
.bd-field select, .bd-field input {
  padding: 8px 10px; min-height: 40px; min-width: 180px;
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--line2); border-radius: var(--r-m);
  font-size: var(--fs-4); font-family: var(--sans);
}
.bd-field-name input { min-width: 220px; }
.bd-field select:focus, .bd-field input:focus { border-color: var(--gold); outline: none; }
.bd-bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-saved { font-size: var(--fs-2); color: var(--muted); margin-left: auto; padding-bottom: 10px; }

.bd-btn {
  padding: 8px 14px; min-height: 40px;
  border-radius: var(--r-m); border: 1px solid var(--line2);
  background: transparent; color: var(--gold);
  font-size: var(--fs-3); font-family: var(--sans); cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.bd-btn:hover { color: var(--text); background: var(--bg3); border-color: var(--gold-dim); }
.bd-btn:active { transform: scale(0.98); }
.bd-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); font-weight: 600; }
.bd-btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--ink); }
.bd-btn.danger:hover { color: var(--accent-hi); border-color: var(--accent); }
.bd-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 两栏 ---------- */
.bd-cols {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.95fr);
  gap: 16px; align-items: start;
}
.bd-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bd-col-deck { position: sticky; top: 74px; max-height: calc(100dvh - 94px); overflow-y: auto; padding-right: 2px; }
.bd-panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; }
.bd-panelhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.bd-panelhead h2 { font-size: var(--fs-4); font-weight: 600; color: var(--gold); letter-spacing: 0.05em; }
.bd-muted { font-size: var(--fs-2); color: var(--muted); white-space: nowrap; }
.bd-muted b { color: var(--gold); font-weight: 700; }
.bd-subhead { font-size: var(--fs-3); color: var(--gold); letter-spacing: 0.08em; margin: 14px 0 6px; font-weight: 600; }
.bd-note { font-size: var(--fs-2); color: var(--muted); line-height: 1.7; margin-top: 8px; }
.bd-note b { color: var(--gold-dim); font-weight: 600; }

/* ---------- 卡池工具栏 ---------- */
.bd-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.bd-search { flex: 1; min-width: 200px; }
.bd-search input {
  width: 100%; padding: 10px 14px 10px 38px; min-height: 44px;
  background: var(--bg3); border: 1px solid var(--line2); border-radius: var(--r-m);
  color: var(--text); font-size: var(--fs-4); font-family: var(--sans);
  transition: border-color 0.15s;
}
.bd-search input:focus { border-color: var(--gold); outline: none; }
.bd-search input::placeholder { color: var(--muted); }

.bd-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bd-chip {
  padding: 6px 12px; min-height: 32px;
  border-radius: var(--r-pill); border: 1px solid var(--line2);
  background: transparent; color: var(--muted);
  font-size: var(--fs-3); font-family: var(--sans); cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.bd-chip:hover { color: var(--text); border-color: var(--gold-dim); }
.bd-chip.on { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); font-weight: 600; }

.bd-selects { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.bd-selects .bd-field { gap: 2px; }
.bd-selects .bd-field select { min-width: 0; }
.bd-selects select {
  padding: 6px 8px; min-height: 32px;
  border-radius: var(--r-s); background: var(--bg3); color: var(--text);
  border: 1px solid var(--line2); font-size: var(--fs-3); font-family: var(--sans);
}
.bd-selects select:focus { border-color: var(--gold); outline: none; }
.bd-target { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.bd-target > span { font-size: var(--fs-2); color: var(--muted); white-space: nowrap; }

/* ---------- 卡池网格 ---------- */
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.bd-tile {
  position: relative; background: var(--bg3);
  border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s;
}
.bd-tile:hover { transform: translateY(-2px); border-color: var(--gold-dim); }
.bd-tile.selected { border-color: var(--gold); }
.bd-tile .imgbtn {
  display: block; width: 100%; padding: 0; border: 0; background: var(--bg);
  cursor: pointer; position: relative; color: inherit; font-family: var(--sans);
}
.bd-tile .imgbtn img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; display: block; }
.bd-tile .imgbtn .noimg {
  aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: var(--fs-1); letter-spacing: 0.2em; writing-mode: vertical-rl;
}
.bd-tile .cost {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  min-width: 22px; height: 22px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--scrim); border: 1px solid var(--gold-dim); border-radius: 50%;
  color: var(--gold); font-weight: 700; font-size: var(--fs-2);
}
.bd-tile .forbid {
  position: absolute; bottom: 6px; right: 6px; z-index: 2;
  padding: 1px 6px; border-radius: var(--r-s);
  background: var(--accent); color: var(--ink-on-accent); font-weight: 700; font-size: var(--fs-1);
}
.bd-tile .info {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 1px solid var(--gold-dim);
  background: var(--scrim); color: var(--gold);
  font-size: var(--fs-1); line-height: 1; cursor: pointer; font-family: var(--sans);
}
.bd-tile .info:hover { color: var(--text); border-color: var(--gold); }
.bd-tile .name {
  padding: 4px 6px 2px; font-size: var(--fs-1); line-height: 1.35; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bd-tile .ops { display: flex; align-items: center; gap: 4px; padding: 3px 5px 5px; }
.bd-tile .ops button {
  flex: 1; min-height: 26px; padding: 0;
  border-radius: var(--r-s); border: 1px solid var(--line2);
  background: var(--bg2); color: var(--text);
  font-size: var(--fs-3); line-height: 1; cursor: pointer; font-family: var(--sans);
}
.bd-tile .ops button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.bd-tile .ops button.minus:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-hi); }
.bd-tile .ops button:disabled { opacity: 0.35; cursor: not-allowed; }
.bd-tile .ops .n {
  flex: none; width: 30px; text-align: center;
  font-size: var(--fs-2); font-weight: 700; color: var(--gold);
}
.bd-tile .ops .pick { flex: 1 1 100%; }

.bd-state { padding: 26px 14px; text-align: center; background: var(--bg2); border: 1px dashed var(--line2); border-radius: var(--r-m); }
.bd-state h4 { font-size: var(--fs-5); color: var(--text); margin-bottom: 6px; }
.bd-state p { font-size: var(--fs-3); color: var(--muted); }

/* ---------- 卡组列表 ---------- */
.bd-list { display: flex; flex-direction: column; gap: 4px; }
.bd-list .bd-empty { font-size: var(--fs-2); color: var(--muted); padding: 4px 2px; }
.bd-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: var(--r-m); background: var(--bg3); font-size: var(--fs-3);
}
.bd-row img { width: 26px; height: 34px; object-fit: cover; object-position: top; border-radius: var(--r-s); background: var(--bg); flex: none; }
.bd-row .nm {
  flex: 1; min-width: 0; text-align: left;
  background: none; border: 0; padding: 0; color: var(--text);
  font-size: var(--fs-3); font-family: var(--sans); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bd-row .nm:hover { color: var(--gold); }
.bd-row .sub { font-size: var(--fs-1); color: var(--muted); }
.bd-row .n { flex: none; font-weight: 700; color: var(--gold); font-size: var(--fs-3); }
.bd-row .warn { flex: none; font-size: var(--fs-1); color: var(--accent-hi); font-weight: 700; }
.bd-row .b {
  flex: none; width: 24px; height: 24px; padding: 0; line-height: 1;
  border-radius: var(--r-s); border: 1px solid var(--line2);
  background: transparent; color: var(--muted); cursor: pointer; font-size: var(--fs-3); font-family: var(--sans);
}
.bd-row .b:hover:not(:disabled) { color: var(--gold); border-color: var(--gold-dim); }
.bd-row .b.minus:hover:not(:disabled) { color: var(--accent-hi); border-color: var(--accent); }
.bd-row .b:disabled { opacity: 0.35; cursor: not-allowed; }

.bd-cmd { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-m); background: var(--bg3); }
.bd-cmd img { width: 52px; height: 69px; object-fit: cover; object-position: top; border-radius: var(--r-s); background: var(--bg); flex: none; }
.bd-cmd .meta { flex: 1; min-width: 0; }
.bd-cmd .nm { font-size: var(--fs-4); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-cmd .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; font-size: var(--fs-2); color: var(--muted); }
.bd-cmd .b {
  flex: none; padding: 5px 10px; min-height: 30px;
  border-radius: var(--r-s); border: 1px solid var(--line2);
  background: transparent; color: var(--muted); font-size: var(--fs-2); font-family: var(--sans); cursor: pointer;
}
.bd-cmd .b:hover { color: var(--accent-hi); border-color: var(--accent); }

/* ---------- 校验 ---------- */
.bd-checks { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.bd-checks li { display: flex; gap: 8px; align-items: baseline; font-size: var(--fs-3); color: var(--muted); }
.bd-checks li .ic { flex: none; }
.bd-checks li .t { flex: 1; min-width: 0; }
.bd-checks li .v { flex: none; color: var(--gold-dim); font-size: var(--fs-2); }
.bd-checks li.ok .v { color: var(--wind); }
.bd-checks li.bad { color: var(--accent-hi); }
.bd-checks li.bad .v { color: var(--accent-hi); }
.bd-checks li.warn { color: var(--gold); }
.bd-checks li.warn .v { color: var(--gold); }

.bd-verdict {
  margin-top: 12px; padding: 9px 12px; border-radius: var(--r-m);
  border: 1px solid var(--line2); background: var(--bg3);
  font-size: var(--fs-4); font-weight: 600; color: var(--muted);
}
.bd-verdict.ok { color: var(--wind); }
.bd-verdict.warn { color: var(--gold); }
.bd-verdict.bad { color: var(--accent-hi); }

/* ---------- 卡组码 ---------- */
.bd-code {
  width: 100%; min-height: 132px; resize: vertical;
  padding: 9px 11px; border-radius: var(--r-m);
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--line2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-2); line-height: 1.7;
}
.bd-code:focus { border-color: var(--gold-dim); outline: none; }
.bd-code::placeholder { color: var(--muted); }
.bd-rowbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- 弹窗补充（沿用 styles.css 的 .modal 结构） ---------- */
#mBody .bd-tile-prints { margin-top: 14px; }
#mBody .bd-tile-prints h5 { font-size: var(--fs-2); color: var(--gold); letter-spacing: 0.14em; margin-bottom: 7px; font-weight: 600; }
#mBody .bd-prints { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-2); color: var(--muted); }
#mBody .bd-prints b { color: var(--text); font-weight: 500; }

/* ---------- 响应式（置于文件末尾，确保覆盖基础规则） ---------- */
@media (max-width: 960px) {
  .bd-cols { grid-template-columns: 1fr; }
  .bd-col-deck { position: static; max-height: none; overflow: visible; padding-right: 0; }
  /* 单列下卡组列表限高内部滚动，避免把卡池挤到很远 */
  .bd-list { max-height: 300px; overflow-y: auto; }
}
@media (max-width: 640px) {
  .bd-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
  .bd-bar { padding: 10px 12px; }
  .bd-field { flex: 1 1 140px; }
  .bd-field select, .bd-field input { min-width: 0; width: 100%; }
  .bd-bar-btns { width: 100%; }
  .bd-bar-btns .bd-btn { flex: 1; }
  .bd-saved { margin-left: 0; padding-bottom: 0; }
  .bd-tile .info { width: 20px; height: 20px; }
}

