/* ===== 左侧工具栏样式 ===== */

/* 工具栏欧美风格 - 已移动到左侧 */
.toolbar {
  display: none; /* 隐藏原来的顶部工具栏 */
}

.tool-btn {
  background: none;
  border: none;
  outline: none;
  font-size: 22px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  color: #222;
  position: relative;
}

.tool-btn.active, .tool-btn:hover {
  background: #e6f0ff;
  color: #0074d9;
  box-shadow: 0 2px 8px rgba(0,116,217,0.08);
}

.divider {
  width: 2px;
  height: 32px;
  background: #eee;
  margin: 0 8px;
  border-radius: 2px;
}

.brush-types {
  display: flex;
  gap: 4px;
}

.brush-type-btn {
  background: none;
  border: none;
  outline: none;
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #444;
  transition: background 0.18s, color 0.18s;
}

.brush-type-btn.active, .brush-type-btn:hover {
  background: #f0f7ff;
  color: #0074d9;
}

.brush-label {
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
  letter-spacing: 0.5px;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafd;
  border-radius: 8px;
  padding: 4px 10px;
}

.slider-label {
  font-size: 13px;
  color: #666;
  margin-right: 2px;
}

input[type=range] {
  width: 80px;
  accent-color: #0074d9;
  margin: 0 4px;
}

.slider-value {
  font-size: 13px;
  color: #222;
  min-width: 18px;
  text-align: right;
}

@media (max-width: 900px) {
  .toolbar {
    top: auto;
    bottom: 12px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    flex-wrap: wrap;
    padding: 8px 6px;
    border-radius: 12px;
    gap: 8px;
  }
  .divider {
    height: 20px;
  }
  .slider-group {
    padding: 2px 4px;
  }
}

/* 左侧工具栏样式 - 欧美紧凑设计 */
.left-toolbar {
  position: fixed;
  left: var(--toolbar-margin);
  top: 150px; /* 70px导航栏 + 80px header */
  width: var(--toolbar-width);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 253, 0.98) 100%);
  border-radius: 16px;
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.6);
  z-index: 998; /* 进一步降低z-index，确保导航栏下拉菜单不被遮挡 */
  padding: 20px 16px 20px 16px;
  max-height: calc(100vh - 170px); /* 150px上方空间 + 20px底部边距 */
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.25) transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: var(--toolbar-width);
  box-sizing: border-box;
}

/* 展开状态下的提示文本 */
.left-toolbar:not(.collapsed)::after {
  content: 'Click ◀ to collapse';
  position: absolute;
  top: -25px;
  right: 45px;
  font-size: 10px;
  color: #3b82f6;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  opacity: 0.8;
  pointer-events: none !important;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  animation: fadeInOut 3s ease-in-out infinite;
  z-index: 1500;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

/* 折叠状态样式 */
.left-toolbar.collapsed {
  width: var(--toolbar-collapsed-width);
  padding: 16px 8px 16px 8px;
  left: var(--toolbar-margin);
  top: 150px; /* 与展开状态保持一致 */
  bottom: auto;
  height: 80px;
  max-height: 80px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 253, 0.95) 100%);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed; /* 保持固定定位 */
  box-sizing: border-box;
}

.left-toolbar.collapsed .tool-section {
  display: none !important;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.left-toolbar .tool-section {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.left-toolbar.collapsed .toolbar-toggle-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  transform: none;
  z-index: 1600;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.left-toolbar.collapsed .toolbar-toggle-btn:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

/* 折叠按钮样式 - 改进为更直观的设计 */
.toolbar-toggle-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: 2px solid white;
  color: white;
  font-size: 12px;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1700 !important;
  font-weight: bold;
  font-family: Arial, sans-serif;
  pointer-events: auto !important;
  user-select: none;
}

.toolbar-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.toolbar-toggle-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.8);
}

.toggle-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-toolbar.collapsed .toggle-icon {
  transform: rotate(180deg);
}

/* 折叠状态下的简化工具 */
.left-toolbar.collapsed::before {
  content: '🖊️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}

/* 折叠状态下的提示文本 */
.left-toolbar.collapsed::after {
  content: 'Click to expand';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #10b981;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  opacity: 0.9;
  pointer-events: none !important;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  z-index: 1500;
}

.left-toolbar:hover {
  box-shadow: 
    0 8px 28px rgba(0, 0, 0, 0.08),
    0 3px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.left-toolbar::-webkit-scrollbar {
  width: 6px;
}

.left-toolbar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.left-toolbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.4) 0%, rgba(59, 130, 246, 0.2) 100%);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.left-toolbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.6) 0%, rgba(59, 130, 246, 0.4) 100%);
}

.tool-section {
  margin-bottom: 20px;
  position: relative;
}

.tool-section:last-child {
  margin-bottom: 0;
}

.tool-section::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.1) 50%, transparent 100%);
}

.tool-section:last-child::after {
  display: none;
}

.tool-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-section-title::before {
  content: '';
  width: 2px;
  height: 12px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 2px;
  flex-shrink: 0;
}

.tool-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-buttons .tool-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tool-buttons .tool-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s;
}

.tool-buttons .tool-btn:hover::before {
  left: 100%;
}

.tool-buttons .tool-btn:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #3b82f6;
  transform: translateX(4px) scale(1.02);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-buttons .tool-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-color: #1d4ed8;
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateX(2px);
}

.action-buttons, .view-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.action-buttons .tool-btn, .view-buttons .tool-btn {
  padding: 10px;
  border-radius: 10px;
  font-size: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.action-buttons .tool-btn:hover, .view-buttons .tool-btn:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #3b82f6;
  transform: scale(1.05);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-buttons .tool-btn.active, .view-buttons .tool-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-color: #1d4ed8;
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.help-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 18px;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
  position: relative;
  overflow: hidden;
}

.help-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.2), transparent);
  transition: left 0.5s;
}

.help-btn:hover::before {
  left: 100%;
}

.help-btn:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  border-color: #d97706;
  transform: scale(1.02);
  box-shadow: 
    0 4px 12px rgba(245, 158, 11, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 修改画笔类型按钮样式 */
.left-toolbar .brush-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* 橡皮边缘类型按钮样式 */
.left-toolbar .eraser-edge-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.left-toolbar .brush-type-btn {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.left-toolbar .brush-type-btn:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #3b82f6;
  transform: scale(1.03);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.left-toolbar .brush-type-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-color: #1d4ed8;
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.left-toolbar .brush-label {
  font-size: 10px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
}

/* 橡皮边缘类型按钮样式 */
.left-toolbar .eraser-edge-btn {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.left-toolbar .eraser-edge-btn:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #3b82f6;
  transform: scale(1.03);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.left-toolbar .eraser-edge-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-color: #1d4ed8;
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.left-toolbar .eraser-edge-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.left-toolbar .edge-label {
  font-size: 10px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
}

/* 修改滑块组样式 */
.left-toolbar .slider-group {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-toolbar .slider-group:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.left-toolbar .slider-label {
  font-size: 11px;
  color: #475569;
  margin-bottom: 8px;
  display: block;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.left-toolbar input[type=range] {
  width: 100%;
  margin: 8px 0;
  height: 5px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.left-toolbar input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  border: 2px solid white;
  transition: all 0.2s;
}

.left-toolbar input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.left-toolbar input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  border: 2px solid white;
  transition: all 0.2s;
}

.left-toolbar input[type=range]::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.left-toolbar .slider-value {
  font-size: 11px;
  color: #1e293b;
  text-align: center;
  display: block;
  margin-top: 4px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.1);
  padding: 3px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
} 