/* ============================================================
   图片体系 · BINK定制五金库（暖色体系，暗色主题就绪）
   封面缩略图 / 详情图库 / 图片编辑器 / 品牌卡
   ============================================================ */

/* ---- 卡片封面 ---- */
.card-thumb {
  position: relative; margin: -13px -14px 10px; height: 132px; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.card-thumb.is-diagram img { object-fit: contain; background: var(--panel); }
.card:hover .card-thumb img { transform: scale(1.04); }
.thumb-tag {
  position: absolute; left: 8px; bottom: 8px; font-size: 10px; padding: 2px 7px;
  border-radius: 10px; background: var(--chip-bg); color: var(--ink-2);
  border: 1px solid var(--line);
}
.card-thumb.is-diagram .thumb-tag { color: var(--accent-2); border-color: var(--line); }
.brand-chip {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 9px; background: var(--accent-soft);
  color: var(--accent); border: 1px solid var(--line); letter-spacing: 0;
}

/* ---- 侧栏品牌库 ---- */
.brand-group { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.brand-head { padding: 6px 10px; font-weight: 700; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; }
.brand-head .cnt { margin-left: auto; font-size: 11px; color: var(--ink-2); background: var(--panel-2); padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); }
.cat-child .ccode.flag {
  font-size: 9.5px; font-weight: 700; color: #fff; background: var(--accent-2);
  padding: 1px 4px; border-radius: 3px; min-width: 22px; text-align: center;
}

/* ---- 详情图库 ---- */
.gallery { margin: 12px 0 18px; }
.gal-main {
  position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; cursor: zoom-in; display: flex; align-items: center; justify-content: center;
  height: 320px;
}
.gal-main img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.gal-main:hover { border-color: var(--accent); }
.gal-hint {
  position: absolute; right: 10px; bottom: 10px; font-size: 11px; color: var(--ink-2);
  background: var(--chip-bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 10px;
}
.gal-cap { font-size: 12px; color: var(--ink-3); margin: 6px 2px 0; }
.gal-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gal-thumb {
  width: 78px; height: 58px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
  cursor: pointer; background: var(--panel); transition: .15s;
}
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-thumb.is-diagram img { object-fit: contain; }
.gal-thumb:hover { border-color: var(--accent); }
.gal-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* ---- 品牌卡 ---- */
.brand-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel-2); }
.bc-top { display: flex; align-items: center; gap: 10px; }
.bc-flag {
  font-size: 11px; font-weight: 800; color: #fff; background: var(--accent-2);
  padding: 4px 7px; border-radius: 5px; letter-spacing: .5px;
}
.bc-name { font-weight: 700; font-size: 15px; }
.bc-en { font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.bc-meta { font-size: 11.5px; color: var(--ink-3); }
.bc-site { margin-left: auto; font-size: 12px; color: var(--accent-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.bc-site:hover { text-decoration: underline; }
.bc-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.bc-lines { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.bc-filter { margin-top: 10px; }

/* ---- 外部链接 ---- */
.link-list { display: flex; flex-direction: column; gap: 5px; }
.ext-link {
  font-size: 12.5px; color: var(--accent-2); text-decoration: none;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
}
.ext-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---- 图片编辑器 ---- */
.hint-inline { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.img-zone {
  border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 10px; background: var(--panel-2);
  transition: .15s;
}
.img-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.img-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 10px; }
.img-url {
  flex: 1; min-width: 220px; padding: 5px 10px; border: 1px solid var(--line-2);
  border-radius: 7px; font-size: 12.5px; outline: none; background: var(--panel); color: var(--ink);
}
.img-url:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.img-tools .hint { font-size: 11px; color: var(--ink-3); width: 100%; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.img-empty {
  grid-column: 1/-1; text-align: center; padding: 22px 10px; color: var(--ink-3); font-size: 12.5px;
  border: 1px dashed var(--line-2); border-radius: 8px; background: var(--panel);
}
.img-empty span { font-size: 11.5px; }
.img-tile {
  position: relative; border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  overflow: hidden; cursor: grab;
}
.img-tile.is-cover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.img-tile.dragging { opacity: .4; }
.img-tile.drop-hint { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-soft); }
.it-pic { height: 104px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; }
.it-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.it-cover {
  position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 700; color: #fff;
  background: var(--accent); padding: 1px 7px; border-radius: 9px;
}
.it-cap { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 5px 8px; font-size: 11.5px; outline: none; background: var(--panel); color: var(--ink); }
.it-cap:focus { background: var(--accent-soft); }
.it-bar { display: flex; border-top: 1px solid var(--line); }
.it-bar button {
  flex: 1; border: 0; border-right: 1px solid var(--line); background: var(--panel-2);
  font-size: 11px; padding: 5px 0; color: var(--ink-2);
}
.it-bar button:last-child { border-right: 0; }
.it-bar button:hover { background: var(--accent-soft); color: var(--accent); }
.it-bar button.danger:hover { background: #fdeaea; color: var(--warn); }
.it-name { font-size: 10px; color: var(--ink-3); padding: 3px 8px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-lib-wrap { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.lib-title { font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.img-lib { display: flex; flex-wrap: wrap; gap: 8px; max-height: 240px; overflow-y: auto; padding: 2px; }
.lib-tile {
  width: 92px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
  cursor: pointer; background: var(--panel); transition: .15s;
}
.lib-tile img { width: 100%; height: 62px; object-fit: cover; display: block; }
.lib-tile span { display: block; font-size: 9.5px; color: var(--ink-3); padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-tile:hover { border-color: var(--accent); }
.lib-tile.used { border-color: var(--ok); box-shadow: 0 0 0 2px var(--accent-soft); }

/* ---- 灯箱增强 ---- */
.lightbox img { transition: transform .12s ease-out; transform-origin: center center; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 78px;
  border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 34px; line-height: 1;
  border-radius: 8px;
}
.lb-nav:hover { background: rgba(255, 255, 255, .28); }
.lb-nav.prev { left: 18px; }
.lb-nav.next { right: 18px; }
.lb-bar {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 22px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px;
}
.lb-bar button { border: 0; background: rgba(255, 255, 255, .16); color: #fff; padding: 3px 10px; border-radius: 6px; font-size: 12.5px; }
.lb-bar button:hover { background: rgba(255, 255, 255, .32); }
.lb-bar a { color: #ffd8a8; text-decoration: none; }
.lb-bar a:hover { text-decoration: underline; }

/* ---- 品牌总览弹窗 ---- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.brand-grid .brand-card { cursor: default; }
