/* ==========================================================================
   依赖组（dep_groups）样式
   —— 全部使用 app.css 的设计令牌，浅色 / 深色主题自动跟随
   —— 类名统一 dg- 前缀，避免与既有样式冲突
   ========================================================================== */

/* ---------------------------------------------------------------- 组卡片 */
.dg-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 11px 13px;
  margin-bottom: 10px;
  transition: border-color var(--theme-trans), background var(--theme-trans);
}
.dg-card.clickable { cursor: pointer; }
.dg-card.clickable:hover { border-color: var(--accent-line); background: var(--hover-tint); }
.dg-card.selected { border-color: var(--accent-line); background: var(--accent-soft); }
.dg-card.partial { border-color: var(--warn-line); }

.dg-card-h {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.dg-card-icon { font-size: 13px; line-height: 1; }
.dg-card-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.dg-card-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }

.dg-card-b { min-width: 0; }
.dg-card-f {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
}

/* ---------------------------------------------------------------- 成员行 */
.dg-members { display: flex; flex-direction: column; gap: 3px; }
.dg-members.empty { color: var(--faint); font-size: 12.5px; padding: 2px 0; }
.dg-member {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  min-width: 0;
}
.dg-member-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dg-member.more { padding-left: 2px; }
.dg-member.dead { color: var(--faint); }

/* ---------------------------------------------------------------- 选择器里的组区 */
.dg-picker-groups {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 10px 11px;
  margin-bottom: 10px;
  max-height: 240px;
  overflow-y: auto;
}
.dg-picker-group-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  margin-bottom: 8px;
}
.dg-picker-groups .dg-card { margin-bottom: 7px; }
.dg-picker-groups .dg-card:last-child { margin-bottom: 0; }
.dg-picker-no-group {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------------------------------------------------------------- 来源 chip */
.dg-source {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.dg-source-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dg-source-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.dg-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.dg-chip:hover { background: var(--surface-3); }
.dg-chip.stale {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  color: var(--st-doing);
}
.dg-chip-icon { font-size: 11px; }
.dg-chip-flag {
  font-size: 10.5px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--st-doing);
  color: var(--on-doing);
}
.dg-chip-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
}
/* 作者样式里的 display:flex 会盖掉浏览器默认的 [hidden]{display:none} —— 显式补回来 */
.dg-chip-menu[hidden] { display: none; }
.dg-chip-menu .btn { justify-content: flex-start; width: 100%; }

/* ---------------------------------------------------------------- 管理面板 */
.dg-panel { display: flex; flex-direction: column; gap: 4px; }
.dg-panel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.dg-panel-t { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.dg-panel-list { display: flex; flex-direction: column; }
.dg-panel-tip { margin-top: 4px; line-height: 1.6; }

/* ---------------------------------------------------------------- 编辑器 */
.dg-editor { display: flex; flex-direction: column; gap: 10px; }
.dg-editor-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.dg-pick-list {
  border: 1px solid var(--line);
  border-radius: var(--r);
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
}
.dg-pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 12.5px;
  min-width: 0;
}
.dg-pick-row:last-child { border-bottom: none; }
.dg-pick-row:hover { background: var(--hover-tint); }
.dg-pick-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ---------------------------------------------------------------- 扫描建组 */
.dg-scan-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.dg-scan-row {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dg-scan-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.dg-scan-act { display: flex; gap: 7px; align-items: center; }
.dg-scan-act .input { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- 窄屏 */
@media (max-width: 720px) {
  .dg-source { align-items: flex-start; }
  .dg-source-chips { width: 100%; }
  .dg-chip-menu { left: auto; right: 0; }
  .dg-picker-groups { max-height: 190px; }
  .dg-scan-act { flex-wrap: wrap; }
  .dg-scan-act .input { flex: 1 1 100%; }
}
