.store-owner-media-tools { scroll-margin-top: 10px; }
.owner-tool-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-bottom: 9px; }
.owner-tool-tabs button[aria-pressed="true"] { background: linear-gradient(#b9791e,#82500b); border-color: #e1a94d; }
.owner-tool-panel { display: grid; grid-template-columns: minmax(260px,360px) minmax(0,1fr); gap: 12px; min-width: 0; }
.owner-tool-panel[hidden] { display: none !important; }
.owner-library-panel { display: block; }
.owner-library-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.owner-library-head div { display: grid; gap: 2px; }
.owner-library-head strong,.owner-sticker-panel strong { color: #f6d88a; font-size: 15px; }
.owner-library-head span,.owner-sticker-panel p { margin: 0; color: #a8bbc0; font-size: 12px; line-height: 1.45; }
.owner-library-commands { display: grid; grid-template-columns: minmax(120px,180px) minmax(110px,150px); gap: 5px; align-items: end; }
.owner-library-commands label { display: grid; gap: 3px; color: #b8c7cb; font-size: 11px; font-weight: 700; }
.owner-library-commands select { width: 100%; height: 36px; border: 1px solid #506c75; border-radius: 7px; padding: 0 7px; background: #071319; color: #f5fbfc; }
.owner-library-tabs { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 4px; margin-bottom: 7px; }
.owner-library-tabs button[aria-pressed="true"] { background: linear-gradient(#347485,#153f4c); border-color: #6fc1d1; color: #fff; }
.owner-motion-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.owner-motion-grid article { min-width: 0; overflow: hidden; border: 1px solid #38525b; border-radius: 8px; background: #09171d; }
.owner-motion-grid canvas { display: block; width: 100%; height: auto; background: #061015; }
.owner-motion-grid article>div:not(.owner-card-actions) { display: grid; gap: 2px; padding: 6px 7px; }
.owner-motion-grid strong { color: #f4d98f; font-size: 13px; }
.owner-motion-grid small { min-height: 32px; color: #aebfc3; font-size: 11px; line-height: 1.4; }
.owner-card-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; padding: 0 5px 6px; }
.owner-card-actions button { min-width: 0; min-height: 35px; padding: 4px 2px; white-space: nowrap; font-size: 10px; }
.owner-library-panel>output { display: block; margin-top: 7px; min-height: 38px; padding: 8px; border: 1px solid #38525b; border-radius: 7px; background: #09171d; color: #f3d487; font-size: 12px; }
.owner-sticker-panel { grid-template-columns: minmax(0,1fr) minmax(240px,360px); align-items: center; padding: 14px; border: 1px solid #38525b; background: #08151b; }
.owner-sticker-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.owner-motion-controls,.privacy-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 7px; min-width: 0; }
.owner-motion-controls label,.privacy-controls label { display: grid; gap: 4px; min-width: 0; color: #b8c7cb; font-size: 12px; font-weight: 700; }
.owner-motion-controls .wide,.privacy-controls .wide { grid-column: 1/-1; }
.owner-motion-controls input,.owner-motion-controls select,.privacy-controls input,.privacy-controls select { width: 100%; min-width: 0; height: 39px; border: 1px solid #506c75; border-radius: 7px; padding: 0 8px; background: #071319; color: #f5fbfc; font: inherit; }
.owner-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.owner-motion-controls output,.privacy-controls output { min-height: 48px; padding: 8px; border: 1px solid #38525b; border-radius: 7px; background: #09171d; color: #f3d487; font-size: 12px; line-height: 1.45; }
.owner-motion-preview,.privacy-stage { min-width: 0; overflow: auto; padding: 8px; background: #050a0d; text-align: center; }
.owner-motion-canvas-wrap { position: relative; width: min(100%,620px); margin: 0 auto; }
.owner-motion-preview canvas,.privacy-stage canvas { display: block; width: 100%; height: auto; margin: 0 auto; background: #0b171c; box-shadow: 0 8px 26px #000b; touch-action: none; }
.motion-text-selection { position: absolute; pointer-events: none; border: 3px solid #ffd45e; border-radius: 6px; box-sizing: border-box; box-shadow: 0 0 0 1px #173342,0 0 12px #ffd45e99; }
.motion-text-selection[hidden] { display: none; }
.owner-motion-preview span,.privacy-stage span { display: block; padding: 6px; color: #9cb0b5; font-size: 11px; }
.privacy-check { display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: center; padding: 8px; border: 1px solid #3d5962; border-radius: 7px; background: #0c1c22; }
.privacy-check input { width: 20px; height: 20px; flex: 0 0 auto; }
/* 批TGWDEV687：桌面预览与设置独立排布，短字段三列；checkbox 不得继承整行输入宽高。 */
[data-motion-editor] { box-sizing: border-box; width: min(96vw,1000px); max-width: 96vw; height: min(90dvh,760px); max-height: 90dvh; padding: 12px; overflow: hidden; }
[data-motion-editor] *,[data-motion-editor] *::before,[data-motion-editor] *::after { box-sizing: border-box; }
[data-motion-editor] .owner-motion-editor-layout { display: grid; grid-template-columns: minmax(240px,380px) minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); gap: 12px 16px; width: 100%; min-width: 0; height: 100%; margin: 0; padding: 0; }
.owner-motion-editor-head { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.owner-motion-editor-head h2 { margin: 0; font-size: 18px; }
[data-motion-editor] button { min-width: 0; min-height: 34px; padding: 6px 10px; font-size: 13px; white-space: normal; cursor: pointer; }
[data-motion-editor] .owner-motion-controls { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 4px 4px 0; }
[data-motion-editor] fieldset { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 8px 10px 10px; border: 1px solid #38525b; border-radius: 7px; }
[data-motion-editor] legend { padding: 0 4px; font-size: 13px; color: #cbdce1; font-weight: 700; }
[data-motion-editor] .owner-motion-basic,[data-motion-editor] .owner-motion-dialog-settings { grid-template-columns: repeat(3,minmax(0,1fr)); }
[data-motion-editor] .owner-motion-copy,.owner-motion-more-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
[data-motion-editor] .owner-motion-controls input:not([type=checkbox]),[data-motion-editor] .owner-motion-controls select { height: 34px; padding: 0 7px; }
[data-motion-editor] .owner-motion-controls textarea { width: 100%; min-width: 0; min-height: 60px; padding: 7px; resize: vertical; border: 1px solid #506c75; border-radius: 7px; background: #071319; color: #f5fbfc; font: inherit; line-height: 1.5; }
[data-motion-editor] .owner-motion-dialog-toggle { display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 34px; }
[data-motion-editor] .owner-motion-dialog-toggle input { flex: 0 0 18px; width: 18px; height: 18px; padding: 0; margin: 0; }
[data-motion-editor] small,.owner-motion-more summary span { color: #9cb0b5; font-size: 12px; font-weight: 400; }
.owner-motion-period { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 12px; color: #c4d9df; }
.owner-motion-period span { min-width: 0; overflow-wrap: anywhere; }
[data-motion-editor] .owner-motion-period button { flex: 0 0 auto; }
.owner-motion-more { border: 1px solid #38525b; border-radius: 7px; padding: 8px 10px; }
.owner-motion-more summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.owner-motion-more summary span { margin-left: 4px; }
.owner-motion-more-fields { display: grid; gap: 8px; padding-top: 10px; }
[data-motion-editor] input[type=file] { max-width: 100%; padding: 5px !important; font-size: 12px; }
[data-motion-editor] .owner-motion-preview { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; padding: 0; overflow: auto; background: transparent; }
[data-motion-editor] .owner-motion-canvas-wrap { flex: 0 0 auto; width: min(100%,calc(90dvh - 278px)); }
[data-motion-editor] canvas[data-motion-canvas] { width: 100%; max-width: 100%; height: auto; }
[data-motion-editor] .owner-motion-preview > span { padding: 0; line-height: 1.5; }
[data-motion-editor] .owner-actions { grid-template-columns: repeat(2,minmax(0,1fr)); flex: 0 0 auto; }
[data-motion-editor] [data-motion-status] { display: block; text-align: left; color: #c4d9df; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
[data-motion-editor] [hidden] { display: none !important; }
[data-motion-editor] :focus-visible { outline: 2px solid #a2dce7; outline-offset: 2px; }
@media(max-width:900px) and (min-width:761px) {
  [data-motion-editor] .owner-motion-editor-layout { grid-template-columns: minmax(220px,32%) minmax(0,1fr); gap: 10px; }
}
@media(max-width:760px) {
  [data-motion-editor] { height: auto; max-height: 94dvh; padding: 10px; overflow-y: auto; }
  [data-motion-editor] .owner-motion-editor-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto auto; height: auto; }
  [data-motion-editor] .owner-motion-controls { grid-column: 1; grid-row: 3; overflow: visible; padding-right: 0; }
  [data-motion-editor] .owner-motion-preview { grid-column: 1; grid-row: 2; overflow: visible; }
  [data-motion-editor] .owner-motion-canvas-wrap { width: min(100%,280px); }
  [data-motion-editor] .owner-motion-basic,[data-motion-editor] .owner-motion-dialog-settings { grid-template-columns: repeat(2,minmax(0,1fr)); }
  [data-motion-editor] .owner-motion-controls input:not([type=checkbox]),[data-motion-editor] .owner-motion-controls select { height: 38px; font-size: 14px; }
  [data-motion-editor] .owner-motion-copy,.owner-motion-more-fields { grid-template-columns: minmax(0,1fr); }
  [data-motion-editor] button { min-height: 38px; }
}
@media(max-width:760px){
  .store-owner-media-tools { padding: 8px !important; }
  .owner-tool-panel { grid-template-columns: minmax(0,1fr); gap: 7px; }
  .owner-tool-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
  .owner-tool-tabs button { min-height: 38px; padding: 5px 2px; font-size: 11px; }
  .owner-library-head { align-items: stretch; flex-direction: column; }
  .owner-library-commands { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .owner-library-head button { min-height: 36px; }
  .owner-library-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; }
  .owner-library-tabs button { min-height: 34px; padding: 4px 1px; font-size: 10px; }
  .owner-motion-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
  .owner-motion-grid small { min-height: 47px; }
  .owner-card-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .owner-card-actions button { min-height: 34px; font-size: 11px; }
  .owner-sticker-panel { padding: 9px; }
  .owner-motion-controls,.privacy-controls { gap: 5px; }
  .owner-motion-controls input,.owner-motion-controls select,.privacy-controls input,.privacy-controls select { height: 36px; font-size: 12px; }
  .owner-actions button { min-height: 38px; padding: 6px 3px; font-size: 11px; white-space: normal; }
  .owner-motion-preview,.privacy-stage { padding: 0; overflow: hidden; }
  .owner-motion-preview canvas,.privacy-stage canvas { width: 100%; box-shadow: none; }
}
