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

/* Lucide Icons 样式 */
[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  display: inline-block;
  vertical-align: middle;
}

.header-btn [data-lucide],
.action-btn-live [data-lucide],
.action-btn-capture [data-lucide],
.action-btn-compare [data-lucide],
.action-btn-viewer [data-lucide],
.action-btn-primary [data-lucide] {
  width: 18px;
  height: 18px;
}

.history-nav-btn [data-lucide] {
  width: 16px;
  height: 16px;
}

.compare-slider-handle svg {
  width: 14px;
  height: 14px;
  color: #9B99ED;
  stroke-width: 2.5;
}

.render-icon[data-lucide] {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

/* 自定义滚动条 - 悬浮式，不影响布局 */
html {
  overflow-y: overlay; /* WebKit: 滚动条悬浮不占空�?*/
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: transparent transparent; /* Firefox: 默认透明 */
}

html:hover {
  scrollbar-color: rgba(0,0,0,0.3) transparent; /* Firefox: 悬停显示 */
}

/* WebKit (Chrome, Safari, Edge) - CEF */
html::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s;
}

html:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
}

html:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.5);
}

/* 所有元素的滚动条样�?*/
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
  min-width: 450px;
  overflow-x: hidden;
}

/* 顶部固定区域（header + tabs�?*/
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 头部 */
.header {
  background: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e8e8e8;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7C7AE6;
  font-weight: 450;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.header-actions {
  display: flex;
  gap: calc(8px * 2 / 3);
}

.header-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 18px;
}

.header-btn:hover { background: #f0f0f0; }

.header-btn svg {
  display: block;
}

/* Tab导航 */
.tabs {
  background: #fff;
  display: flex;
  border-bottom: 1px solid #e8e8e8;
}

.tab {
  flex: 1;
  padding: 14px 8px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  color: #666;
  font-size: 13px;
  text-align: center;
  transition: all 0.2s ease;
}

.tab:hover { color: #7C7AE6; background: #f8f9fa; }
.tab.active { color: #7C7AE6; border-bottom-color: #7C7AE6; font-weight: 500; }

/* 内容�?*/
.content {
  padding: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 各标签页 - 填满视口无滚�?*/
#renderContent,
#panoramaContent,
#editContent,
#modelContent {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#renderContent > .image-preview,
#panoramaContent > .image-preview,
#editContent > .image-preview,
#modelContent > .image-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#renderContent > .image-preview > .image-container,
#panoramaContent > .image-preview > .image-container,
#editContent > .image-preview > .image-container,
#modelContent > .image-preview > .image-container {
  flex: 1;
  height: auto;
  min-height: 150px;
}

#renderContent > .prompt-section,
#panoramaContent > .prompt-section,
#editContent > .prompt-section,
#modelContent > .prompt-section {
  flex-shrink: 0;
  margin-bottom: 0;
}

/* 登录页面 - 扁平式布局 */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px 40px;
  min-height: 100vh;
  background: #f5f7fa;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.login-logo-text {
  font-size: 20px;
  font-weight: 450;
  color: #7C7AE6;
  letter-spacing: 0.5px;
}

.login-logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #888;
}

.login-form {
  width: 100%;
  max-width: 320px;
}

.login-title {
  text-align: center;
  margin-bottom: 24px;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.input-group { margin-bottom: 14px; position: relative; }

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}

.input-group input:focus {
  border-color: #7C7AE6;
}

.input-group input::placeholder {
  color: #999;
}

.forgot-link {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #7C7AE6;
  font-size: 12px;
  text-decoration: none;
}

.forgot-link:hover {
  color: #5B59C2;
}

.btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  opacity: 0.8;
}

.btn-primary {
  background: linear-gradient(180deg, #8B90FF 0%, #6B70F5 100%);
  color: #f8f9ff;
}

.btn-warning {
  background: linear-gradient(180deg, #2A2D37 0%, #1F222B 100%);
  color: #e5e7eb;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  white-space: nowrap;
}
.login-footer > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-footer a {
  color: #666;
  text-decoration: none;
}
.login-footer a:hover {
  color: #7C7AE6;
}

/* 注册按钮突出样式 */
.login-footer a.register-link {
  color: #7C7AE6;
  font-weight: 600;
  font-size: 14px;
  border: 1.5px solid #7C7AE6;
  padding: 4px 14px;
  border-radius: 6px;
  transition: all 0.2s;
}
.login-footer a.register-link:hover {
  background: #7C7AE6;
  color: #fff;
}
.login-footer label {
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.login-footer input[type="checkbox"] {
  cursor: pointer;
  accent-color: #7C7AE6;
}

.web-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: #7C7AE6;
  text-decoration: none;
  font-size: 14px;
}
.web-link:hover {
  color: #5B59C2;
}

/* 登录方式切换 Tab */
.login-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #e8e8e8;
}

.login-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.login-tab:hover {
  color: #7C7AE6;
}

.login-tab.active {
  color: #7C7AE6;
  border-bottom-color: #7C7AE6;
  font-weight: 500;
}

/* 登录表单内容 */
.login-form-content {
  animation: fadeIn 0.2s ease;
}

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

/* 带按钮的输入�?*/
.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
}

.btn-sms {
  flex-shrink: 0;
  padding: 0 12px;
  border: 1px solid #7C7AE6;
  background: transparent;
  color: #7C7AE6;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-sms:hover:not(:disabled) {
  background: #7C7AE6;
  color: #fff;
}

.btn-sms:disabled {
  border-color: #ccc;
  color: #999;
  cursor: not-allowed;
}

/* 语言选择�?*/
.lang-selector {
  position: relative;
  display: inline-block;
}

.lang-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 12px;
  font-weight: 500;
}

.lang-btn:hover {
  background: #f0f0f0;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 120px;
  z-index: 1000;
  display: none;
  margin-top: 4px;
}

.lang-dropdown.show {
  display: block;
}

.lang-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}

.lang-option:hover {
  background: #f5f7fa;
}

.lang-option.active {
  color: #7C7AE6;
  background: #EDEDFC;
}

.lang-option:first-child {
  border-radius: 8px 8px 0 0;
}

.lang-option:last-child {
  border-radius: 0 0 8px 8px;
}

/* 登录页顶部操作栏 */
.login-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-page {
  position: relative;
}

/* 主界�?*/
.main-page { display: none; }
.main-page.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.login-page.hidden { display: none; }

.image-preview {
  background: #fff;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.image-container {
  width: 100%;
  /* 动态高度：100vh - header(57px) - tabs(49px) - padding(32px) - prompt-section(�?80px) - margins(32px) */
  height: calc(100vh - 450px);
  min-height: 200px;
  min-width: 300px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  position: relative;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* macOS 上浅色模式偏白，单独增强上传区层次（不影�?Windows�?*/
body.platform-mac:not(.dark-mode) .image-container {
  background: #e6e6e6;
  box-shadow: inset 0 0 0 1px #d7d7d7;
}

body.platform-mac:not(.dark-mode) .image-container.drag-over {
  background: #e5e5eb;
}

/* Windows 浅色模式轻微加深灰底，增强层次但不改变整体风�?*/
body.platform-win:not(.dark-mode) .image-container {
  background: #ebebeb;
  box-shadow: inset 0 0 0 1px #dcdcdc;
}

body.platform-win:not(.dark-mode) .image-container.drag-over {
  background: #e8e8ee;
}

/* 传图窗口去描边（输入视图�?*/
#suViewContainer,
#renderResultContainer,
#panoramaPreviewContainer,
#editSingleContainer,
#editMultiContainer,
#modelRefContainer {
  box-shadow: none;
}

/* panorama / 3D model 顶部统一直角，避免出现“矩�?倒角”叠�?*/
#panoramaPreviewContainer,
#panoramaRenderContainer,
#modelRefContainer,
#modelResultContainer {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
#panoramaPreviewContainer {
  flex-direction: column;
}

.image-container.hidden {
  display: none;
}

.image-actions.hidden {
  display: none;
}

/* 上传图片操作按钮覆盖�?*/
.uploaded-image-actions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 16px;
  z-index: 10;
}

.uploaded-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.uploaded-action-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.uploaded-action-btn [data-lucide] {
  width: 20px;
  height: 20px;
}

.center-action-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.center-action-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.center-action-btn [data-lucide] {
  width: 13px;
  height: 13px;
}

/* Edit 输出悬浮操作按钮�?*/
.edit-output-hover-actions {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
#editOutputContainer:hover .edit-output-hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.preview-hint {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: #999;
  font-size: 14px;
}

.preview-hint span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hint-icon {
  width: 16px;
  height: 16px;
  color: #666;
}

.dark-mode .hint-icon {
  color: #8B9DC3;
}

.tutorial-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 16px;
  border: 1px solid #c5c5c5;
  border-radius: 16px;
  background: rgba(255,255,255,0.85);
  color: #666;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.tutorial-video-btn:hover {
  background: #7C7AE6;
  border-color: #7C7AE6;
  color: #fff;
}
.dark-mode .tutorial-video-btn {
  background: rgba(30,30,60,0.7);
  border-color: #444;
  color: #8B9DC3;
}
.dark-mode .tutorial-video-btn:hover {
  background: #7C7AE6;
  border-color: #7C7AE6;
  color: #fff;
}

.image-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.image-actions button {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.9);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-actions button:hover {
  background: #fff;
  transform: scale(1.05);
}

.image-actions .action-btn-primary {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
}

.image-actions .action-btn-primary:hover {
  background: linear-gradient(135deg, #5B59C2, #1565C0);
  transform: scale(1.08);
}

.image-actions .action-btn-live,
.image-actions .action-btn-viewer {
  background: rgba(255,255,255,0.9);
  position: relative;
}

.image-actions .action-btn-live.active,
.image-actions .action-btn-viewer.active {
  background: linear-gradient(135deg, #FF9800, #F57C00);
  color: #fff;
  animation: pulse 2s infinite;
}

/* 激活状态下显示 cancel 提示 */
.image-actions .action-btn-live.active::after,
.image-actions .action-btn-viewer.active::after {
  content: attr(data-cancel-text);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 3px;
  font-size: 10px;
  color: #F57C00;
  white-space: nowrap;
  pointer-events: none;
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
}

.image-actions .action-btn-viewer:hover {
  transform: scale(1.08);
}

/* 上传图片下拉菜单 */
.upload-dropdown-wrapper {
  position: relative;
}

.image-actions .action-btn-upload {
  background: rgba(255,255,255,0.9);
}

.image-actions .action-btn-upload:hover {
  background: #fff;
}

.upload-dropdown {
  position: fixed;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s ease;
}

.upload-dropdown.show {
  display: block;
}

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

.upload-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background 0.15s;
}

.upload-dropdown-item:hover {
  background: #f5f7fa;
}

.upload-dropdown-item:first-child {
  border-radius: 10px 10px 0 0;
}

.upload-dropdown-item:last-child {
  border-radius: 0 0 10px 10px;
}

.upload-dropdown-item i,
.upload-dropdown-item [data-lucide] {
  width: 18px;
  height: 18px;
  color: #7C7AE6;
  flex-shrink: 0;
}

/* 暗黑模式 - 上传下拉菜单 */
.dark-mode .upload-dropdown {
  background: #1e2a4a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dark-mode .upload-dropdown-item {
  color: #e0e0e0;
}

.dark-mode .upload-dropdown-item:hover {
  background: #2a3a5a;
}

.dark-mode .upload-dropdown-item i,
.dark-mode .upload-dropdown-item [data-lucide] {
  color: #9B99ED;
}

.dark-mode .image-actions .action-btn-upload {
  background: rgba(30, 30, 60, 0.9);
  color: #ccc;
}

.dark-mode .image-actions .action-btn-upload:hover {
  background: #2a2a4a;
}

/* 拖拽上传状�?*/
.image-container.drag-over {
  background: #EDEDFC;
  border: none;
}

.dark-mode .image-container.drag-over {
  background: #2a2a55;
  border: none;
}

/* Pannellum 容器样式 */
#panoramaViewer,
#panoramaRenderViewer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

#panoramaViewer .pnlm-container,
#panoramaRenderViewer .pnlm-container {
  background: #1a1a2e;
}

/* Pannellum 控制按钮移到左下�?*/
#panoramaViewer .pnlm-controls-container,
#panoramaRenderViewer .pnlm-controls-container {
  top: auto;
  bottom: 4px;
  left: 4px;
}

/* 底部切换标签 */
.preview-tabs {
  display: flex;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(to top, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.05);
}

.preview-tab {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
}

.preview-tab::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7C7AE6, #9B99ED);
  border-radius: 1px;
  transition: width 0.3s ease;
}

.preview-tab:hover {
  color: #666;
}

.preview-tab.active {
  color: #7C7AE6;
  font-weight: 500;
}

.preview-tab.active::before {
  width: 40px;
}

/* 分隔�?*/
.preview-tabs::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 24px;
  background: rgba(0,0,0,0.08);
}

/* 裁剪框覆盖层 */
.crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.crop-mask {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
}

.crop-mask-top {
  top: 0;
  left: 0;
  right: 0;
}

.crop-mask-bottom {
  bottom: 0;
  left: 0;
  right: 0;
}

.crop-mask-left {
  left: 0;
}

.crop-mask-right {
  right: 0;
}

.crop-box {
  position: absolute;
  pointer-events: auto;
  cursor: move;
}

.crop-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.crop-border::before,
.crop-border::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.5);
}

/* 三等分网格线 */
.crop-border::before {
  top: 33.33%;
  left: 0;
  right: 0;
  height: 1px;
  box-shadow: 0 calc(33.33% * 2 - 1px) 0 0 rgba(255, 255, 255, 0.5);
}

.crop-border::after {
  left: 33.33%;
  top: 0;
  bottom: 0;
  width: 1px;
  box-shadow: calc(33.33% * 2 - 1px) 0 0 0 rgba(255, 255, 255, 0.5);
}

/* 比例选择�?*/
.ratio-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.9));
  border-top: 1px solid rgba(0,0,0,0.05);
}

.ratio-btn {
  width: 40px;
  height: 32px;
  border: 1.5px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #999;
}

.ratio-btn svg {
  width: 20px;
  height: 20px;
}

.ratio-btn:hover {
  border-color: #7C7AE6;
  color: #7C7AE6;
}

.ratio-btn.active {
  border-color: #7C7AE6;
  background: #7C7AE6;
  color: #fff;
}

/* 历史记录选择�?*/
.history-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.9));
  border-top: 1px solid rgba(0,0,0,0.05);
}

.history-nav-btn {
  width: 28px;
  height: 36px;
  border: none;
  background: #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.history-nav-btn:hover {
  background: #e0e0e0;
  color: #333;
}

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

.history-thumbnails {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.history-thumbnails::-webkit-scrollbar {
  display: none;
}

.history-empty {
  width: 100%;
  text-align: center;
  color: #999;
  font-size: 12px;
  padding: 8px 0;
}

.history-thumb {
  width: 48px;
  height: 36px;
  border-radius: 4px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.history-thumb:hover {
  border-color: #90CAF9;
}

.history-thumb.active {
  border-color: #7C7AE6;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 质量选择�?*/
.quality-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(255,255,255,0.9));
  border-top: 1px solid rgba(0,0,0,0.05);
}

.quality-btn {
  padding: 6px 20px;
  border: 1.5px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.quality-btn:hover {
  border-color: #7C7AE6;
  color: #7C7AE6;
}

.quality-btn.active {
  border-color: #7C7AE6;
  background: #7C7AE6;
  color: #fff;
}

/* 3D模型标签样式 */
.upload-dropzone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f0f0f0;
  box-sizing: border-box;
}

body.platform-mac:not(.dark-mode) .upload-dropzone {
  background: #e6e6e6;
}

body.platform-win:not(.dark-mode) .upload-dropzone {
  background: #ebebeb;
}

.upload-dropzone:hover {
  background: #e8e8e8;
}

body.platform-mac:not(.dark-mode) .upload-dropzone:hover {
  background: #e0e0e0;
}

body.platform-win:not(.dark-mode) .upload-dropzone:hover {
  background: #e4e4e4;
}

.upload-dropzone.dragover {
  background: #EDEDFC;
}

body.platform-mac:not(.dark-mode) .upload-dropzone.dragover {
  background: #e5e5eb;
}

body.platform-win:not(.dark-mode) .upload-dropzone.dragover {
  background: #e8e8ee;
}

.upload-dropzone.hidden {
  display: none;
}

.upload-icon {
  margin-bottom: 12px;
  opacity: 0.6;
  color: #999;
}

.upload-icon svg {
  width: 48px;
  height: 48px;
}

.upload-text {
  font-size: 16px;
  color: #666;
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 13px;
  color: #999;
}

#modelRefContainer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#modelResultContainer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 截取视图按钮样式 */
.action-btn-capture.active {
  border: 2px solid #7C7AE6;
  background: rgba(255,255,255,0.9);
}

.action-btn-capture.active [data-lucide] {
  color: #7C7AE6;
}

/* 对比按钮样式 */
.action-btn-compare {
  background: rgba(255,255,255,0.9);
}

.action-btn-compare.active {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
}

/* 多图切换按钮 */
.result-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.result-nav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.result-nav-btn [data-lucide] {
  width: 20px;
  height: 20px;
}

.result-nav-prev {
  left: 12px;
}

.result-nav-next {
  right: 12px;
}

.result-indicator {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  z-index: 15;
}

/* 对比滑块覆盖�?*/
.compare-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

.compare-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}

.compare-before img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 100%;
  cursor: ew-resize;
  z-index: 15;
  transform: translateX(-50%);
  pointer-events: auto;
}

.compare-slider-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: #9B99ED;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(155,153,237,0.5);
}

.compare-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: #fff;
  border: 2.5px solid #9B99ED;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 2px 8px rgba(155,153,237,0.4);
  color: #9B99ED;
  font-size: 10px;
}

.compare-slider-handle:hover {
  background: #f8f7ff;
  box-shadow: 0 2px 12px rgba(155,153,237,0.6);
}

.prompt-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  overflow: visible;
}

.prompt-input-wrapper {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s;
}

.prompt-input-wrapper:focus-within {
  border-color: #7C7AE6;
}

.prompt-input {
  width: 100%;
  min-height: 80px;
  border: none;
  padding: 12px 12px 4px;
  font-size: 14px;
  display: block;
  background: transparent;
  resize: none;
  outline: none;
}

.prompt-input:disabled {
  opacity: 1;
  cursor: not-allowed;
  -webkit-text-fill-color: inherit;
}

.prompt-input-wrapper.is-disabled {
  background: #f3f4f7;
  border-color: #e3e4ea;
}

.prompt-input-wrapper.is-disabled .prompt-input {
  color: #8a8a95;
}

.prompt-input-wrapper.is-disabled .prompt-input::placeholder {
  color: #8a8a95;
}

/* 无参考图行的标签页，增加高度补偿 */
#panoramaPromptInput,
#editPromptInput,
#modelPromptInput {
  min-height: 118px;
}

/* 参考图上传行（输入框内底部�?*/
.ref-image-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 8px;
}

.ref-image-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px dashed #bbb;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.2s, color 0.2s;
}

.ref-image-add-btn:hover {
  border-color: #7C7AE6;
  color: #7C7AE6;
}

.ref-image-label {
  font-size: 12px;
  color: #999;
  cursor: pointer;
  user-select: none;
}

.ref-image-label:hover {
  color: #7C7AE6;
}

.ref-image-thumb {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  margin-left: 4px;
}

.ref-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ref-image-remove {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ref-image-remove:hover {
  background: rgba(220,50,50,0.8);
}

/* 底部操作�?*/
.prompt-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 8px;
}

.prompt-actions-left {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
}

.prompt-actions-right {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* 自定义上拉选择器样�?*/
.custom-select {
  position: relative;
  display: inline-block;
}

.custom-select-trigger {
  padding: 6px 28px 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  user-select: none;
  position: relative;
}

.custom-select-trigger::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 0.2s;
}

.custom-select.open .custom-select-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger:hover {
  border-color: #c0c0c0;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus {
  border-color: #7C7AE6;
  box-shadow: 0 0 0 2px rgba(124, 122, 230, 0.15);
}

/* 模型/引擎选择器始终显示主题色描边 */
.model-select + .custom-select .custom-select-trigger {
  border-color: #7C7AE6;
  box-shadow: 0 0 0 2px rgba(124, 122, 230, 0.15);
}

.custom-select-options {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: background 0.15s;
  white-space: nowrap;
}

.custom-select-option:hover {
  background: #f5f7fa;
}

.custom-select-option.selected {
  background: #7C7AE6;
  color: #fff;
}

.custom-select-option.selected:hover {
  background: #6B69D6;
}

/* 兼容旧的原生 select（隐藏） */
.model-select, .count-select, .resolution-select {
  display: none;
}

.render-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.render-btn-text {
  /* 渲染按钮文字 */
}

.render-btn-score {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ffe066;
}

.render-btn:hover {
  background: linear-gradient(135deg, #5B59C2, #1565C0);
  transform: translateY(-1px);
}

.render-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* 历史记录 */
.history-page {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.history-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px;
  margin-bottom: 12px;
}

.history-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  color: #888;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 500;
}

.history-tab:hover {
  border-color: #7C7AE6;
  color: #7C7AE6;
}

.history-tab.active {
  background: #7C7AE6;
  border-color: #7C7AE6;
  color: #fff;
}

.history-tab svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.history-content {
  flex: 1;
  overflow-y: overlay;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.history-content:hover {
  scrollbar-color: rgba(0,0,0,0.3) transparent;
}

.history-content::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}

.history-content::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.history-content:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
}

.history-content:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.5);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 12px;
  gap: 12px;
}

/* Legacy WebView fallback for flex-gap (SU2020) */
body.no-flex-gap .header-actions > * + * {
  margin-left: calc(8px * 2 / 3);
}

body.no-flex-gap .history-tabs > * + * {
  margin-left: 8px;
}

body.no-flex-gap .history-tab > * + * {
  margin-left: 6px;
}

body.no-flex-gap .history-selector > * + * {
  margin-left: 6px;
}

body.no-flex-gap .history-thumbnails > * + * {
  margin-left: 6px;
}

body.no-flex-gap .prompt-actions-left > * + * {
  margin-left: 6px;
}

body.no-flex-gap .prompt-actions-right > * + * {
  margin-left: 6px;
}

body.no-flex-gap .uploaded-image-actions > * + * {
  margin-left: 16px;
}

body.no-flex-gap .image-actions > * + * {
  margin-left: 8px;
}

.history-item {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.history-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-item .item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity 0.2s;
}

.history-item:hover .item-overlay {
  opacity: 1;
}

.history-item .item-date {
  color: #fff;
  font-size: 11px;
}

/* 历史记录空状�?*/
.history-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.history-empty-state .empty-icon {
  color: #d9d9d9;
  margin-bottom: 16px;
}

.history-empty-state .empty-text {
  font-size: 16px;
  color: #999;
  margin-bottom: 8px;
}

.history-empty-state .empty-hint {
  font-size: 13px;
  color: #bbb;
}

/* 状态提�?*/
.status-bar {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 8px;
  display: none;
  z-index: 1000;
  text-align: center;
  max-width: 80%;
}

.status-bar.show { display: block; }

/* 按钮抖动动画（错误反馈） */
@keyframes btn-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.btn-shake {
  animation: btn-shake 0.4s ease-in-out;
}

/* 加载动画 */
.loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading.show { display: flex; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: #7C7AE6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 预览区域局�?Loading */
.preview-loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
}

.preview-loading.show {
  display: flex;
}

.preview-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.preview-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.preview-loading-text {
  color: #fff;
  font-size: 13px;
}

/* 模型导入 Loading 覆盖层 */
.model-import-loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 15;
  flex-direction: column;
}

.model-import-loading.show {
  display: flex;
}

/* 占位内容 */
.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.placeholder-content h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 8px;
}

.placeholder-content p {
  color: #666;
  font-size: 14px;
}

/* 全景图进度条样式 */
.panorama-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 12px 16px;
  z-index: 10;
}

.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7C7AE6, #9B99ED);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  color: #fff;
  font-size: 12px;
}

/* 渲染进度条（�?loading overlay 底部�?*/
.render-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 10px 16px;
  z-index: 11;
}

/* 主题切换按钮 */
.theme-toggle-btn {
  font-size: 16px !important;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
  transform: rotate(180deg);
}

/* ==================== 夜间模式 ==================== */
body.dark-mode {
  background: #1a1a2e;
  color: #e0e0e0;
}

.dark-mode .header {
  background: #16213e;
  border-bottom-color: #2a2a4a;
}

.dark-mode .logo {
  color: #9B99ED;
}

.dark-mode .header-btn {
  color: #aaa;
}

.dark-mode .header-btn:hover {
  background: #2a2a4a;
}

.dark-mode .lang-btn {
  color: #aaa;
}

.dark-mode .lang-btn:hover {
  background: #2a2a4a;
}

.dark-mode .lang-dropdown {
  background: #16213e;
  border-color: #2a2a4a;
}

.dark-mode .lang-option {
  color: #e0e0e0;
}

.dark-mode .lang-option:hover {
  background: #2a2a4a;
}

.dark-mode .lang-option.active {
  color: #9B99ED;
  background: #1a3a5c;
}

.dark-mode .tabs {
  background: #16213e;
  border-bottom-color: #2a2a4a;
}

.dark-mode .tab {
  color: #888;
}

.dark-mode .tab:hover {
  color: #9B99ED;
  background: #1a2a4a;
}

.dark-mode .tab.active {
  color: #9B99ED;
  border-bottom-color: #9B99ED;
}

.dark-mode .image-preview {
  background: #16213e;
}

.dark-mode .image-container {
  background: #0f0f23;
}

.dark-mode .image-actions button {
  background: rgba(30, 30, 60, 0.9);
  color: #ccc;
}

.dark-mode .image-actions button:hover {
  background: #2a2a4a;
}

.dark-mode .image-actions .action-btn-live {
  background: rgba(30, 30, 60, 0.9);
}

.dark-mode .preview-tabs {
  background: linear-gradient(to top, rgba(22, 33, 62, 0.95), rgba(22, 33, 62, 0.8));
  border-top-color: rgba(255,255,255,0.05);
}

.dark-mode .preview-tab {
  color: #666;
}

.dark-mode .preview-tab:hover {
  color: #aaa;
}

.dark-mode .preview-tab.active {
  color: #9B99ED;
}

/* 暗黑模式 - 比例选择�?*/
.dark-mode .ratio-selector {
  background: linear-gradient(to top, rgba(22, 33, 62, 0.98), rgba(22, 33, 62, 0.9));
  border-top-color: rgba(255,255,255,0.05);
}

.dark-mode .ratio-btn {
  border-color: #2a2a4a;
  background: #1e1e3a;
  color: #888;
}

.dark-mode .ratio-btn:hover {
  border-color: #9B99ED;
  color: #9B99ED;
}

.dark-mode .ratio-btn.active {
  border-color: #9B99ED;
  background: #9B99ED;
  color: #fff;
}

/* 暗黑模式 - 多图切换按钮 */
.dark-mode .result-nav-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.dark-mode .result-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dark-mode .result-indicator {
  background: rgba(255, 255, 255, 0.2);
}

/* 暗黑模式 - 历史记录选择�?*/
.dark-mode .history-selector {
  background: linear-gradient(to top, rgba(22, 33, 62, 0.98), rgba(22, 33, 62, 0.9));
  border-top-color: rgba(255,255,255,0.05);
}

.dark-mode .history-nav-btn {
  background: #2a2a4a;
  color: #888;
}

.dark-mode .history-nav-btn:hover {
  background: #3a3a5a;
  color: #aaa;
}

.dark-mode .history-empty {
  color: #666;
}

.dark-mode .history-thumb:hover {
  border-color: #42A5F5;
}

.dark-mode .history-thumb.active {
  border-color: #9B99ED;
}

/* 暗黑模式 - 质量选择�?*/
.dark-mode .quality-selector {
  background: linear-gradient(to top, rgba(22, 33, 62, 0.98), rgba(22, 33, 62, 0.9));
  border-top-color: rgba(255,255,255,0.05);
}

.dark-mode .quality-btn {
  border-color: #2a2a4a;
  background: #1e1e3a;
  color: #888;
}

.dark-mode .quality-btn:hover {
  border-color: #9B99ED;
  color: #9B99ED;
}

.dark-mode .quality-btn.active {
  border-color: #9B99ED;
  background: #9B99ED;
  color: #fff;
}

/* 暗黑模式 - 截取视图按钮 */
.dark-mode .action-btn-capture.active {
  border-color: #9B99ED;
  background: rgba(30, 30, 60, 0.9);
}

.dark-mode .action-btn-capture.active [data-lucide] {
  color: #9B99ED;
}

/* 暗黑模式 - 对比按钮和滑�?*/
.dark-mode .action-btn-compare {
  background: rgba(30, 30, 60, 0.9);
}

.dark-mode .action-btn-compare.active {
  background: linear-gradient(135deg, #9B99ED, #42A5F5);
  color: #fff;
}

.dark-mode .compare-slider-handle {
  background: #1e1e3a;
  border-color: #9B99ED;
  color: #9B99ED;
}

.dark-mode .compare-slider-handle:hover {
  background: #2a2a4a;
}

/* 暗黑模式 - 3D模型标签 */
.dark-mode .upload-dropzone {
  background: #252545;
}

.dark-mode .upload-dropzone:hover {
  background: #2a2a55;
}

.dark-mode .upload-dropzone.dragover {
  background: #2e2e5e;
}

.dark-mode .upload-text {
  color: #aaa;
}

.dark-mode .upload-hint {
  color: #666;
}

.dark-mode #modelResultContainer {
  background: linear-gradient(135deg, #1a1a3e 0%, #2a2a4a 100%);
}

.dark-mode .upload-icon {
  color: #666;
}

/* 暗黑模式 - 历史记录 */
.dark-mode .history-tabs {
  background: transparent;
}

.dark-mode .history-tab {
  border-color: #2a2a4a;
  background: #1e1e3a;
  color: #ccc;
}

.dark-mode .history-tab:hover {
  border-color: #9B99ED;
  color: #9B99ED;
}

.dark-mode .history-tab.active {
  background: #9B99ED;
  border-color: #9B99ED;
  color: #fff;
}

.dark-mode .history-item {
  background: #1e2a4a;
}

.dark-mode .history-empty-state .empty-icon {
  color: #2a3a5a;
}

.dark-mode .history-empty-state .empty-text {
  color: #666;
}

.dark-mode .history-empty-state .empty-hint {
  color: #555;
}

.dark-mode .prompt-section {
  background: #16213e;
}

.dark-mode .prompt-input-wrapper {
  border-color: #2a2a4a;
  background: #0f0f23;
}

.dark-mode .prompt-input-wrapper:focus-within {
  border-color: #9B99ED;
}

.dark-mode .prompt-input {
  background: transparent;
  color: #e0e0e0;
}

.dark-mode .prompt-input::placeholder {
  color: #666;
}

.dark-mode .prompt-input-wrapper.is-disabled {
  background: #101328;
  border-color: #2a2a4a;
}

.dark-mode .prompt-input-wrapper.is-disabled .prompt-input {
  color: #777a8f;
}

.dark-mode .prompt-input-wrapper.is-disabled .prompt-input::placeholder {
  color: #777a8f;
}

.dark-mode .ref-image-add-btn {
  border-color: #444;
  color: #666;
}

.dark-mode .ref-image-add-btn:hover {
  border-color: #9B99ED;
  color: #9B99ED;
}

.dark-mode .ref-image-label {
  color: #666;
}

.dark-mode .ref-image-label:hover {
  color: #9B99ED;
}

/* 暗黑模式 - 自定义上拉选择�?*/
.dark-mode .custom-select-trigger {
  background: #0f0f23;
  border-color: #2a2a4a;
  color: #ccc;
}

.dark-mode .custom-select-trigger::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E");
}

.dark-mode .custom-select-trigger:hover {
  border-color: #3a3a5a;
}

.dark-mode .custom-select.open .custom-select-trigger,
.dark-mode .custom-select-trigger:focus {
  border-color: #9B99ED;
  box-shadow: 0 0 0 2px rgba(155, 153, 237, 0.15);
}

.dark-mode .model-select + .custom-select .custom-select-trigger {
  border-color: #9B99ED;
  box-shadow: 0 0 0 2px rgba(155, 153, 237, 0.15);
}

.dark-mode .custom-select-options {
  background: #1a1a2e;
  border-color: #2a2a4a;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .custom-select-option {
  color: #ccc;
}

.dark-mode .custom-select-option:hover {
  background: #2a2a4a;
}

.dark-mode .custom-select-option.selected {
  background: #9B99ED;
  color: #fff;
}

.dark-mode .custom-select-option.selected:hover {
  background: #8B89DD;
}

.dark-mode .placeholder-content {
  color: #888;
}

.dark-mode .placeholder-content h3 {
  color: #e0e0e0;
}

.dark-mode .status-bar {
  background: rgba(100, 181, 246, 0.9);
}

/* 登录页夜间模�?*/
.dark-mode .login-page {
  background: #1a1a2e;
}

.dark-mode .login-logo-text {
  color: #9B99ED;
}

.dark-mode .login-logo-text span {
  color: #888;
}

.dark-mode .login-title {
  color: #e0e0e0;
}

.dark-mode .input-group input {
  background: #0f0f23;
  border-color: #2a2a4a;
  color: #e0e0e0;
}

.dark-mode .input-group input:focus {
  border-color: #9B99ED;
}

.dark-mode .input-group input::placeholder {
  color: #666;
}

.dark-mode .forgot-link {
  color: #9B99ED;
}

.dark-mode .login-footer a,
.dark-mode .login-footer label {
  color: #888;
}

.dark-mode .login-footer a:hover {
  color: #9B99ED;
}

.dark-mode .login-footer a.register-link {
  color: #9B99ED;
  border-color: #9B99ED;
}
.dark-mode .login-footer a.register-link:hover {
  background: #9B99ED;
  color: #fff;
}

.dark-mode .web-link {
  color: #9B99ED;
}

/* 夜间模式 - 交互式预览按�?*/
.dark-mode .image-actions .action-btn-viewer {
  background: rgba(30, 30, 60, 0.9);
}

.dark-mode .image-actions .action-btn-viewer:hover {
  background: #2a2a4a;
}

.dark-mode .image-actions .action-btn-viewer.active {
  background: linear-gradient(135deg, #FF9800, #F57C00);
  color: #fff;
}

/* 夜间模式 - Pannellum 容器 */
.dark-mode #panoramaViewer .pnlm-container,
.dark-mode #panoramaRenderViewer .pnlm-container {
  background: #0f0f23;
}

.dark-mode #panoramaViewer .pnlm-controls,
.dark-mode #panoramaRenderViewer .pnlm-controls {
  background-color: rgba(30, 30, 60, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.dark-mode #panoramaViewer .pnlm-control:hover,
.dark-mode #panoramaRenderViewer .pnlm-control:hover {
  background-color: rgba(50, 50, 80, 0.9);
}

/* 夜间模式 - 渲染按钮 */
.dark-mode .render-btn {
  background: linear-gradient(135deg, #9B99ED, #7C7AE6);
}
.dark-mode .render-btn:hover {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
}
.dark-mode .render-btn:disabled {
  background: #3a3a5a;
}

/* 夜间模式 - 图片操作按钮 */
.dark-mode .image-actions button {
  background: rgba(30, 30, 60, 0.9);
  color: #ccc;
}
.dark-mode .image-actions button:hover {
  background: rgba(50, 50, 80, 0.95);
  color: #fff;
}
.dark-mode .image-actions .action-btn-primary {
  background: linear-gradient(135deg, #9B99ED, #7C7AE6);
  color: #fff;
}
.dark-mode .image-actions .action-btn-primary:hover {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
}

/* 夜间模式 - 悬浮操作按钮 */
.dark-mode .uploaded-action-btn {
  background: rgba(20, 20, 40, 0.7);
  border-color: rgba(155, 153, 237, 0.3);
}
.dark-mode .uploaded-action-btn:hover {
  background: rgba(30, 30, 60, 0.9);
  border-color: rgba(155, 153, 237, 0.5);
}
.dark-mode .center-action-btn {
  background: rgba(20, 20, 40, 0.6);
  border-color: rgba(155, 153, 237, 0.2);
}
.dark-mode .center-action-btn:hover {
  background: rgba(30, 30, 60, 0.8);
  border-color: rgba(155, 153, 237, 0.4);
}
.dark-mode .edit-output-hover-actions .center-action-btn {
  background: rgba(20, 20, 40, 0.6);
}

/* ==================== 更新提示 ==================== */
.update-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.update-notification.required {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
}

.update-notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.update-notification-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.update-notification-notes {
  font-size: 12px;
  opacity: 0.9;
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-notification-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.update-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.update-btn-primary {
  background: #fff;
  color: #6A68D5;
}

.update-btn-primary:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}

.update-notification.required .update-btn-primary {
  color: #6A68D5;
}

.update-btn-secondary {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.update-btn-secondary:hover {
  background: rgba(255,255,255,0.3);
}

/* 夜间模式 - 更新提示 */
.dark-mode .update-notification {
  background: linear-gradient(135deg, #6A68D5, #4D4BB0);
}

.dark-mode .update-notification.required {
  background: linear-gradient(135deg, #6A68D5, #4D4BB0);
}

.dark-mode .update-btn-primary {
  background: rgba(255,255,255,0.95);
  color: #6A68D5;
}

.dark-mode .update-notification.required .update-btn-primary {
  color: #6A68D5;
}

/* ==================== 更新模态对话框 ==================== */
.update-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: umFadeIn 0.3s ease;
}

.update-modal {
  background: #fff;
  border-radius: 6px;
  width: 520px;
  min-height: 520px;
  max-width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: umScaleIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

.update-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 16px;
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
}

.update-modal.required .update-modal-header {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
}

.update-modal-icon {
  font-size: 28px;
  line-height: 1;
}

.update-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.update-modal-close {
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.update-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.update-modal-body {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.update-modal-versions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #555;
}

.update-modal-arrow {
  font-size: 18px;
  color: #999;
}

.update-modal-new-version {
  font-weight: 700;
  color: #7C7AE6;
  font-size: 16px;
}

.update-modal.required .update-modal-new-version {
  color: #7C7AE6;
}

.update-modal-features {
  margin-top: 12px;
}

.update-modal-features h4,
.update-modal-highlights h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.update-modal-highlights {
  margin-top: 12px;
  border: 1px solid #E6E6F7;
  background: #F8F8FD;
  border-radius: 4px;
  padding: 12px;
  min-height: 160px;
}

.update-modal-highlights-content {
  max-height: 220px;
  overflow-y: auto;
}

.update-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.update-features-list li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

/* Override bullet rendering to avoid encoding artifacts */
.update-features-list li::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7C7AE6;
}

.update-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px 24px;
  margin-top: auto;
}

.update-modal-footer .update-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.update-modal-footer .update-btn-primary {
  background: #7C7AE6;
  color: #fff;
}

.update-modal-footer .update-btn-primary:hover {
  background: #6A68D5;
}

.update-modal.required .update-modal-footer .update-btn-primary {
  background: #7C7AE6;
}

.update-modal.required .update-modal-footer .update-btn-primary:hover {
  background: #6A68D5;
}

.update-modal-footer .update-btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.update-modal-footer .update-btn-secondary:hover {
  background: #e8e8e8;
}

.update-modal-footer .update-btn-tertiary {
  flex-basis: 100%;
  background: transparent;
  color: #999;
  font-size: 12px;
  padding: 6px;
}

.update-modal-footer .update-btn-tertiary:hover {
  color: #666;
}

/* 模态对话框动画 */
@keyframes umFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes umScaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes umFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes umScaleOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.9); opacity: 0; }
}

/* 暗黑模式 - 更新模态对话框 */
.dark-mode .update-modal {
  background: #2a2a2a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.dark-mode .update-modal-body {
  color: #ddd;
}

.dark-mode .update-modal-versions {
  color: #bbb;
}

.dark-mode .update-modal-features h4 {
  color: #ddd;
}

.dark-mode .update-modal-highlights {
  border-color: #4A4A6A;
  background: #33334C;
}

.dark-mode .update-features-list li {
  color: #bbb;
}

.dark-mode .update-modal-footer .update-btn-secondary {
  background: #3a3a3a;
  color: #ddd;
}

.dark-mode .update-modal-footer .update-btn-secondary:hover {
  background: #444;
}

.dark-mode .update-modal-footer .update-btn-tertiary {
  color: #888;
}

.dark-mode .update-modal-footer .update-btn-tertiary:hover {
  color: #aaa;
}

/* Web环境插件提示样式 */
.web-only-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  text-align: center;
  color: #666;
  padding: 20px;
}

.web-only-notice .notice-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.web-only-notice .notice-title {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.web-only-notice .notice-desc {
  font-size: 14px;
  color: #888;
  margin-bottom: 24px;
  max-width: 280px;
  line-height: 1.5;
}

.web-only-notice .notice-btn {
  padding: 10px 24px;
  background: #7C7AE6;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease;
}

.web-only-notice .notice-btn:hover {
  background: #6B69D6;
}

/* 暗黑模式 - Web环境提示 */
.dark-mode .web-only-notice .notice-title {
  color: #e0e0e0;
}

.dark-mode .web-only-notice .notice-desc {
  color: #aaa;
}

.dark-mode .web-only-notice .notice-btn {
  background: #9B99ED;
}

.dark-mode .web-only-notice .notice-btn:hover {
  background: #8886E0;
}

/* ==================== 本地历史网格样式 ==================== */
.history-grid-item {
  position: relative;
  aspect-ratio: 3/2;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #f0f0f0;
}

.history-grid-item:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.history-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 11px;
}

.history-item-time {
  opacity: 0.9;
}

/* 暗黑模式 - 本地历史网格 */
.dark-mode .history-grid-item {
  background: #1e2a4a;
}

.dark-mode .history-grid-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 加载更多按钮 */
.history-load-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.history-load-more button {
  padding: 8px 32px;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #666;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.history-load-more button:hover {
  background: #7C7AE6;
  color: #fff;
  border-color: #7C7AE6;
}

.dark-mode .history-load-more button {
  background: #1e2a4a;
  border-color: #3a4a6a;
  color: #aaa;
}

.dark-mode .history-load-more button:hover {
  background: #9B99ED;
  color: #fff;
  border-color: #9B99ED;
}

/* 3D模型历史卡片 */
.model-history-item {
  position: relative;
}

.model-history-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(124, 122, 230, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
}

.model-history-download {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.model-history-item:hover .model-history-download {
  opacity: 1;
}

.model-history-download:hover {
  background: rgba(124, 122, 230, 0.9);
}

/* ==================== 全屏全景交互查看器 ==================== */
.fullscreen-panorama-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.fullscreen-panorama-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ==================== 全屏查看器样式 ==================== */
.fullscreen-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: #fff;
}

.viewer-title {
  font-size: 14px;
  font-weight: 500;
}

.viewer-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.viewer-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0 60px;
}

.viewer-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.viewer-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.viewer-prev {
  left: 16px;
}

.viewer-next {
  right: 16px;
}

.viewer-info {
  padding: 8px 16px 4px;
  color: #999;
  font-size: 12px;
  text-align: center;
}

.viewer-prompt {
  padding: 4px 32px 16px;
  color: #ccc;
  font-size: 13px;
  text-align: center;
  max-height: 60px;
  overflow-y: auto;
  line-height: 1.4;
}

.viewer-prompt:empty {
  display: none;
}

/* ==================== 用户中心全屏弹窗 ==================== */
.user-center-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  animation: ucFadeIn 0.3s ease;
}

@keyframes ucFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 标题�?*/
.uc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  flex-shrink: 0;
}

.uc-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
}

.uc-close {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  color: #333;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.uc-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* 标签导航 */
.uc-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px 12px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.uc-tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.uc-tab:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #333;
}

.uc-tab.active {
  background: rgba(124, 122, 230, 0.12);
  color: #7C7AE6;
  font-weight: 500;
}

/* 内容�?*/
.uc-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.uc-panel {
  display: none;
}

.uc-panel.active {
  display: block;
}

/* 用户信息�?*/
.uc-user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #7C7AE6 0%, #5B59C2 100%);
  border-radius: 16px;
  margin-bottom: 20px;
}

.uc-avatar-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
}

.uc-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uc-user-details {
  flex: 1;
  min-width: 0;
  color: #fff;
}

.uc-nickname {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uc-points-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.uc-points-label {
  font-size: 14px;
  opacity: 0.9;
}

.uc-points-value {
  font-size: 24px;
  font-weight: 700;
}

.uc-points-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.uc-points-bar-fill {
  height: 100%;
  background: #ffe066;
  border-radius: 3px;
  transition: width 0.3s;
}

/* 充值套餐区 */
.uc-recharge-section {
  background: #f5f5f7;
  border-radius: 16px;
  padding: 16px;
}

.uc-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 16px;
}

.uc-recharge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.uc-recharge-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.uc-recharge-tab {
  flex: 1;
  border: 1px solid #d8d9e2;
  background: #fff;
  color: #4a4f63;
  border-radius: 10px;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.uc-recharge-tab:hover {
  border-color: #7C7AE6;
  color: #5f5dd4;
}

.uc-recharge-tab.active {
  background: linear-gradient(135deg, #7C7AE6, #9B99ED);
  border-color: #7C7AE6;
  color: #fff;
}

.uc-recharge-hint {
  margin-top: 16px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

/* 套餐卡片 - 长条�?1:2 比例 */
.recharge-card {
  background: #ffffff;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 1 / 2;
}

.card-title {
  font-size: 15px;
  color: #1a1a2e;
  font-weight: 700;
  line-height: 1.2;
}

.card-subtitle {
  margin-top: 4px;
  font-size: 11px;
  color: #8c90a0;
  line-height: 1.2;
}

.recharge-card:hover {
  border-color: #7C7AE6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 122, 230, 0.15);
}

.recharge-card.recommended {
  border-color: #7C7AE6;
  background: rgba(124, 122, 230, 0.08);
  position: relative;
}

.recharge-card.selected {
  border-color: #7C7AE6;
  background: rgba(124, 122, 230, 0.12);
}

.card-score {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a2e;
  margin-top: 10px;
  line-height: 1;
}

.card-score-unit {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.card-price {
  font-size: 16px;
  font-weight: 600;
  color: #16a34a;
  margin-top: 6px;
}

.card-price-old {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
  margin-top: 1px;
}

.card-badge {
  display: inline-block;
  background: linear-gradient(135deg, #7C7AE6, #9B99ED);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

.card-features {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  width: 100%;
  flex: 1;
}

.card-features li {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 10px;
  color: #666;
  line-height: 1.3;
  padding: 2px 2px;
  text-align: left;
}

.card-features li .card-check {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: #7C7AE6;
}

.card-features li .card-check svg {
  width: 12px;
  height: 12px;
}

.uc-empty-inline {
  grid-column: 1 / -1;
  padding: 24px 10px;
  text-align: center;
  color: #9aa0b2;
  font-size: 13px;
  border: 1px dashed #d7d9e5;
  border-radius: 10px;
  background: #fff;
}

/* 消�?充值记录列�?*/
.uc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uc-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #f5f5f7;
  border-radius: 12px;
  transition: background 0.2s;
}

.uc-list-item:hover {
  background: #ebebf0;
}

.uc-list-item-left {
  flex: 1;
  min-width: 0;
}

.uc-list-item-title {
  font-size: 14px;
  color: #1a1a2e;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uc-list-item-date {
  font-size: 12px;
  color: #999;
}

.uc-list-item-amount {
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 12px;
}

.uc-list-item-amount.consume {
  color: #f87171;
}

.uc-list-item-amount.recharge {
  color: #4ade80;
}

/* 空状�?*/
.uc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
}

.uc-empty i,
.uc-empty [data-lucide] {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.uc-empty span {
  font-size: 14px;
}

/* 加载状�?*/
.uc-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.uc-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #7C7AE6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 加载更多按钮 */
.uc-load-more {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  background: #f5f5f7;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.uc-load-more:hover {
  background: #ebebf0;
  color: #333;
}

.uc-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 分页组件 */
.uc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
  margin-top: 8px;
}

.uc-page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f5f5f7;
  border: 1px solid #e5e5e5;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.uc-page-btn:hover:not(:disabled) {
  background: #ebebf0;
  color: #333;
}

.uc-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.uc-page-btn [data-lucide] {
  width: 18px;
  height: 18px;
}

.uc-page-info {
  font-size: 14px;
  color: #666;
  min-width: 60px;
  text-align: center;
}

/* ==================== 用户中心深色模式 ==================== */
.dark-mode .user-center-fullscreen {
  background: rgba(0, 0, 0, 0.95);
}

.dark-mode .uc-title {
  color: #fff;
}

.dark-mode .uc-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dark-mode .uc-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dark-mode .uc-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .uc-tab {
  color: rgba(255, 255, 255, 0.6);
}

.dark-mode .uc-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
}

.dark-mode .uc-tab.active {
  background: rgba(124, 122, 230, 0.2);
  color: #9B99ED;
}

.dark-mode .uc-recharge-section {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .uc-section-title {
  color: #fff;
}

.dark-mode .uc-recharge-tab {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.dark-mode .uc-recharge-tab:hover {
  border-color: #9B99ED;
  color: #c8c6ff;
}

.dark-mode .uc-recharge-tab.active {
  background: linear-gradient(135deg, #5f5dd4, #7a78ec);
  border-color: #7d7bec;
  color: #fff;
}

.dark-mode .uc-recharge-hint {
  color: rgba(255, 255, 255, 0.5);
}

.dark-mode .recharge-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
}

.dark-mode .recharge-card:hover {
  border-color: #9B99ED;
  box-shadow: 0 4px 12px rgba(155, 153, 237, 0.2);
}

.dark-mode .recharge-card.recommended {
  border-color: #9B99ED;
  background: rgba(155, 153, 237, 0.15);
}

.dark-mode .recharge-card.selected {
  border-color: #9B99ED;
  background: rgba(155, 153, 237, 0.2);
}

.dark-mode .card-score {
  color: #fff;
}

.dark-mode .card-title {
  color: #fff;
}

.dark-mode .card-subtitle {
  color: rgba(255, 255, 255, 0.62);
}

.dark-mode .card-score-unit {
  color: rgba(255, 255, 255, 0.6);
}

.dark-mode .card-price {
  color: #4ade80;
}

.dark-mode .card-price-old {
  color: rgba(255, 255, 255, 0.4);
}

.dark-mode .card-features li {
  color: rgba(255, 255, 255, 0.55);
}

.dark-mode .card-features li .card-check {
  color: #9B99ED;
}

.dark-mode .uc-empty-inline {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.6);
}

.dark-mode .uc-list-item {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .uc-list-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dark-mode .uc-list-item-title {
  color: #fff;
}

.dark-mode .uc-list-item-date {
  color: rgba(255, 255, 255, 0.5);
}

.dark-mode .uc-empty {
  color: rgba(255, 255, 255, 0.4);
}

.dark-mode .uc-spinner {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: #9B99ED;
}

.dark-mode .uc-load-more {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.dark-mode .uc-load-more:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dark-mode .uc-page-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.dark-mode .uc-page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.dark-mode .uc-page-info {
  color: rgba(255, 255, 255, 0.7);
}

/* ==================== 3D 模型查看�?==================== */
#modelViewerContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#modelViewerContainer canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==================== 全屏3D模型查看�?==================== */
.fullscreen-model-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.fullscreen-model-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: #fff;
}

.fullscreen-model-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.fullscreen-model-content #modelViewerContainer {
  width: 100% !important;
  height: 100% !important;
}

/* ==================== 3D模型显示模式工具�?==================== */
.model-display-toolbar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 28px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.model-import-hint {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
}
.model-import-hint::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0,0,0,0.65);
}

.model-display-btn {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #666;
  padding: 0;
}

.model-display-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
}

.model-display-btn.active {
  border-color: #7C7AE6;
  background: rgba(124, 122, 230, 0.15);
}

.model-display-btn [data-lucide] {
  width: 16px;
  height: 16px;
  color: #555;
}

.model-display-btn.active [data-lucide] {
  color: #5B59C6;
}

/* 导入按钮高亮 */
.model-import-btn {
  position: relative;
  background: rgba(124, 122, 230, 0.1) !important;
}
.model-import-btn:hover {
  background: rgba(124, 122, 230, 0.25) !important;
  border-color: #7C7AE6 !important;
}
.model-import-btn [data-lucide] {
  color: #7C7AE6 !important;
}

/* 工具栏分隔线 */
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.12);
  align-self: center;
  flex-shrink: 0;
}

/* 暗色主题 - 3D模型工具�?*/
.dark-mode .model-display-toolbar {
  background: rgba(30, 30, 30, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.dark-mode .model-display-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #aaa;
}
.dark-mode .model-display-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}
.dark-mode .model-display-btn.active {
  background: rgba(124, 122, 230, 0.2);
}
.dark-mode .model-display-btn [data-lucide] {
  color: #ccc;
}
.dark-mode .model-display-btn.active [data-lucide] {
  color: #fff;
}
.dark-mode .model-import-btn {
  background: rgba(124, 122, 230, 0.15) !important;
}
.dark-mode .model-import-btn:hover {
  background: rgba(124, 122, 230, 0.35) !important;
}
.dark-mode .model-import-btn [data-lucide] {
  color: #9B99ED !important;
}
.dark-mode .toolbar-divider {
  background: rgba(255, 255, 255, 0.15);
}

/* 材质球图�?*/
.material-sphere {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: block;
}

.sphere-textured {
  background: radial-gradient(circle at 35% 35%, #a08060, #6b5040 50%, #3a2820 90%);
  box-shadow: inset -3px -3px 6px rgba(0,0,0,0.3), inset 2px 2px 4px rgba(255,255,255,0.15);
}

.sphere-solid {
  background: radial-gradient(circle at 35% 35%, #c8c8c8, #909090 50%, #606060 90%);
  box-shadow: inset -3px -3px 6px rgba(0,0,0,0.3), inset 2px 2px 4px rgba(255,255,255,0.2);
}

.sphere-wireframe {
  background: radial-gradient(circle at 35% 35%, #4a90d9, #2a5a8a 50%, #1a3a5a 90%);
  box-shadow: inset -3px -3px 6px rgba(0,0,0,0.3), inset 2px 2px 4px rgba(255,255,255,0.15);
  position: relative;
}

.sphere-wireframe::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: repeating-conic-gradient(transparent 0deg, transparent 24deg, rgba(255,255,255,0.15) 24deg, rgba(255,255,255,0.15) 26deg);
}

.sphere-normal {
  background: radial-gradient(circle at 35% 35%, #c080ff, #8040d0 40%, #4020a0 70%, #2010a0 100%);
  box-shadow: inset -3px -3px 6px rgba(0,0,0,0.3), inset 2px 2px 4px rgba(255,255,255,0.15);
}

/* ==================== 多物体建模 - 框选控件 ==================== */

/* 多物体模式：modelRefActions 放到图片上方独立一行（避免遮挡框选区域） */
#modelRefActions.bbox-mode {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 8px 12px 10px;
  z-index: 2;
}

/* 框选工具栏（左侧水平排列） */
.model-bbox-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* 框选按钮 - 与右侧 action button 同高 (36px) */
.model-bbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.model-bbox-btn i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.model-bbox-btn:hover {
  background: #fff;
  transform: scale(1.05);
}

.model-bbox-btn.active {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
}

/* 纯图标按钮（undo/redo） */
.model-bbox-btn-icon {
  width: 36px;
  padding: 0;
  justify-content: center;
}

/* 右侧操作按钮组 */
.model-ref-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* 框选绘制画布覆盖层 */
.model-bbox-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* 暗色主题适配 */
.dark-mode .model-bbox-btn {
  background: rgba(30, 30, 50, 0.85);
  color: #c0c0d0;
}

.dark-mode .model-bbox-btn:hover {
  background: rgba(40, 40, 60, 0.95);
  transform: scale(1.05);
}

.dark-mode .model-bbox-btn.active {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
}

/* ==================== 编辑遮罩工具 ==================== */

/* 遮罩画布覆盖层 */
.edit-mask-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* 遮罩工具栏（左上角悬浮） */
.edit-mask-toolbar {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* 遮罩工具按钮 */
.edit-mask-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.edit-mask-btn i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.edit-mask-btn:hover {
  background: rgba(124, 122, 230, 0.12);
  color: #7C7AE6;
}

.edit-mask-btn.active {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
}

/* 分隔符 */
.edit-mask-separator {
  width: 1px;
  height: 18px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 2px;
  flex-shrink: 0;
}

/* 画笔大小滑块 */
.edit-mask-slider {
  width: 60px;
  height: 4px;
  flex-shrink: 0;
}

/* 暗色主题适配 */
.dark-mode .edit-mask-toolbar {
  background: rgba(30, 30, 50, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-mode .edit-mask-btn {
  color: #c0c0d0;
}

.dark-mode .edit-mask-btn:hover {
  background: rgba(124, 122, 230, 0.2);
  color: #9B99F0;
}

.dark-mode .edit-mask-btn.active {
  background: linear-gradient(135deg, #7C7AE6, #5B59C2);
  color: #fff;
}

.dark-mode .edit-mask-separator {
  background: rgba(255, 255, 255, 0.12);
}

/* ==================== 支付视图 ==================== */
.payment-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 16px;
  width: 100%;
}

.payment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.payment-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: #555;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

.payment-back-btn:hover {
  background: rgba(0,0,0,0.06);
}

.payment-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.payment-summary {
  width: 100%;
  background: linear-gradient(135deg, #8B5CF6, #A78BFA, #7C3AED);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: #fff;
}

.payment-summary-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.payment-score-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
}

.payment-score-unit {
  font-size: 14px;
  opacity: 0.85;
}

.payment-summary-price {
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
  opacity: 0.9;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.payment-method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  transition: all 0.2s;
}

.payment-method-btn:hover {
  border-color: #8B5CF6;
  background: #faf5ff;
}

.payment-method-btn:active {
  transform: scale(0.98);
}

.payment-method-btn svg {
  flex-shrink: 0;
}

.payment-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.payment-qr-container {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  justify-content: center;
  align-items: center;
}

.payment-qr-container img {
  display: block;
}

.payment-qr-container canvas {
  display: block;
}

.payment-qr-tip {
  font-size: 13px;
  color: #888;
  text-align: center;
}

.payment-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
}

.payment-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-status-icon.pulse {
  animation: paymentPulse 1.5s ease-in-out infinite;
}

.payment-status-text {
  font-size: 14px;
  color: #555;
  text-align: center;
}

.payment-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e2e2;
  border-top-color: #8B5CF6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.payment-actions {
  width: 100%;
  padding-top: 8px;
}

.payment-cancel-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-cancel-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

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

/* 支付视图 - 暗色模式 */
.dark-mode .payment-back-btn {
  color: #ccc;
}

.dark-mode .payment-back-btn:hover {
  background: rgba(255,255,255,0.1);
}

.dark-mode .payment-title {
  color: #e0e0e0;
}

.dark-mode .payment-method-btn {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

.dark-mode .payment-method-btn:hover {
  border-color: #8B5CF6;
  background: #332a47;
}

.dark-mode .payment-qr-container {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.dark-mode .payment-qr-tip {
  color: #999;
}

.dark-mode .payment-status-text {
  color: #bbb;
}

.dark-mode .payment-spinner {
  border-color: #444;
  border-top-color: #A78BFA;
}

.dark-mode .payment-cancel-btn {
  background: #2a2a2a;
  border-color: #444;
  color: #bbb;
}

.dark-mode .payment-cancel-btn:hover {
  background: #333;
  border-color: #555;
}

/* ====== 图片编辑标签页样�?====== */

/* 多图网格 - 2x2 固定布局 */
.edit-multi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  width: 100%;
  height: 100%;
}

.edit-multi-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.edit-multi-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 中心操作按钮�?*/
.edit-multi-actions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.edit-multi-item:hover .edit-multi-actions {
  opacity: 1;
}

.edit-multi-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s;
}

.edit-multi-action-btn:hover {
  background: rgba(124, 122, 230, 0.9);
  transform: scale(1.1);
}

.edit-multi-action-btn:active {
  transform: scale(0.95);
}

.edit-multi-action-btn [data-lucide] {
  width: 18px;
  height: 18px;
}

.edit-multi-add {
  border: 1.5px dashed #ccc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: #999;
  font-size: 12px;
  transition: all 0.2s;
}

.edit-multi-add:hover {
  border-color: #7C7AE6;
  color: #7C7AE6;
  background: rgba(124, 122, 230, 0.05);
}

.edit-multi-add [data-lucide] {
  width: 28px;
  height: 28px;
}

/* 编辑模式标签（复�?quality-selector�?*/
.edit-mode-tabs {
  flex-shrink: 0;
}

/* 暗黑模式 - 编辑标签�?*/
.dark-mode .edit-multi-item {
  background: #1a2040;
}

.dark-mode .edit-multi-add {
  border-color: #3a3a5a;
  color: #666;
}

.dark-mode .edit-multi-add:hover {
  border-color: #9B99ED;
  color: #9B99ED;
  background: rgba(155, 153, 237, 0.1);
}

/* 图片标注模态框 */
.edit-annotation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.edit-annotation-container {
  width: 95vw;
  height: 95vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.edit-annotation-header {
  padding: 10px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.edit-annotation-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.edit-annotation-tools {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tool-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tool-btn:hover {
  background: #f0f0f0;
  border-color: #7C7AE6;
}

.tool-btn.active {
  background: #7C7AE6;
  border-color: #7C7AE6;
  color: #fff;
}

.tool-btn [data-lucide] {
  width: 16px;
  height: 16px;
}

.tool-select {
  height: 30px;
  padding: 0 6px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
}

.tool-slider {
  width: 70px;
  height: 4px;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  background: #ddd;
  flex-shrink: 1;
  min-width: 40px;
}

.tool-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7C7AE6;
  cursor: pointer;
}

.tool-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7C7AE6;
  cursor: pointer;
  border: none;
}

.edit-annotation-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.action-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.action-btn:hover {
  background: #f0f0f0;
  border-color: #7C7AE6;
  color: #7C7AE6;
}

#annotationSave {
  background: #7C7AE6;
  color: #fff;
  border-color: #7C7AE6;
}

#annotationSave:hover {
  background: #6A68D5;
  border-color: #6A68D5;
  color: #fff;
}

.edit-annotation-canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #f5f5f5;
  padding: 20px;
}

#annotationCanvas {
  max-width: 100%;
  max-height: 100%;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.annotation-text-input {
  position: fixed;
  background: transparent;
  border: none;
  outline: 2px dashed rgba(124, 122, 230, 0.5);
  padding: 4px 8px;
  font-family: sans-serif;
  z-index: 10001;
}

/* 暗黑模式 - 标注模态框 */
.dark-mode .edit-annotation-container {
  background: #1a2040;
}

.dark-mode .edit-annotation-header {
  background: #151d35;
  border-bottom-color: #2a3555;
}

.dark-mode .edit-annotation-header h3 {
  color: #fff;
}

.dark-mode .tool-btn {
  background: #1a2040;
  border-color: #2a3555;
  color: #fff;
}

.dark-mode .tool-btn:hover {
  background: #2a3555;
  border-color: #7C7AE6;
}

.dark-mode .tool-select {
  background: #1a2040;
  border-color: #2a3555;
  color: #fff;
}

.dark-mode .tool-slider {
  background: #2a3555;
}

.dark-mode .action-btn {
  background: #1a2040;
  border-color: #2a3555;
  color: #fff;
}

.dark-mode .action-btn:hover {
  background: #2a3555;
}

.dark-mode .edit-annotation-canvas-wrapper {
  background: #0d1428;
}

.dark-mode #annotationCanvas {
  border-color: #2a3555;
}

/* 编辑 - 历史记录选择弹窗 */
.edit-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dropdownFadeIn 0.2s ease;
}

.edit-history-modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.edit-history-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e8e8e8;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.edit-history-modal-header button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.2s;
}

.edit-history-modal-header button:hover {
  background: #f0f0f0;
}

.edit-history-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
}

.edit-history-modal-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: #f5f5f5;
}

.edit-history-modal-item:hover {
  border-color: #7C7AE6;
  transform: scale(1.03);
}

.edit-history-modal-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.edit-history-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid #e8e8e8;
  font-size: 13px;
  color: #666;
  flex-shrink: 0;
}

.edit-history-modal-footer button {
  padding: 4px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: #333;
  transition: background 0.2s;
}

.edit-history-modal-footer button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.edit-history-modal-footer button:hover:not(:disabled) {
  background: #f0f0f0;
}

/* 暗黑模式 - 历史弹窗 */
.dark-mode .edit-history-modal-content {
  background: #1e2a4a;
}

.dark-mode .edit-history-modal-header {
  border-bottom-color: rgba(255,255,255,0.1);
  color: #e0e0e0;
}

.dark-mode .edit-history-modal-header button {
  color: #aaa;
}

.dark-mode .edit-history-modal-header button:hover {
  background: rgba(255,255,255,0.1);
}

.dark-mode .edit-history-modal-item {
  background: #2a3a5a;
}

.dark-mode .edit-history-modal-item:hover {
  border-color: #9B99ED;
}

.dark-mode .edit-history-modal-footer {
  border-top-color: rgba(255,255,255,0.1);
  color: #aaa;
}

.dark-mode .edit-history-modal-footer button {
  background: #2a3a5a;
  border-color: #3a4a6a;
  color: #ccc;
}

.dark-mode .edit-history-modal-footer button:hover:not(:disabled) {
  background: #3a4a6a;
}

.edit-history-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: #999;
  font-size: 13px;
}
