/* ==========================================================================
   CubeStack 正式版 · main.css 结构说明（2026-10-01 废弃代码清理后）
   --------------------------------------------------------------------------
   本文件为白天版唯一样式源（theme.js 强制 body.light-theme）。
   旧版夜间皮肤基础层已全部清理为白天值，无前缀规则即白天底子。

   文件结构（自前向后加载，后定义覆盖先定义，同特异性时靠后获胜）：
   1) 基础布局层（无前缀规则）—— flex/网格/尺寸/定位等结构属性 + 白天色值；
      外观属性仍由下方 body.light-theme 规则定稿，如需调整优先改第 3/5 层。
   2) 历史白天覆盖层（body.light-theme 前缀，早期版本）—— 结构与颜色混合，
      大部分属性已被下方 V2/polish 规则覆盖，改动无效时请勿在此修改。
   3) V2 Token 层（:root 变量 + body.light-theme 白天规则）—— 视觉设计定稿层。
   4) V2 强制层（body.light-theme ... !important）—— 收口历史层与内联残留。
   5) 精修层（原 ui-polish-v3.css，文件末尾）—— 白天版最终视觉权威。
      ★ 修改外观请从第 5 层开始，其次第 3 层；不要在第 1/2 层改颜色。
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #F4F6FA; color: #1F2D3D; height: 100vh; overflow: hidden; }
  #app { display: flex; flex-direction: column; height: 100vh; }
  header { background: #ffffff; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e8f0; }
  header h1 { font-size: 16px; color: #2a6fb5; }

  .section-title { font-size: 13px; color: #0D6EFD; margin: 12px 0 8px 0; padding-left: 8px; border-left: 3px solid #0D6EFD; font-weight: 600; }
  .section-title:first-child { margin-top: 0; }

  .form-row-vertical { display: flex; flex-direction: column; margin-bottom: 8px; }
  .form-label-top { font-size: 12px; color: #aaa; margin-bottom: 4px; font-weight: 500; }

  .main { display: flex; flex: 1; overflow: hidden; }
  .panel { width: 260px; background: #ffffff; padding: 12px; overflow-y: auto; overflow-x: hidden; border-right: 1px solid #e2e8f0; flex-shrink: 0; }

  .form-row { display: flex; align-items: center; margin-bottom: 5px; }
  .form-row label { width: 65px; font-size: 11px; color: #bbb; white-space: nowrap; flex-shrink: 0; }
  .form-row input[type="number"] { flex: 1; max-width: 130px; padding: 4px 6px; background: #ffffff; border: 1px solid #d0d0d0; color: #1a1a2e; border-radius: 3px; font-size: 11px; }
  .form-row .unit { width: 25px; font-size: 10px; color: #888; margin-left: 3px; }

  .tex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .tex-item { display: flex; flex-direction: column; align-items: center; }
  .tex-item label { font-size: 10px; color: #aaa; margin-bottom: 2px; }
  .tex-item .thumb { width: 100%; height: 40px; background: #ffffff; border: 1px dashed #d0d0d0; border-radius: 3px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; font-size: 9px; color: #8A94A6; }
  .tex-item .thumb img { width: 100%; height: 100%; object-fit: cover; }

  .btn { padding: 6px 10px; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; transition: background 0.2s; }
  .btn-primary { background: #0D6EFD; color: #fff; }
  .btn-primary:hover { background: #0B5ED7; }
  .btn-success { background: #3a8a5a; color: #fff; }
  .btn-success:hover { background: #4a9a6a; }
  .btn-warn { background: #b8864a; color: #fff; }
  .btn-warn:hover { background: #c8965a; }
  .btn:disabled { background: #444; color: #888; cursor: not-allowed; }
  .btn-group { display: flex; gap: 5px; margin-top: 8px; flex-wrap: nowrap; }
  .btn-group .btn { flex: 1; min-width: 0; white-space: normal; word-break: break-word; line-height: 1.2; padding: 6px 3px; font-size: 10px; }

  .viewport { flex: 1; position: relative; background: radial-gradient(ellipse at 50% 45%, #EAF0F7 0%, #DCE4EE 70%); min-width: 0; }
  #three-canvas { width: 100%; height: 100%; display: block; }

  .view-controls { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; z-index: 5; }
  .view-controls .btn { padding: 4px 10px; font-size: 11px; background: rgba(60,60,90,0.85); color: #ddd; }
  .view-controls .btn.active { background: #0D6EFD; color: #fff; }

  .camera-controls { position: absolute; top: 45px; right: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 10; }
  .camera-controls .cam-btn { padding: 7px; font-size: 14px; font-weight: 600; line-height: 1; background: rgba(45,45,65,0.9); color: #aaa; border: 1px solid rgba(80,80,110,0.6); border-radius: 6px; cursor: pointer; min-width: 34px; min-height: 34px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
  .camera-controls .cam-btn:hover { background: rgba(70,70,100,0.95); color: #fff; border-color: rgba(120,120,160,0.8); }
  .camera-controls .cam-btn.active { background: #3d6ea8; color: #fff; border-color: #0B5ED7; box-shadow: 0 0 6px rgba(74,122,184,0.5); }

  .info-overlay { position: absolute; bottom: 8px; left: 8px; background: rgba(30,30,50,0.85); padding: 7px 10px; border-radius: 5px; font-size: 10px; line-height: 1.6; max-width: 280px; z-index: 5; }
  .info-overlay .title { color: #0D6EFD; font-weight: bold; margin-bottom: 2px; }
  .model-popup { position: absolute; background: rgba(255,255,255,0.97); border: 1px solid #d0d0d0; border-radius: 8px; padding: 10px 12px; z-index: 60; box-shadow: 0 4px 20px rgba(0,0,0,0.15); min-width: 130px; }
  body.light-theme .model-popup { background: rgba(255,255,255,0.96); border-color: #d0d0d0; }
  .model-popup .popup-title { font-size: 11px; font-weight: bold; margin-bottom: 8px; color: #0D6EFD; letter-spacing: 0.5px; }
  body.light-theme .model-popup .popup-title { color: #2a6fb5; }
  .model-popup .popup-row { display: flex; align-items: center; margin-bottom: 5px; gap: 6px; }
  .model-popup .popup-row:last-child { margin-bottom: 0; }
  .model-popup .popup-row label { font-size: 10px; width: 16px; color: #999; flex-shrink: 0; }
  .model-popup .popup-row input { flex: 1; padding: 3px 5px; background: #f5f5f5; border: 1px solid #ccc; color: #333; border-radius: 3px; font-size: 11px; width: 55px; min-width: 0; }
  body.light-theme .model-popup .popup-row input { background: #f5f5f5; border-color: #ccc; color: #333; }

  .annotation-panel { width: 240px; background: #ffffff; border-left: 1px solid #e2e8f0; display: flex; flex-direction: column; flex-shrink: 0; }
  .annotation-header { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
  .annotation-header .panel-tag { color: #0D6EFD; font-weight: bold; font-size: 12px; }
  .header-btns { display: flex; gap: 5px; }
  .header-btns .btn { padding: 3px 8px; font-size: 10px; }

  .annotation-content { flex: 1; overflow-y: auto; padding: 8px; }
  .panel-section { margin-bottom: 10px; }
  .panel-section .section-title { font-size: 11px; margin: 6px 0 5px 0; }
  .single-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .single-title-row .btn-mini { padding: 3px 8px; font-size: 10px; }

  .single-preview { background: #f8fafc; border-radius: 4px; overflow: hidden; margin-bottom: 5px; }
  .preview-placeholder { padding: 15px; text-align: center; color: #666; font-size: 10px; }
  .preview-img { width: 100%; display: block; }

  .four-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .view-item { background: #ffffff; border-radius: 3px; overflow: hidden; }
  .view-label { font-size: 9px; color: #5A6A80; padding: 3px 5px; background: #f0f3f8; }
  .view-preview { min-height: 50px; display: flex; align-items: center; justify-content: center; }
  .view-preview img { width: 100%; display: block; }
  .view-empty { font-size: 9px; color: #8A94A6; padding: 10px; }
  .btn-view-dl { width: 100%; padding: 2px; font-size: 9px; border-radius: 0; }

  .info-list { background: #ffffff; border-radius: 4px; padding: 6px 8px; }
  .info-row { display: flex; justify-content: space-between; font-size: 10px; padding: 2px 0; border-bottom: 1px solid #eef0f5; }
  .info-row:last-child { border-bottom: none; }
  .info-label { color: #888; }
  .info-value { color: #1f2d3d; font-weight: 500; }

  .scheme-selector { margin: 8px 0; }
  .scheme-selector .scheme-label { color: #0D6EFD; font-weight: bold; font-size: 11px; margin-bottom: 5px; }
  .scheme-btns { display: flex; gap: 4px; }
  .scheme-btn { flex: 1; padding: 5px 2px; font-size: 10px; background: rgba(60,60,90,0.6); color: #ccc; border: 1px solid #444; border-radius: 3px; cursor: pointer; }
  .scheme-btn:hover { background: rgba(80,80,120,0.8); }
  .scheme-btn.active { background: #0D6EFD; color: #fff; border-color: #0B5ED7; }
  .scheme-btn small { display: block; font-size: 8px; opacity: 0.8; margin-top: 1px; }
  .model-btns { display: flex; gap: 4px; margin-bottom: 4px; }
  .model-btn { flex: 1; padding: 5px 2px; font-size: 10px; background: rgba(60,60,90,0.6); color: #ccc; border: 1px solid #444; border-radius: 3px; cursor: pointer; text-align: center; }
  .model-btn:hover { background: rgba(80,80,120,0.8); }
  .model-btn.active { background: #0D6EFD; color: #fff; border-color: #0B5ED7; }
  body.light-theme .model-btn { background: #ffffff; color: #495057; border-color: #dee2e6; }
  body.light-theme .model-btn:hover { background: #e9ecef; }
  body.light-theme .model-btn.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
  .model-hint { font-size: calc(9px * var(--fs)); opacity: 0.75; margin-top: 2px; }

  .layer-control { margin: 8px 0; }
  .layer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
  .layer-header span { color: #0D6EFD; font-weight: bold; font-size: 11px; }
  .layer-btns { display: flex; align-items: center; gap: 6px; }
  .layer-btns .btn { width: 26px; height: 26px; padding: 0; font-size: 14px; line-height: 1; }
  #layer-count-display { color: #1a1a2e; font-size: 14px; font-weight: bold; min-width: 20px; text-align: center; }

  .layer-warning { background: #fff3cd; border: 1px solid #ffc107; border-radius: 3px; padding: 5px 7px; color: #856404; font-size: 9px; line-height: 1.4; margin-top: 5px; }

  .pallet-info { font-size: 10px; color: #5a6a80; background: #f7f9fc; padding: 6px 8px; border-radius: 3px; margin-top: 6px; line-height: 1.6; }
  .pallet-info b { color: #12B500; }

  .pallet-detail { background: #e9ecef; border: 1px solid #dee2e6; border-radius: 3px; padding: 6px 8px; margin-bottom: 8px; font-size: 10px; }
  .pallet-detail > div { display: flex; justify-content: space-between; margin-bottom: 2px; }
  .pallet-detail > div:last-child { margin-bottom: 0; }
  .pallet-detail span:first-child { color: #8a9aaa; }
  .pallet-detail span:last-child { color: #e0e8f0; }

  .hint { font-size: 9px; color: #888; margin-top: 5px; line-height: 1.4; }


  /* 白天模式样式 */
  body.light-theme { background: #f0f2f5; color: #1a1a2e; }
  body.light-theme header { background: #ffffff; border-bottom-color: #e0e0e0; }
  body.light-theme header h1 { color: #2a6fb5; }
  body.light-theme .section-title { color: #2a6fb5; border-left-color: #4a90d9; }
  body.light-theme .panel { background: #ffffff; border-right-color: #e0e0e0; }
  body.light-theme .form-label-top { color: #555; }
  body.light-theme .form-row label { color: #555; }
  body.light-theme .form-row input[type=number] { background: #f8f9fa; border-color: #d0d0d0; color: #1a1a2e; }
  body.light-theme .form-row .unit { color: #888; }
  body.light-theme .btn { background: #4a90d9; color: #fff; }
  body.light-theme .btn:hover { background: #3a7bc8; }
  body.light-theme .btn-primary { background: #0d6efd; color: #fff; }
  body.light-theme .btn-primary:hover { background: #0b5ed7; }
  body.light-theme .btn-success { background: #12B500; color: #fff; }
  body.light-theme .btn-success:hover { background: #157347; }
  body.light-theme .btn-warn { background: #fd7e14; color: #fff; }
  body.light-theme .btn-warn:hover { background: #e76f0f; }
  body.light-theme .pallet-info { background: #e9ecef; color: #495057; }
  body.light-theme .pallet-info b { color: #12B500; }
  body.light-theme .pallet-detail { background: #e9ecef; border-color: #dee2e6; }
  body.light-theme .pallet-detail > div { color: #495057; }
  body.light-theme .pallet-detail span:first-child { color: #666; }
  body.light-theme .pallet-detail span:last-child { color: #1a1a2e; }
  body.light-theme .hint { color: #888; }
  body.light-theme .cam-btn { background: #e9ecef; color: #495057; border-color: #dee2e6; }
  body.light-theme .cam-btn:hover { background: #dee2e6; }
  body.light-theme .cam-btn.active { background: #4a90d9; color: #fff; }
  body.light-theme .view-controls .btn { background: #6c757d; color: #fff; }
  body.light-theme .view-controls .btn.active { background: #0d6efd; color: #fff; }
  body.light-theme .view-controls .btn:hover { background: #5c636a; }
  body.light-theme .view-controls .btn.active:hover { background: #0b5ed7; }
  body.light-theme select { background: #f8f9fa; border-color: #d0d0d0; color: #1a1a2e; }
  body.light-theme .thumb { background: #e9ecef; border-color: #ced4da; color: #6c757d; }
  body.light-theme .thumb:hover { border-color: #4a90d9; background: #f8f9fa; }
  body.light-theme .tex-item label { color: #6c757d; }
  body.light-theme .info-overlay { background: rgba(255,255,255,0.95); color: #333; }

  /* 白天模式 - 右侧标注图面板 */
  body.light-theme .annotation-panel { background: #ffffff; border-left-color: #e0e0e0; }
  body.light-theme .annotation-header { background: #f8f9fa; border-bottom: 1px solid #e0e0e0; }
  body.light-theme .panel-tag { color: #2a6fb5; }
  body.light-theme .panel-section { background: #ffffff; }
  body.light-theme .annotation-content { background: #ffffff; }
  body.light-theme .single-preview { background: #f8f9fa; border-color: #dee2e6; }
  body.light-theme .preview-placeholder { color: #adb5bd; }
  body.light-theme .four-view-grid { background: #ffffff; }
  body.light-theme .view-item { background: #ffffff; }
  body.light-theme .view-label { color: #495057; background: #f8f9fa; }
  body.light-theme .view-preview { background: #f8f9fa; border-color: #dee2e6; }
  body.light-theme .view-empty { color: #adb5bd; }
  body.light-theme .btn-view-dl { background: #0d6efd; color: #fff; }
  body.light-theme .btn-view-dl:hover { background: #0b5ed7; }
  body.light-theme .btn-group .btn { border-color: #dee2e6; }

  /* 白天模式 - 堆码方案选择器 */
  body.light-theme .scheme-selector { background: #f8f9fa; border-color: #e0e0e0; }
  body.light-theme .scheme-label { color: #495057; }
  body.light-theme .scheme-btn { background: #ffffff; color: #495057; border-color: #dee2e6; }
  body.light-theme .scheme-btn:hover { background: #e9ecef; }
  body.light-theme .scheme-btn.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
  body.light-theme .scheme-btn small { color: #6c757d; }
  body.light-theme .scheme-btn.active small { color: #e0e0e0; }

  /* 白天模式 - 层数控制 */
  body.light-theme .layer-control { background: #f8f9fa; border-color: #e0e0e0; }
  body.light-theme #layer-count-display { color: #1a1a2e; }
  body.light-theme .layer-warning { background: #fff3cd; border-color: #ffc107; color: #856404; }

  /* 白天模式 - 方案信息列表 */
  body.light-theme .info-list { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 3px; padding: 8px; }
  body.light-theme .info-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #e9ecef; color: #495057; }
  body.light-theme .info-row:last-child { border-bottom: none; }
  body.light-theme .info-label { color: #6c757d; }
  body.light-theme .info-value { color: #1a1a2e; font-weight: 500; }

  /* 夜间模式 - 下载按钮disabled状态也保持灰色 */
  #btn-download-single:disabled { background: #6c757d !important; color: #fff !important; border-color: #6c757d !important; cursor: not-allowed; }
  .btn-view-dl:disabled { background: #6c757d !important; color: #fff !important; border-color: #6c757d !important; cursor: not-allowed; }

  /* 白天模式 - 下载按钮默认灰色，启用后蓝色（置于夜间模式之后生效） */
  body.light-theme #btn-download-single:disabled { background: #6c757d !important; color: #fff !important; border-color: #6c757d !important; }
  body.light-theme #btn-download-single:not(:disabled) { background: #0d6efd !important; border-color: #0d6efd !important; }
  body.light-theme #btn-download-single:not(:disabled):hover { background: #0b5ed7 !important; }
  body.light-theme .btn-view-dl:disabled { background: #6c757d !important; color: #fff !important; border-color: #6c757d !important; }
  body.light-theme .btn-view-dl:not(:disabled) { background: #0d6efd !important; border-color: #0d6efd !important; }
  body.light-theme .btn-view-dl:not(:disabled):hover { background: #0b5ed7 !important; }

  /* ===== 响应式适配：1080P / 2K / 4K ===== */
  :root {
    --left-panel-w: 270px;
    --right-panel-w: 240px;
    --fs: 1;
    --pad-scale: 1;
    --left-min: 270px;
    --right-min: 170px;
  }
  @media (min-width: 2560px) {
    :root { --left-panel-w: 312px; --right-panel-w: 288px; --fs: 1.2; --pad-scale: 1.15; --left-min: 270px; --right-min: 205px; }
  }
  @media (min-width: 3840px) {
    :root { --left-panel-w: 374px; --right-panel-w: 346px; --fs: 1.45; --pad-scale: 1.3; --left-min: 270px; --right-min: 240px; }
  }

  /* 面板宽度自适应 */
  .panel { width: var(--left-panel-w); padding: calc(12px * var(--pad-scale)); }
  .annotation-panel { width: var(--right-panel-w); }
  .annotation-content { padding: calc(8px * var(--pad-scale)); }
  .annotation-header { padding: calc(8px * var(--pad-scale)) calc(10px * var(--pad-scale)); }
  header { padding: calc(8px * var(--pad-scale)) calc(20px * var(--pad-scale)); }

  /* 防横向溢出：所有面板内容强制不超出容器宽度 */
  .panel, .annotation-panel, .annotation-content { overflow-x: hidden; }
  .panel > *, .annotation-panel > *, .annotation-content > * { max-width: 100%; }
  .panel *, .annotation-panel * { word-wrap: break-word; overflow-wrap: break-word; }
  .form-row { flex-wrap: nowrap; }
  .form-row label { width: auto; min-width: calc(60px * var(--fs)); flex-shrink: 0; }
  .form-row input[type="number"] { max-width: calc(120px * var(--fs)); flex: 1 1 auto; min-width: 0; }
  .form-row .unit { width: auto; min-width: calc(22px * var(--fs)); white-space: nowrap; flex-shrink: 0; text-align: left; }
  .btn-group { flex-wrap: nowrap; }
  .btn-group .btn { min-width: 0; flex: 1 1 auto; }
  .scheme-btns { flex-wrap: nowrap; }
  .scheme-btn { min-width: 0; flex: 1 1 auto; }
  .tex-grid { grid-template-columns: 1fr 1fr; }
  .four-view-grid { grid-template-columns: 1fr 1fr; }
  select#pallet-select { max-width: 100%; }

  /* 面板拖拽调整宽度 */
  .resizer { width: 5px; flex-shrink: 0; cursor: col-resize; background: transparent; position: relative; transition: background 0.2s; z-index: 20; }
  .resizer:hover, .resizer.active { background: rgba(90,154,255,0.5); }
  .resizer::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 2px; height: 40px; background: rgba(255,255,255,0.15); border-radius: 1px; }
  .resizer:hover::after, .resizer.active::after { background: rgba(90,154,255,0.8); }
  body.resizing { user-select: none; cursor: col-resize; }
  body.resizing * { cursor: col-resize !important; }

  /* 窄面板下防止文字竖排 */
  .annotation-header { flex-wrap: nowrap; overflow: hidden; }
  .annotation-header .panel-tag { white-space: nowrap; flex-shrink: 0; }
  .header-btns { flex-shrink: 0; display: flex; gap: 5px; }
  .header-btns .btn { white-space: nowrap; flex-shrink: 0; }
  .btn-group .btn { white-space: normal; word-break: break-word; line-height: 1.2; }

  .export-hint { font-size: calc(8px * var(--fs)); line-height: 1.4; opacity: 0.8; }

  /* 字体大小随分辨率缩放 */
  header h1 { font-size: calc(16px * var(--fs)); }
  .section-title { font-size: calc(15px * var(--fs)); margin: calc(12px * var(--pad-scale)) 0 calc(8px * var(--pad-scale)) 0; }
  .form-label-top { font-size: calc(12px * var(--fs)); }
  .form-row label { font-size: calc(11px * var(--fs)); }
  .form-row input[type="number"] { font-size: calc(11px * var(--fs)); padding: calc(4px * var(--pad-scale)) calc(6px * var(--pad-scale)); }
  .form-row .unit { font-size: calc(10px * var(--fs)); }
  .btn { font-size: calc(11px * var(--fs)); padding: calc(6px * var(--pad-scale)) calc(10px * var(--pad-scale)); }
  .btn-group .btn { font-size: calc(10px * var(--fs)); padding: calc(6px * var(--pad-scale)) calc(3px * var(--pad-scale)); }
  .tex-item label { font-size: calc(10px * var(--fs)); margin-bottom: 1px; }
  .tex-item .thumb { font-size: calc(9px * var(--fs)); height: calc(32px * var(--pad-scale)); }
  .hint { font-size: calc(9px * var(--fs)); }
  .pallet-detail { font-size: calc(10px * var(--fs)); padding: calc(4px * var(--pad-scale)) calc(8px * var(--pad-scale)); line-height: 1.5; }
  .pallet-detail > div { margin-bottom: 1px; }
  .pallet-info { font-size: calc(10px * var(--fs)); padding: calc(4px * var(--pad-scale)) calc(8px * var(--pad-scale)); line-height: 1.5; }
  .scheme-label { font-size: calc(11px * var(--fs)); }
  .scheme-btn { font-size: calc(10px * var(--fs)); padding: calc(5px * var(--pad-scale)) calc(2px * var(--pad-scale)); }
  .scheme-btn small { font-size: calc(8px * var(--fs)); }
  .layer-header span { font-size: calc(11px * var(--fs)); }
  #layer-count-display { font-size: calc(14px * var(--fs)); }
  .layer-btns .btn { width: calc(26px * var(--pad-scale)); height: calc(26px * var(--pad-scale)); font-size: calc(14px * var(--fs)); }
  .layer-warning { font-size: calc(9px * var(--fs)); }
  .annotation-header .panel-tag { font-size: calc(12px * var(--fs)); }
  .header-btns .btn { font-size: calc(10px * var(--fs)); padding: calc(3px * var(--pad-scale)) calc(8px * var(--pad-scale)); }
  .panel-section .section-title { font-size: calc(11px * var(--fs)); }
  .view-label { font-size: calc(9px * var(--fs)); padding: calc(3px * var(--pad-scale)) calc(5px * var(--pad-scale)); }
  .view-empty { font-size: calc(9px * var(--fs)); }
  .btn-view-dl { font-size: calc(9px * var(--fs)); padding: calc(2px * var(--pad-scale)); }
  .info-row { font-size: calc(10px * var(--fs)); padding: calc(2px * var(--pad-scale)) 0; }
  .info-list { padding: calc(6px * var(--pad-scale)) calc(8px * var(--pad-scale)); }
  .info-overlay { font-size: calc(10px * var(--fs)); max-width: calc(280px * var(--fs)); }
  .view-controls .btn { font-size: calc(11px * var(--fs)); padding: calc(4px * var(--pad-scale)) calc(10px * var(--pad-scale)); }
  select#pallet-select { font-size: calc(11px * var(--fs)); padding: calc(6px * var(--pad-scale)) calc(8px * var(--pad-scale)); }
  .preview-placeholder { font-size: calc(10px * var(--fs)); padding: calc(8px * var(--pad-scale)); }
  .camera-controls .cam-btn { font-size: calc(14px * var(--fs)); min-width: calc(34px * var(--pad-scale)); min-height: calc(34px * var(--pad-scale)); padding: calc(7px * var(--pad-scale)); }
  .form-row-vertical { margin-bottom: calc(8px * var(--pad-scale)); }
  .panel-section { margin-bottom: calc(8px * var(--pad-scale)); }
  .single-preview { margin-bottom: calc(4px * var(--pad-scale)); }
  .view-preview { min-height: calc(40px * var(--pad-scale)); }
  .four-view-grid { gap: calc(4px * var(--pad-scale)); }

  /* ===== 设计稿风格：白天主题精修（白底简洁） ===== */
  body.light-theme { background: #f5f6fa; color: #1f2d3d; }
  body.light-theme header { background: #ffffff; border-bottom: 1px solid #eef0f5; }
  body.light-theme header h1 { color: #1f2d3d; }
  body.light-theme .panel { background: #ffffff; border-right: 1px solid #eef0f5; }
  body.light-theme .annotation-panel { background: #ffffff; border-left: 1px solid #eef0f5; }

  /* 分区标题：黑粗大字号，去左蓝条，加底部细分隔线 */
  body.light-theme .section-title {
    color: #1f2d3d; border-left: none; font-weight: 700;
    font-size: calc(14px * var(--fs));
    margin: calc(16px * var(--pad-scale)) 0 calc(10px * var(--pad-scale));
    padding: 0 0 calc(6px * var(--pad-scale));
    border-bottom: 2px solid #f0f2f6;
  }
  body.light-theme .section-title:first-child { margin-top: 0; }

  /* 输入行：大间距、圆润 */
  body.light-theme .form-row { margin-bottom: calc(8px * var(--pad-scale)); }
  body.light-theme .form-row label { color: #465468; font-size: calc(12px * var(--fs)); min-width: calc(66px * var(--fs)); }
  body.light-theme .form-row input[type=number] {
    background: #ffffff; border: 1px solid #d8dde8; border-radius: 6px;
    padding: calc(7px * var(--pad-scale)) calc(10px * var(--pad-scale));
    color: #1f2d3d; font-size: calc(12px * var(--fs));
    box-shadow: inset 0 1px 2px rgba(16,24,40,0.04);
  }
  body.light-theme .form-row input[type=number]:focus {
    border-color: #3d7dd6; outline: none; box-shadow: 0 0 0 3px rgba(61,125,214,0.14);
  }
  body.light-theme .form-row .unit { color: #7a8699; font-size: calc(11px * var(--fs)); }

  /* 下拉框（含内联深色样式强制覆盖） */
  body.light-theme select,
  body.light-theme select#pallet-select {
    background: #ffffff !important; border: 1px solid #d8dde8 !important;
    border-radius: 6px !important; padding: calc(7px * var(--pad-scale)) calc(10px * var(--pad-scale));
    color: #1f2d3d !important; font-size: calc(12px * var(--fs));
  }

  /* 模型按钮 */
  body.light-theme .model-btn {
    background: #ffffff; color: #465468; border: 1px solid #d8dde8;
    border-radius: 6px; padding: calc(7px * var(--pad-scale)) calc(4px * var(--pad-scale));
    font-size: calc(11px * var(--fs));
  }
  body.light-theme .model-btn:hover { background: #f2f5fa; }
  body.light-theme .model-btn.active { background: #3d7dd6; color: #ffffff; border-color: #3d7dd6; box-shadow: 0 2px 6px rgba(61,125,214,0.25); }

  /* 托盘信息卡 */
  body.light-theme .pallet-detail {
    background: #f7f9fc; border: 1px solid #e6eaf2; border-radius: 8px;
    padding: calc(8px * var(--pad-scale)) calc(10px * var(--pad-scale));
  }
  body.light-theme .pallet-detail span:first-child { color: #6b7a90; }
  body.light-theme .pallet-detail span:last-child { color: #1f2d3d; font-weight: 600; }

  /* 上传区：白底虚线圆角 */
  body.light-theme .tex-item .thumb {
    background: #f8fafc; border: 1.5px dashed #c6cfdc; border-radius: 8px;
    height: calc(46px * var(--pad-scale)); color: #8a94a6; font-size: calc(10px * var(--fs));
  }
  body.light-theme .tex-item .thumb:hover { border-color: #3d7dd6; background: #f0f5fc; }
  body.light-theme .tex-item label { color: #6b7a90; font-size: calc(10px * var(--fs)); }

  /* 按钮 */
  body.light-theme .btn { border-radius: 6px; }
  body.light-theme .btn-primary { background: #3d7dd6; }
  body.light-theme .btn-primary:hover { background: #2f6cc4; }
  body.light-theme .btn-success { background: #2f9e5f; }
  body.light-theme .btn-success:hover { background: #258a52; }
  body.light-theme .btn-warn { background: #f07d3c; }
  body.light-theme .btn-warn:hover { background: #dd6b2b; }

  /* 提示文字 */
  body.light-theme .hint { color: #8a94a6; }

  /* 预览信息卡（3D 下方） */
  body.light-theme .info-overlay { background: rgba(255,255,255,0.96); color: #333; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
  body.light-theme .info-overlay .title { color: #1f2d3d; }

  /* 右侧标注图区：白卡片 */
  body.light-theme .view-item, body.light-theme .single-preview {
    background: #f8fafc; border: 1px solid #e6eaf2; border-radius: 8px;
  }
  body.light-theme .view-label { background: #eef2f7; color: #5a6a80; }
  body.light-theme .pallet-info { background: #f7f9fc; border: 1px solid #e6eaf2; color: #5a6a80; }
  body.light-theme .layer-warning { background: #fff7e6; border-color: #f0c36d; color: #7a5b00; }

  /* ===== 设计稿 100% 复刻 v2（覆盖 v1，严格照设计稿） ===== */
  body.light-theme { background: #fafbfc; color: #1f2d3d; }
  body.light-theme header { background: #ffffff; border-bottom: 1px solid #eef0f5; }
  body.light-theme .panel { background: #ffffff; border-right: 1px solid #eef0f5; }

  /* 区块标题：蓝字 + 左侧蓝竖线（设计稿） */
  body.light-theme .section-title {
    color: #0b5ec8; border-left: 3px solid #0b5ec8; border-bottom: none;
    padding-left: 10px; font-weight: 600;
    font-size: calc(14px * var(--fs));
    margin: calc(18px * var(--pad-scale)) 0 calc(10px * var(--pad-scale));
  }
  body.light-theme .section-title:first-child { margin-top: 0; }

  /* 托盘类型下拉：深色长条（设计稿） */
  body.light-theme select#pallet-select {
    background: #1c2534 !important; color: #eef2f7 !important;
    border: 1px solid #1c2534 !important; border-radius: 4px !important;
    height: calc(32px * var(--pad-scale)); font-size: calc(12px * var(--fs));
  }

  /* 内含规格 / 排列方向下拉：深色（设计稿） */
  body.light-theme #inp-goods-mode,
  body.light-theme #inp-goods-dir {
    background: #1c2534 !important; color: #eef2f7 !important;
    border: 1px solid #1c2534 !important; border-radius: 4px !important;
  }

  /* 参数输入框：浅灰底、矮（设计稿） */
  body.light-theme .form-row input[type=number] {
    background: #f4f3f6; border: 1px solid #e4e3ea; border-radius: 4px;
    padding: calc(2px * var(--pad-scale)) calc(8px * var(--pad-scale));
    height: calc(26px * var(--pad-scale)); font-size: calc(12px * var(--fs));
  }
  body.light-theme .form-row input[type=number]:focus {
    border-color: #0b5ec8; outline: none; box-shadow: 0 0 0 2px rgba(11,94,200,0.12);
  }
  body.light-theme .form-row label { color: #5a6478; font-size: calc(12px * var(--fs)); }
  body.light-theme .form-row .unit { color: #9aa3b2; font-size: calc(11px * var(--fs)); }

  /* 模型按钮：复刻设计稿（立方体/圆柱体浅蓝+复选框，PDQ深蓝） */
  body.light-theme .model-btn {
    background: #e3edfb; color: #1e3d66; border: 1px solid #c9d9f2;
    border-radius: 4px; padding: calc(6px * var(--pad-scale)) calc(2px * var(--pad-scale));
    font-size: calc(11px * var(--fs));
  }
  body.light-theme .model-btn:hover { background: #d5e4f9; }
  body.light-theme .model-btn.active {
    background: #0d6efd; color: #ffffff; border-color: #0d6efd;
    box-shadow: 0 1px 4px rgba(13,110,253,0.3);
  }
  /* 复选框图标：立方体红勾 / 圆柱体空框 */
  /* 托盘信息卡：浅灰 */
  body.light-theme .pallet-detail {
    background: #f4f3f6; border: none; border-radius: 4px;
    padding: calc(6px * var(--pad-scale)) calc(10px * var(--pad-scale));
    font-size: calc(11px * var(--fs));
  }
  body.light-theme .pallet-detail span:first-child { color: #7a8496; }
  body.light-theme .pallet-detail span:last-child { color: #1f2d3d; font-weight: 600; }

  /* 箱体外观标题行：标题左、颜色右（设计稿） */
  .section-title-row { display: flex; align-items: center; justify-content: space-between; }
  .section-title-row .section-title { margin: calc(18px * var(--pad-scale)) 0 calc(10px * var(--pad-scale)); }
  .color-inline {
    display: flex; align-items: center; gap: 6px;
    font-size: calc(11px * var(--fs)); color: #5a6478;
  }


  /* 六面图上传区：浅灰虚线矮框（设计稿） */
  body.light-theme .tex-item .thumb {
    background: #f4f3f6; border: 1px dashed #b9c3d4; border-radius: 4px;
    height: calc(34px * var(--pad-scale)); color: #8a94a6; font-size: calc(10px * var(--fs));
  }
  body.light-theme .tex-item .thumb:hover { border-color: #0b5ec8; background: #ecf2fb; }
  body.light-theme .tex-item label { color: #6b7a90; font-size: calc(10px * var(--fs)); }

  /* 按钮：圆角、配色（设计稿） */
  body.light-theme .btn { border-radius: 4px; }
  body.light-theme .btn-primary { background: #0d6efd; }
  body.light-theme .btn-primary:hover { background: #0b5ed7; }
  body.light-theme .btn-success { background: #2f9e5f; }
  body.light-theme .btn-success:hover { background: #258a52; }
  body.light-theme .btn-warn { background: #f07d3c; }
  body.light-theme .btn-warn:hover { background: #dd6b2b; }

  /* 说明文字：灰 */
  body.light-theme .hint { color: #8a94a6; }
  body.light-theme .export-hint { opacity: 1; color: #8a94a6; }

  /* ===== 设计稿 v3：按用户 SVG 导出精确复刻 ===== */
  body.light-theme { background: #e9e9eb; color: #231815; }
  body.light-theme header { background: #ffffff; border-bottom: 1px solid #c8c9ca; }
  body.light-theme .panel {
    background: #ffffff; border-right: 1px solid #c8c9ca;
  }
  /* 区块标题：蓝竖线 + 深蓝粗体 */
  body.light-theme .section-title {
    color: #004a9e; border-left: 3px solid #0d6efd; border-bottom: none;
    padding-left: 8px; font-weight: 700;
    font-size: calc(13px * var(--fs));
    margin: calc(8px * var(--pad-scale)) 0 calc(6px * var(--pad-scale));
  }
  body.light-theme .section-title:first-child { margin-top: 0; }
  /* 浅灰圆角卡片（两个圆角色块） */
  .design-card {
    background: #f4f3f6; border: 1px solid #ffffff; border-radius: 4px;
    padding: calc(8px * var(--pad-scale)) calc(10px * var(--pad-scale));
    margin: calc(6px * var(--pad-scale)) 0;
  }
  /* 设计稿横线分隔 st17 #B1B3C3 */
  .design-divider {
    height: 1px; background: #B1B3C3;
    margin: calc(5px * var(--pad-scale)) 0;
  }
  /* 托盘下拉：与其他下拉统一（黑底白字，圆角一致） */
  body.light-theme select#pallet-select {
    background: #1a2530 !important; color: #e0e8f0 !important;
    border: 1px solid #2a3a4a !important; border-radius: var(--r-sm) !important;
    height: calc(32px * var(--pad-scale));
    font-size: clamp(8px, calc(var(--left-panel-w) * 0.045 * var(--fs)), calc(12px * var(--fs)));
  }
  /* 托盘下拉：任意面板宽度下字号自适应，保证文字完整显示 */
  select#pallet-select {
    font-size: clamp(8px, calc(var(--left-panel-w) * 0.045 * var(--fs)), calc(12px * var(--fs)));
  }
  /* 托盘信息：白底一行式深灰 */
  body.light-theme .pallet-detail {
    background: transparent; border: none; border-radius: 0; padding: 0;
    font-size: calc(11px * var(--fs)); line-height: 1.9;
  }
  body.light-theme .pallet-detail span:first-child { color: #6b747c; }
  body.light-theme .pallet-detail span:last-child { color: #231815; font-weight: 400; }
  /* 模型按钮：浅蓝（未激活）/ 蓝（激活），带白方块复选框 */
  body.light-theme .model-btn {
    background: #82b7e4; color: #ffffff; border: none; border-radius: 3px;
    padding: calc(5px * var(--pad-scale)) calc(3px * var(--pad-scale));
    font-size: calc(12px * var(--fs));
    display: flex; align-items: center; justify-content: center; gap: 3px;
  }
  /* 复选框：白方块，选中红色填充（不带✓/□符号） */
  .model-btn .chk {
    width: calc(10px * var(--pad-scale)); height: calc(10px * var(--pad-scale));
    background: #ffffff; border: 1px solid #b9baba; border-radius: 2px;
    flex-shrink: 0; display: inline-block;
  }
  .model-btn .chk.on { background: #e40012; border-color: #e40012; }
  body.light-theme .model-btn:hover { background: #6fa9dd; }
  body.light-theme .model-btn.active { background: #0d6efd; }
  /* 内含规格 / 排列方向：近黑下拉 */
  body.light-theme #inp-goods-mode,
  body.light-theme #inp-goods-dir {
    background: #231815 !important; color: #ffffff !important;
    border: 1px solid #231815 !important; border-radius: 3px !important;
  }
  /* PDQ参数输入框：白底浅灰描边，数值近黑 */
  body.light-theme .form-row input[type=number] {
    background: #ffffff; border: 1px solid #babdbf; border-radius: 3px;
    padding: calc(2px * var(--pad-scale)) calc(6px * var(--pad-scale));
    height: calc(22px * var(--pad-scale)); font-size: calc(13px * var(--fs)); color: #231815;
  }
  body.light-theme .form-row input[type=number]:focus { border-color: #0d6efd; outline: none; }
  body.light-theme .form-row label { color: #6b747c; font-size: calc(12px * var(--fs)); }
  body.light-theme .form-row .unit { color: #6b747c; font-size: calc(10px * var(--fs)); }
  /* 箱体外观标题行：标题左、颜色右 */
  .section-title-row { display: flex; align-items: center; justify-content: space-between; }
  .color-inline { display: flex; align-items: center; gap: 4px; font-size: calc(10px * var(--fs)); color: #6b747c; }
  .color-inline input[type=color] {
    width: calc(16px * var(--pad-scale)); height: calc(16px * var(--pad-scale));
    padding: 0; border: none; border-radius: 0; background: none; cursor: pointer;
    appearance: none; -webkit-appearance: none;
  }
  /* 六面图上传：白底虚线 */
  body.light-theme .tex-item .thumb {
    background: #ffffff; border: 1px dashed #babdbf; border-radius: 3px;
    height: calc(28px * var(--pad-scale)); color: #6b747c; font-size: calc(9px * var(--fs));
  }
  body.light-theme .tex-item .thumb:hover { border-color: #0d6efd; }
  body.light-theme .tex-item label { color: #6b747c; font-size: calc(9px * var(--fs)); }
  /* 底部按钮：蓝 / 绿 / 橙 */
  body.light-theme .btn { border-radius: 3px; }
  body.light-theme .btn-primary { background: #0d6efd; }
  body.light-theme .btn-primary:hover { background: #0b5ed7; }
  body.light-theme .btn-success { background: #12b500; }
  body.light-theme .btn-success:hover { background: #0f9a00; }
  body.light-theme .btn-warn { background: #fd7e14; }
  body.light-theme .btn-warn:hover { background: #e76f0f; }
  /* 说明文字：浅灰 */
  body.light-theme .hint { color: #b9baba; }
  body.light-theme .export-hint { opacity: 1; color: #b9baba; }

/* ============ 登录/注册 ============ */
.header-right { display: flex; align-items: center; gap: 12px; }
.auth-wrapper { display: flex; gap: 6px; }
.auth-btn { padding: 4px 12px; font-size: 11px; background: rgba(60,60,90,0.6); color: #ccc; border: 1px solid #555; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.auth-btn:hover { background: rgba(80,80,120,0.8); color: #fff; }
.auth-btn-primary { background: #0D6EFD; color: #fff; border-color: #0D6EFD; }
.auth-btn-primary:hover { background: #0B5ED7; }

/* 语言切换器 */
.lang-switch { position: relative; display: inline-flex; align-items: center; }
.lang-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lang-caret { font-size: 9px; color: #888; transition: transform 0.2s; }
.lang-switch.open .lang-caret { transform: rotate(180deg); }
.lang-dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 110px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 4px 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all 0.18s ease; z-index: 120; }
.lang-dropdown a { display: block; padding: 7px 14px; font-size: 12px; color: #333; text-decoration: none; cursor: pointer; }
.lang-dropdown a:hover { background: #F0F6FF; color: #0D6EFD; }
.lang-switch.open .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
body.dark .lang-dropdown { background: #1e2430; border-color: #333c4d; }
body.dark .lang-dropdown a { color: #ccc; }
body.dark .lang-dropdown a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.user-info { display: flex; align-items: center; gap: 8px; position: relative; }
.user-email { font-size: 11px; color: #0D6EFD; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 用户下拉菜单 */
.user-dropdown-trigger { display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: background 0.2s; }
.user-dropdown-trigger:hover { background: rgba(255,255,255,0.08); }
body.light-theme .user-dropdown-trigger:hover { background: rgba(0,0,0,0.05); }
.user-dropdown-arrow { font-size: 9px; color: #888; transition: transform 0.2s; }
.user-info:hover .user-dropdown-arrow { transform: rotate(180deg); }

.user-dropdown { position: absolute; top: 100%; right: 0; margin-top: 6px; width: 240px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s ease; z-index: 100; overflow: hidden; }
body.light-theme .user-dropdown { background: #fff; border-color: #ddd; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.user-info:hover .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.user-dropdown-header { padding: 14px 16px; background: rgba(255,255,255,0.03); }
body.light-theme .user-dropdown-header { background: #f8f9fa; }
.user-dropdown-email { font-size: 13px; color: #fff; font-weight: 600; margin-bottom: 8px; word-break: break-all; }
body.light-theme .user-dropdown-email { color: #333; }
.user-dropdown-plan-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-plan-badge { font-size: 11px; padding: 3px 10px; border-radius: 12px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; font-weight: 600; }
.user-plan-badge.plan-free { background: linear-gradient(135deg, #6c757d, #495057); }
.user-plan-badge.plan-trial { background: #95eb5c; }
.user-plan-badge.plan-basic { background: #93B4E6; }
.user-plan-badge.plan-pro { background: #0d6efd; }
.btn-plan-action { padding: 3px 12px; font-size: 11px; background: #0D6EFD; color: #fff; border: none; border-radius: 4px; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.btn-plan-action:hover { background: #0B5ED7; }
.user-dropdown-expire { font-size: 10px; color: #888; margin-top: 6px; }
body.light-theme .user-dropdown-expire { color: #999; }

.user-dropdown-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0; }
body.light-theme .user-dropdown-divider { background: #eee; }

.user-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 12px; color: #ccc; cursor: pointer; transition: all 0.15s; }
body.light-theme .user-dropdown-item { color: #555; }
.user-dropdown-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
body.light-theme .user-dropdown-item:hover { background: #f0f2f5; color: #333; }
.user-dropdown-item .dropdown-icon { font-size: 14px; width: 18px; text-align: center; }

.auth-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.auth-modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.auth-modal-content { position: relative; width: 380px; max-width: 90vw; background: #ffffff; border: 1px solid #ddd; border-radius: 12px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
body.light-theme .auth-modal-content { background: #fff; border-color: #ddd; }
.auth-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: #888; font-size: 24px; cursor: pointer; line-height: 1; padding: 4px; }
.auth-modal-close:hover { color: #fff; }
body.light-theme .auth-modal-close:hover { color: #333; }

.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid #ddd; }
.auth-login-methods { display: flex; gap: 8px; margin-bottom: 14px; }
.auth-login-method { flex: 1; padding: 8px; background: rgba(13,110,253,0.06); border: 1px solid #3a4a5f; border-radius: 6px; color: #93A5BC; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.auth-login-method:hover { border-color: #0D6EFD; }
.auth-login-method.on { background: rgba(13,110,253,0.14); border-color: #0D6EFD; color: #0D6EFD; font-weight: 600; }
body.light-theme .auth-login-method { background: rgba(42,111,181,0.05); border-color: #c9d3e0; color: #666; }
body.light-theme .auth-login-method:hover { border-color: #2a6fb5; }
body.light-theme .auth-login-method.on { background: rgba(42,111,181,0.12); border-color: #2a6fb5; color: #2a6fb5; }
body.light-theme.dark .auth-login-method { background: rgba(74,158,255,0.06); border-color: #27364A; color: #93A5BC; }
body.light-theme.dark .auth-login-method.on { background: rgba(74,158,255,0.14); border-color: #4A9EFF; color: #4A9EFF; }
body.light-theme .auth-tabs { border-bottom-color: #ddd; }
.auth-tab { flex: 1; padding: 10px; background: none; border: none; color: #888; font-size: 14px; cursor: pointer; transition: all 0.2s; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab:hover { color: #ccc; }
.auth-tab.active { color: #0D6EFD; border-bottom-color: #0D6EFD; font-weight: 600; }
body.light-theme .auth-tab.active { color: #2a6fb5; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 12px; color: #aaa; font-weight: 500; }
body.light-theme .auth-field label { color: #666; }
.auth-field input { padding: 10px 12px; background: #f5f5f5; border: 1px solid #ccc; color: #333; border-radius: 6px; font-size: 13px; transition: border-color 0.2s; }
body.light-theme .auth-field input { background: #f5f5f5; border-color: #ccc; color: #333; }
.auth-field input:focus { outline: none; border-color: #0D6EFD; }
.auth-field input::placeholder { color: #666; }

.auth-verify-row { display: flex; gap: 8px; }
.auth-verify-row input { flex: 1; }
.auth-send-code { padding: 10px 14px; font-size: 12px; white-space: nowrap; background: rgba(13,110,253,0.12); color: #0D6EFD; border: 1px solid #0D6EFD; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.auth-send-code:hover:not(:disabled) { background: rgba(13,110,253,0.22); }
.auth-send-code:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-submit { padding: 12px; background: #0D6EFD; color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; margin-top: 4px; }
.auth-submit:hover { background: #0B5ED7; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error { color: #ff6b6b; font-size: 12px; min-height: 16px; }
.auth-success { color: #51cf66; font-size: 12px; min-height: 16px; }
.auth-hint { text-align: center; font-size: 12px; color: #888; }
.auth-hint a { color: #0D6EFD; text-decoration: none; }
.auth-hint a:hover { text-decoration: underline; }

/* 贴图删除按钮：右上角小圆X */
.tex-item { position: relative; }
.tex-del { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; border: none; background: #e5484d; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 1px 0; z-index: 5; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.tex-del:hover { background: #d93036; }

/* 自动旋转按钮：3D视窗底部居中 */
.auto-rotate-btn { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 5px 14px; background: rgba(20,24,38,.85); color: #cfd6e4; border: 1px solid rgba(120,140,180,.4); border-radius: 16px; cursor: pointer; font-size: 11px; z-index: 6; transition: all .2s; backdrop-filter: blur(4px); }
.auto-rotate-btn:hover { border-color: #0B5ED7; color: #fff; }
.auto-rotate-btn.rotating { background: #0D6EFD; color: #fff; border-color: #0D6EFD; }
body.light-theme .auto-rotate-btn { background: rgba(255,255,255,.92); color: #333; border-color: #c8d0dc; }
body.light-theme .auto-rotate-btn:hover { border-color: #4a90d9; }
body.light-theme .auto-rotate-btn.rotating { background: #0D6EFD; color: #fff; border-color: #0D6EFD; }

/* 视窗底部按钮组：自动旋转 + 降落演示 */
.view-bottom-btns { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; align-items: center; }
.auto-rotate-btn { position: static; transform: none; bottom: auto; left: auto; }
.drop-btn { display: flex; align-items: center; gap: 5px; padding: 5px 14px; background: rgba(20,24,38,.85); color: #cfd6e4; border: 1px solid rgba(120,140,180,.4); border-radius: 16px; cursor: pointer; font-size: 11px; z-index: 6; transition: all .2s; backdrop-filter: blur(4px); }
.drop-btn:hover { border-color: #0B5ED7; color: #fff; }
.drop-btn.playing { background: #3a8a5a; color: #fff; border-color: #3a8a5a; }
body.light-theme .drop-btn { background: rgba(255,255,255,.92); color: #333; border-color: #c8d0dc; }
body.light-theme .drop-btn:hover { border-color: #4a90d9; }
body.light-theme .drop-btn.playing { background: #3a8a5a; color: #fff; border-color: #3a8a5a; }

/* 堆码演示控制条：视频式播放/暂停 + 进度条 + 时间 + 关闭 */
.drop-control { display: flex; align-items: center; gap: 7px; padding: 5px 12px; background: rgba(20,24,38,.85); color: #cfd6e4; border: 1px solid rgba(120,140,180,.4); border-radius: 16px; font-size: 11px; z-index: 6; backdrop-filter: blur(4px); }
.drop-c-play, .drop-c-close { display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: #cfd6e4; cursor: pointer; padding: 2px; line-height: 1; border-radius: 4px; }
.drop-c-play:hover, .drop-c-close:hover { color: #fff; }
.drop-c-bar { width: 150px; height: 5px; background: rgba(120,140,180,.35); border-radius: 3px; cursor: pointer; position: relative; overflow: hidden; }
.drop-c-fill { height: 100%; width: 0%; background: #4a90d9; border-radius: 3px; transition: width .08s linear; }
.drop-c-time { color: #9fb0c8; font-size: 10px; min-width: 64px; text-align: center; }
body.light-theme .drop-control { background: rgba(255,255,255,.92); color: #333; border-color: #c8d0dc; }
body.light-theme .drop-c-play, body.light-theme .drop-c-close { color: #555; }
body.light-theme .drop-c-play:hover, body.light-theme .drop-c-close:hover { color: #111; }
body.light-theme .drop-c-bar { background: rgba(0,0,0,.15); }
body.light-theme .drop-c-fill { background: #4a90d9; }
body.light-theme .drop-c-time { color: #888; }

/* 右侧栏堆码演示视频板块提示文字 */
.video-hint { font-size: 10px; color: #9fb0c8; line-height: 1.5; margin-bottom: 8px; }
body.light-theme .video-hint { color: #777; }

/* ==========================================================================
   V2 视觉重构层 —— pallet-stacker-v2 测试版（与正式版对比用）
   --------------------------------------------------------------------------
   原则：
   1. 单一设计 token 驱动，颜色/字号/间距/圆角/阴影收敛；
   2. 保留全部功能类名与深浅色切换（body.light-theme）；
   3. 以覆盖层方式追加，不改动上方任何原有规则；如需回归整段删除即可。
   ========================================================================== */

/* ---------- 1. 设计 Token ---------- */
:root{
  /* 品牌与语义色（收敛 8 种蓝 → 1 个品牌色 + 语义色） */
  --accent:#0D6EFD; --accent-hover:#0B5ED7;
  --accent-soft:rgba(13,110,253,.14); --accent-border:rgba(13,110,253,.45);
  --success:#34C77B; --success-hover:#2BB56D; --success-soft:rgba(52,199,123,.14);
  --warning:#E8A23D; --warning-hover:#D8942C;
  --danger:#F0555E;
  /* 浅色主题（白天默认；夜间主题已退役移除，无前缀规则直接落到浅色） */
  --bg-base:#F4F6FA; --bg-panel:#FFFFFF; --bg-card:#FBFCFE; --bg-card-2:#F0F3F8;
  --border:#E2E8F0; --border-soft:#EDF1F6;
  --text-1:#1F2D3D; --text-2:#5A6A80; --text-3:#8A94A6;
  /* 浅色主题 */
  --bg-base-lt:#F4F6FA; --bg-panel-lt:#FFFFFF; --bg-card-lt:#FBFCFE; --bg-card-2-lt:#F0F3F8;
  --border-lt:#E2E8F0; --border-soft-lt:#EDF1F6;
  --text-1-lt:#1F2D3D; --text-2-lt:#5A6A80; --text-3-lt:#8A94A6;
  /* 节奏：4px 网格；圆角 3 档；阴影 */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-6:24px;
  --r-sm:4px; --r-md:8px; --r-lg:12px;
  --sh-sm:0 1px 2px rgba(0,0,0,.30);
  --sh-md:0 4px 12px rgba(0,0,0,.35);
  --sh-lg:0 12px 32px rgba(0,0,0,.45);
  /* 动效统一 */
  --t-fast:.15s cubic-bezier(.4,0,.2,1);
}

/* ---------- 2. 全局基线与字号阶梯（最小 12px） ---------- */
body, body.light-theme{
  font-variant-numeric: tabular-nums;
}
body{ background:var(--bg-base); color:var(--text-1); }
header h1, .section-title, .form-label-top, .form-row label, .form-row .unit,
.tex-item label, .btn, .hint, .view-label, .btn-view-dl, .scheme-btn,
.scheme-btn small, .model-btn, .model-hint, .pallet-info, .pallet-detail,
.info-row, .info-overlay, .preview-placeholder, .view-empty, .layer-warning,
.panel-section .section-title, .header-btns .btn, .layer-header span,
#layer-count-display, .annotation-header .panel-tag, .guide-card, .guide-toggle, .guide-spot { transition: var(--t-fast); }

/* ---------- 3. 头部品牌化 ---------- */
header{
  background:linear-gradient(180deg,#18273A,#121D2C);
  border-bottom:1px solid var(--border-soft);
  position:relative; padding:10px 20px;
}
header::after{
  content:""; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background:linear-gradient(90deg, transparent, var(--accent-border), transparent);
  opacity:.8;
}
.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brand-logo{ flex:none; display:block; filter:drop-shadow(0 0 6px rgba(13,110,253,.35)); }
.brand-text{ display:flex; flex-direction:column; gap:1px; min-width:0; }
header .brand-name{ font-size:calc(18px * var(--fs)); font-weight:700; color:var(--text-1); letter-spacing:.5px; line-height:1.15; }
.brand-name em{ font-style:normal; color:var(--accent); }
html[lang="en"] .brand-cn{ display:none; }
header .brand-slogan{ font-size:calc(12px * var(--fs)); color:var(--text-3); letter-spacing:.5px; line-height:1.2; }
body.light-theme header{ background:linear-gradient(180deg,#FFFFFF,#FBFCFE); border-bottom-color:var(--border-lt); }
body.light-theme header .brand-name{ color:var(--text-1-lt); }
body.light-theme header .brand-slogan{ color:var(--text-3-lt); }


/* ---------- 5. 浅色主题层次（body.light-theme 收敛为单一浅色 token） ---------- */
body.light-theme{ background:var(--bg-base-lt); color:var(--text-1-lt); }
body.light-theme .panel,
body.light-theme .annotation-panel{ background:var(--bg-panel-lt); border-color:var(--border-lt); }
body.light-theme .viewport{ background:radial-gradient(ellipse at 50% 45%, #EAF0F7 0%, #DCE4EE 70%); }
body.light-theme .single-preview,
body.light-theme .four-view-grid,
body.light-theme .view-item,
body.light-theme .pallet-detail,
body.light-theme .info-list,
body.light-theme .pallet-info,
body.light-theme .tex-item .thumb{ background:var(--bg-card-lt); border-color:var(--border-lt); box-shadow:var(--sh-sm); }
body.light-theme .view-label{ background:var(--bg-card-2-lt); color:var(--text-2-lt); }
body.light-theme .info-label{ color:var(--text-3-lt); }
body.light-theme .info-value{ color:var(--text-1-lt); }
body.light-theme .pallet-detail span:first-child{ color:var(--text-3-lt); }
body.light-theme .pallet-detail span:last-child{ color:var(--text-1-lt); }
body.light-theme .pallet-info{ color:var(--text-2-lt); }
body.light-theme .hint{ color:var(--text-3-lt); }
body.light-theme .form-row input[type="number"],
body.light-theme select,
body.light-theme .model-popup .popup-row input{ background:#FFFFFF; border-color:var(--border-lt); color:var(--text-1-lt); }
body.light-theme .model-popup{ background:rgba(255,255,255,.97); border-color:var(--border-lt); box-shadow:var(--sh-lg); }
body.light-theme .layer-warning{ background:#FFF3E2; border-color:#F0C36D; color:#8A5B00; }
body.light-theme .info-overlay{ background:rgba(255,255,255,.96); color:var(--text-1-lt); box-shadow:var(--sh-md); }

/* ---------- 6. 按钮语义收敛 ---------- */
.btn{ border-radius:var(--r-md); font-size:calc(12px * var(--fs)); padding:7px 12px; transition:var(--t-fast); }
.btn-group .btn{ font-size:calc(12px * var(--fs)); padding:7px 4px; white-space:normal; word-break:break-word; line-height:1.2; }
.header-btns .btn{ font-size:calc(11px * var(--fs)); padding:4px 9px; }
.single-title-row .btn-mini{ font-size:calc(11px * var(--fs)); padding:4px 9px; }
.btn-primary{ background:var(--accent); color:#fff; }
.btn-primary:hover{ background:var(--accent-hover); }
.btn-primary:active{ transform:translateY(1px); }
.btn-success{ background:var(--success); color:#08251A; font-weight:600; }
.btn-success:hover{ background:var(--success-hover); color:#fff; }
.btn-warn{ background:var(--warning); color:#3A2800; }
.btn-warn:hover{ background:var(--warning-hover); }
/* 导出按钮 = 正常操作，改为幽灵样式；清空保持警告琥珀 */
#btn-export-single, #btn-export-pallet{
  background:transparent; color:var(--accent); border:1px solid var(--accent-border);
  /* 多语言适配：英文文案较长，允许换行（保持 flex 等分收缩，不截断、不溢出面板） */
  white-space:normal; overflow:visible; text-overflow:clip; line-height:1.35; padding:7px 8px;
}
#btn-export-single:hover:not(:disabled), #btn-export-pallet:hover:not(:disabled){ background:var(--accent-soft); color:var(--accent-hover); }
/* 禁用态统一 */
.btn:disabled, .btn[disabled]{
  background:transparent; color:var(--text-3); border:1px solid var(--border-soft);
  opacity:.45; cursor:not-allowed;
}
body.light-theme .btn:disabled, body.light-theme .btn[disabled]{
  background:transparent; color:var(--text-3-lt); border:1px solid var(--border-lt); opacity:.5;
}

/* ---------- 7. 控件尺寸与反馈 ---------- */
/* 贴图上传框：28px → 52px 近正方形 */
.tex-item .thumb{ height:52px; border-radius:var(--r-md); font-size:calc(12px * var(--fs)); color:var(--text-3); }
.tex-item .thumb:hover{ border-color:var(--accent-border); background:var(--accent-soft); }
.tex-item label{ font-size:calc(12px * var(--fs)); }
/* 输入框与下拉：加高加宽 */
.form-row input[type="number"],
.form-row input[type="text"]{ height:28px; padding:4px 8px; font-size:calc(13px * var(--fs)); border-radius:var(--r-sm); }
.form-row input[type="number"]:focus,
.form-row input[type="text"]:focus,
select:focus{ border-color:var(--accent-border); outline:none; box-shadow:0 0 0 3px var(--accent-soft); }
.form-row label{ font-size:calc(13px * var(--fs)); color:var(--text-2); }
.form-row .unit{ font-size:calc(12px * var(--fs)); }
/* 数值字段：等宽数字，输入时不跳动 */
input[type="number"], input[type="text"], select{
  font-family:Consolas,"SF Mono",Menlo,monospace; font-variant-numeric:tabular-nums;
}
/* 内联深色残留（select/boxshape/input 等硬编码 #2a3a4a）统一收口 */
/* 下拉/选择类：一律黑底白字（浅色主题也保持，符合产品约定），圆角统一 */
#pallet-select, #boxshape-current, #boxshape-menu, #inp-goods-dir, #pdq-shape-select{
  border-color:#2a3a4a !important; background:#1a2530 !important; color:#e0e8f0 !important; border-radius:var(--r-sm) !important;
}
body.light-theme #pallet-select, body.light-theme #boxshape-current, body.light-theme #boxshape-menu,
body.light-theme #inp-goods-dir, body.light-theme #pdq-shape-select{
  border-color:#2a3a4a !important; background:#1a2530 !important; color:#e0e8f0 !important; border-radius:var(--r-sm) !important;
}
/* 输入框类：深色主题跟随主题卡片色，浅色主题白底 */
body.light-theme:not(.dark) #inp-goods-count, body.light-theme:not(.dark) #inp-goods-layers, body.light-theme:not(.dark) #inp-goods-gap-v, body.light-theme:not(.dark) #inp-goods-gap-h,
body.light-theme:not(.dark) #inp-goods-tri-l, body.light-theme:not(.dark) #inp-goods-tri-m, body.light-theme:not(.dark) #inp-goods-tri-r,
body.light-theme:not(.dark) #inp-goods-side-fwd, body.light-theme:not(.dark) #inp-goods-side-side{
  border-color:var(--border) !important; background:var(--bg-card) !important; color:var(--text-1) !important;
  border-radius:var(--r-sm) !important;
}
body.light-theme:not(.dark) #inp-goods-count, body.light-theme:not(.dark) #inp-goods-layers, body.light-theme:not(.dark) #inp-goods-gap-v, body.light-theme:not(.dark) #inp-goods-gap-h,
body.light-theme:not(.dark) #inp-goods-tri-l, body.light-theme:not(.dark) #inp-goods-tri-m, body.light-theme:not(.dark) #inp-goods-tri-r,
body.light-theme:not(.dark) #inp-goods-side-fwd, body.light-theme:not(.dark) #inp-goods-side-side{
  border-color:var(--border-lt) !important; background:#FFFFFF !important; color:var(--text-1-lt) !important;
  border-radius:var(--r-sm) !important;
}
/* 四视图格子放大（40px → 68px） */
.view-preview{ min-height:68px; }
.view-label{ font-size:calc(12px * var(--fs)); padding:4px 6px; }
.btn-view-dl{ font-size:calc(12px * var(--fs)); padding:4px 0; border-radius:0; }
/* 相机按钮 */
.camera-controls .cam-btn{ min-width:38px; min-height:38px; font-size:calc(15px * var(--fs)); border-radius:var(--r-md); }
/* 层数按钮 */
.layer-btns .btn{ width:28px; height:28px; font-size:calc(15px * var(--fs)); }

/* ---------- 8. 字号阶梯收尾（9/10px → ≥12px） ---------- */
.hint{ font-size:calc(12px * var(--fs)); }
.info-row{ font-size:calc(13px * var(--fs)); padding:3px 0; }
.info-overlay{ font-size:calc(12px * var(--fs)); }
.pallet-info{ font-size:calc(12px * var(--fs)); }
.pallet-info b{ color:var(--success); font-weight:700; }
body.light-theme .pallet-info b{ color:var(--success); }
.pallet-detail{ font-size:calc(12px * var(--fs)); }
.preview-placeholder{ font-size:calc(12px * var(--fs)); color:var(--text-3); }
.view-empty{ font-size:calc(12px * var(--fs)); color:var(--text-3); }
.layer-warning{ font-size:calc(12px * var(--fs)); }
.model-hint{ font-size:calc(12px * var(--fs)); }
.scheme-btn{ font-size:calc(12px * var(--fs)); padding:6px 3px; }
.scheme-btn small{ font-size:calc(12px * var(--fs)); }
.model-btn{ font-size:calc(12px * var(--fs)); padding:6px 3px; }
.section-title{ font-size:calc(14px * var(--fs)); border-left-color:var(--accent); color:var(--accent); }
body.light-theme .section-title{ color:var(--accent); border-left-color:var(--accent); }
.panel-section .section-title{ font-size:calc(13px * var(--fs)); }
.form-label-top{ font-size:calc(12px * var(--fs)); }
.scheme-selector .scheme-label{ font-size:calc(12px * var(--fs)); color:var(--accent); }
.layer-header span{ font-size:calc(12px * var(--fs)); color:var(--accent); }
.annotation-header .panel-tag{ font-size:calc(13px * var(--fs)); color:var(--accent); }
#pdq-cap-hint{ font-size:calc(12px * var(--fs)) !important; }

/* ---------- 9. 滚动条与杂项 ---------- */
::-webkit-scrollbar{ width:6px; height:6px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--border); border-radius:3px; }
::-webkit-scrollbar-thumb:hover{ background:var(--accent-border); }
body.light-theme ::-webkit-scrollbar-thumb{ background:var(--border-lt); }
.panel, .annotation-content, #boxshape-menu{ scrollbar-width:thin; scrollbar-color:var(--border) transparent; }

/* 统一 transition（0.2s/0.3s → 0.15s 同曲线） */
.btn, .cam-btn, .thumb, .model-btn, .scheme-btn, .view-item, .view-preview,
.model-popup, .info-overlay, .gbtn, .guide-card, .guide-toggle, .drop-btn,
.auto-rotate-btn, .auth-btn{ transition:var(--t-fast); }

/* 荧光绿彻底退役 */
.btn-success{ background:var(--success); }
.btn-success:hover{ background:var(--success-hover); }

/* ==========================================================================
   V2 浅色强制层 —— 压过历史浅色主题块（v1/v2/v3/暗夜蓝 中的 .btn/.thumb/input 覆盖）
   确保浅色主题与深色主题走同一套 V2 token
   ========================================================================== */
body.light-theme .btn{ border-radius:var(--r-md) !important; font-size:calc(12px * var(--fs)) !important; padding:7px 12px !important; }
body.light-theme .btn-group .btn{ font-size:calc(12px * var(--fs)) !important; padding:7px 4px !important; }
body.light-theme .header-btns .btn{ font-size:calc(11px * var(--fs)) !important; padding:4px 9px !important; }
body.light-theme .single-title-row .btn-mini{ font-size:calc(11px * var(--fs)) !important; padding:4px 9px !important; }
body.light-theme .btn-primary{ background:var(--accent) !important; color:#fff !important; }
body.light-theme .btn-primary:hover{ background:var(--accent-hover) !important; }
body.light-theme .btn-success{ background:var(--success) !important; color:#fff !important; }
body.light-theme .btn-success:hover{ background:var(--success-hover) !important; }
body.light-theme .btn-warn{ background:var(--warning) !important; color:#fff !important; }
body.light-theme .btn-warn:hover{ background:var(--warning-hover) !important; }
body.light-theme .btn-view-dl{ background:var(--accent) !important; color:#fff !important; border-radius:0 !important; font-size:calc(12px * var(--fs)) !important; }
body.light-theme .btn-view-dl:hover{ background:var(--accent-hover) !important; }
body.light-theme .btn-view-dl:disabled,
body.light-theme #btn-download-single:disabled{
  background:transparent !important; color:var(--text-3-lt) !important;
  border:1px solid var(--border-lt) !important; opacity:.5 !important;
}
body.light-theme .tex-item .thumb{ height:52px !important; font-size:calc(12px * var(--fs)) !important; border-radius:var(--r-md) !important; color:var(--text-3-lt) !important; }
body.light-theme .tex-item .thumb:hover{ border-color:var(--accent-border) !important; background:var(--accent-soft) !important; }
body.light-theme .tex-item label{ font-size:calc(12px * var(--fs)) !important; }
body.light-theme .form-row input[type="number"],
body.light-theme .form-row input[type="text"]{ height:28px !important; padding:4px 8px !important; font-size:calc(13px * var(--fs)) !important; border-radius:var(--r-sm) !important; }
body.light-theme .form-row label{ font-size:calc(13px * var(--fs)) !important; }
body.light-theme .form-row .unit{ font-size:calc(12px * var(--fs)) !important; }
body.light-theme .pallet-info b{ color:var(--success) !important; }

/* 导出按钮禁用态：保持幽灵样式（压过 body.light-theme .btn-warn 的 !important） */
#btn-export-single:disabled, #btn-export-pallet:disabled,
body.light-theme #btn-export-single:disabled, body.light-theme #btn-export-pallet:disabled{
  background:transparent !important; color:var(--accent) !important;
  border:1px solid var(--accent-border) !important; opacity:.45 !important;
}


/* ==========================================================================
   V2 品牌 LOGO 与品牌区（外部追加：换用官网 LOGO，品牌色 #0d6efd）
   ========================================================================== */
/* 深浅主题各用对应 LOGO 版本 */
.brand-logo-dark{ display:block; }
.brand-logo-light{ display:none; }
body.light-theme .brand-logo-dark{ display:none; }
body.light-theme .brand-logo-light{ display:block; }
.brand{ gap:0; }
/* LOGO 已含品牌名与 slogan 文字，隐藏冗余文字（保留 DOM 兼容 JS 读取） */
header .brand-name, header .brand-slogan{ display:none !important; }
/* header 深色背景带品牌蓝 tint */

/* ==========================================================================
   V2 白天版 UI 精修（用户 8 点调整，2026-09-26）
   ========================================================================== */

/* 1. LOGO 去掉蓝色光效 */
.brand-logo{ filter:none !important; box-shadow:none !important; }

/* 2. LOGO 右侧 slogan 小字（品牌名文字继续隐藏） */
header .brand-name{ display:none !important; }
header .brand-slogan{ display:inline-block !important; margin-left:10px; padding-top:6px;
  font-size:calc(12px * var(--fs)); color:#7A8794; letter-spacing:.4px; white-space:nowrap; }
body.light-theme header .brand-slogan{ color:#7A8794; }

/* 3. 3D 视窗视角栏：图1款（白底圆角竖排面板 + 顶部蓝块图标 + T/F/S + 底部适配） */
body.light-theme .camera-controls{ background:#FFFFFF; border:1px solid #E4E9F0; border-radius:12px;
  padding:5px 4px; box-shadow:0 2px 8px rgba(16,42,88,.08); gap:3px; }
body.light-theme .camera-controls .cam-btn{ background:transparent; color:#4A5568;
  border:none; box-shadow:none; min-width:34px; min-height:34px; font-weight:600; }
body.light-theme .camera-controls .cam-btn:hover{ background:#F1F4F9; color:var(--accent); }
body.light-theme .camera-controls .cam-btn.active{ background:var(--accent); color:#FFFFFF; border-radius:8px; }

/* 4. 所有下拉式选项框一律黑底白字（盒形、托盘类型、排列方向） */
body.light-theme #boxshape-current,
body.light-theme select#pallet-select,
body.light-theme #inp-goods-dir{
  background:#1A2530 !important; color:#E0E8F0 !important; border-color:#2A3A4A !important; }
body.light-theme #boxshape-menu{ background:#16212B !important; border-color:#2A3A4A !important; }
body.light-theme #boxshape-menu > div{ color:#D6E0EC !important; }
body.light-theme #boxshape-menu > div:hover{ background:#22334A !important; }
body.light-theme #boxshape-current .arrow, body.light-theme #boxshape-current > span:last-child{ color:#8FA3BF !important; }

/* 5. PDQ 面板输入框统一白底黑字（内含规格/层/排列间距/单侧/三侧） */
body.light-theme #pdq-goods-params input[type=number]{
  background:#FFFFFF !important; color:#3A4550 !important; border-color:#C9D2DC !important; }
/* 排列间距/单侧/三侧的标签行间距收紧 */
body.light-theme #pdq-goods-params .form-row{ margin-bottom:4px; }

/* 6. 盒装/袋装/PDQ 选项按钮：图4款（白底圆角 + 勾选小方块；选中蓝底；红灯逻辑保留） */
body.light-theme .model-btn{
  background:#FFFFFF; color:#495057; border:1px solid #D8DEE6; border-radius:7px;
  padding:7px 4px; font-size:calc(12px * var(--fs)); display:flex; align-items:center; justify-content:center; gap:5px; }
body.light-theme .model-btn:hover{ background:#F2F6FB; }
body.light-theme .model-btn.active{ background:var(--accent); color:#FFFFFF; border-color:var(--accent);
  box-shadow:0 2px 6px rgba(13,110,253,.25); }
body.light-theme .model-btn .chk{ width:12px; height:12px; border:1px solid #9AA3AB; border-radius:3px;
  background:#FFFFFF; display:inline-block; flex:none; }
body.light-theme .model-btn.active .chk{ border-color:rgba(255,255,255,.85); background:rgba(255,255,255,.22); }
/* 红灯勾选（JS 驱动的 .chk.on，行为逻辑保留） */
body.light-theme .model-btn .chk.on{ background:#E40012; border-color:#E40012; }
body.light-theme .model-btn.active .chk.on{ background:#FF3B30; border-color:#FF3B30; }

/* 7. 单侧规格 / 三侧规格：标签与输入框分行（左侧面板收窄时数字不被遮挡） */
#row-side-spec, #row-tri-spec{ flex-wrap:wrap; align-items:center; }
#row-side-spec > label, #row-tri-spec > label{ flex-basis:100%; padding-left:2px; margin-bottom:2px; }
body.light-theme #row-side-spec > label, body.light-theme #row-tri-spec > label{ color:#6B747C; }

/* ==========================================================================
   V2 白天版 UI 精修 · 第 6 点修正：模型按钮组外框样式（图4款紧凑版）
   ========================================================================== */

/* 外框：浅底圆角容器包裹三个选项 */
body.light-theme .model-btns{
  background:#F1F4F8; border:1px solid #DDE3EA; border-radius:8px;
  padding:3px; gap:3px; margin-bottom:6px;
}

/* 选项按钮：未选中融入容器（透明底），选中为蓝色高亮块 */
body.light-theme .model-btn{
  background:transparent; border:none; color:#4A5568;
  padding:5px 6px; font-size:calc(12px * var(--fs));
  border-radius:5px; display:flex; align-items:center; justify-content:center; gap:5px; min-height:30px;
}
body.light-theme .model-btn:hover{ background:#E4EBF4; color:var(--accent); }
body.light-theme .model-btn.active{
  background:var(--accent); color:#FFFFFF;
  box-shadow:0 1px 4px rgba(13,110,253,.30);
}
body.light-theme .model-btn.active:hover{ background:var(--accent); color:#FFFFFF; }

/* 勾选小方块：未选中灰框白底，选中半透明白，红灯（.chk.on）逻辑保留 */
body.light-theme .model-btn .chk{
  width:11px; height:11px; border:1px solid #9AA3AB; border-radius:3px;
  background:#FFFFFF; display:inline-block; flex:none;
}
body.light-theme .model-btn.active .chk{ border-color:rgba(255,255,255,.9); background:rgba(255,255,255,.25); }
body.light-theme .model-btn .chk.on{ background:#E40012; border-color:#E40012; }
body.light-theme .model-btn.active .chk.on{ background:#FF3B30; border-color:#FF3B30; }

/* 托盘参数容器（自重/高度限制/警告阈值）去掉灰底与阴影框 */
body.light-theme .pallet-detail{ background:transparent !important; box-shadow:none !important; }

/* ==========================================================================
   V2 白天版 · 表单控件字体统一（下拉框/输入框/按钮继承主体字体，避免宋体）
   ========================================================================== */
body select, body input, body button, body textarea, body option{
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif !important;
}

/* ==========================================================================
   V2 白天版 · 左侧栏最小宽度锁定 + 防溢出（拖到最紧信息仍完整、文字不竖排）
   ========================================================================== */
/* 1) 拖拽下限统一锁定为 270px（覆盖所有屏宽档位的 --left-min） */
:root{ --left-min: 270px !important; }

/* 2) 模型按钮组：禁止换行/竖排，三选项始终一行 */
body.light-theme .model-btns{ flex-wrap: nowrap !important; }
body.light-theme .model-btn{ white-space: nowrap !important; flex: 1 1 auto !important; }

/* 3) 数字输入框保底宽度，拖窄也不至于消失 */
body.light-theme .form-row input[type="number"]{ min-width: calc(34px * var(--fs)); }

/* 4) 下拉/自定义下拉（托盘类型、盒形、排列方向）文本不折行 */
body.light-theme select, body.light-theme #boxshape-current{ white-space: nowrap !important; }

/* ==========================================================================
   堆码四视图 · 去掉外层直角阴影外框（只保留四个圆角视图卡片）
   ========================================================================== */
body.light-theme .four-view-grid{ box-shadow:none !important; }

/* ==========================================================================
   堆码四视图 · 视图卡片去阴影（圆角框架保持简洁平面）
   ========================================================================== */
body.light-theme .view-item{ box-shadow:none !important; }

/* ==========================================================================
   下载视频按钮 · 与「下载 JPG」统一禁用/启用逻辑（方案未生成=透明无颜色）
   ========================================================================== */
body.light-theme #btn-download-video:disabled{
  background:transparent !important; color:var(--text-3) !important;
  border:1px solid var(--border-soft) !important; opacity:.5; cursor:not-allowed;
}
body.light-theme #btn-download-video:not(:disabled){ background:var(--accent) !important; color:#fff !important; border-color:var(--accent) !important; }
body.light-theme #btn-download-video:not(:disabled):hover{ background:var(--accent-hover) !important; }
/* ==========================================================================
   浅色主题 · 自动旋转 / 堆码演示按钮恢复品牌色（白底灰字在浅色视窗上几乎隐形）
   ========================================================================== */
body.light-theme .auto-rotate-btn,
body.light-theme .drop-btn{
  background: var(--accent) !important; color: #FFFFFF !important;
  border-color: var(--accent) !important;
}
body.light-theme .auto-rotate-btn:hover,
body.light-theme .drop-btn:hover{ background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }
body.light-theme .auto-rotate-btn.rotating{ background: #0D6EFD !important; border-color: #0D6EFD !important; color: #FFFFFF !important; }
body.light-theme .drop-btn.playing{ background: var(--success) !important; border-color: var(--success) !important; color: #FFFFFF !important; }
/* =====================================================================
   以下为原 ui-polish-v3.css 内容（已于 20260926 并入本文件，删除该独立文件引用）
   ===================================================================== */
/* ---------- 0. 层次 token（复用 V2 的 --accent 等，补充新变量） ---------- */
body.light-theme{
  --card:#FBFCFE; --card-border:#E6EAF2;
  --ink:#1F2D3D; --ink-2:#5A6A80; --ink-3:#8A94A6;
  --line:#E4E9F0; --line-soft:#EEF2F7;
  --seg-bg:#F1F4F8; --seg-border:#DDE3EA;
}

/* ---------- 1. 整体基调：冷灰底，去暖米色 ---------- */
body.light-theme{ background:#EEF1F6; color:var(--ink); }

/* ---------- 2. 头部：纯白 + 细描边；修复登录/注册按钮低对比灰蓝 ---------- */
body.light-theme header{
  background:#FFFFFF; border-bottom:1px solid var(--line);
  padding-top:calc(9px * var(--pad-scale)); padding-bottom:calc(9px * var(--pad-scale));
}
body.light-theme header::after{ display:none; }
body.light-theme .auth-btn{
  background:#FFFFFF !important; color:var(--ink-2) !important;
  border:1px solid var(--seg-border) !important;
  padding:5px 14px !important; font-size:calc(12px * var(--fs)) !important; border-radius:8px !important;
}
body.light-theme .auth-btn:hover{ border-color:var(--accent) !important; color:var(--accent) !important; }
body.light-theme .auth-btn-primary{
  background:var(--accent) !important; color:#FFFFFF !important; border-color:var(--accent) !important;
}
body.light-theme .auth-btn-primary:hover{ background:var(--accent-hover) !important; }
body.light-theme .user-email{ color:var(--ink-2); font-weight:600; }

/* ---------- 3. 3D 视口：冷色摄影棚渐变，替代旧蓝灰渐变 ---------- */
body.light-theme .viewport{
  background:radial-gradient(ellipse 120% 90% at 50% 38%, #F5F8FC 0%, #E3E9F2 78%, #D9E1EC 100%);
}

/* ---------- 4. 左栏：卡片、分隔线、标题 ---------- */
body.light-theme .design-card{
  background:var(--card); border:1px solid var(--card-border); border-radius:10px;
  box-shadow:0 1px 3px rgba(16,42,88,.05);
}
body.light-theme .design-divider{ background:var(--line); height:1px; }
body.light-theme .section-title{ color:#0B57A4; border-left-color:var(--accent); font-weight:700; }
body.light-theme .tex-section-title{ color:#0B57A4; }

/* ---------- 5. 六面贴图上传：近正方形 + 加号引导 + hover 微浮起 ---------- */
body.light-theme .tex-grid{ gap:6px; row-gap:9px; }
body.light-theme .tex-item .thumb{
  height:auto !important; aspect-ratio:4/3;
  border:1px dashed #C6CFDC !important; border-radius:8px !important;
  background:#FFFFFF !important; color:var(--ink-3) !important;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  position:relative;
}
body.light-theme .tex-item .thumb::before{
  content:"+"; font-size:calc(16px * var(--fs)); line-height:1; color:#B7C2D2; font-weight:600;
}
body.light-theme .tex-item .thumb img{
  position:absolute; inset:0; width:100% !important; height:100% !important;
  object-fit:contain; background:#FFFFFF;
}
body.light-theme .tex-item .thumb:hover{
  border-color:var(--accent) !important; background:#F5F9FE !important;
  transform:translateY(-1px); box-shadow:0 2px 8px rgba(13,110,253,.10);
}
body.light-theme .tex-item .thumb:has(img)::before{ content:none; }
body.light-theme .tex-item > label{
  color:var(--ink-2) !important; font-weight:600; font-size:calc(11px * var(--fs)) !important;
}

/* ---------- 6. 按钮：语义分层（实心=核心动作，幽灵=次要，红描边=清空） ---------- */
body.light-theme .btn{ border-radius:8px !important; font-weight:600; }
body.light-theme .btn-group{ gap:8px; margin-top:10px; }
body.light-theme .btn-group .btn{ padding:8px 6px !important; }

body.light-theme #btn-preview-single{
  background:#FFFFFF !important; color:var(--accent) !important; border:1px solid var(--accent) !important;
}
body.light-theme #btn-preview-single:hover{ background:#EEF5FF !important; }

body.light-theme #btn-calc-pallet{
  background:var(--accent) !important; color:#FFFFFF !important;
  box-shadow:0 2px 8px rgba(13,110,253,.28);
}
body.light-theme #btn-calc-pallet:hover{ background:var(--accent-hover) !important; }

body.light-theme #btn-export-single, body.light-theme #btn-export-pallet{
  background:#F6F9FD !important; color:var(--ink-2) !important;
  border:1px solid var(--card-border) !important; box-shadow:none !important;
}
body.light-theme #btn-export-single:not(:disabled):hover,
body.light-theme #btn-export-pallet:not(:disabled):hover{
  border-color:var(--accent) !important; color:var(--accent) !important; background:#EEF5FF !important;
}
body.light-theme #btn-export-single:disabled, body.light-theme #btn-export-pallet:disabled{
  background:#F6F9FD !important; color:#C3CCD8 !important;
  border-color:var(--line) !important; opacity:1 !important;
}

body.light-theme #btn-clear-exports{
  background:#FFFFFF !important; color:var(--danger) !important;
  border:1px solid rgba(240,85,94,.5) !important;
}
body.light-theme #btn-clear-exports:hover{ background:#FFF2F3 !important; border-color:var(--danger) !important; }

body.light-theme #btn-download-single, body.light-theme #btn-download-video{
  padding:6px 0 !important; font-size:calc(12px * var(--fs)) !important; border-radius:6px !important;
}
body.light-theme #btn-download-single:not(:disabled),
body.light-theme #btn-download-video{ box-shadow:0 1px 4px rgba(13,110,253,.22); }

body.light-theme .layer-btns .btn{
  background:#FFFFFF !important; color:var(--ink-2) !important;
  border:1px solid var(--seg-border) !important; border-radius:8px !important;
}
body.light-theme .layer-btns .btn:hover{ border-color:var(--accent) !important; color:var(--accent) !important; }

body.light-theme #btn-pdq-back{
  background:#FFFFFF !important; color:var(--ink-2) !important;
  border:1px solid var(--seg-border) !important; border-radius:6px !important;
  padding:3px 10px !important; font-size:calc(11px * var(--fs)) !important;
}
body.light-theme #btn-pdq-back:hover{ border-color:var(--accent) !important; color:var(--accent) !important; }

/* ---------- 7. 分段控件：方案选择、视图切换统一模型按钮组语言 ---------- */
body.light-theme .scheme-selector .scheme-label{ font-weight:700; }
body.light-theme .scheme-btns{
  background:var(--seg-bg); border:1px solid var(--seg-border); border-radius:9px;
  padding:3px; gap:3px;
}
body.light-theme .scheme-btn{
  background:transparent !important; border:none !important; color:#4A5568;
  border-radius:6px !important; box-shadow:none !important; padding:6px 2px !important;
}
body.light-theme .scheme-btn:hover{ background:#E4EBF4 !important; color:var(--accent); }
body.light-theme .scheme-btn.active{
  background:var(--accent) !important; color:#FFFFFF !important;
  box-shadow:0 1px 4px rgba(13,110,253,.30) !important;
}
body.light-theme .scheme-btn small{ color:#6B7A90; font-size:calc(10px * var(--fs)); margin-top:1px; }
body.light-theme .scheme-btn.active small{ color:rgba(255,255,255,.85); }

body.light-theme .layer-header span{ font-weight:700; }

body.light-theme .view-controls{
  background:#FFFFFF; border:1px solid var(--line); border-radius:10px;
  padding:3px; gap:3px; box-shadow:0 2px 8px rgba(16,42,88,.08);
}
body.light-theme .view-controls .btn{
  background:transparent !important; color:#4A5568; border:none !important;
  padding:5px 12px !important; font-size:calc(12px * var(--fs)) !important;
  border-radius:7px !important; box-shadow:none !important;
}
body.light-theme .view-controls .btn:hover{ background:#F1F4F9 !important; color:var(--accent); }
body.light-theme .view-controls .btn.active{
  background:var(--accent) !important; color:#FFFFFF !important;
  box-shadow:0 1px 4px rgba(13,110,253,.30) !important;
}

/* ---------- 8. 右栏与浮层 ---------- */
body.light-theme .panel-section{
  background:var(--card); border:1px solid var(--card-border); border-radius:10px;
  padding:10px 10px 8px; margin-bottom:10px; box-shadow:0 1px 3px rgba(16,42,88,.05);
}
body.light-theme .panel-section .section-title{ margin-top:0; }
body.light-theme .view-item{
  background:#FFFFFF !important; border:1px solid var(--card-border) !important;
  border-radius:8px !important;
}
body.light-theme .view-item:hover{ border-color:#C9D6EA !important; box-shadow:0 2px 8px rgba(16,42,88,.08); }
body.light-theme .view-label{ font-weight:600; letter-spacing:.3px; }
body.light-theme .view-empty, body.light-theme .preview-placeholder{ color:#B7C2D2; }
body.light-theme .single-preview{
  border:1px dashed #C6CFDC !important; background:#FFFFFF !important; border-radius:8px !important; box-shadow:none !important;
}
body.light-theme .info-list{ background:#FFFFFF !important; box-shadow:none !important; }
body.light-theme .info-row{ border-bottom-color:var(--line-soft); }
body.light-theme .info-row:last-child{ border-bottom:none; }
body.light-theme .info-value{ font-weight:700; font-variant-numeric:tabular-nums; }

body.light-theme .info-overlay{
  background:rgba(255,255,255,.82); backdrop-filter:blur(8px);
  border:1px solid rgba(226,232,240,.9); border-radius:10px;
  box-shadow:0 4px 16px rgba(16,42,88,.10);
  color:var(--ink); padding:8px 12px; line-height:1.65;
}
body.light-theme .info-overlay .title{ color:var(--accent); font-weight:700; letter-spacing:.5px; }

/* ---------- 9. 提示与文字颜色收口 ---------- */
body.light-theme #pdq-cap-hint{ color:#B45500 !important; }
body.light-theme .color-inline, body.light-theme .metal-toggle-label,
body.light-theme .gift-color-row .color-inline{ color:var(--ink-2); }
body.light-theme .hint{ color:#94A0B0; }
body.light-theme .video-hint{ color:#94A0B0; }
body.light-theme .pallet-info{
  background:#FFF8EA; border:1px solid #F2D8A0; border-radius:8px; color:#8A5B00; box-shadow:none;
}
body.light-theme .pallet-info b{ color:#C2700A !important; }
body.light-theme #pallet-scheme-name{ color:#C2700A; }
body.light-theme .export-hint{ color:#94A0B0; }

/* ---------- 10. 无障碍：键盘焦点 + 系统降低动效偏好 ---------- */
body.light-theme .btn:focus-visible, body.light-theme .model-btn:focus-visible,
body.light-theme .scheme-btn:focus-visible, body.light-theme .cam-btn:focus-visible,
body.light-theme .auth-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){
  body.light-theme *{ transition-duration:.01ms !important; animation-duration:.01ms !important; }
}

/* ==========================================================================
   第三档 · 内联隐藏态收口（原 style="display:none..." 提取为 class）
   JS 动态显隐仍用 style.display 内联赋值（内联优先于 class，行为不变）
   ========================================================================== */
.hidden{ display:none; }
.hidden-flex-row{ display:none; align-items:center; }
.hidden-flex-row-margin{ display:none; align-items:center; margin:6px 0 2px; }

/* 下拉菜单（#boxshape-menu）与提示文字（#row-gift-lid-hint）隐藏态 */
.hidden-menu{ display:none; position:absolute; left:0; right:0; top:calc(100% + 2px); z-index:60; max-height:264px; overflow:auto; box-shadow:0 6px 18px rgba(0,0,0,.35); }
.hidden-hint{ display:none; color:#8a94a0; font-size:10px; padding-left:66px; white-space:nowrap; margin:-2px 0 2px; }

/* ==========================================================================
   第四档 · 原 index_split.html 内联 <style> 块并入（保持原定义顺序与级联等价）
   分区A：新手引导（原 #guide-style）  分区B：金属质感标签  分区C：礼盒颜色行
   ========================================================================== */
/* ===== 新手引导（首次试用操作指引） ===== */
#guide-root{position:fixed;inset:0;z-index:9999;font-family:inherit;}
.guide-spot{position:fixed;border:2px solid #4aa3ff;border-radius:8px;box-shadow:0 0 0 9999px rgba(6,10,16,0.6);transition:left .2s ease,top .2s ease,width .2s ease,height .2s ease;pointer-events:none;z-index:1;}
.guide-card{position:fixed;width:304px;max-width:calc(100vw - 32px);background:#14202b;border:1px solid #2a3a4a;border-radius:10px;padding:14px 16px;color:#e0e8f0;box-shadow:0 12px 34px rgba(0,0,0,0.5);z-index:2;}
.guide-step-tag{font-size:11px;color:#7fb8ff;margin-bottom:6px;letter-spacing:1px;}
.guide-title{font-size:15px;font-weight:700;margin-bottom:6px;color:#ffffff;}
.guide-desc{font-size:12px;line-height:1.75;color:#c2ccd6;white-space:pre-line;}
.guide-btns{margin-top:12px;display:flex;gap:8px;justify-content:flex-end;align-items:center;}
.guide-skip{margin-right:auto;background:none;border:none;color:#7b8794;font-size:12px;cursor:pointer;padding:4px 6px;}
.guide-skip:hover{color:#c2ccd6;}
.gbtn{border-radius:6px;padding:6px 14px;font-size:12px;cursor:pointer;border:1px solid transparent;}
.gbtn-prev{background:#22303d;color:#c2ccd6;border-color:#2a3a4a;}
.gbtn-prev:hover{background:#2a3a4a;}
.gbtn-next{background:#2f7df6;color:#fff;}
.gbtn-next:hover{background:#4a93ff;}
#guide-root.guide-center .guide-card{left:50%;top:50%;transform:translate(-50%,-50%);text-align:center;width:360px;max-width:calc(100vw - 48px);}
#guide-root.guide-center .guide-btns{justify-content:center;}
#guide-root.guide-center .guide-step-tag{display:none;}
#guide-root.guide-center .gbtn-prev{display:none;}
#guide-root.guide-center .guide-skip{margin-right:0;position:absolute;right:16px;bottom:14px;top:auto;}
.guide-toggle{position:absolute;right:12px;bottom:12px;z-index:12;display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:8px;background:rgba(20,28,38,0.82);color:#9fd0ff;border:1px solid #2a3a4a;font-size:13px;font-weight:500;line-height:1;cursor:pointer;backdrop-filter:blur(2px);}
.guide-toggle .gt-q{font-weight:700;font-size:14px;}
.guide-toggle:hover{background:#2a3a4a;color:#ffffff;border-color:#3a4a5a;}
/* 欢迎页富文本排版 */
.g-welcome{font-size:12px;color:#9fb3c8;letter-spacing:2px;margin-bottom:6px;}
.g-brand{font-size:23px;font-weight:800;color:#ffffff;letter-spacing:1px;}
.g-slogan{font-size:13px;color:#e0e8f0;margin-top:20px;}
.g-flow{font-size:13px;color:#e0e8f0;margin-top:3px;}
.g-sub{font-size:11px;color:#9fb3c8;margin-top:10px;line-height:1.7;}
.metal-toggle-label { display:inline-flex; align-items:center; gap:3px; margin-left:8px; font-size:11px; color:#a0b0c0; cursor:pointer; white-space:nowrap; }
.metal-toggle-label input { cursor:pointer; }
.gift-color-row { display:flex; align-items:center; gap:12px; margin:4px 0 8px 0; padding-left:2px; }
.gift-color-row .color-inline { font-size:11px; color:#a0b0c0; }
.gift-color-row .color-inline input[type="color"] { width:24px; height:20px; border:none; background:none; cursor:pointer; vertical-align:middle; margin-left:4px; }
.metal-toggle-label { display:inline-flex; align-items:center; gap:3px; font-size:11px; color:#a0b0c0; cursor:pointer; white-space:nowrap; }
.metal-toggle-label input { cursor:pointer; }

/* 第四档 · .btn-ghost 收口（原 btn-pdq-back 内联值） */
.btn-ghost{ font-size:calc(10px * var(--fs)); padding:2px 6px; border:1px solid #babdbf; background:#ffffff; color:#6b747c; border-radius:3px; cursor:pointer; }

/* ==========================================================================
   工具页夜间模式 V2（2026-10-01 重做）
   颜色与帮助页（help.html html.dark）完全一致：
   bg #0E141E / panel #151F2C / card #1B2735 / border #27364A
   text #E6EDF7 / muted #93A5BC / accent #4A9EFF / accent-soft #14273F
   机制：body 同时挂 light-theme + dark 两个类；本块写在文件最末尾，
   body.light-theme.dark 与 body.light-theme 特异性相同、靠后获胜，可覆盖精修层白天值。
   白天版"下拉框黑底白字"在夜间反向为"白底黑字"（用户约定）。
   ========================================================================== */
.theme-toggle-btn{ width:30px !important;height:30px;padding:0 !important;border-radius:50%;border:1px solid #d5dbe3 !important;background:#ffffff;color:#1f2937 !important;display:inline-flex;align-items:center !important;justify-content:center;cursor:pointer !important;transition:all .15s cubic-bezier(.4,0,.2,1);flex-shrink:0 !important; }
.theme-toggle-btn:hover{ border-color:#0D6EFD !important; color:#0D6EFD; }

body.light-theme.dark{
  --bg-base:#0E141E; --bg-panel:#151F2C; --bg-card:#1B2735; --bg-card-2:#223044;
  --border:#27364A; --border-soft:#22303F;
  --text-1:#E6EDF7; --text-2:#93A5BC; --text-3:#64748B;
  --accent:#4A9EFF; --accent-hover:#6BB1FF; --accent-soft:#14273F;
  /* 覆写白天变量族：所有引用 var(--xxx-lt) 的规则自动夜间化（无需逐条覆盖） */
  --bg-base-lt:#0E141E; --bg-panel-lt:#151F2C; --bg-card-lt:#1B2735; --bg-card-2-lt:#223044;
  --border-lt:#27364A; --border-soft-lt:#22303F;
  --text-1-lt:#E6EDF7; --text-2-lt:#93A5BC; --text-3-lt:#64748B;
  --accent-lt:#4A9EFF; --accent-hover-lt:#6BB1FF; --accent-soft-lt:#14273F;
  --sh-sm:0 1px 2px rgba(0,0,0,.4); --sh-md:0 4px 12px rgba(0,0,0,.45);
}
body.light-theme.dark { background:var(--bg-base) !important; color:var(--text-1); }
/* 顶部栏 */
body.light-theme.dark header{ background:#151F2C !important; border-bottom:1px solid #27364A; }
body.light-theme.dark .brand-name, body.light-theme.dark .brand-name em{ color:#F4F8FE !important; }
body.light-theme.dark .brand-slogan{ color:#93A5BC !important; }
body.light-theme.dark .header-right .auth-btn{ background:#1B2735 !important; border:1px solid #27364A; color:#E6EDF7 !important; }
body.light-theme.dark .header-right .auth-btn:hover{ border-color:#4A9EFF !important; color:#4A9EFF; }
body.light-theme.dark .auth-btn-primary{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
body.light-theme.dark .theme-toggle-btn{ background:#1B2735 !important; border-color:#27364A; color:#E6EDF7 !important; }
body.light-theme.dark .theme-toggle-btn:hover{ border-color:#4A9EFF !important; color:#4A9EFF; }
/* 左栏 */
body.light-theme.dark .panel{ background:#151F2C !important; border-right:1px solid #27364A; }
body.light-theme.dark .section-title{ color:#4A9EFF !important; border-left-color:#4A9EFF !important; }
body.light-theme.dark .form-label-top, body.light-theme.dark .form-row label, body.light-theme.dark .form-row-vertical label{ color:#93A5BC !important; }
body.light-theme.dark .form-row input[type="number"], body.light-theme.dark .form-row input[type="text"], body.light-theme.dark .form-row-vertical input[type="number"]{ background:#0E141E !important; border:1px solid #27364A; color:#E6EDF7 !important; }
body.light-theme.dark select, body.light-theme.dark .pallet-select, body.light-theme.dark #pallet-select{ background:#FFFFFF !important; border:1px solid #27364A !important; color:#1F2937 !important; }
body.light-theme.dark .form-row select, body.light-theme.dark .form-row-vertical select{ background:#FFFFFF !important; color:#1F2937 !important; }
/* 盒装/袋装/PDQ、方案按钮组（白天态） */
body.light-theme.dark .model-btn{ background:#1B2735 !important; border:1px solid #27364A; color:#E6EDF7 !important; }
body.light-theme.dark .model-btn.active{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
body.light-theme.dark .scheme-btn{ background:#1B2735 !important; border:1px solid #27364A; color:#E6EDF7 !important; }
body.light-theme.dark .scheme-btn.active{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
body.light-theme.dark .scheme-selector .scheme-label, body.light-theme.dark .layer-header span{ color:#4A9EFF !important; }
body.light-theme.dark .layer-control, body.light-theme.dark .layer-btns .btn{ background:#1B2735 !important; border-color:#27364A; color:#E6EDF7 !important; }
body.light-theme.dark #layer-count-display{ color:#E6EDF7 !important; }
body.light-theme.dark .btn-primary{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
body.light-theme.dark .btn-ghost{ background:#1B2735 !important; border-color:#27364A; color:#93A5BC !important; }
body.light-theme.dark .btn-pdq-back{ background:#1B2735 !important; border-color:#27364A; color:#E6EDF7 !important; }
/* 上传框 */
body.light-theme.dark .tex-item .thumb{ background:#0E141E !important; border:1px dashed #33445C; color:#64748B !important; }
body.light-theme.dark .tex-item .thumb:hover{ border-color:#4A9EFF !important; background:#14273F; }
body.light-theme.dark .gift-color-row .color-inline, body.light-theme.dark .metal-toggle-label{ color:#93A5BC !important; }
/* 3D 视口与视图按钮 */
body.light-theme.dark .viewport{ background:radial-gradient(ellipse at 50% 45%, #1B2735 0%, #0E141E 70%) !important; }
body.light-theme.dark .view-controls .btn, body.light-theme.dark .btn-view, body.light-theme.dark .view-legend-btn{ background:#1B2735 !important; border:1px solid #27364A; color:#93A5BC !important; }
body.light-theme.dark .view-controls .btn.active, body.light-theme.dark .btn-view.active{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
body.light-theme.dark .auto-rotate-btn{ background:#1B2735 !important; border-color:#27364A; color:#E6EDF7 !important; }
body.light-theme.dark .auto-rotate-btn.rotating{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
body.light-theme.dark .info-overlay{ background:rgba(14,20,30,0.86) !important; border:1px solid #27364A; color:#E6EDF7 !important; }
body.light-theme.dark .info-overlay .title{ color:#4A9EFF !important; }
body.light-theme.dark .info-overlay .row span{ color:#93A5BC !important; }
body.light-theme.dark .info-overlay .row b{ color:#F4F8FE !important; }
/* 右栏 */
body.light-theme.dark .annotation-panel{ background:#151F2C !important; border-left:1px solid #27364A; }
body.light-theme.dark .annotation-header{ background:#1B2735 !important; border-bottom:1px solid #27364A; }
body.light-theme.dark .annotation-header .panel-tag{ color:#4A9EFF !important; }
body.light-theme.dark .header-btns .btn{ background:#1B2735 !important; border:1px solid #27364A; color:#E6EDF7 !important; }
body.light-theme.dark .single-preview{ background:#1B2735 !important; border:1px solid #27364A; }
body.light-theme.dark .preview-placeholder{ color:#64748B !important; }
body.light-theme.dark .view-item{ background:#1B2735 !important; border:1px solid #27364A; }
body.light-theme.dark .view-label{ background:#223044 !important; color:#93A5BC; }
body.light-theme.dark .view-empty{ color:#64748B !important; }
body.light-theme.dark .info-list{ background:#1B2735 !important; border:1px solid #27364A; }
body.light-theme.dark .info-row{ border-bottom:1px solid #27364A !important; }
body.light-theme.dark .info-label{ color:#93A5BC !important; }
body.light-theme.dark .info-value{ color:#F4F8FE !important; }
body.light-theme.dark .pallet-info{ background:#1B2735 !important; border:1px solid #27364A; color:#93A5BC !important; }
body.light-theme.dark .pallet-info b{ color:#34C77B !important; }
body.light-theme.dark .pallet-detail{ background:#1B2735 !important; border-color:#27364A; }
body.light-theme.dark .pallet-detail span:first-child{ color:#93A5BC !important; }
body.light-theme.dark .pallet-detail span:last-child{ color:#F4F8FE !important; }
body.light-theme.dark .layer-warning{ background:#3A2E15 !important; border-color:#8A6D3B; color:#F5D9A8 !important; }
body.light-theme.dark .video-card, body.light-theme.dark .annotation-section{ background:#1B2735 !important; border:1px solid #27364A; }
body.light-theme.dark #btn-download-single:disabled, body.light-theme.dark .btn-view-dl:disabled, body.light-theme.dark #btn-download-video:disabled{ background:#334155 !important; color:#94A3B8 !important; border-color:#334155 !important; }
/* 模型弹窗/上传弹窗 */
body.light-theme.dark .model-popup{ background:rgba(21,31,44,0.97) !important; border:1px solid #27364A; }
body.light-theme.dark .model-popup .popup-title, body.light-theme.dark .model-popup .popup-row label{ color:#4A9EFF !important; }
body.light-theme.dark .model-popup .popup-row input, body.light-theme.dark .annotation-panel input[type="number"]{ background:#0E141E !important; border:1px solid #27364A; color:#E6EDF7 !important; }
/* 账户下拉 */
body.light-theme.dark .user-dropdown{ background:#151F2C !important; border:1px solid #27364A; box-shadow:0 8px 32px rgba(0,0,0,0.5) !important; }
body.light-theme.dark .user-dropdown-header, body.light-theme.dark .user-dropdown-email{ color:#F4F8FE !important; }
body.light-theme.dark .user-dropdown-item{ color:#E6EDF7 !important; }
body.light-theme.dark .user-dropdown-item:hover{ background:#1B2735 !important; }
body.light-theme.dark .user-dropdown-divider{ background:#27364A !important; }
body.light-theme.dark .user-email{ color:#4A9EFF !important; }
body.light-theme.dark .btn-plan-action{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
/* 登录弹窗 */
body.light-theme.dark .auth-modal-content{ background:#151F2C !important; border:1px solid #27364A; }
body.light-theme.dark .auth-modal-title, body.light-theme.dark .auth-modal-subtitle{ color:#F4F8FE !important; }
body.light-theme.dark .auth-tabs{ border-bottom-color:#27364A !important; }
body.light-theme.dark .auth-tab{ color:#93A5BC !important; }
body.light-theme.dark .auth-tab.active{ color:#4A9EFF !important; border-bottom-color:#4A9EFF !important; }
body.light-theme.dark .auth-field label{ color:#93A5BC !important; }
body.light-theme.dark .auth-field input{ background:#0E141E !important; border:1px solid #27364A; color:#E6EDF7 !important; }
body.light-theme.dark .auth-field input::placeholder{ color:#64748B !important; }
body.light-theme.dark .auth-submit{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
body.light-theme.dark .auth-send-code{ background:rgba(74,158,255,0.12) !important; border-color:#4A9EFF; color:#4A9EFF !important; }
body.light-theme.dark .auth-hint, body.light-theme.dark .auth-hint a{ color:#93A5BC !important; }
body.light-theme.dark .auth-hint a{ color:#4A9EFF !important; }
/* 下拉选项夜间模式：深底浅字（与输入框统一风格） */
body.light-theme.dark select{ background:#0E141E !important; color:#E6EDF7 !important; }
body.light-theme.dark #pallet-select, body.light-theme.dark #boxshape-current, body.light-theme.dark #boxshape-menu,
body.light-theme.dark #inp-goods-dir, body.light-theme.dark #pdq-shape-select{
  border-color:#27364A !important; background:#0E141E !important; color:#E6EDF7 !important; border-radius:var(--r-sm) !important;
}
body.light-theme.dark select option{ background:#0E141E !important; color:#E6EDF7 !important; }
/* 夜间：内含规格输入框深底（覆盖白天 ID 强制层） */
body.light-theme.dark #inp-goods-count, body.light-theme.dark #inp-goods-layers, body.light-theme.dark #inp-goods-gap-v, body.light-theme.dark #inp-goods-gap-h,
body.light-theme.dark #inp-goods-tri-l, body.light-theme.dark #inp-goods-tri-m, body.light-theme.dark #inp-goods-tri-r,
body.light-theme.dark #inp-goods-side-fwd, body.light-theme.dark #inp-goods-side-side{
  border-color:#27364A !important; background:#0E141E !important; color:#E6EDF7 !important;
}
/* 夜间：PDQ参数区所有输入框深底浅字 */
body.light-theme.dark #inp-pdq-L, body.light-theme.dark #inp-pdq-W, body.light-theme.dark #inp-pdq-H,
body.light-theme.dark #inp-pdq-weight, body.light-theme.dark #inp-pdq-fronth, body.light-theme.dark #inp-pdq-frontd,
body.light-theme.dark #inp-pdq-structh, body.light-theme.dark #inp-pdq-leftw, body.light-theme.dark #inp-pdq-rightw,
body.light-theme.dark #inp-pdq-backd{
  border-color:#27364A !important; background:#0E141E !important; color:#E6EDF7 !important;
}
/* 夜间：托盘选择区-允许总超出输入框 */
body.light-theme.dark #inp-allow-over{
  border-color:#27364A !important; background:#0E141E !important; color:#E6EDF7 !important;
}
/* 新手引导：本就是深色浮层，夜间下仅融合边框 */
body.light-theme.dark .guide-toggle{ background:rgba(27,39,53,0.88) !important; border-color:#27364A; color:#9FD0FF !important; }
body.light-theme.dark .guide-toggle:hover{ background:#223044 !important; }
body.light-theme.dark .guide-card{ background:#151F2C !important; border-color:#27364A; }

/* 左栏 .panel 与右栏 .panel-section 卡片（白天白底，夜间必须覆盖，2026-10-01 补） */
body.light-theme.dark .panel{ background:#151F2C !important; border-right:1px solid #27364A !important; }
body.light-theme.dark .panel-section{ background:#1B2735 !important; border-color:#27364A !important; }

/* ===== 全页面白色残留补扫（2026-10-02）===== */
/* 左栏卡片与按钮组 */
body.light-theme.dark .design-card{ background:#1B2735 !important; border:1px solid #27364A !important; box-shadow:inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 2px rgba(0,0,0,0.3) !important; }
body.light-theme.dark .model-btns{ background:#1B2735 !important; border-color:#27364A !important; }
body.light-theme.dark .model-btn{ background:#1B2735 !important; border-color:#27364A !important; color:#E6EDF7 !important; }
body.light-theme.dark .model-btn.active{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
/* 右栏内容容器 */
body.light-theme.dark .annotation-content{ background:#151F2C !important; }
/* 按钮：主按钮品牌蓝，次级按钮深底（ghost 化）——白天为 ID 级 !important，夜间必须 ID 级才压得住 */
body.light-theme.dark #btn-preview-single{ background:#4A9EFF !important; color:#fff !important; border:1px solid #4A9EFF !important; }
body.light-theme.dark #btn-preview-single:hover{ background:#6BB1FF !important; border-color:#6BB1FF !important; }
body.light-theme.dark #btn-export-single, body.light-theme.dark #btn-export-pallet{ background:#223044 !important; color:#E6EDF7 !important; border:1px solid #27364A !important; box-shadow:none !important; }
body.light-theme.dark #btn-export-single:not(:disabled):hover, body.light-theme.dark #btn-export-pallet:not(:disabled):hover{ background:#27364A !important; color:#4A9EFF !important; border-color:#4A9EFF !important; }
body.light-theme.dark #btn-export-single:disabled, body.light-theme.dark #btn-export-pallet:disabled{ background:#334155 !important; color:#94A3B8 !important; border-color:#334155 !important; opacity:1 !important; }
body.light-theme.dark #btn-clear-exports{ background:#223044 !important; color:#F0555E !important; border:1px solid rgba(240,85,94,0.4) !important; }
body.light-theme.dark #btn-clear-exports:hover{ background:#3A2E15 !important; border-color:#F0555E !important; }
/* 视口顶部视图栏 / 相机控制栏 */
body.light-theme.dark .view-controls{ background:#1B2735 !important; border:1px solid #27364A !important; }
body.light-theme.dark .view-controls .view-btn{ background:transparent !important; border-color:transparent !important; color:#93A5BC !important; }
body.light-theme.dark .view-controls .view-btn.active{ background:#223044 !important; color:#4A9EFF !important; }
body.light-theme.dark .camera-controls{ background:#1B2735 !important; border:1px solid #27364A !important; }
body.light-theme.dark .cam-btn{ background:#1B2735 !important; border-color:#27364A !important; color:#E6EDF7 !important; }
body.light-theme.dark .cam-btn.active{ background:#4A9EFF !important; border-color:#4A9EFF !important; color:#fff !important; }
/* 四视图缩略格 */
body.light-theme.dark .view-preview{ background:#1B2735 !important; border-color:#27364A !important; }
body.light-theme.dark .view-preview .vp-label{ color:#93A5BC !important; }
/* 账户下拉头部 / 复选框 */
body.light-theme.dark .user-dropdown-header{ background:#151F2C !important; }
/* 盒装/袋装/PDQ 的选中红点：普通方块深色，选中红点保留红色（2026-10-02 修正） */
body.light-theme.dark .model-btn .chk{ background:#223044 !important; border-color:#27364A !important; }
body.light-theme.dark .model-btn .chk.on{ background:#FF3B30 !important; border-color:#FF3B30 !important; }
body.light-theme.dark .model-btn.active .chk{ border-color:rgba(255,255,255,0.85) !important; background:rgba(255,255,255,0.25) !important; }
body.light-theme.dark .model-btn.active .chk.on{ background:#FF5A50 !important; border-color:#FF5A50 !important; }

/* 头部品牌 LOGO：夜间换深色版（与帮助页一致，2026-10-02） */
body.light-theme.dark .brand-logo-dark{ display:block !important; }
body.light-theme.dark .brand-logo-light{ display:none !important; }
body.light-theme.dark header .brand-slogan{ color:#93A5BC !important; }

/* ===== 2026-10-03 夜间残留补扫：堆码操作区 + 右栏视图容器 =====
   堆码方案/堆码层数区块（计算堆码后才显示）与右栏四视图容器
   的日间背景此前未覆盖，夜间出现白色残留；此处以更高特异性
   （容器前缀 / ID 级）强制压过日间基础层。 */
body.light-theme.dark .scheme-selector{ background:#1B2735 !important; border:1px solid #27364A !important; }
body.light-theme.dark .scheme-btns{ background:#223044 !important; border:1px solid #27364A !important; }
body.light-theme.dark .annotation-panel .view-item{ background:#1B2735 !important; border:1px solid #27364A !important; }
body.light-theme.dark .annotation-panel .view-preview{ background:#0E141E !important; border:1px solid #27364A !important; }
body.light-theme.dark #theme-toggle-btn{ background:#1B2735 !important; border:1px solid #27364A !important; color:#E6EDF7 !important; }
body.light-theme.dark #user-dropdown{ background:#151F2C !important; border:1px solid #27364A !important; }
body.light-theme.dark #user-dropdown-header, body.light-theme.dark .user-dropdown-header{ background:#1B2735 !important; }


/* ===== 到期提醒横幅（批次6） ===== */
.exp-notice{padding:8px 14px;font-size:13px;text-align:center;line-height:1.6}
body.light-theme .exp-notice-soon{background:#fff7e6;color:#b26a00;border-bottom:1px solid #ffe7a6}
body.light-theme .exp-notice-expired{background:#fdecee;color:#c0392b;border-bottom:1px solid #f5c6cb}
body.dark .exp-notice-soon{background:#33291a;color:#f0c36d;border-bottom:1px solid #5c4a26}
body.dark .exp-notice-expired{background:#3a1f24;color:#f0909a;border-bottom:1px solid #6b343d}

/* ===== 夜间模式表单控件终极覆盖（2026-11-04） ===== */
body.light-theme.dark input[type="number"],
body.light-theme.dark input[type="text"],
body.light-theme.dark select{
  background:#0E141E !important;
  color:#E6EDF7 !important;
  border-color:#27364A !important;
}
body.light-theme.dark select option{
  background:#0E141E !important;
  color:#E6EDF7 !important;
}
