/* =========================================================================
 * onticards · 行业智能化全景图谱 — 分类卡片视图样式
 * 与 graph.css（基础主题/顶栏/模态/仓库）配合使用，仅定义卡片视图专属部分
 * ========================================================================= */

/* ===================== 卡片舞台 ===================== */
.card-stage {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--bg-canvas, #f7f3e9);
}

.card-app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 60px;
}

/* ===================== 两级分类标签 ===================== */
.card-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.card-nav-domains { margin-bottom: 14px; }

.card-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.card-tab:hover { border-color: var(--border-strong); color: var(--text); }
.card-tab .card-tab-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.card-tab .card-tab-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--surface);
  border-radius: 999px;
  padding: 1px 8px;
  line-height: 16px;
}
.card-tab-domain.active {
  color: #fff;
  border-color: var(--tab-accent, var(--primary));
  background: var(--tab-accent, var(--primary));
}
.card-tab-domain.active .card-tab-count { background: rgba(255,255,255,0.22); color: #fff; }

.card-nav-modules { margin-bottom: 20px; }
.card-tab-module {
  font-size: 12.5px;
  padding: 7px 14px;
  background: var(--surface);
}
.card-tab-module.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}
.card-tab-module.active .card-tab-count {
  color: var(--primary);
  background: rgba(79,70,229,0.12);
}

/* ===================== 当前模块说明 ===================== */
.card-context {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-context-title { font-size: 20px; font-weight: 800; color: var(--text); }
.card-context-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 920px;
}

/* ===================== 场景卡片流 ===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.scene-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  font-family: inherit;
  padding: 18px 18px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 0.2s ease;
}
.scene-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.scene-card:hover .scene-card-open {
  opacity: 1;
  transform: translate(0, 0);
}

.scene-card-group {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--surface);
  border-radius: 999px;
  padding: 2px 9px;
}

.scene-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
  padding-right: 6px;
}

.scene-card-desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 60px;
}

.scene-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  margin-top: auto;
}
.scene-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.scene-meta-item svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.scene-meta-item b { font-size: 13px; font-weight: 800; margin-left: 1px; }

.scene-card-open {
  position: absolute;
  right: 14px;
  bottom: 14px;
  opacity: 0;
  transform: translate(4px, 4px);
  transition: all 0.2s ease;
}
.scene-card-open svg { width: 16px; height: 16px; color: var(--primary); }

.card-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ===================== 场景详情模态窗 ===================== */
.modal-scene {
  max-width: 980px;
  width: 94vw;
  height: 86vh;
  display: flex;
  flex-direction: column;
}

.scene-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.scene-col { margin-bottom: 22px; }
.scene-col:last-child { margin-bottom: 4px; }

.scene-col-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--c, var(--text));
  margin-bottom: 10px;
}
.scene-col-label::before {
  content: '';
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--c, var(--text));
}

.scene-col-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 10px 0;
}

.scene-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scene-li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}
.scene-li-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.scene-li-main b { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.5; }
.scene-li-sub {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* 必须/可选徽标 */
.must-badge {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #059669;
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 16px;
  margin-top: 1px;
}
.must-badge.optional {
  background: #e5e0d5;
  color: #8a8274;
}

/* ===================== 技能块（含仓库） ===================== */
.scene-skill {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  padding: 14px;
  margin-bottom: 12px;
}
.scene-skill-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.scene-skill-name { font-size: 13.5px; font-weight: 800; color: var(--text); flex: 1; min-width: 160px; }
.scene-skill-desc {
  margin: 8px 0 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.btn-download-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 999px;
  box-shadow: none;
}

/* 仓库面板在模态中占 260px 高，树 230px 宽 */
.repo-panel-sm { height: 260px; }
.repo-panel-sm .repo-tree { width: 230px; flex: none; }

/* ===================== 窄屏适配 ===================== */
@media (max-width: 720px) {
  .card-app { padding: 18px 16px 48px; }
  .card-grid { grid-template-columns: 1fr; }
  .repo-panel-sm { flex-direction: column; height: auto; }
  .repo-panel-sm .repo-tree { width: 100%; max-height: 180px; }
}
