:root {
  color-scheme: light;
  --page: #f6f6f1;
  --paper: #fff;
  --ink: #242a22;
  --muted: #62685d;
  --line: #e5e7df;
  --accent: #354331;
  --tint: #ecf0e7;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible, summary:focus-visible {
  outline: 2px solid #758864;
  outline-offset: 3px;
}
button:disabled { opacity: .5; cursor: default; }
[hidden] { display: none !important; }
.symbols, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.shell { max-width: 1260px; width: calc(100% - 88px); margin-inline: auto; }
.site-header { background: #fbfbf8; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 71px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.brand { font-size: 17px; font-weight: 720; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand-icon { width: 39px; height: 39px; display: grid; place-items: center; color: #f6f7ee; background: var(--accent); border-radius: 12px; }
.brand-icon svg { width: 24px; height: 24px; }
.header-actions { display: flex; gap: 9px; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.button-quiet { border-color: #dedfd6; background: var(--paper); color: var(--accent); }
.button-quiet:hover { background: var(--tint); }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { background: #465943; }
.page-title { padding: 36px 0 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 750; letter-spacing: -.045em; line-height: 1.15; }
.page-title p { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: 328px minmax(0, 1fr); align-items: start; gap: 20px; }
.editor, .viewer { border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: 0 2px 9px #2e302105; min-width: 0; }
.editor-section { padding: 17px 20px; }
.editor-section + .editor-section { border-top: 1px solid #ecece6; }
h2 { font-size: 14px; font-weight: 700; line-height: 1.35; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.unit { color: var(--muted); font-size: 11px; }
.type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.type-option { min-height: 47px; background: #fafaf8; border: 1px solid #e5e7df; border-radius: 9px; color: #565f51; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 630; font-size: 13px; }
.type-option svg { width: 21px; height: 21px; }
.type-option:hover, .type-option[aria-pressed="true"] { border-color: #a8b49d; color: #32442e; background: var(--tint); }
.dimensions { display: flex; gap: 8px; }
.dimensions label { flex: 1; min-width: 0; display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.dimensions input, .jar-options input, select {
  width: 100%; height: 35px; background: #fafaf8; border: 1px solid #e4e6de; border-radius: 7px; padding: 0 8px; color: var(--ink);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.dimensions input[aria-invalid="true"], .jar-options input[aria-invalid="true"] { border-color: #a95340; }
.settings-line { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-top: 13px; }
.colors { display: flex; gap: 9px; }
.color-control { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.color-control input { appearance: none; width: 19px; height: 19px; padding: 2px; border: 1px solid #d7d9d0; border-radius: 5px; background: #fff; cursor: pointer; }
.color-control input::-webkit-color-swatch-wrapper { padding: 0; }
.color-control input::-webkit-color-swatch { border: 0; border-radius: 2px; }
.color-control input::-moz-color-swatch { border: 0; border-radius: 2px; }
.text-button { padding: 0; border: 0; color: #496140; background: transparent; text-align: left; font-size: 11px; font-weight: 650; flex-shrink: 0; }
.text-button:hover { text-decoration: underline; }
.restore-spec { margin-top: 8px; }
.dropzone { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; padding: 11px; min-height: 64px; background: #f8f9f5; border: 1px dashed #bac6b3; color: var(--ink); border-radius: 9px; }
.dropzone:hover, .dropzone:focus-within, .dropzone.is-dragging { background: var(--tint); border-color: #6c845e; }
.dropzone:focus-visible { outline: 2px solid #6c845e; outline-offset: 2px; }
.upload-text { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.upload-text button { font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.dropzone small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.upload-icon { width: 32px; height: 32px; display: grid; place-items: center; background: #e9eee4; border-radius: 7px; color: #4b6243; }
.upload-icon svg { width: 17px; height: 17px; }
.file-preview { margin-top: 8px; display: flex; align-items: center; gap: 8px; min-height: 33px; border: 1px solid var(--line); padding: 3px 4px 3px 5px; border-radius: 7px; }
.file-preview img { display: block; width: 35px; height: 25px; object-fit: contain; background: #eeefe8; border-radius: 4px; }
.file-preview span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; font-size: 11px; color: var(--muted); }
.field-note { font-size: 11px; color: var(--muted); line-height: 1.55; margin-top: 7px; }
.face-controls { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.face-controls select { height: 31px; }
.adjust { margin-top: 9px; }
.adjust summary { display: flex; align-items: center; color: var(--muted); cursor: pointer; gap: 5px; font-size: 11px; list-style: none; }
.adjust summary::-webkit-details-marker { display: none; }
.adjust summary svg { width: 15px; height: 15px; }
.chevron { margin-left: auto; }
.adjust[open] .chevron { transform: rotate(180deg); }
.slider-label { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: 11px; margin-top: 8px; color: var(--muted); }
.slider-label input { margin: 0; width: 100%; grid-column: 1 / -1; accent-color: var(--accent); }
.reference-upload { width: 100%; min-height: 35px; display: flex; gap: 7px; align-items: center; padding: 5px 8px; border: 1px solid #e5e7df; border-radius: 7px; background: #fafaf8; color: #4e584a; font-size: 12px; }
.reference-upload:hover { background: var(--tint); }
.reference-upload svg { width: 16px; height: 16px; }
.reference-plus { margin-left: auto; font-size: 16px; }
#apply-suggestion { margin-top: 7px; }
.viewer { overflow: hidden; display: flex; flex-direction: column; }
.viewer-header, .viewer-footer { padding: 11px 15px; background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.viewer-header { min-height: 56px; }
.viewer-title, .viewer-actions, .views { display: flex; align-items: center; gap: 6px; }
.viewer-actions { flex-shrink: 0; }
.background-select { width: auto; height: 33px; font-size: 12px; color: #505d4b; background: #fff; }
.viewer-title { flex-wrap: wrap; gap: 7px 10px; }
.viewer-title span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon-button { display: grid; place-items: center; width: 33px; height: 33px; color: #505d4b; background: #fff; border: 1px solid #e3e6dc; border-radius: 8px; padding: 0; flex-shrink: 0; }
.icon-button:hover, .icon-button[aria-pressed="true"] { background: var(--tint); color: #33472c; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.small { width: 25px; height: 25px; border: 0; }
.icon-button.small svg { width: 14px; height: 14px; }
.stage { height: clamp(415px, 55vh, 580px); min-height: 0; position: relative; isolation: isolate; overflow: hidden; border-block: 1px solid #e9e8dc; background: radial-gradient(ellipse at 49% 40%, #f7f5e9 0%, #eeebdf 54%, #e3e2d5 100%); }
.stage[data-background="transparent"] {
  background: conic-gradient(#eef0eb 25%, #fff 0 50%, #eef0eb 0 75%, #fff 0) 0 0 / 20px 20px;
}
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.stage canvas:active { cursor: grabbing; }
.stage canvas:focus-visible { outline-offset: -4px; }
.stage-hint { display: flex; align-items: center; gap: 6px; position: absolute; left: 16px; bottom: 16px; pointer-events: none; color: #4f5849; }
.stage-hint span, .privacy span { width: 6px; height: 6px; background: #789068; border-radius: 50%; }
.stage-hint strong { font-size: 11px; font-weight: 580; }
.zoom-control { position: absolute; right: 13px; bottom: 12px; display: flex; gap: 3px; border: 1px solid #dadbd0; background: #fcfcf7e8; border-radius: 10px; padding: 3px; }
.zoom-control .icon-button { border-color: transparent; width: 29px; height: 29px; background: transparent; }
.zoom-control .icon-button:hover { background: var(--tint); }
.views { max-width: 100%; flex-wrap: wrap; }
.views button { border: 1px solid transparent; background: transparent; color: #5b6457; padding: 6px 9px; min-height: 32px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.views button:hover, .views button[aria-pressed="true"] { color: #374d31; background: var(--tint); border-color: #e5eadf; }
.view-hint { color: var(--muted); display: flex; gap: 5px; align-items: center; font-size: 11px; white-space: nowrap; }
.view-hint svg { width: 15px; height: 15px; }
.viewer:fullscreen, .viewer.expanded { background: white; border: 0; border-radius: 0; width: 100%; height: 100%; }
.viewer.expanded { position: fixed; inset: 0; z-index: 10; }
.viewer:fullscreen .stage, .viewer.expanded .stage { flex: 1; }
.privacy { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; padding: 13px 0 24px; }
.privacy span { background: #9ba894; }
.render-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 25px; color: #62685d; font-size: 14px; }
.toast { position: fixed; z-index: 11; left: 50%; bottom: 22px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 28px); padding: 10px 15px; border-radius: 9px; background: #303d2d; color: #fff; font-size: 13px; text-align: center; box-shadow: 0 5px 14px #242a2229; }
@media (max-width: 900px) {
  .shell { width: calc(100% - 40px); }
  .workspace { grid-template-columns: 292px minmax(0, 1fr); gap: 13px; }
  .editor-section { padding-inline: 15px; }
  .view-hint { display: none; }
}
@media (max-width: 660px) {
  .shell { width: calc(100% - 26px); }
  .header-inner { min-height: 59px; gap: 7px; }
  .brand { font-size: 14px; gap: 6px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 9px; }
  .brand-icon svg { width: 20px; height: 20px; }
  .header-actions { gap: 5px; }
  .button { min-height: 33px; padding: 5px 7px; gap: 4px; font-size: 11px; }
  .button svg { width: 13px; height: 13px; }
  .page-title { padding: 23px 0 15px; }
  .page-title p { margin-top: 6px; font-size: 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .viewer { grid-row: 1; }
  .stage { height: clamp(280px, 44vh, 475px); }
  .viewer-header, .viewer-footer { padding: 7px 9px; }
  .viewer-header { min-height: 49px; }
  .privacy { padding-bottom: 18px; }
}

.jar-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.jar-options label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.jar-options select, .jar-options input { min-width: 0; }
@media (min-width: 661px) {
  html { scrollbar-gutter: stable; }
  .editor { position: relative; }
  .editor-section { padding-block: 14px; }
  .viewer { position: sticky; top: 14px; }
  .viewer-header, .viewer-footer { flex: none; }
  .stage { height: clamp(200px, calc(100svh - 344px), 560px); }
  .privacy { padding-block: 10px 12px; }
}
