/* Model Rush - 自定义样式 */
/* 配色: 深色主题, 绿色/琥珀色, 禁止蓝紫渐变 */

* { box-sizing: border-box; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 2px; }

/* 面板标签栏 */
.panel-tab {
  flex: 1;
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  color: #7f8c8d;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.panel-tab:hover { color: #ccc; }
.panel-tab.active {
  color: #00ff88;
  border-bottom-color: #00ff88;
}

/* 标签内容面板 */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 拖拽手柄 */
#panel-resize-handle {
  cursor: col-resize;
  user-select: none;
}
#panel-resize-handle:hover, #panel-resize-handle.dragging {
  background: #00ff88 !important;
}

/* 面板卡片 */
.panel-card {
  background: #111118;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  padding: 8px 10px;
}

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #1a1a2e;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #00ff88;
  border-radius: 3px;
  transition: width 0.3s;
}

/* 操作按钮 */
.action-btn {
  padding: 6px 14px;
  border: 1px solid #2a2a3a;
  border-radius: 4px;
  font-size: 13px;
  color: #ccc;
  background: #111118;
  cursor: pointer;
  transition: all 0.15s;
}
.action-btn:hover {
  border-color: #00ff88;
  color: #00ff88;
  background: rgba(0,255,136,0.05);
}
.action-btn.danger-btn {
  border-color: #e74c3c;
  color: #e74c3c;
}
.action-btn.danger-btn:hover {
  background: rgba(231,76,60,0.1);
}

/* 速度按钮 */
.speed-btn {
  transition: all 0.15s;
}

/* 模态框 */
#modal-overlay { transition: opacity 0.2s; }
#modal-overlay:not(.hidden) { display: flex !important; }

/* 模态框内按钮 */
.modal-btn {
  padding: 8px 16px;
  border: 1px solid #2a2a3a;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-btn:hover { border-color: #00ff88; }
.modal-btn.primary {
  background: #00ff88;
  color: #0a0a0f;
  border-color: #00ff88;
  font-weight: bold;
}
.modal-btn.primary:hover {
  background: #00cc66;
  border-color: #00cc66;
}
.modal-btn.danger {
  border-color: #e74c3c;
  color: #e74c3c;
}
.modal-btn.danger:hover {
  background: rgba(231,76,60,0.1);
}

/* 输入框 */
.modal-input {
  width: 100%;
  padding: 8px 10px;
  background: #0a0a0f;
  border: 1px solid #2a2a3a;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.modal-input:focus { border-color: #00ff88; }
.modal-input::placeholder { color: #555; }

/* Toast 动画 */
#toast { animation: slideIn 0.3s ease; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 技术卡片 */
.tech-card {
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.tech-card:hover { border-color: #555; }
.tech-card.selected {
  border-color: #00ff88;
  background: rgba(0,255,136,0.05);
}
.tech-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
}
.tech-card.locked:hover { border-color: #2a2a3a; }

/* 标签 */
.tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; }
.tag-green { background: rgba(0,255,136,0.15); color: #00ff88; }
.tag-red { background: rgba(231,76,60,0.15); color: #e74c3c; }
.tag-amber { background: rgba(255,170,0,0.15); color: #ffaa00; }
.tag-silver { background: rgba(127,140,141,0.15); color: #7f8c8d; }

/* 排名高亮 */
.rank-1 { color: #ffaa00; }
.rank-2 { color: #ccc; }
.rank-3 { color: #cd7f32; }

/* 下拉菜单 */
.dropdown-group {
  position: relative;
}
.dropdown-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: #111118;
  border: 1px solid #2a2a3a;
  border-radius: 4px;
  min-width: 140px;
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.5);
}
.dropdown-group.open .dropdown-menu {
  display: block;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  text-align: left;
  font-size: 13px;
  color: #ccc;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.1s;
}
.dropdown-item:hover {
  background: rgba(0,255,136,0.08);
  color: #00ff88;
}
.dropdown-item:not(:last-child) {
  border-bottom: 1px solid #1a1a2e;
}

/* 底部操作栏 */
#bottombar {
  overflow: visible;
}

/* 锁定覆盖 */
.locked-overlay { position: relative; }
.locked-overlay::after {
  content: 'LOCKED';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,15,0.7);
  color: #555;
  font-size: 11px;
  letter-spacing: 2px;
  border-radius: 6px;
}

/* 模型规模滑动条 */
.scale-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #1a1a2e;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00ff88;
  border: 2px solid #0a0a0f;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,255,136,0.5);
  transition: transform 0.1s;
}
.scale-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.scale-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00ff88;
  border: 2px solid #0a0a0f;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,255,136,0.5);
}

/* === 移动端面板切换按钮 === */
#panel-toggle-btn {
  display: none;
}

/* === 主体flex布局 === */
body { display: flex; flex-direction: column; }
#main-body { flex: 1; min-height: 0; }

/* === 移动端适配 === */
@media (max-width: 768px) {
  /* 顶部栏：缩小字体，隐藏部分信息 */
  #topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 6px 8px;
    gap: 4px 8px;
    font-size: 11px;
  }
  #topbar > span { font-size: 11px; white-space: nowrap; }

  /* 主体布局：面板变为覆盖层 */
  #main-body {
    position: relative;
  }
  #right-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85% !important;
    max-width: 320px !important;
    z-index: 30;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -4px 0 16px rgba(0,0,0,0.5);
  }
  #right-panel.mobile-open {
    transform: translateX(0);
  }
  #panel-resize-handle { display: none; }

  /* 面板切换按钮 */
  #panel-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 31;
    width: 36px;
    height: 36px;
    background: #111118;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    color: #00ff88;
    font-size: 18px;
    cursor: pointer;
  }

  /* 底部操作栏：水平滚动 */
  #bottombar {
    height: auto !important;
    min-height: 48px;
    overflow-x: auto;
    overflow-y: visible;
    gap: 4px;
    padding: 6px 8px;
    -webkit-overflow-scrolling: touch;
  }
  #bottombar .action-btn {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  #bottombar .dropdown-menu {
    min-width: 120px;
    /* 移动端bottombar横向滚动会裁剪absolute菜单，改用fixed居中弹出 */
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 54px;
    width: max-content;
    max-width: 90vw;
    margin-bottom: 0;
  }

  /* 模态框：全宽 */
  #modal-content {
    max-width: 95vw !important;
    max-height: 85vh !important;
    padding: 12px !important;
    font-size: 12px;
  }
  #modal-content .modal-input { font-size: 14px; }

  /* 启动界面 */
  #startup-overlay > div {
    width: 90vw !important;
    padding: 16px !important;
  }

  /* 面板标签字体缩小 */
  .panel-tab { font-size: 11px; padding: 6px 2px; }

  /* 滑动条触控区域加大 */
  .scale-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }
  .scale-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  #topbar { font-size: 10px; }
  #topbar > span { font-size: 10px; }
  .panel-tab { font-size: 10px; padding: 4px 1px; }
  #bottombar .action-btn { padding: 5px 8px; font-size: 11px; }
}