/* ==========================================================================
   政策知识库 - 桌面/移动自适应全功能工作台样式
   ========================================================================== */

.knowledge-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #f8fafc;
  overflow: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
}

/* ==================== 顶部导航栏 (Top Header) ==================== */
.kg-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px 10px 115px; /* 留出左上角 [← 返回主页] 按钮的空间，永不重叠 */
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  gap: 16px;
  z-index: 20;
}

.kg-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.kg-logo {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.kg-graph-select {
  min-width: 200px;
  max-width: 260px;
  font-weight: 600;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s;
}

.kg-graph-select:hover, .kg-graph-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.kg-header-center {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
}

.kg-search-wrap {
  position: relative;
  flex: 1;
}

.kg-search-input {
  width: 100%;
  border-radius: 20px;
  padding: 6px 16px;
  background: #f1f5f9;
  border: 1px solid transparent;
  font-size: 13px;
  transition: all 0.2s;
}

.kg-search-input:focus {
  background: #fff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.kg-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
}

.kg-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.kg-search-item:hover {
  background: #f8fafc;
}

.kg-si-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.kg-si-info {
  flex: 1;
  min-width: 0;
}

.kg-si-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

.kg-si-desc {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-si-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e0e7ff;
  color: #4338ca;
  flex-shrink: 0;
}

.kg-view-switcher {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
  flex-shrink: 0;
}

.kg-view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.kg-view-btn:hover {
  color: #1e293b;
}

.kg-view-btn.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.kg-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ==================== 桌面树形工作区 (Desktop Tree Workspace) ==================== */
.kg-main-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左侧栏 */
.kg-tree-sidebar {
  width: 320px;
  min-width: 300px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width 0.25s ease, min-width 0.25s ease;
  z-index: 10;
}

.kg-tree-sidebar.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
}

.kg-sidebar-toggle {
  position: absolute;
  top: 14px;
  right: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: #64748b;
  z-index: 30;
  transition: all 0.2s;
}

.kg-sidebar-toggle:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

.kg-sidebar-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.kg-dim-tabs {
  display: flex;
  padding: 10px 14px;
  gap: 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.kg-dim-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.kg-dim-tab.active {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #4f46e5;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kg-dim-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.kg-tree-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
}

#kg-tree-filter {
  flex: 1;
  border-radius: 6px;
}

.kg-tree-btns {
  display: flex;
  gap: 4px;
}

.kg-tree-tree-scroll, .kg-scenario-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* 树节点样式 */
.kg-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  transition: all 0.15s;
  user-select: none;
  margin-bottom: 2px;
}

.kg-tree-row:hover {
  background: #f1f5f9;
}

.kg-tree-row.active {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}

.kg-tree-arrow {
  width: 16px;
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  cursor: pointer;
}

.kg-tree-arrow-spacer {
  width: 16px;
}

.kg-tree-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.kg-tree-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-tree-price {
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  background: #fee2e2;
  padding: 1px 6px;
  border-radius: 4px;
}

.kg-tree-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
}

.kg-badge-category { background: #e0e7ff; color: #4338ca; }
.kg-badge-instance { background: #dbeafe; color: #1e40af; }
.kg-badge-tutorial { background: #dcfce7; color: #15803d; }

/* 场景列表项 */
.kg-scenario-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.kg-scenario-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.kg-scenario-item.active {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.kg-sc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.kg-sc-info {
  flex: 1;
  min-width: 0;
}

.kg-sc-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

.kg-sc-desc {
  font-size: 11.5px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-sc-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 500;
}

/* ==================== 右侧内容区 (Right Content Area) ==================== */
.kg-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 32px;
  background: #ffffff;
}

.kg-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 20px;
}

.kg-bc-item {
  cursor: pointer;
  transition: color 0.15s;
}

.kg-bc-item:hover {
  color: #4f46e5;
}

.kg-bc-item.active {
  color: #0f172a;
  font-weight: 600;
  cursor: default;
}

.kg-bc-sep {
  color: #cbd5e1;
}

/* Hero Banner */
.kg-node-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.kg-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.kg-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.kg-hero-info h1 {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kg-hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kg-hero-desc {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
}

.kg-kind-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.kg-kind-category { background: #e0e7ff; color: #4338ca; }
.kg-kind-instance { background: #dbeafe; color: #1e40af; }
.kg-kind-tutorial { background: #dcfce7; color: #15803d; }

.kg-btype-chip {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* Detail Card */
.kg-detail-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.kg-card-title {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.kg-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.kg-card-title-row .kg-card-title {
  margin-bottom: 0;
}

/* 属性网格 */
.kg-attrs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.kg-attr-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
}

.kg-attr-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.kg-attr-val {
  font-size: 14.5px;
  font-weight: 600;
  color: #1e293b;
}

.kg-attr-val.price {
  font-size: 20px;
  font-weight: 700;
  color: #ef4444;
}

/* 场景标签 */
.kg-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kg-pill-scenario {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.kg-pill-scenario:hover {
  background: #e0e7ff;
  transform: translateY(-1px);
}

.kg-pill-custom {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
}

/* 关键要点 */
.kg-keypoints-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kg-kp-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: #78350f;
}

.kg-kp-icon {
  font-size: 15px;
  flex-shrink: 0;
}

/* 关系规则 */
.kg-relations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kg-rel-box {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
}

.kg-rel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.kg-rel-badge {
  font-size: 11px;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.kg-rel-jump-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #4f46e5;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.kg-rel-jump-btn:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.kg-rel-desc {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
}

.kg-rel-cond {
  font-size: 12px;
  color: #e8590c;
  margin-top: 4px;
  font-weight: 500;
}

/* 经验心得 */
.kg-experiences-list, .kg-mob-exp-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kg-exp-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
}

.kg-exp-card.pinned {
  background: #fefce8;
  border-color: #fde047;
}

.kg-exp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kg-exp-pin {
  font-size: 12px;
  font-weight: 700;
  color: #eab308;
}

.kg-exp-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

.kg-exp-author {
  font-size: 12px;
  color: #64748b;
}

.kg-exp-upvote-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  cursor: pointer;
  color: #334155;
  transition: all 0.15s;
}

.kg-exp-upvote-btn:hover {
  background: #e0e7ff;
  border-color: #6366f1;
  color: #4338ca;
}

.kg-exp-body {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}

/* 教程时间轴 */
.kg-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kg-timeline-item {
  display: flex;
  gap: 14px;
}

.kg-timeline-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0ea5e9;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.kg-timeline-content {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
}

.kg-timeline-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.kg-step-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
}

.kg-timeline-body {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

.kg-step-note {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  background: #eff6ff;
  color: #1d4ed8;
}

/* 子分类卡片网格 */
.kg-children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.kg-child-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.kg-child-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: #c7d2fe;
}

.kg-cc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kg-cc-icon {
  font-size: 20px;
}

.kg-cc-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

.kg-cc-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}

.kg-cc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kg-cc-price {
  font-size: 16px;
  font-weight: 700;
  color: #ef4444;
}

.kg-cc-btype {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==================== 知识导图 & 关系图谱视图 (Mindmap / Graph View) ==================== */
.kg-graph-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 56px);
  position: relative;
  overflow: hidden;
  background: #f8fafc;
}

.kg-graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.kg-graph-modes {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 4px;
}

.kg-gmode-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kg-gmode-btn.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.kg-mindmap-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kg-gorient-group {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 6px;
  gap: 2px;
}

.kg-gctrl-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.kg-gctrl-btn.active {
  background: #ffffff;
  color: #3b82f6;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.kg-gdivider {
  width: 1px;
  height: 18px;
  background: #e2e8f0;
  margin: 0 4px;
}

.kg-graph-filter-chips {
  display: flex;
  gap: 6px;
}

.kg-filter-chip {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.kg-filter-chip.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  font-weight: 600;
}

.kg-echarts-container {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 450px;
}

.kg-node-popup {
  position: absolute;
  top: 70px;
  right: 24px;
  width: 300px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  padding: 18px;
  z-index: 50;
  animation: fadeIn 0.15s ease;
}

.kg-popup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.kg-popup-icon {
  font-size: 22px;
}

.kg-popup-info {
  flex: 1;
}

.kg-popup-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #94a3b8;
}

.kg-popup-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 10px;
}

.kg-popup-price {
  font-size: 18px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 12px;
}

.kg-popup-action {
  width: 100%;
  padding: 8px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ==================== 后台管理视图 (Admin View) ==================== */
.kg-admin-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #f8fafc;
}

.kg-admin-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.kg-asubtab {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.kg-asubtab:hover {
  background: #f1f5f9;
}

.kg-asubtab.active {
  background: #4f46e5;
  color: #ffffff;
  font-weight: 600;
}

.kg-admin-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ==================== 移动端专属视图 (Mobile Workspace) ==================== */
.kg-mobile-workspace {
  display: none; /* 桌面端默认隐藏 */
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #f8fafc;
}

/* 移动端顶栏：知识库切换与搜索 */
.kg-mob-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.kg-mob-graph-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 145px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.kg-mob-graph-pill:active {
  background: #e0e7ff;
}

.kg-mob-cur-graph-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-mob-graph-caret {
  font-size: 10px;
  opacity: 0.7;
}

.kg-mob-search-wrap {
  flex: 1;
  min-width: 0;
}

.kg-mob-search-input {
  width: 100%;
  border-radius: 20px;
  padding: 8px 14px;
  background: #f1f5f9;
  border: 1px solid transparent;
  font-size: 12.5px;
}

.kg-mob-search-input:focus {
  background: #fff;
  border-color: #c7d2fe;
}

.kg-mob-content-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.kg-mob-bottom-nav {
  display: flex;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 6px 0;
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.kg-mob-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 0;
}

.kg-mob-tab-btn.active {
  color: #4f46e5;
  font-weight: 600;
}

.kg-mtab-icon {
  font-size: 18px;
}

/* 移动端 Banner */
.kg-mob-banner {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
  cursor: pointer;
}

.kg-mob-banner-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.kg-mob-banner-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.kg-mob-banner-title {
  font-size: 16px;
  font-weight: 700;
}

.kg-mob-banner-desc {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.5;
}

/* 移动端知识库切换抽屉 (Bottom Sheet) */
.kg-mob-sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}

.kg-mob-sheet-panel {
  background: #ffffff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kg-mob-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.kg-mob-sheet-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.kg-mob-sheet-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.kg-mob-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.kg-mob-graph-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kg-mob-graph-item:active {
  background: #f1f5f9;
  transform: scale(0.98);
}

.kg-mob-graph-item.active {
  background: #eef2ff;
  border-color: #6366f1;
}

.kg-mob-gi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.kg-mob-graph-item.active .kg-mob-gi-icon {
  background: #6366f1;
  color: #ffffff;
  border-color: #4f46e5;
}

.kg-mob-gi-info {
  flex: 1;
  min-width: 0;
}

.kg-mob-gi-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.kg-mob-graph-item.active .kg-mob-gi-name {
  color: #4338ca;
}

.kg-mob-gi-desc {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kg-mob-gi-check {
  font-size: 11.5px;
  font-weight: 700;
  color: #4338ca;
  background: #dbeafe;
  padding: 3px 8px;
  border-radius: 12px;
}

.kg-mob-gi-arrow {
  font-size: 16px;
  color: #cbd5e1;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.kg-mob-sec-header {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 16px 0 10px 0;
}

/* 移动端分类卡片网格 */
.kg-mob-cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.kg-mob-cat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.kg-mob-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kg-mob-cat-meta {
  flex: 1;
  min-width: 0;
}

.kg-mob-cat-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.kg-mob-cat-desc {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-mob-cat-badge {
  font-size: 12px;
  color: #4f46e5;
  font-weight: 600;
}

/* 移动端政策卡片 */
.kg-mob-policy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kg-mob-pcard {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.kg-mob-pc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.kg-mob-pc-icon {
  font-size: 18px;
}

.kg-mob-pc-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

.kg-mob-pc-price {
  font-size: 16px;
  font-weight: 700;
  color: #ef4444;
}

.kg-mob-pc-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 10px;
}

.kg-mob-pc-bot {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}

.kg-mob-pc-arrow {
  font-size: 12px;
  color: #4f46e5;
  font-weight: 600;
}

/* 移动端导航头部 */
.kg-mob-nav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 12px;
}

.kg-mob-back-btn {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.kg-mob-nav-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

/* 移动端横向滑动筛选 */
.kg-mob-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.kg-mob-fchip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12.5px;
  color: #64748b;
  white-space: nowrap;
  cursor: pointer;
}

.kg-mob-fchip.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  font-weight: 600;
}

/* 移动端详情卡片 */
.kg-mob-pdetail-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
}

.kg-mob-phead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.kg-mob-picon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.kg-mob-pinfo h2 {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.kg-mob-ptags {
  display: flex;
  gap: 6px;
}

.kg-mob-pdesc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.kg-mob-price-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #fee2e2, #fef2f2);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 14px;
}

.kg-mob-pb-label {
  font-size: 13px;
  color: #991b1b;
  font-weight: 600;
}

.kg-mob-pb-val {
  font-size: 22px;
  font-weight: 800;
  color: #dc2626;
}

.kg-mob-section-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
}

.kg-mob-sec-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.kg-mob-attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kg-mob-attr-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
}

.kg-mob-attr-k {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 2px;
}

.kg-mob-attr-v {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.kg-mob-scenario-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.kg-mob-sc-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.kg-mob-sc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.kg-mob-sc-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.kg-mob-sc-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

.kg-mob-sc-count {
  font-size: 12px;
  color: #4f46e5;
  font-weight: 600;
}

.kg-mob-exp-tag {
  font-size: 12px;
  color: #4f46e5;
  font-weight: 600;
  cursor: pointer;
}

/* ==================== 后台管理全套组件样式 (Admin Panel Components) ==================== */
.kga-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.kga-count {
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
}

.kga-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.kga-filter-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12.5px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.kga-filter-btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  font-weight: 600;
}

.kga-card-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.kga-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.kga-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.kga-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.kga-table tr:hover td {
  background: #f8fafc;
}

.kga-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}

.kga-node-ref {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
}

.kga-rule-desc {
  max-width: 380px;
}

.kga-expr-line {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.kga-expr-label {
  font-weight: 600;
  color: #4338ca;
}

.kga-desc-text {
  font-size: 12px;
  color: #64748b;
}

.kga-ops {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.kg-ta-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.kg-ta-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.kg-ta-btn.kg-ta-del {
  color: #ef4444;
  border-color: #fecaca;
}

.kg-ta-btn.kg-ta-del:hover {
  background: #fee2e2;
}

.kga-preview {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.4;
}

/* 知识树管理左右分栏 (Tree Manager 2-Column Split Pane) */
.kga-tree-mgr {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 140px);
  gap: 20px;
  overflow: hidden;
}

.kga-tree-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.kga-tree-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.kga-tree-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.kga-tree-search {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.kga-tree-search input {
  width: 100%;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
}

.kga-tree-nodes {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.kga-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  transition: all 0.15s;
  user-select: none;
  margin-bottom: 2px;
}

.kga-tree-row:hover {
  background: #f1f5f9;
}

.kga-tree-row.selected {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}

.kga-tree-arrow {
  width: 14px;
  text-align: center;
  font-size: 9px;
  color: #94a3b8;
}

.kga-tree-arrow-sp {
  width: 14px;
}

.kga-tree-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.kga-tree-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kga-tree-kind {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
}

.kga-kind-category { background: #e0e7ff; color: #4338ca; }
.kga-kind-instance { background: #dbeafe; color: #1e40af; }
.kga-kind-tutorial { background: #dcfce7; color: #15803d; }

.kga-tree-add-child {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
}

.kga-tree-row:hover .kga-tree-add-child {
  opacity: 1;
}

.kga-tree-add-child:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.kga-empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
}

.kga-empty-tree {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* 编辑面板 (Edit Panel) */
.kga-edit-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.kga-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.kga-editor-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kga-node-icon-lg {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}

.kga-editor-title h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.kga-editor-actions {
  display: flex;
  gap: 10px;
}

.kga-btn-danger {
  color: #ef4444 !important;
  border-color: #fecaca !important;
}

.kga-btn-danger:hover {
  background: #fee2e2 !important;
}

.kga-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.kga-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.kga-form-group {
  margin-bottom: 16px;
}

.kga-form-group:last-child {
  margin-bottom: 0;
}

.kga-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 7px;
}

.kga-form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .kga-form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.kga-icon-picker-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kga-icon-input {
  width: 100% !important;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.kga-quick-emojis {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kga-emoji-pill {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.kga-emoji-pill:hover {
  background: #eef2ff;
  border-color: #6366f1;
  transform: scale(1.15);
}

.kga-color-picker-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kga-color-swatch-input {
  width: 100%;
  height: 38px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  padding: 2px 4px;
  box-sizing: border-box;
}

.kga-color-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kga-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  transition: transform 0.15s;
}

.kga-color-dot:hover {
  transform: scale(1.25);
}

.kga-select-input {
  width: 100%;
  font-size: 13.5px;
}

.kga-form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}

.kga-form-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

.kga-kind-selector {
  display: flex;
  gap: 10px;
}

.kga-kind-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.kga-kind-btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.kga-btype-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kga-btype-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.kga-btype-btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  font-weight: 600;
}

.kga-attrs-editor, .kga-kp-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kga-attr-row, .kga-kp-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kga-attr-key {
  width: 140px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  font-size: 13px;
}

.kga-attr-val, .kga-kp-input {
  flex: 1;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  font-size: 13px;
}

.kga-btn-rm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kga-empty-attrs {
  font-size: 12.5px;
  color: #94a3b8;
  padding: 10px 0;
}

.kga-quick-add {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.kga-quick-label {
  font-size: 12px;
  color: #64748b;
}

.kga-quick-btn {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #4338ca;
  font-size: 11.5px;
  cursor: pointer;
}

.kga-quick-btn:hover {
  background: #eef2ff;
  border-color: #6366f1;
}

.kga-scenario-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kga-scenario-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.kga-scenario-chip.selected {
  background: #dbeafe;
  color: #1e40af;
  border-color: #3b82f6;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.kga-btype-add-btn {
  border-style: dashed !important;
  color: #4f46e5 !important;
  background: #f5f3ff !important;
}
.kga-btype-add-btn:hover {
  background: #ede9fe !important;
  border-color: #6366f1 !important;
}

/* 交互式标签选择盒 */
.kga-tags-chip-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kga-tags-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.kga-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.kga-tag-chip-del {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.kga-tag-chip-del:hover {
  color: #ef4444;
}

.kga-tag-input-row {
  display: flex;
  gap: 8px;
}

.kga-tag-input-row .input {
  flex: 1;
}

.kga-quick-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

.kga-quick-tag-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.kga-quick-tag-btn:hover {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #a5b4fc;
}

/* 流程教程编辑 (Tutorial Step Editor) */
.kga-step-item {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.kga-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24px;
}

.kga-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.kga-step-line {
  flex: 1;
  width: 2px;
  background: #cbd5e1;
  margin-top: 4px;
}

.kga-step-body {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.kga-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.kga-step-title {
  font-weight: 700;
  font-size: 13.5px;
  border: none;
  border-bottom: 1px dashed #cbd5e1;
  outline: none;
  width: 70%;
  padding-bottom: 2px;
}

.kga-step-actions {
  display: flex;
  gap: 4px;
}

.kga-step-btn {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 11px;
  cursor: pointer;
}

.kga-step-content {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  font-size: 12.5px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.kga-step-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.kga-step-tag {
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 11.5px;
  cursor: pointer;
}

.kga-step-tag.active {
  background: #0ea5e9;
  color: #fff;
  border-color: #0ea5e9;
}

.kga-step-note {
  background: #eff6ff;
  border-radius: 6px;
  padding: 8px 10px;
}

.kga-step-note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.kga-note-type {
  font-size: 11.5px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 2px 6px;
}

.kga-note-input {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  padding: 4px 6px;
  box-sizing: border-box;
}

.kga-add-note-btn {
  font-size: 12px;
  color: #4f46e5;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* 场景编排宫格 (Scenarios Grid) */
.kga-sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.kga-sc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.kga-sc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.kga-sc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.kga-sc-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.kga-sc-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
}

/* Markdown 编辑器 (Markdown Editor) */
.kga-md-editor {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.kga-md-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.kga-md-tl, .kga-md-tr {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kga-md-btn {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.kga-md-divider {
  width: 1px;
  height: 16px;
  background: #cbd5e1;
  margin: 0 4px;
}

.kga-md-textarea {
  width: 100%;
  padding: 12px;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  box-sizing: border-box;
}

.kga-md-footer {
  padding: 6px 12px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  font-size: 11.5px;
  color: #94a3b8;
}

/* ==================== 标签维度侧边栏样式 ==================== */
.kg-tag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.kg-tag-item:hover {
  background: #f1f5f9;
}

.kg-tag-item.active {
  background: #ede9fe;
  border-color: #c4b5fd;
}

.kg-tag-icon {
  font-size: 18px;
}

.kg-tag-info {
  flex: 1;
  min-width: 0;
}

.kg-tag-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kg-tag-item.active .kg-tag-name {
  color: #6366f1;
}

.kg-tag-desc {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kg-tag-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}

.kg-tag-item.active .kg-tag-badge {
  background: #8b5cf6;
  color: #fff;
}

/* 可点击标签药丸 */
.kg-pill-custom {
  background: #f1f5f9;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kg-pill-custom:hover {
  background: #e0e7ff;
  border-color: #6366f1;
  transform: translateY(-1px);
}

/* ==================== 业务类型后台卡片网格 ==================== */
.kga-btype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 20px;
}

.kga-btype-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.kga-btype-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.kga-btype-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.kga-btype-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #e2e8f0;
}

.kga-btype-card-main {
  flex: 1;
  min-width: 0;
}

.kga-btype-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.kga-btype-card-key {
  font-size: 11.5px;
  color: #64748b;
}

.kga-btype-card-key code {
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  color: #475569;
}

.kga-btype-tag {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.kga-btype-tag.preset {
  background: #f1f5f9;
  color: #64748b;
}

.kga-btype-tag.custom {
  background: #dbeafe;
  color: #1e40af;
}

.kga-btype-card-body {
  flex: 1;
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid #f8fafc;
}

.kga-btype-usage-title {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.kga-btype-nodes-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kga-btype-node-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kga-btype-node-chip.more {
  background: #e2e8f0;
  color: #475569;
  font-weight: 600;
}

.kga-btype-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* ==================== 标签与场景分段按钮与表格 ==================== */
.kga-seg-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 4px;
}

.kga-seg-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kga-seg-btn.active {
  background: #ffffff;
  color: #4f46e5;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.kga-tag-pill {
  display: inline-block;
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12.5px;
}

/* ==================== 响应式媒体查询 (Responsive Breakpoints) ==================== */
@media (max-width: 768px) {
  .kg-top-header {
    display: none; /* 移动端使用专用移动顶栏 */
  }

  .kg-main-workspace,
  .kg-graph-workspace,
  .kg-admin-workspace {
    display: none !important;
  }

  .kg-mobile-workspace {
    display: flex !important;
  }
}
