/* BallScript 控制台共享样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  color: #e0e0e0;
}

/* === Panel === */
.bs-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: rgba(18, 18, 28, 0.98);
  backdrop-filter: blur(20px);
}

.bs-sidebar-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 560px;
  height: 100vh;
  z-index: 2147483646;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  transform: translateX(0);
}

.bs-sidebar-panel.collapsed {
  transform: translateX(100%);
}

/* === Floating Window === */
.bs-floating-window {
  position: fixed;
  z-index: 2147483646;
  width: 420px;
  height: 480px;
  background: rgba(18, 18, 28, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  top: 80px;
  left: 80px;
}

.bs-floating-header {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  flex-shrink: 0;
  user-select: none;
}

.bs-floating-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.bs-floating-actions {
  display: flex;
  gap: 6px;
}

/* === Panel Header === */
.bs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.bs-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.bs-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bs-ball-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff9999, #ff0000);
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
  flex-shrink: 0;
}

.bs-panel-body {
  flex: 1;
  overflow: hidden;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

/* === Buttons === */
.bs-btn-icon {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}
.bs-btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bs-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  color: #fff;
}
.bs-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.bs-btn-lg {
  padding: 8px 18px;
  font-size: 13px;
}
.bs-btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.bs-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #7b93ff, #8b5fcf);
}
.bs-btn-success {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}
.bs-btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #3ddb80, #2ecc71);
}
.bs-btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}
.bs-btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff5f4f, #e74c3c);
}
.bs-btn-warning {
  background: linear-gradient(135deg, #f39c12, #d68910);
}
.bs-btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffb030, #f39c12);
}

.bs-btn-sm {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}
.bs-btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* === Toolbar === */
.bs-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.bs-toolbar-sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

/* === Editor === */
.bs-editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bs-editor-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.bs-speed-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #888;
}

.bs-speed-control label {
  white-space: nowrap;
}

.bs-speed-control input[type="range"] {
  width: 80px;
  height: 3px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.bs-speed-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(102, 126, 234, 0.5);
}

.bs-editor-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  min-height: 0;
}

.bs-line-numbers {
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: #555;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
  min-width: 40px;
  user-select: none;
  white-space: pre;
  flex-shrink: 0;
  overflow: hidden;
}

.bs-code-editor {
  flex: 1;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: #e0e0e0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.bs-code-editor::placeholder {
  color: #444;
}

.bs-highlight-line {
  position: absolute;
  left: 40px;
  right: 0;
  height: 21px;
  background: rgba(102, 126, 234, 0.15);
  border-left: 2px solid #667eea;
  pointer-events: none;
  display: none;
  transition: top 0.1s ease;
}

/* === Bottom Section === */
.bs-bottom-section {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  max-height: 200px;
  min-height: 120px;
}

.bs-quick-actions, .bs-console-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bs-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.bs-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  overflow-y: auto;
}

.bs-action-grid.collapsed {
  display: none;
}

.bs-btn-action {
  padding: 5px 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: #999;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s;
  text-align: center;
}
.bs-btn-action:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
  color: #fff;
}

.bs-console {
  flex: 1;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 10px;
  line-height: 1.5;
  overflow-y: auto;
  color: #aaa;
}

.bs-console::-webkit-scrollbar { width: 3px; }
.bs-console::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }

.bs-log-info { color: #aaa; }
.bs-log-warn { color: #f39c12; }
.bs-log-error { color: #e74c3c; }
.bs-log-success { color: #2ecc71; }
.bs-log-system { color: #667eea; }

/* === Status Bar === */
.bs-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}

.bs-status-positions {
  display: flex;
  gap: 12px;
}

/* === Code Reference Table === */
.bs-code-ref {
  flex-shrink: 0;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bs-code-ref-body {
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 4px 0;
}

.bs-code-ref-body.collapsed {
  display: none;
}

.bs-cmd-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 10px;
  font-size: 11px;
  line-height: 1.5;
}

.bs-cmd-row code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  color: #667eea;
  white-space: nowrap;
  min-width: 160px;
  flex-shrink: 0;
}

.bs-cmd-row span {
  color: #777;
  font-size: 10px;
}

/* === Expand Button === */
.bs-btn-expand {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 24px;
  height: 60px;
  background: rgba(18, 18, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: #aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483646;
  transition: all 0.2s;
}
.bs-btn-expand:hover {
  background: rgba(30, 30, 50, 0.95);
  color: #fff;
}

/* === Scrollbar === */
.bs-panel ::-webkit-scrollbar { width: 5px; }
.bs-panel ::-webkit-scrollbar-track { background: transparent; }
.bs-panel ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }

/* === Resize Handle for floating window === */
.bs-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.1) 50%);
}
