:root {
  color-scheme: light;
  --ink: #1f1f1f;
  --muted: #777;
  --subtle: #9a9a9a;
  --line: #dedede;
  --line-soft: #e9e9e9;
  --panel: #fff;
  --canvas: #e8e8e8;
  --surface: #f5f5f5;
  --hover: #efefef;
  --accent: #2c2c2c;
  --accent-dark: #111;
  --shadow: 0 12px 34px rgba(0, 0, 0, .08);
  font: 100%/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow: hidden; background: var(--surface); color: var(--ink); font-size: 12px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, label:has(input:focus-visible) { outline: 2px solid #555; outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 48px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(18px); }
.brand-lockup, .topbar-tools { display: flex; align-items: center; }
.brand-lockup { gap: 9px; min-width: 220px; }
.brand-lockup strong { font-size: 12px; font-weight: 650; letter-spacing: -.01em; }
.document-name { margin-left: 3px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.brand-mark { width: 20px; height: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; padding: 3px; border-radius: 5px; background: #222; }
.brand-mark span { border: 1px solid rgba(255,255,255,.85); }
.brand-mark span:nth-child(1) { background: #fff; }
.topbar-tools { gap: 2px; }
.panel-icon-button { border: 0; background: transparent; color: #646464; }
.topbar-note { display: flex; align-items: center; gap: 6px; padding: 0 7px; color: var(--muted); font-size: 10px; }
.status-dot, .canvas-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #222; }

.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: 238px minmax(360px, 1fr) 304px; }
.layers-panel, .inspector-panel { min-width: 0; min-height: 0; background: var(--panel); }
.layers-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.inspector-panel { overflow-y: auto; border-left: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #c9c9c9 transparent; }
.panel-titlebar { height: 40px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--line-soft); }
.panel-titlebar strong { font-size: 11px; font-weight: 650; }
.panel-icon-button { width: 27px; height: 27px; border-radius: 5px; font-size: 15px; }
.panel-icon-button:hover { background: var(--hover); color: #111; }
.live-pill { color: var(--subtle); font-size: 9px; }

.import-block { padding: 12px; border-bottom: 1px solid var(--line-soft); }
.dropzone { position: relative; height: 76px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 9px; padding: 12px; border: 1px dashed #c7c7c7; border-radius: 7px; background: #fafafa; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .1s ease; }
.dropzone:hover, .dropzone.dragging { border-color: #565656; background: #f4f4f4; }
.dropzone:active { transform: scale(.99); }
.dropzone input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-icon { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #c8c8c8; border-radius: 5px; background: #fff; color: #333; font-size: 17px; }
.dropzone-title { align-self: end; font-size: 11px; font-weight: 600; }
.dropzone-subtitle { align-self: start; margin-top: 2px; color: var(--subtle); font-size: 9px; }
.demo-button { width: 100%; height: 30px; margin-top: 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #555; font-size: 10px; }
.demo-button:hover { background: var(--hover); color: #111; }
.layers-heading { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.asset-library { min-height: 0; overflow-y: auto; padding: 0 7px 12px; scrollbar-width: thin; }
.asset-library-header { display: none; }
.asset-list { display: grid; gap: 2px; }
.asset-item { min-width: 0; display: grid; grid-template-columns: 32px minmax(0,1fr) 24px; align-items: center; gap: 8px; min-height: 40px; padding: 4px 5px; border: 1px solid transparent; border-radius: 5px; }
.asset-item:hover { border-color: #e2e2e2; background: #f5f5f5; }
.asset-thumb { width: 32px; height: 28px; display: block; border-radius: 3px; background: #ececec; object-fit: cover; }
.asset-meta { min-width: 0; }
.asset-meta strong { display: block; overflow: hidden; color: #444; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta small { display: block; margin-top: 2px; color: #aaa; font-size: 8px; }
.asset-remove { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #999; font-size: 14px; opacity: 0; }
.asset-item:hover .asset-remove { opacity: 1; }
.asset-remove:hover { background: #e6e6e6; color: #111; }
.layers-empty { margin: 32px 18px; color: #aaa; font-size: 10px; line-height: 1.55; text-align: center; }
.asset-library:not([hidden]) + .layers-empty { display: none; }

.preview-area { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--canvas); }
.preview-toolbar { position: relative; z-index: 40; height: 48px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow: visible; padding: 0 12px; border-bottom: 1px solid rgba(0,0,0,.1); background: rgba(247,247,247,.92); backdrop-filter: blur(16px); }
.canvas-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.canvas-title strong { font-size: 10px; font-weight: 600; }
.canvas-title > span:last-child { overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-status-dot { width: 5px; height: 5px; background: #777; }
.toolbar-actions { display: flex; align-items: center; gap: 6px; }
.zoom-control { height: 30px; display: flex; align-items: center; gap: 1px; padding: 2px; border: 1px solid #d6d6d6; border-radius: 6px; background: rgba(255,255,255,.8); }
.zoom-control.is-disabled { opacity: .45; }
.zoom-step, .zoom-fit { height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #666; }
.zoom-step { width: 23px; font-size: 14px; }
.zoom-fit { min-width: 34px; padding: 0 6px; font-size: 9px; }
.zoom-step:hover, .zoom-fit:hover, .zoom-fit.active { background: #e9e9e9; color: #111; }
.zoom-range { width: 70px !important; }
.zoom-value { width: 43px; height: 23px; display: flex; align-items: center; padding: 0 4px; color: #888; }
.zoom-value input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #333; font-size: 9px; text-align: right; appearance: textfield; }
.zoom-value span { font-size: 8px; }
.icon-button { width: 30px; height: 30px; padding: 0; border: 1px solid #d6d6d6; border-radius: 6px; background: #fff; color: #555; font-size: 16px; transition: transform .16s ease, background .16s ease; }
.icon-button:hover { background: #eee; color: #111; transform: rotate(30deg); }
.primary-button { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 0; border-radius: 6px; background: #252525; color: #fff; font-size: 10px; font-weight: 600; }
.primary-button:hover { background: #000; }
.button-arrow { color: #cfcfcf; font-size: 13px; }
.export-control { position: relative; }
.export-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 228px; padding: 13px; border: 1px solid #d4d4d4; border-radius: 9px; background: rgba(255,255,255,.96); box-shadow: 0 18px 44px rgba(0,0,0,.16); backdrop-filter: blur(20px); transform-origin: top right; animation: popover-in .16s ease-out both; }
.export-popover-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.export-popover-head strong { font-size: 11px; }
.export-popover-head span { color: #888; font-size: 8px; }
.export-scale-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; padding: 2px; border-radius: 5px; background: #ededed; }
.export-scale { height: 27px; border: 0; border-radius: 4px; background: transparent; color: #777; font-size: 9px; }
.export-scale.active { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.custom-scale { display: grid; grid-template-columns: 1fr 72px; align-items: center; gap: 8px; margin-top: 10px; color: #666; font-size: 9px; }
.custom-scale div { height: 28px; display: flex; align-items: center; padding: 0 7px; border: 1px solid #d9d9d9; border-radius: 4px; }
.custom-scale input { min-width: 0; width: 100%; border: 0; outline: 0; font-size: 9px; }
.custom-scale small { color: #999; }
.export-confirm { width: 100%; height: 31px; margin-top: 10px; border: 0; border-radius: 5px; background: #222; color: #fff; font-size: 9px; }
@keyframes popover-in { from { opacity: 0; transform: translateY(-3px) scale(.98); } to { opacity: 1; transform: none; } }

.canvas-stage { position: relative; z-index: 0; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background-color: #e7e7e7; background-image: radial-gradient(#c9c9c9 .65px, transparent .65px); background-size: 16px 16px; scrollbar-width: thin; scrollbar-color: #b7b7b7 transparent; }
.canvas-viewport { position: relative; width: max-content; min-width: 100%; height: max-content; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 42px; }
.board-wrap { position: relative; flex: 0 0 auto; width: 0; min-width: 0; }
.board { position: relative; width: 100%; overflow: hidden; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.08), 0 18px 48px rgba(0,0,0,.08); }
.board.crop-editing { overflow: visible; }
.preview-footer { height: 28px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-top: 1px solid rgba(0,0,0,.1); background: #f6f6f6; color: #929292; font-size: 8px; }
.empty-state { margin: auto; text-align: center; }
.empty-mark { width: 52px; height: 52px; display: grid; grid-template: repeat(2,1fr) / repeat(2,1fr); gap: 4px; margin: 0 auto 16px; padding: 6px; border: 1px solid #c9c9c9; border-radius: 9px; background: rgba(255,255,255,.45); }
.empty-mark span { border: 1px solid #a9a9a9; background: #f6f6f6; }
.empty-mark span:nth-child(1) { background: #999; }
.empty-mark span:nth-child(4) { background: #fff; }
.empty-state h3 { margin: 0; font-size: 13px; font-weight: 600; }
.empty-state p { margin: 6px 0 14px; color: #858585; font-size: 10px; }
.outline-button { height: 30px; padding: 0 12px; border: 1px solid #bdbdbd; border-radius: 5px; background: rgba(255,255,255,.7); color: #333; font-size: 9px; }
.outline-button:hover { background: #fff; border-color: #777; }

.inspector-section { padding: 13px 12px 15px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-heading h3 { margin: 0; font-size: 10px; font-weight: 650; }
.section-heading span { color: #999; font-size: 8px; }
.layout-style-control { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.style-option { min-width: 0; height: 65px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px; padding: 7px; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; color: #666; text-align: left; }
.style-option:hover { background: #f7f7f7; border-color: #bcbcbc; }
.style-option.active { border-color: #333; box-shadow: inset 0 0 0 1px #333; color: #111; }
.style-option strong { overflow: hidden; font-size: 9px; font-weight: 600; text-overflow: ellipsis; }
.style-option small { color: #aaa; font-size: 7px; }
.style-preview { grid-column: 1 / -1; height: 24px; display: block; border: 1px solid #c8c8c8; background-color: #f5f5f5; }
.rows-preview { background-image: linear-gradient(to bottom, transparent 47%, #bbb 47%, #bbb 53%, transparent 53%); }
.mosaic-preview { background-image: linear-gradient(to right, transparent 31%, #bbb 31%, #bbb 35%, transparent 35%, transparent 66%, #bbb 66%, #bbb 70%, transparent 70%); }
.adaptive-preview { background-image: linear-gradient(to right, transparent 42%, #bbb 42%, #bbb 46%, transparent 46%), linear-gradient(to bottom, transparent 48%, #bbb 48%, #bbb 53%, transparent 53%); }
.field-grid { display: grid; gap: 7px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.field { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 5px; color: #858585; font-size: 9px; }
.input-with-unit { height: 29px; display: flex; align-items: center; padding: 0 7px; border: 1px solid #d8d8d8; border-radius: 5px; background: #f8f8f8; }
.input-with-unit:focus-within { border-color: #666; background: #fff; }
.input-with-unit input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #222; font-size: 9px; }
.input-with-unit input:disabled { color: #aaa; }
.input-with-unit small { color: #aaa; font-size: 8px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 9px; padding: 2px; border-radius: 6px; background: #ededed; }
.segment { height: 26px; border: 0; border-radius: 4px; background: transparent; color: #777; font-size: 9px; }
.segment.active { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 600; }
.range-field { margin-top: 13px; }
.range-field:first-child { margin-top: 0; }
.range-label { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: #666; font-size: 9px; }
.range-label output { color: #333; font-size: 8px; }
.range-number { width: 64px; height: 26px; display: flex; align-items: center; padding: 0 6px; border: 1px solid #dedede; border-radius: 4px; background: #f7f7f7; color: #999; }
.range-number:focus-within { border-color: #666; background: #fff; }
.range-number input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #222; font-size: 9px; text-align: right; appearance: textfield; }
.range-number span { margin-left: 3px; font-size: 8px; }
input[type="range"] { width: 100%; height: 3px; margin: 0; accent-color: #333; }
.control-help { display: block; margin-top: 5px; color: #a2a2a2; font-size: 8px; line-height: 1.4; }
.range-field.is-disabled { opacity: .45; }
.range-field.is-disabled .range-label > span::after { content: " · 不生效"; color: #aaa; }
.row-count-control { margin-top: 10px; padding: 10px; border: 1px solid #e1e1e1; border-radius: 6px; background: #f7f7f7; }
.row-count-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.row-count-meta small { color: #999; font-size: 8px; }
.row-count-meta label { width: 58px; height: 27px; display: flex; align-items: center; padding: 0 6px; border: 1px solid #d8d8d8; border-radius: 4px; background: #fff; }
.row-count-meta input { min-width: 0; width: 100%; border: 0; outline: 0; font-size: 9px; }
.row-count-meta span { color: #999; font-size: 8px; }
.choice-row { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; cursor: pointer; }
.choice-row input, .switch-row input { position: absolute; opacity: 0; }
.custom-radio { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; border: 1px solid #aaa; border-radius: 50%; background: #fff; }
.choice-row input:checked + .custom-radio { border: 4px solid #333; }
.choice-row strong, .switch-row strong { display: block; font-size: 9px; font-weight: 550; }
.choice-row small, .switch-row small { display: block; margin-top: 2px; color: #999; font-size: 8px; }
.switch-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 11px; padding-top: 11px; border-top: 1px solid #ededed; cursor: pointer; }
.switch-ui { position: relative; width: 28px; height: 16px; flex: 0 0 auto; border-radius: 16px; background: #c9c9c9; transition: background .16s ease; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .16s ease; }
.switch-row input:checked + .switch-ui { background: #333; }
.switch-row input:checked + .switch-ui::after { transform: translateX(12px); }
.stats-grid { display: grid; grid-template-columns: 48px 1fr 52px; gap: 6px; }
.stats-grid div { min-width: 0; padding: 7px; border-radius: 5px; background: #f5f5f5; }
.stats-grid span { display: block; color: #999; font-size: 7px; }
.stats-grid strong { display: block; overflow: hidden; margin-top: 3px; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tip-section { display: flex; align-items: flex-start; gap: 8px; color: #888; }
.tip-icon { width: 15px; height: 15px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #aaa; border-radius: 50%; font-size: 8px; }
.tip-section p { margin: 0; font-size: 8px; line-height: 1.55; }

.image-tile { position: absolute; z-index: 1; overflow: hidden; margin: 0; background: #eee; cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; animation: tile-in .28s both cubic-bezier(.2,.8,.2,1); transition: outline-color .12s ease, filter .12s ease, opacity .12s ease, transform .12s ease; }
.image-tile:active { cursor: grabbing; }
.image-tile.drag-armed { transform: scale(.985); outline: 2px solid #222; outline-offset: -2px; }
.image-tile.drag-source { opacity: .35; filter: grayscale(.5); }
.image-tile.drag-target { outline: 3px solid #111; outline-offset: -3px; filter: brightness(1.05); }
.drag-ghost { position: fixed; z-index: 100; overflow: hidden; margin: 0; border-radius: 3px; background: #eee; opacity: .86; pointer-events: none; will-change: transform; box-shadow: 0 18px 45px rgba(0,0,0,.28); }
.drag-ghost img { width: 100%; height: 100%; display: block; object-fit: inherit; }
.tile-clip { position: absolute; inset: 0; z-index: 2; overflow: hidden; background: #eee; }
.tile-clip img, .crop-overflow-image { position: absolute; left: 0; top: 0; display: block; width: 100%; height: 100%; max-width: none; object-position: center; pointer-events: none; will-change: left, top, width, height; }
.image-tile.crop-mode img { object-fit: cover; }
.image-tile.contain-mode img { object-fit: contain; }
.board.crop-editing .image-tile:not(.crop-editing-tile) { opacity: .14; filter: none; }
.image-tile.crop-editing-tile { z-index: 6; overflow: visible; cursor: move; outline: 2px solid #111; outline-offset: -2px; box-shadow: 0 0 0 1px #fff, 0 10px 28px rgba(0,0,0,.24); animation: none; }
.image-tile.crop-editing-tile::after { content: ""; position: absolute; inset: 0; z-index: 4; border: 1px dashed #fff; box-shadow: inset 0 0 0 1px #222; pointer-events: none; }
.crop-overflow-image { z-index: 1; opacity: .92; filter: grayscale(1) brightness(1.04) contrast(.8); }
.crop-source-outline { position: absolute; z-index: 0; border: 1px solid #333; outline: 1px solid #fff; outline-offset: 1px; background: #e7e7e7; box-shadow: 0 3px 12px rgba(0,0,0,.16); pointer-events: none; }
.image-tile.crop-editing-tile.crop-moving { cursor: grabbing; }
.image-tile figcaption { position: absolute; right: 7px; bottom: 6px; left: 7px; z-index: 3; overflow: hidden; color: rgba(255,255,255,.9); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; opacity: 0; text-shadow: 0 1px 4px #000; transition: opacity .16s; }
.image-tile:hover figcaption { opacity: 1; }
.image-tile.crop-editing-tile figcaption, .image-tile.crop-editing-tile .debug-label { display: none; }
.board.debug-mode .image-tile { outline: 1px solid #333; outline-offset: -1px; }
.debug-label { position: absolute; inset: 0; z-index: 3; padding: 6px; overflow: hidden; background: linear-gradient(180deg, rgba(0,0,0,.78), transparent); color: #fff; font-size: 7px; line-height: 1.45; pointer-events: none; }
.debug-label b { color: #fff; }
.layout-debug-panel { display: flex; flex-wrap: wrap; gap: 6px 11px; margin-top: 8px; padding: 8px 10px; border: 1px solid #c8c8c8; border-radius: 4px; background: rgba(255,255,255,.94); color: #777; font-size: 8px; box-shadow: 0 8px 18px rgba(0,0,0,.08); }
.layout-debug-panel strong { width: 100%; color: #222; }
@keyframes tile-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }

.toast { position: fixed; right: 20px; bottom: 18px; z-index: 300; padding: 9px 12px; border-radius: 6px; background: #222; color: #fff; font-size: 9px; box-shadow: var(--shadow); opacity: 0; transform: translateY(7px); pointer-events: none; transition: .18s; }
.toast.visible { opacity: 1; transform: none; }
.crop-editor-panel { position: fixed; left: 50%; bottom: 18px; z-index: 200; min-width: min(650px, calc(100vw - 32px)); height: 58px; display: flex; align-items: center; gap: 12px; padding: 8px 9px 8px 13px; border: 1px solid #ccc; border-radius: 10px; background: rgba(255,255,255,.94); box-shadow: 0 18px 48px rgba(0,0,0,.2); backdrop-filter: blur(20px); transform: translateX(-50%); }
.crop-editor-copy { min-width: 130px; }
.crop-editor-copy strong { display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.crop-editor-copy small { display: block; margin-top: 3px; color: #999; font-size: 8px; }
.crop-zoom-control { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 6px; }
.crop-zoom-control > button { width: 26px; height: 26px; border: 0; border-radius: 4px; background: transparent; color: #666; }
.crop-zoom-control > button:hover { background: #eee; }
.crop-zoom-control label { width: 53px; height: 27px; display: flex; align-items: center; padding: 0 5px; border: 1px solid #ddd; border-radius: 4px; }
.crop-zoom-control label input { min-width: 0; width: 100%; border: 0; outline: 0; font-size: 8px; text-align: right; }
.crop-zoom-control label span { color: #999; font-size: 8px; }
.crop-reset, .crop-done { height: 30px; padding: 0 11px; border-radius: 5px; font-size: 9px; }
.crop-reset { border: 1px solid #d3d3d3; background: #fff; color: #666; }
.crop-done { border: 0; background: #222; color: #fff; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 210px minmax(320px,1fr) 280px; }
  .zoom-range { display: none; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .workspace { display: grid; grid-template-columns: 190px minmax(0,1fr); grid-template-rows: minmax(560px, calc(100vh - 48px)) auto; }
  .layers-panel { grid-column: 1; grid-row: 1; }
  .preview-area { grid-column: 2; grid-row: 1; min-height: 560px; }
  .inspector-panel { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; border-top: 1px solid var(--line); border-left: 0; }
  .inspector-titlebar { grid-column: 1 / -1; }
  .inspector-section { border-right: 1px solid var(--line-soft); }
}
@media (max-width: 620px) {
  .document-name, .topbar-note, .zoom-value, .zoom-step { display: none; }
  .workspace { display: flex; flex-direction: column; }
  .layers-panel { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .asset-library { max-height: 180px; }
  .preview-area { min-height: 540px; }
  .inspector-panel { display: block; }
  .canvas-viewport { padding: 22px; }
  .crop-editor-panel { min-width: calc(100vw - 20px); height: auto; flex-wrap: wrap; }
  .crop-zoom-control { order: 4; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .preview-toolbar, .export-popover, .crop-editor-panel { background: #fff; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: #999; --line-soft: #bbb; }
}
