.entity-inspector {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #262626;
  color: #ccc;
  position: relative;
  font-size: 11px;
}

.inspector-header {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 6px;
  border-bottom: 1px solid #1a1a1a;
  background-color: #2d2d2d;
  flex-shrink: 0;
}

.inspector-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.inspector-lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0;
}

.inspector-lock-btn:hover {
  color: #999;
}

.inspector-lock-btn.locked {
  color: #f59e0b;
}

.inspector-object-count {
  font-size: 11px;
  color: #888;
  margin-left: auto;
}

.inspector-header-icon {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.inspector-header h3 {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Search Box */
.inspector-search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: #262626;
  border-bottom: 1px solid #1a1a1a;
}

.inspector-search svg {
  color: #555;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.inspector-search input {
  flex: 1;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 11px;
  color: #ccc;
  height: 18px;
}

.inspector-search input:focus {
  outline: none;
  border-color: #4a9eff;
}

.inspector-search input::placeholder {
  color: #555;
}

/* Category Tabs */
.inspector-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px 6px;
  background: #262626;
  border-bottom: 1px solid #1a1a1a;
}

.inspector-category-tab {
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 400;
  color: #888;
  background: transparent;
  border: 1px solid #333;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.1s ease;
  height: 18px;
}

.inspector-category-tab:hover {
  background: #333;
  color: #ccc;
}

.inspector-category-tab.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.inspector-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  min-height: 0;
}

.inspector-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.inspector-content::-webkit-scrollbar-track {
  background: var(--color-bg-base);
}

.inspector-content::-webkit-scrollbar-thumb {
  background: rgba(121, 121, 121, 0.4);
  border-radius: 4px;
}

.inspector-content::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.7);
}

.inspector-content::-webkit-scrollbar-corner {
  background: transparent;
}

.inspector-section {
  margin-bottom: 0;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border-subtle);
}

.section-icon {
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.section-header span {
  flex: 1;
}

.add-component-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-component-btn:hover {
  background-color: var(--color-primary-hover);
  transform: scale(1.1);
}

.add-component-btn:active {
  transform: scale(0.95);
}

.section-content {
  padding: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-base);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.info-row:hover {
  background-color: var(--color-bg-hover);
}

.info-label {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.info-value {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-mono);
}

.component-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  min-height: min-content;
}

.component-item {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-base) 100%);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  overflow: visible;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  min-height: min-content;
}

.component-item:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.component-item.expanded {
  background: var(--color-bg-overlay);
  box-shadow: var(--shadow-md);
  overflow: visible;
}

.component-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  user-select: none;
}

.component-header:hover {
  background-color: var(--color-bg-hover);
}

.component-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  padding: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.component-expand-btn:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

.component-icon {
  display: flex;
  align-items: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.component-item:hover .component-icon,
.component-item.expanded .component-icon {
  color: var(--color-primary);
}

.component-name {
  flex: 1;
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

.remove-component-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  padding: var(--spacing-xs);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  opacity: 0;
}

.component-header:hover .remove-component-btn {
  opacity: 1;
}

.remove-component-btn:hover {
  background-color: var(--color-error);
  color: var(--color-text-inverse);
  transform: scale(1.1);
}

.remove-component-btn:active {
  transform: scale(0.95);
}

.component-properties {
  border-top: 1px solid var(--color-border-default);
  background-color: var(--color-bg-base);
  overflow: visible;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4xl) var(--spacing-lg);
  text-align: center;
  color: var(--color-text-secondary);
  height: 100%;
}

.empty-icon {
  color: var(--color-text-tertiary);
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.empty-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.empty-state-small {
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  font-style: italic;
}

.entity-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.section-title {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0;
}

.property-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  font-size: 11px;
  gap: 8px;
  background-color: transparent;
  border-radius: 0;
  margin-bottom: 1px;
  min-height: 24px;
}

.property-field:last-child {
  margin-bottom: 0;
}

.property-field:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.property-label {
  color: #888;
  font-weight: 400;
  flex-shrink: 0;
  min-width: 70px;
  font-size: 11px;
}

.property-value-text {
  color: #ccc;
  text-align: right;
  word-break: break-word;
  font-size: 11px;
  flex: 1;
  font-family: var(--font-family-mono);
}

.component-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  padding: 4px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
  flex-shrink: 0;
  opacity: 0;
  margin-left: auto;
}

.component-header:hover .component-remove-btn {
  opacity: 1;
}

.component-remove-btn:hover {
  background-color: var(--color-error);
  color: white;
}

.empty-inspector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  height: 100%;
}

.child-node-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  font-size: 12px;
  transition: background-color 0.15s;
  cursor: default;
}

.child-node-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.child-node-index {
  color: #666;
  min-width: 20px;
  font-size: 12px;
}

.child-node-name {
  color: #ccc;
  flex: 1;
  font-size: 12px;
}

.file-preview-content {
  background: #1e1e1e;
  border: 1px solid #3e3e3e;
  border-radius: 4px;
  padding: 12px;
  max-height: 400px;
  overflow-y: auto;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-word;
}

.file-preview-content::-webkit-scrollbar {
  width: 10px;
}

.file-preview-content::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.file-preview-content::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 5px;
}

.file-preview-content::-webkit-scrollbar-thumb:hover {
  background: #4e4e4e;
}

.spin-slow {
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 添加组件菜单样式 */
.section-title-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.component-menu-container {
  position: relative;
}

.add-component-trigger {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  background: #3b82f6;
  border: none;
  border-radius: 2px;
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  transition: all 0.1s ease;
  height: 18px;
}

.add-component-trigger:hover {
  background: #2563eb;
}

.add-component-trigger:active {
  background: #1d4ed8;
}

.component-dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-index-dropdown);
}

.component-dropdown {
  position: fixed;
  min-width: 220px;
  max-height: 320px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: calc(var(--z-index-dropdown) + 1);
  overflow: hidden;
  animation: dropdownSlide 0.15s ease;
}

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

.component-dropdown-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-default);
  background: var(--color-bg-base);
}

.component-dropdown-search svg {
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.component-dropdown-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-primary);
  font-size: 12px;
}

.component-dropdown-search input::placeholder {
  color: var(--color-text-tertiary);
}

.component-dropdown-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 12px;
}

.component-dropdown-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}

.component-dropdown-list::-webkit-scrollbar {
  width: 6px;
}

.component-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}

.component-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.component-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.component-category-group {
  margin-bottom: 4px;
}

.component-category-group:last-child {
  margin-bottom: 0;
}

.component-category-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg-base);
  border: none;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.component-category-header:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.component-category-header svg {
  color: var(--color-text-tertiary);
}

.component-category-count {
  margin-left: auto;
  padding: 1px 6px;
  background: var(--color-bg-inset);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-tertiary);
}

.component-category-label {
  padding: 6px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.component-dropdown-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px 6px 28px;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.1s ease;
}

.component-dropdown-item svg {
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.component-dropdown-item:hover {
  background: var(--color-bg-hover);
}

.component-dropdown-item:active {
  background: var(--color-primary);
}

.component-dropdown-item-name {
  font-size: 12px;
  font-weight: 500;
}

.component-dropdown-item-desc {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

/* 组件列表项样式 */
.component-item-card {
  margin-bottom: 0;
  background: #262626;
  border: none;
  border-bottom: 1px solid #1a1a1a;
  overflow: visible;
}

.component-item-card.expanded {
  background: #262626;
}

.component-item-header {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: #2d2d2d;
  cursor: pointer;
  user-select: none;
  height: 26px;
  gap: 6px;
}

.component-item-header:hover {
  background: #333;
}

.component-expand-icon {
  display: flex;
  align-items: center;
  color: #888;
  width: 12px;
  height: 12px;
}

.component-item-card.expanded .component-expand-icon {
  color: #ccc;
}

.component-icon {
  display: flex;
  align-items: center;
  color: #888;
}

.component-item-card.expanded .component-icon {
  color: #ccc;
}

.component-item-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #ccc;
}

.component-item-card.expanded .component-item-name {
  color: #fff;
}

.component-item-card .component-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 2px;
  opacity: 0;
}

.component-item-header:hover .component-remove-btn {
  opacity: 1;
}

.component-item-card .component-remove-btn:hover {
  color: #ef4444;
}

.component-item-content {
  padding: 0;
  background: #262626;
  overflow: visible;
  min-width: 0;
}

/* Property rows inside component */
.component-item-content .property-row {
  display: flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 0;
}

.component-item-content .property-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Code Preview */
.code-preview-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.code-preview-section .code-preview-container {
  flex: 1;
  min-height: 0;
}

.code-preview-container {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  height: 100%;
}

.code-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  font-size: 12px;
}

/* ==================== Transform Component ==================== */
.transform-section {
  background: #262626;
  border-bottom: 1px solid #1a1a1a;
}

.transform-section-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  background: #2d2d2d;
  cursor: pointer;
  user-select: none;
  height: 24px;
  border-bottom: 1px solid #1a1a1a;
}

.transform-section-header:hover {
  background: #333;
}

.transform-section-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: transform 0.15s ease;
  width: 14px;
  height: 14px;
}

.transform-section-expand.expanded {
  transform: rotate(90deg);
}

.transform-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #ccc;
  flex: 1;
}

.transform-section-content {
  padding: 4px 0;
}

/* Transform Row */
.transform-row {
  display: flex;
  align-items: center;
  padding: 3px 8px;
  min-height: 22px;
  gap: 4px;
}

.transform-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Transform Row Label */
.transform-row-label {
  display: flex;
  align-items: center;
  width: 64px;
  min-width: 64px;
  flex-shrink: 0;
}

.transform-label-text {
  font-size: 11px;
  color: #999;
  font-weight: 400;
}

/* Transform Row Inputs Container */
.transform-row-inputs {
  display: flex;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.transform-row-inputs.rotation-single {
  /* Single rotation input takes full width */
}

/* Transform Axis Input */
.transform-axis-input {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 2px;
  height: 18px;
  overflow: hidden;
}

.transform-axis-input:hover {
  border-color: #4a4a4a;
  background: #222;
}

.transform-axis-input:focus-within {
  border-color: #4a9eff;
}

.transform-axis-input.dragging {
  border-color: #4a9eff;
}

/* Color bar indicator inside input */
.transform-axis-bar {
  width: 3px;
  height: 100%;
  flex-shrink: 0;
  cursor: ew-resize;
  transition: width 0.1s ease;
}

.transform-axis-bar:hover {
  width: 4px;
}

.transform-axis-bar.x {
  background: #c83232;
}

.transform-axis-bar.y {
  background: #32a852;
}

.transform-axis-bar.z {
  background: #3264c8;
}

.transform-axis-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  background: transparent;
  border: none;
  font-size: 10px;
  font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
  color: #ddd;
  text-align: left;
  -moz-appearance: textfield;
}

.transform-axis-input input::-webkit-outer-spin-button,
.transform-axis-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.transform-axis-input input:focus {
  outline: none;
  background: rgba(74, 158, 255, 0.05);
}

/* Suffix (like degree symbol) */
.transform-axis-suffix {
  font-size: 9px;
  color: #666;
  padding-right: 4px;
  flex-shrink: 0;
}

/* Lock Button */
.transform-lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  border-radius: 2px;
}

.transform-lock-btn:hover {
  color: #888;
  background: rgba(255, 255, 255, 0.05);
}

.transform-lock-btn.locked {
  color: #f59e0b;
}

/* Reset Button */
.transform-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  color: #444;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.transform-row:hover .transform-reset-btn {
  opacity: 1;
}

.transform-reset-btn:hover {
  color: #888;
  background: rgba(255, 255, 255, 0.05);
}

/* Mobility Row */
.transform-mobility-row {
  display: flex;
  align-items: center;
  padding: 3px 8px;
  min-height: 22px;
  gap: 4px;
  margin-top: 4px;
  border-top: 1px solid #333;
}

.transform-mobility-label {
  font-size: 11px;
  color: #999;
  width: 64px;
  min-width: 64px;
  flex-shrink: 0;
}

.transform-mobility-buttons {
  display: flex;
  gap: 0;
  flex: 1;
}

.transform-mobility-btn {
  flex: 1;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 400;
  color: #888;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  cursor: pointer;
  height: 18px;
  transition: all 0.1s ease;
}

.transform-mobility-btn:first-child {
  border-radius: 2px 0 0 2px;
}

.transform-mobility-btn:last-child {
  border-radius: 0 2px 2px 0;
}

.transform-mobility-btn:not(:first-child) {
  border-left: none;
}

.transform-mobility-btn:hover {
  background: #3a3a3a;
  color: #ccc;
}

.transform-mobility-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
