/* 主容器 */
.family-tree-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

/* 工具栏 */
.family-tree-toolbar {
  padding: 10px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-section h4 {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.toolbar-button {
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  min-height: 40px;
  min-width: 80px;
}

.toolbar-button:hover {
  background-color: #f0f0f0;
}

/* 画布容器 */
.family-tree-canvas-container {
  flex: 1;
  position: relative;
  background-color: #f9f9f9;
  touch-action: none;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.family-tree-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 3000px;
  height: 3000px;
  vector-effect: non-scaling-stroke;
  transform-origin: center center;
}

.nodes-container,
.connections-container {
  transform-origin: inherit;
}

/* 状态栏 */
.family-tree-statusbar {
  padding: 8px 10px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #666;
}

/* 节点样式 */
.node circle {
  cursor: pointer;
  transition: all 0.2s;
}

.node text {
  pointer-events: none;
  user-select: none;
}

.interaction-point {
  cursor: pointer;
  transition: all 0.2s;
}

/* 连接线样式 */
.connection {
  pointer-events: none;
}

.horizontal-marriage, .vertical-marriage {
  stroke-linecap: round;
}

/* 添加兄弟姐妹按钮 */
.add-sibling-button {
  cursor: pointer;
}

.add-sibling-button circle {
  transition: all 0.2s;
}

/* 节点编辑面板 */
.node-editor-panel {
  position: absolute;
  top: 50px;
  left: 50px;
  width: 300px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: none;
  max-height: 80vh;
  overflow-y: auto;
  font-size: 0.875rem !important;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background-color: #4CAF50;
  color: white;
  border-radius: 8px 8px 0 0;
  cursor: move;
}

.editor-header h3 {
  margin: 0;
  font-size: 1.25rem !important;
}

.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 30px;
  height: 30px;
  text-align: center;
}

.editor-tabs {
  display: flex;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
}

.tab-button {
  padding: 10px 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem !important;
  color: #666;
  border-bottom: 2px solid transparent;
  min-height: 44px;
}

.tab-button.active {
  color: #4CAF50;
  border-bottom-color: #4CAF50;
  background-color: #fff;
}

.tab-contents {
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.875rem !important;
  color: #555;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.875rem !important;
  min-height: 44px;
}

.radio-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem !important;
}

.radio-group input[type="radio"] {
  margin-right: 5px;
  width: 20px;
  height: 20px;
}

.color-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-options label {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem !important;
}

.color-options input[type="radio"] {
  margin-right: 5px;
  width: 20px;
  height: 20px;
}

fieldset {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

legend {
  padding: 0 5px;
  font-size: 0.875rem !important;
  color: #555;
}

.editor-footer {
  padding: 15px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #ddd;
}

.cancel-button,
.save-button {
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem !important;
  min-height: 44px;
  min-width: 80px;
}

.cancel-button {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  color: #555;
}

.save-button {
  background-color: #4CAF50;
  border: 1px solid #4CAF50;
  color: white;
}

/* 移动设备适配 */
@media (max-width: 768px) {
  .node-editor-panel {
    font-size: 0.75rem !important;
  }
  
  .editor-header h3 {
    font-size: 1rem !important;
  }
  
  .tab-button {
    font-size: 0.75rem !important;
  }
  
  .form-group label {
    font-size: 0.75rem !important;
  }
  
  .form-group input[type="text"],
  .form-group input[type="date"],
  .form-group select,
  .form-group textarea {
    font-size: 0.75rem !important;
  }
  
  .toolbar-button {
    padding: 10px 15px;
    font-size: 16px;
    min-height: 44px;
    min-width: 100px;
  }
  
  .toolbar-section h4 {
    font-size: 16px;
  }
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 40px 15px 15px;
  background-color: white;
  border-left: 4px solid #2196F3;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 12px;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
  max-width: 300px;
}

.notification.success {
  border-left-color: #4CAF50;
}

.notification.warning {
  border-left-color: #FFC107;
}

.notification.error {
  border-left-color: #F44336;
}

.notification-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-out {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.5s;
}

/* 移动设备的淡出动画 */
@media (max-width: 768px) {
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .fade-out {
    transform: translateY(20px);
  }
  
  .notification {
    top: auto;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: none;
    font-size: 12px;
    padding: 15px 50px 15px 15px;
  }
}
 
/* 命令窗口样式 */
.command-panel {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 200px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.command-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: move;
}

.command-panel-header h4 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: normal;
}

.toggle-button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  transition: transform 0.3s ease;
}

.toggle-button.collapsed {
  transform: rotate(-90deg);
}

.command-panel-content {
  padding: 10px;
  max-height: 300px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.command-panel-content.collapsed {
  max-height: 0;
  padding: 0 10px;
  overflow: hidden;
}

.command-button {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 12px;
  background-color: rgba(70, 70, 70, 0.7);
  color: white;
  border: none;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.command-button:hover {
  background-color: rgba(100, 100, 100, 0.9);
}

.command-button:last-child {
  margin-bottom: 0;
}

.command-button.active {
  background-color: rgba(0, 123, 255, 0.7);
}

/* 适配移动设备 */
@media (max-width: 768px) {
  .command-panel {
    width: 180px;
    top: 50px;
    right: 10px;
  }
  
  .command-button {
    padding: 10px;
    font-size: 14px;
  }
} 
 