/* ========================================
   织网 (WebWeave) - 职务架构样式
   ======================================== */

/* 职务架构主容器 */
.position-architecture-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--holy-dark, #0a0a0a);
  color: var(--sacred-gold, #B8860B);
}

/* 全局控制栏 */
.architecture-control-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(184, 134, 11, 0.1);
  border-bottom: 1px solid rgba(184, 134, 11, 0.3);
  flex-shrink: 0;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toolbar-center {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

/* 视图切换按钮组 */
.view-switch-group {
  display: flex;
  gap: 5px;
  background: rgba(184, 134, 11, 0.1);
  padding: 5px;
  border-radius: var(--radius-md, 8px);
}

.view-switch-btn {
  padding: 8px 15px;
  font-size: 0.9rem;
  border: none;
  background: transparent;
  color: var(--sacred-gold, #B8860B);
  cursor: pointer;
  border-radius: var(--radius-sm, 4px);
  transition: all 0.3s ease;
}

.view-switch-btn:hover {
  background: rgba(184, 134, 11, 0.2);
}

.view-switch-btn.active {
  background: var(--sacred-gold, #B8860B);
  color: var(--holy-dark, #0a0a0a);
}

/* 主内容区 */
.architecture-main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* 权限控制布局调整 */
/* 非编辑模式：详情面板占据更多空间，便于查看 */
/* 编辑模式：画布占据更多空间，便于编辑 */

.position-architecture-container.view-mode .detail-edit-panel {
  width: 450px; /* 查看模式时面板更宽 */
}

.position-architecture-container.edit-mode .detail-edit-panel {
  width: 400px; /* 编辑模式时面板正常宽度 */
}

/* 查看模式下的样式调整 */
.detail-edit-panel.view-only .form-input:disabled,
.detail-edit-panel.view-only .form-textarea:disabled,
.detail-edit-panel.view-only .form-select:disabled {
  background: rgba(184, 134, 11, 0.05);
  border-color: rgba(184, 134, 11, 0.2);
  color: rgba(184, 134, 11, 0.8);
}

/* 可视化画布容器 */
.architecture-diagram-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--holy-dark, #0a0a0a);
}

.architecture-diagram-container.hidden {
  display: none;
}

/* G6画布 */
.g6-diagram-canvas {
  width: 100%;
  height: 100%;
}

/* 详情/编辑侧边面板 */
.detail-edit-panel {
  width: 400px;
  background: rgba(20, 20, 20, 0.95);
  border-left: 1px solid rgba(184, 134, 11, 0.3);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}

.detail-edit-panel.hidden {
  transform: translateX(100%);
}

.detail-edit-panel.visible {
  transform: translateX(0);
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid rgba(184, 134, 11, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  margin: 0;
  color: var(--sacred-gold, #B8860B);
  font-size: 1.2rem;
}

.panel-close-btn {
  background: none;
  border: none;
  color: var(--sacred-gold, #B8860B);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.panel-close-btn:hover {
  background: rgba(184, 134, 11, 0.2);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.panel-empty {
  text-align: center;
  color: var(--sacred-gold, #B8860B);
  padding: 40px 20px;
  opacity: 0.6;
}

/* 节点详情表单 */
.node-detail-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  color: var(--sacred-gold, #B8860B);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
  padding: 10px 15px;
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius-sm, 4px);
  color: var(--sacred-gold, #B8860B);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--sacred-gold, #B8860B);
  background: rgba(184, 134, 11, 0.15);
}

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* 成员列表 */
.member-list-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(184, 134, 11, 0.3);
}

.member-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.member-list-header h4 {
  margin: 0;
  color: var(--sacred-gold, #B8860B);
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(184, 134, 11, 0.05);
  border-radius: var(--radius-sm, 4px);
  transition: all 0.3s ease;
}

.member-item:hover {
  background: rgba(184, 134, 11, 0.1);
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.member-info {
  flex: 1;
}

.member-name {
  color: var(--sacred-gold, #B8860B);
  font-weight: 600;
  font-size: 0.9rem;
}

.member-role {
  color: rgba(184, 134, 11, 0.7);
  font-size: 0.8rem;
}

/* 操作按钮组 */
.panel-actions {
  padding: 20px;
  border-top: 1px solid rgba(184, 134, 11, 0.3);
  display: flex;
  gap: 10px;
}

.panel-actions .holy-button {
  flex: 1;
}

/* 缩略图导航 */
.minimap-container {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 150px;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius-md, 8px);
  z-index: 50;
  overflow: hidden;
}

.minimap-container.hidden {
  display: none;
}

/* 搜索框 */
.search-box {
  position: relative;
  margin-bottom: 15px;
}

.search-input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius-sm, 4px);
  color: var(--sacred-gold, #B8860B);
  font-size: 0.9rem;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(184, 134, 11, 0.7);
}

/* 右键菜单 */
.context-menu {
  position: fixed;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius-sm, 4px);
  padding: 5px 0;
  z-index: 1000;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.context-menu-item {
  padding: 10px 15px;
  color: var(--sacred-gold, #B8860B);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.context-menu-item:hover {
  background: rgba(184, 134, 11, 0.2);
}

.context-menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.context-menu-item.disabled:hover {
  background: transparent;
}

/* 加载状态 */
.architecture-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--sacred-gold, #B8860B);
  font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .architecture-main-content {
    flex-direction: column;
  }
  
  .detail-edit-panel {
    width: 100%;
    height: 50%;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-left: none;
    border-top: 1px solid rgba(184, 134, 11, 0.3);
  }
  
  .detail-edit-panel.hidden {
    transform: translateY(100%);
  }
  
  .architecture-control-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .toolbar-left,
  .toolbar-right,
  .toolbar-center {
    width: 100%;
    justify-content: center;
  }
}

/* G6节点样式覆盖 */
.g6-node {
  cursor: pointer;
}

.g6-node.selected {
  filter: drop-shadow(0 0 8px var(--sacred-gold, #B8860B));
}

/* G6节点类型样式 - 由G6自定义节点注册处理 */

/* G6边样式覆盖 */
.g6-edge {
  stroke: rgba(184, 134, 11, 0.5);
  stroke-width: 2;
}

.g6-edge:hover {
  stroke: var(--sacred-gold, #B8860B);
  stroke-width: 3;
}


