/* ═══════════════════════════════════════════════════════
   3D模型预览器 - 独立样式表
   移动端优先设计，支持触摸交互
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --primary: #0066FF;
  --primary-dark: #0052CC;
  --primary-light: rgba(0, 102, 255, 0.15);
  --accent: #00d2ff;
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #E74C3C;
  --bg-dark: #0a0a14;
  --bg-panel: #1a1a2e;
  --bg-card: #0f0f1a;
  --border-dark: #2a2a4a;
  --text-bright: #ffffff;
  --text-normal: #c0c8d8;
  --text-muted: #8892a0;
  --text-dim: #5a5a7a;
  --header-h: 56px;
  --footer-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  font-size: 14px; 
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-normal);
  line-height: 1.5;
  overflow: hidden;
  position: fixed;
  inset: 0;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { 
  cursor: pointer; 
  font-family: inherit; 
  border: none; 
  outline: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
input { font-family: inherit; outline: none; }

/* ── App Container ── */
.viewer-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-dark);
}

/* ═══════════════════════════════
   HEADER
   ═══════════════════════════════ */
.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  padding-top: calc(8px + var(--safe-area-top));
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-dark);
  height: var(--header-h);
  flex-shrink: 0;
  z-index: 100;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title i {
  color: var(--accent);
  font-size: 18px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-normal);
  font-size: 16px;
  transition: all 0.2s;
}

.btn-icon:hover, .btn-icon:active {
  background: var(--border-dark);
  color: var(--text-bright);
}

.btn-icon.active {
  background: var(--primary-light);
  color: var(--accent);
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon-sm:hover, .btn-icon-sm:active {
  background: var(--border-dark);
  color: var(--text-bright);
}

/* ═══════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════ */
.viewer-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ── Upload Overlay ── */
.upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
}

.upload-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.upload-panel {
  text-align: center;
  padding: 32px 24px;
  max-width: 400px;
  width: 90%;
}

.upload-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  color: var(--primary);
  opacity: 0.8;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.upload-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.upload-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.upload-browse {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.upload-formats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.format-tag {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.format-tag.stl { background: var(--primary-light); color: var(--primary); }
.format-tag.obj { background: rgba(155, 89, 182, 0.15); color: #9B59B6; }
.format-tag.step, .format-tag.stp { background: rgba(243, 156, 18, 0.15); color: #F39C12; }
.format-tag.magics { background: rgba(231, 76, 60, 0.15); color: #E74C3C; }

.upload-note {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-note i { color: var(--success); }

/* ── Viewer Container ── */
.viewer-container {
  position: absolute;
  inset: 0;
  background: var(--bg-dark);
}

.viewer-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.viewer-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  gap: 16px;
}

.viewer-placeholder i {
  font-size: 64px;
  opacity: 0.3;
}

.viewer-placeholder p {
  font-size: 14px;
}

/* ── File List Panel ── */
.file-list-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 280px;
  max-height: calc(100% - 100px);
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 30;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.file-list-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-dark);
  flex-shrink: 0;
}

.file-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-normal);
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-count i { color: var(--accent); }

.btn-text {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-text:hover, .btn-text:active {
  background: var(--border-dark);
  color: var(--danger);
}

.file-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.file-item:hover, .file-item:active {
  background: var(--border-dark);
}

.file-item.active {
  background: var(--primary-light);
  border: 1px solid var(--primary);
}

.file-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.file-item-icon.stl { background: var(--primary-light); color: var(--primary); }
.file-item-icon.obj { background: rgba(155, 89, 182, 0.15); color: #9B59B6; }
.file-item-icon.step, .file-item-icon.stp { background: rgba(243, 156, 18, 0.15); color: #F39C12; }
.file-item-icon.mgx, .file-item-icon.magics { background: rgba(231, 76, 60, 0.15); color: #E74C3C; }

.file-item-info {
  flex: 1;
  min-width: 0;
}

.file-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-item-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  opacity: 0;
  transition: all 0.2s;
}

.file-item:hover .file-item-remove,
.file-item:active .file-item-remove {
  opacity: 1;
}

.file-item-remove:hover, .file-item-remove:active {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

/* ── Info Panel ── */
.info-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 280px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.info-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.info-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-dark);
}

.info-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-panel-header h3 i { color: var(--accent); }

.info-panel-body {
  padding: 12px 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.info-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-label i { 
  width: 14px;
  font-size: 11px;
  color: var(--accent);
}

.info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-bright);
  text-align: right;
}

.info-divider {
  height: 1px;
  background: var(--border-dark);
  margin: 8px 0;
}

/* ═══════════════════════════════
   FOOTER CONTROLS
   ═══════════════════════════════ */
.viewer-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-dark);
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-area-bottom));
  height: var(--footer-h);
  flex-shrink: 0;
  z-index: 100;
}

.footer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-normal);
  font-size: 16px;
  transition: all 0.2s;
}

.ctrl-btn:hover, .ctrl-btn:active {
  background: var(--border-dark);
  color: var(--text-bright);
}

.ctrl-btn.active {
  background: var(--primary-light);
  color: var(--accent);
  border-color: var(--primary);
}

.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.model-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 50px;
  text-align: center;
}

.control-divider {
  width: 1px;
  height: 32px;
  background: var(--border-dark);
  margin: 0 8px;
}

/* ═══════════════════════════════
   FILE SELECTOR SHEET (Mobile)
   ═══════════════════════════════ */
.file-selector-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 60vh;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.file-selector-sheet.visible {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-dark);
  border-radius: 2px;
  margin: 8px auto;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border-dark);
}

.sheet-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-area-bottom));
}

/* ═══════════════════════════════
   TOAST
   ═══════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 50px;
  background: var(--bg-panel);
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }

/* ═══════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-bright);
}

.loading-spinner i {
  font-size: 48px;
  color: var(--accent);
}

.loading-spinner span {
  font-size: 14px;
  color: var(--text-muted);
}

/* ═══════════════════════════════
   RESPONSIVE - 移动端优化
   ═══════════════════════════════ */
@media (max-width: 768px) {
  .app-title span {
    display: none;
  }
  
  .file-list-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 50vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  
  .file-list-panel.visible {
    transform: translateY(0);
  }
  
  .info-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 60vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  
  .info-panel.visible {
    transform: translateY(0);
  }
  
  .footer-controls {
    gap: 4px;
  }
  
  .ctrl-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  .control-divider {
    display: none;
  }
  
  .upload-panel {
    padding: 24px 16px;
  }
  
  .upload-icon {
    width: 64px;
    height: 64px;
  }
  
  .upload-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .viewer-header {
    padding: 6px 8px;
    padding-top: calc(6px + var(--safe-area-top));
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .app-title {
    font-size: 14px;
  }
  
  .app-title i {
    font-size: 16px;
  }
  
  .ctrl-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  
  .model-counter {
    font-size: 12px;
    min-width: 40px;
  }
  
  .format-tag {
    padding: 3px 8px;
    font-size: 11px;
  }
}

/* ═══════════════════════════════
   横屏模式
   ═══════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .viewer-header, .viewer-footer {
    height: 48px;
  }
  
  .ctrl-btn {
    width: 36px;
    height: 36px;
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
  }
}

/* ═══════════════════════════════
   触摸手势优化
   ═══════════════════════════════ */
@media (pointer: coarse) {
  .ctrl-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  .btn-icon {
    min-width: 44px;
    min-height: 44px;
  }
  
  .file-item {
    padding: 12px;
  }
  
  .file-item-remove {
    opacity: 1;
    width: 32px;
    height: 32px;
  }
}

/* ═══════════════════════════════
   深色模式滚动条
   ═══════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ═══════════════════════════════
   动画
   ═══════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

/* ═══════════════════════════════
   左侧工具栏
   ═══════════════════════════════ */
.toolbar-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 8px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolbar-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px;
}

.toolbar-btn-group {
  display: flex;
  gap: 4px;
}

.toolbar-btn-group.vertical {
  flex-direction: column;
}

.toolbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  color: var(--text-normal);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px;
}

.toolbar-btn i {
  font-size: 14px;
}

.toolbar-btn:hover {
  background: var(--border-dark);
  color: var(--text-bright);
}

.toolbar-btn.active {
  background: var(--primary-light);
  color: var(--accent);
  border-color: var(--primary);
}

.toolbar-btn.toggle-btn {
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  text-align: left;
}

.toolbar-btn.toggle-btn i {
  font-size: 12px;
}

.toolbar-btn.toggle-btn span {
  flex: 1;
}

/* 右侧面板容器 */
.panel-right {
  position: absolute;
  right: 12px;
  top: 12px;
  bottom: 80px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
  pointer-events: none;
}

.panel-right > * {
  pointer-events: auto;
}

/* 结构树面板 */
.structure-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}

.structure-panel.visible {
  display: block;
}

.structure-tree {
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.tree-placeholder {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.tree-item:hover {
  background: var(--border-dark);
}

.tree-item.active {
  background: var(--primary-light);
}

.tree-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 12px;
}

.tree-item-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-normal);
}

.tree-item-visibility {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}

.tree-item-visibility:hover {
  color: var(--text-bright);
}

/* 剖切面板 */
.clipping-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}

.clipping-panel.visible {
  display: block;
}

.clipping-controls {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clipping-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clipping-row label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 70px;
}

.clipping-row input[type="range"] {
  flex: 1;
  height: 4px;
  background: var(--border-dark);
  border-radius: 2px;
  -webkit-appearance: none;
}

.clipping-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.clipping-row input[type="color"] {
  width: 32px;
  height: 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.clipping-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.clipping-row span {
  font-size: 11px;
  color: var(--text-normal);
  min-width: 35px;
}

.clipping-plane-btns {
  display: flex;
  gap: 4px;
}

.plane-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  color: var(--text-normal);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.plane-btn:hover {
  background: var(--border-dark);
}

.plane-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 坐标轴指示器 */
.axis-indicator {
  position: absolute;
  right: 12px;
  bottom: 80px;
  width: 80px;
  height: 80px;
  background: rgba(26, 26, 46, 0.8);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dark);
  z-index: 40;
}

#axis-canvas {
  width: 100%;
  height: 100%;
}

/* 移动端工具栏 */
.mobile-toolbar {
  display: none;
  position: fixed;
  bottom: calc(72px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border-dark);
  border-radius: 50px;
  padding: 6px;
  z-index: 100;
  gap: 4px;
}

.mobile-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 16px;
  border-radius: 50px;
  background: transparent;
  color: var(--text-normal);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-tool-btn i {
  font-size: 16px;
}

.mobile-tool-btn:hover, .mobile-tool-btn:active {
  background: var(--border-dark);
  color: var(--text-bright);
}

.mobile-tool-btn.active {
  background: var(--primary-light);
  color: var(--accent);
}

/* 面板通用样式 */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-dark);
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h3 i {
  color: var(--accent);
}

/* ═══════════════════════════════
   响应式 - 移动端
   ═══════════════════════════════ */
@media (max-width: 768px) {
  .toolbar-left {
    display: none;
  }
  
  .mobile-toolbar {
    display: flex;
  }
  
  .panel-right {
    position: fixed;
    right: 0;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 50vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--bg-panel);
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  
  .panel-right.visible {
    transform: translateY(0);
  }
  
  .axis-indicator {
    right: 8px;
    bottom: 140px;
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .toolbar-btn {
    padding: 6px 8px;
    min-width: 40px;
    font-size: 9px;
  }
  
  .toolbar-btn i {
    font-size: 12px;
  }
}
