/* ========================================
   织网 (WebWeave) - 架构编辑器样式
   ======================================== */

/* === 编辑器容器 === */
.editor-container {
  display: flex;
  height: calc(100vh - 100px);
  gap: 20px;
  padding: 20px;
}

/* === 工具栏 === */
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(145deg, rgba(10, 10, 10, 0.9), rgba(26, 26, 46, 0.8));
  border: 2px solid var(--sacred-gold);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--holy-glow-soft);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
}

/* === 左侧组件面板 === */
.component-panel {
  width: 250px;
  background: linear-gradient(145deg, rgba(10, 10, 10, 0.9), rgba(26, 26, 46, 0.8));
  border: 2px solid var(--sacred-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--holy-glow-soft);
  overflow-y: auto;
}

.component-panel h3 {
  color: var(--divine-gold);
  font-family: var(--font-display);
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.components {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.component-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: rgba(184, 134, 11, 0.1);
  border: 2px solid var(--sacred-gold);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all var(--duration-normal);
}

.component-item:hover {
  background: rgba(184, 134, 11, 0.2);
  border-color: var(--divine-gold);
  transform: translateX(5px);
  box-shadow: var(--holy-glow-soft);
}

.component-item:active {
  cursor: grabbing;
}

.component-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--sacred-gold);
  color: var(--holy-black);
  flex-shrink: 0;
}

.dept-icon::before { content: '🏛'; }
.team-icon::before { content: '🛡'; }
.position-icon::before { content: '⚔'; }

/* === 中央画布容器 === */
.canvas-container {
  flex: 1;
  background: linear-gradient(145deg, rgba(10, 10, 10, 0.95), rgba(26, 26, 46, 0.9));
  border: 3px solid var(--sacred-gold);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), var(--holy-glow-soft);
}

.role-editor-canvas {
  width: 100%;
  height: 100%;
  cursor: default;
}

/* SVG节点样式 */
.role-node {
  transition: transform 0.2s ease-out;
}

.role-node:hover {
  filter: url(#holy-glow) !important;
}

.role-node.selected {
  filter: url(#holy-glow) !important;
}

.divine-connection {
  transition: all 0.3s ease-out;
}

.divine-connection:hover {
  stroke-width: 5;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8)) !important;
}

/* === 右侧属性面板 === */
.property-panel {
  width: 320px;
  background: linear-gradient(145deg, rgba(10, 10, 10, 0.9), rgba(26, 26, 46, 0.8));
  border: 2px solid var(--sacred-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--holy-glow-soft);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.property-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--sacred-gold);
}

.property-header h3 {
  color: var(--divine-gold);
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.2rem;
}

.node-type {
  padding: 4px 12px;
  background: var(--sacred-gold);
  color: var(--holy-black);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
}

/* === 属性表单 === */
.property-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  color: var(--sacred-gold);
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  padding: 10px;
  background: rgba(10, 10, 10, 0.6);
  border: 2px solid var(--sacred-gold);
  border-radius: var(--radius-sm);
  color: var(--holy-white);
  font-family: var(--font-body);
  transition: all var(--duration-normal);
}

.form-input:focus {
  border-color: var(--divine-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  outline: none;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FFD700' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 35px;
}

/* === 成员列表 === */
.member-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-list h4 {
  color: var(--sacred-gold);
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 10px;
}

.member-search {
  margin-bottom: 15px;
}

.member-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid var(--sacred-gold);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal);
}

.member-item:hover {
  background: rgba(184, 134, 11, 0.2);
  border-color: var(--divine-gold);
  transform: translateX(5px);
}

.member-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 2px solid var(--sacred-gold);
  object-fit: cover;
}

.member-info {
  flex: 1;
}

.member-name {
  color: var(--holy-white);
  font-weight: bold;
  font-size: 0.9rem;
}

.member-role {
  color: var(--sacred-gold);
  font-size: 0.8rem;
}

/* === 画布缩放控制 === */
.canvas-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.canvas-control-btn {
  width: 40px;
  height: 40px;
  background: rgba(184, 134, 11, 0.8);
  border: 2px solid var(--divine-gold);
  border-radius: 50%;
  color: var(--holy-white);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--duration-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-control-btn:hover {
  background: var(--divine-gold);
  color: var(--holy-black);
  box-shadow: var(--holy-glow-medium);
  transform: scale(1.1);
}

/* === 响应式 === */
@media (max-width: 1024px) {
  .editor-container {
    flex-direction: column;
  }
  
  .component-panel,
  .property-panel {
    width: 100%;
    max-height: 300px;
  }
  
  .canvas-container {
    min-height: 500px;
  }
}
