.layout-options{grid-template-columns:repeat(3,minmax(0,1fr))}.layout-options button{padding:12px 3px 10px}.layout-options svg{display:block;width:62px;height:42px;margin:0 auto 6px;stroke-width:1.5}.layout-options span{font-size:11px}.layout-section{padding-top:20px}.camera-tools{max-width:calc(100% - 32px);overflow-x:auto;scrollbar-width:thin}.model-status{max-width:calc(100% - 50px);line-height:1.6}.save-panel p{line-height:1.65}.viewer-heading h1{font-size:28px}.viewer-heading p{letter-spacing:2px}.viewer-heading{top:30px}.view-tools{top:30px}@media(max-width:1050px) and (min-width:721px){.viewer-heading{top:86px}.viewer-heading h1{font-size:23px}}@media(max-width:720px){.viewer-heading{top:20px}.viewer-heading h1{font-size:21px}.camera-tools{left:16px;right:16px;transform:none;max-width:none;justify-content:center}.camera-tools button{padding:8px!important;font-size:10px!important}.scene-footer{font-size:9px}.model-status{bottom:111px;font-size:9px}.layout-options button{padding:12px 4px}.layout-options span{font-size:12px}}

@media(max-width:720px){.camera-tools{justify-content:flex-start}.camera-tools button{flex-shrink:0}.camera-tools button:first-child{margin-left:auto}.camera-tools button:last-child{margin-right:auto}}

.scene-footer .scene-hint{position:absolute;left:50%;transform:translateX(-50%)}
.scene-footer #reset-camera{margin-left:auto}
@media(max-width:1050px){.scene-footer .scene-hint{display:none}}

#save-dialog{max-width:620px;max-height:calc(100dvh - 24px);padding:16px 20px;background:var(--paper)}
#save-dialog .dialog-heading button{min-width:44px;min-height:44px}
#plan-preview{max-height:calc(100dvh - 168px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:8px}
#save-dialog #plan-image{display:block;width:100%;height:auto;margin:0}
#save-dialog .dialog-actions{margin-top:12px}
#save-dialog .dialog-actions button{min-height:44px}
#plan-feedback{margin:8px 0 0;font-size:12px;color:#60685c;text-align:center;line-height:1.5}
.plan-description{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:480px){#save-dialog{padding:10px 12px;width:calc(100% - 20px)}}

.layout-options{grid-template-columns:repeat(2,minmax(0,1fr))}button:disabled{cursor:default;opacity:.5}
.layout-options [data-value="zigzag"] { grid-column: 1 / -1; }
#zigzag-options .compact-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }

main { min-height: 0; }

.config-tabs {
  display: flex;
  flex: none;
  gap: 4px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
}

.config-tabs button {
  flex: 1;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.config-tabs button[aria-selected="true"] {
  border-color: #a9b59e;
  background: #e6ebdf;
  color: #40523f;
  font-weight: 600;
}

.config-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.config-scroll [role="tabpanel"] { padding-bottom: 16px; }
.config-scroll [role="tabpanel"] .option-section:last-child { border-bottom: 0; }

.material-targets {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 12px;
}

.material-targets button {
  min-height: 44px;
  padding: 4px 1px;
  font-size: 12px;
  white-space: nowrap;
}

.custom-material {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.custom-material input {
  width: 48px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.custom-material output { color: var(--muted); }
.custom-material button { min-height: 44px; margin-left: auto; padding: 6px 10px; }

.catalog-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:24px; }
.catalog-heading h4 { font-size:14px; margin:0; font-weight:600; }
.catalog-heading span { font-size:11px; color:var(--muted); }
.catalog-filters { display:flex; gap:8px; margin-top:12px; }
.catalog-filters input,.catalog-filters select { min-width:0; min-height:44px; border:1px solid var(--line); border-radius:6px; background:var(--paper); color:inherit; font:inherit; font-size:12px; padding:8px; }
.catalog-filters input { flex:1; width:0; }
.catalog-filters select { width:104px; }
.catalog-options { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.catalog-options button { min-width:0; padding:6px 6px 10px; text-align:left; }
.catalog-options img { display:block; width:100%; height:86px; object-fit:contain; background:#090909; border-radius:3px; margin-bottom:8px; }
.catalog-options button span { display:block; font-size:12px; }
.catalog-options button small { display:inline-block; font-size:10px; margin-top:5px; color:#69705f; }
.catalog-options [data-status="待核验"] small { color:#8d661e; }
.catalog-options [data-status="需重做"] small { color:#ae4636; }
.catalog-options button:focus-visible { outline:2px solid #40523f; outline-offset:2px; }
#catalog-feedback { min-height:36px; line-height:1.6; }

.texture-controls { min-width:0; margin:0 0 16px; padding:12px; border:1px solid var(--line); border-radius:6px; }
.texture-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; }
.texture-heading output { margin-left:8px; font-variant-numeric:tabular-nums; font-weight:600; }
.texture-heading button { min-height:36px; }
.texture-controls input[type="range"] { display:block; width:100%; margin:6px 0 0; min-height:36px; accent-color:#536452; }
.texture-scale-hints { display:flex; justify-content:space-between; font-size:10px; color:var(--muted); }
.texture-directions { display:flex; gap:8px; margin-top:12px; }
.texture-directions button { flex:1; min-height:44px; border:1px solid var(--line); border-radius:6px; background:transparent; font-size:12px; }
.texture-directions button.selected { background:#e6ebdf; border-color:#a9b59e; color:#40523f; }
.texture-controls .field-note { margin-bottom:0; }
.texture-controls:disabled { opacity:.65; }

.glass-toggle { grid-template-columns:repeat(2,minmax(0,1fr)); }
.glass-looks { min-width:0; padding:0; margin:22px 0 0; border:0; }
.glass-looks legend { font-size:12px; margin-bottom:12px; color:var(--muted); }
.glass-options { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.glass-options button { min-width:0; min-height:100px; padding:10px 4px; }
.glass-options button span { font-size:12px; }
.glass-swatch { display:block; width:35px; height:43px; margin:0 auto 12px; transform:skewY(-7deg); border:1px solid #9ab3a9; border-right:3px solid #7d9d91; border-radius:2px; }
.glass-swatch.clear { background:rgba(155,192,174,.25); }
.glass-swatch.ultra { background:rgba(214,234,237,.18); border-color:#b0c6ca; }
.glass-swatch.gray { background:rgba(102,119,133,.35); border-color:#7c8c96; }
.glass-view-actions { display:flex; gap:8px; margin-block:16px; }
.glass-view-actions button { flex:1; min-height:44px; }
.wood-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
.wood-options button { min-height:96px; }
.wood-swatch { display:block; width:68px; height:28px; border-radius:12px 12px 5px 5px; margin:0 auto 12px; border:1px solid #20211e; }
.wood-swatch.black { background:#252321; }
.wood-swatch.walnut { background:#603b28; border-color:#472b1e; }
.config-tabs { gap:2px; }
.config-tabs button { min-width:0; }
@media(max-width:420px){.config-tabs{padding-inline:10px}.config-tabs button{font-size:12px;padding-inline:2px}}

.save-panel {
  flex: none;
  padding-top: 10px;
  padding-bottom: 10px;
}

.save-panel .save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.save-panel #selection-summary {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-panel #save {
  flex: none;
  width: auto;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  white-space: nowrap;
}

.save-panel > small { margin-top: 4px; }

@media (max-width: 720px) {
  .header { height: 56px; }

  main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(160px, 38dvh, 360px) minmax(0, 1fr);
    height: calc(100dvh - 56px);
  }

  .viewer { height: auto; }
  .viewer-heading { display: none; }
  .view-tools { top: 12px; }
  .scene-footer { padding: 8px 18px; }
  .camera-tools { bottom: 42px; }
  .config-tabs { padding: 4px 12px; }
  .config-scroll { padding-inline: 16px; }
  .config-scroll .option-section { padding: 12px 0; }
  .config-scroll .section-title { margin-bottom: 10px; }
  .layout-options button { padding-block: 7px; }
  .layout-options svg { width: 48px; height: 30px; }
  .config-scroll .joint-options button { min-height: 59px; padding-block: 7px; }
  .save-panel { position: static; padding-inline: 16px; box-shadow: none; }
}

@media (min-width: 520px) and (max-width: 720px) and (max-height: 480px) and (orientation: landscape) {
  main {
    grid-template-columns: minmax(0, 1fr) minmax(282px, 47%);
    grid-template-rows: minmax(0, 1fr);
  }

  .config { border-top: 0; border-left: 1px solid var(--line); }
}

/* ── 折叠区：次要设置收起，首屏只留主要选择 ───────────────── */
.fold { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fold > summary {
  display: flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 6px 12px; cursor: pointer; list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: ''; margin-left: 8px; width: 6px; height: 6px; flex: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold-title { font-size: 14px; font-weight: 600; color: var(--ink, #2f332c); }
.fold-value { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.fold-body { padding: 0 12px 12px; }
.fold .texture-controls { margin: 0 0 10px; padding: 0; border: 0; }
.fold .custom-material { margin-top: 0; }

/* 「原始造型」与七款收口并列成一张卡，不再是孤立的标签按钮 */
.raw-joint-card {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 46px; margin: 0 0 10px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  font-size: 13px; color: inherit; text-align: left; position: relative;
}
.raw-joint-card small { font-size: 11px; color: var(--muted); min-width: 12px; }
.raw-joint-card[aria-pressed="true"] { border-color: #a9b59e; background: #eef1e8; box-shadow: inset 0 0 0 1px #a9b59e; }

/* ── 4 个固定主页签 + 页内子页签 ─────────────────────────── */
.config-tabs .main-tab { flex: 1; min-height: 44px; padding: 0 4px; font-size: 14px; }
.sub-tabs {
  display: flex; gap: 6px; padding: 12px 0 4px; margin: 0 0 2px;
  border-bottom: 1px solid var(--line);
}
.sub-tabs button {
  border: 1px solid var(--line); background: #fdfcf8; border-radius: 16px;
  padding: 7px 14px; font-size: 12px; color: #5f6759; min-height: 34px;
}
.sub-tabs button[aria-selected="true"] {
  border-color: #718466; background: #eef1e7; color: #40523f; font-weight: 600;
}

/* 不支持时的提示行，替代原本整条消失的页签 */
.hint-section .field-note { margin-top: 6px; }
.hint-action { margin-top: 10px; min-height: 40px; padding: 0 16px; }

/* 视口左上角的当前选择胶囊，替代原来的大标题 */
.model-chip {
  position: absolute; left: 22px; top: 18px; z-index: 2; pointer-events: none;
  display: inline-flex; align-items: center; max-width: calc(100% - 44px);
  padding: 6px 12px; border: 1px solid #dfe2d8; border-radius: 18px;
  background: #fbfcf9e6; font-size: 11px; color: #5f6759; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .model-chip { left: 14px; top: 12px; font-size: 10px; padding: 5px 10px; }
  .sub-tabs { padding-top: 10px; }
  .sub-tabs button { padding: 6px 12px; font-size: 11px; }
}
.camera-tools .camera-divider { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.camera-tools .minor { font-size: 11px; color: #7b8273; padding: 8px 10px; }
.camera-tools .camera-reset { font-size: 14px; line-height: 1; padding: 8px 12px; color: var(--green); }
@media (max-width: 720px) {
  .camera-tools .minor { font-size: 10px; padding: 8px 8px; }
  .camera-tools .camera-divider { margin: 0 2px; }
}
