:root {
  --red: #ff2442;
  --ink: #202020;
  --line: #e5dfd8;
  --muted: #8f8881;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 97% 2%, rgba(215,185,142,.19), transparent 28rem), #f7f5f2; color: var(--ink); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }
.access-gate { min-height: 100vh; padding: 20px; display: grid; place-items: center; background: radial-gradient(circle at 85% 12%, rgba(255,36,66,.12), transparent 23rem), #faf9f7; }
.access-card { width: min(100%, 430px); padding: 42px 38px 36px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: 0 24px 65px rgba(55,39,34,.1); text-align: center; }
.access-mark { width: 55px; height: 55px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 17px; background: #202020; color: #fff; font: 800 30px/1 Georgia, serif; }
.access-card h1 { margin: 0; font-size: 26px; }
.access-card p { margin: 10px 0 25px; color: var(--muted); font-size: 12px; }
.access-card label { display: block; color: #5f5a56; font-size: 11px; font-weight: 700; text-align: left; }
.access-card input { width: 100%; height: 52px; margin-top: 8px; padding: 0 15px; border: 1px solid #ddd7d1; border-radius: 13px; outline: none; font-size: 18px; letter-spacing: .18em; }
.access-card button { width: 100%; height: 50px; margin-top: 14px; border: 0; border-radius: 13px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; }
.access-card small { min-height: 18px; margin-top: 12px; display: block; color: var(--red); font-size: 10px; }
.cover-page { min-height: 100vh; padding-bottom: 60px; }
.cover-page button { transition: scale 70ms ease, filter 70ms ease; }
.cover-page button:active:not(:disabled) { scale: .97; filter: brightness(.82); }
.studio-header { width: min(1480px, calc(100% - 40px)); min-height: 76px; margin: 0 auto; position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(247,245,242,.92); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #202020; color: #fff; font: 800 23px/1 Georgia, serif; box-shadow: 0 8px 20px rgba(0,0,0,.16); }
.brand > span:last-child, .header-actions, .panel-heading > span, .preview-toolbar > span, .export-row > span { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 14px; }
.brand small, .header-actions span { color: var(--muted); font-size: 10px; }
.header-actions { flex-direction: row; align-items: center; gap: 18px; }
.header-actions button { padding: 10px 15px; border: 1px solid #ded8d1; border-radius: 999px; background: rgba(255,255,255,.72); color: #3f3b38; font-size: 12px; font-weight: 700; cursor: pointer; }
.studio { width: min(1480px, calc(100% - 40px)); margin: 0 auto; }
.intro { min-height: 154px; padding: 30px 36px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.88); box-shadow: 0 18px 52px rgba(43,36,31,.07); }
.intro > div:first-child > span, .standard > div > span { color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.intro h1 { margin: 8px 0 7px; font-size: clamp(30px, 3vw, 46px); letter-spacing: -.055em; }
.intro p { max-width: 740px; margin: 0; color: #77706a; font-size: 13px; line-height: 1.75; }
.status { min-width: 230px; padding: 13px 16px; display: flex; align-items: center; gap: 9px; border: 1px solid #ece6df; border-radius: 14px; background: #faf9f7; color: #655f59; font-size: 11px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #26a26a; box-shadow: 0 0 0 5px rgba(38,162,106,.1); }
.studio-grid { margin-top: 18px; display: grid; grid-template-columns: 340px minmax(420px, 1fr) 340px; gap: 18px; align-items: start; }
.panel, .preview-panel { min-width: 0; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: 0 16px 46px rgba(43,36,31,.06); }
.panel { padding: 22px; }
.panel-heading { margin-bottom: 20px; display: flex; align-items: center; gap: 11px; }
.panel-heading > b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #202020; color: #fff; font-size: 11px; }
.panel-heading strong { font-size: 14px; }
.panel-heading small { color: #9b948e; font-size: 10px; }
.copy-sync { margin-bottom: 14px; padding: 12px 78px 12px 12px; position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border: 1px solid #e8e2dc; border-radius: 14px; background: #faf9f7; }
.copy-sync.ready { border-color: rgba(255,36,66,.28); background: #fff5f7; }
.copy-sync > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.copy-sync strong { font-size: 11px; }
.copy-sync small { overflow: hidden; color: #948c85; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.copy-sync button, .field-control button { border: 0; border-radius: 999px; background: var(--red); color: #fff; font-weight: 750; cursor: pointer; }
.copy-sync button { width: 58px; min-height: 28px; padding: 0; position: absolute; top: 50%; right: 8px; transform: translateY(-50%); font-size: 9px; }
.copy-sync button:disabled, .field-control button:disabled { background: #ded9d4; color: #9b948e; cursor: default; }
.upload-wrap { position: relative; }
.upload { min-height: 76px; padding: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed #d8d0c8; border-radius: 15px; background: #faf8f5; cursor: pointer; transition: border-color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out; }
.upload.dragging { border-color: var(--red); background: #fff1f3; box-shadow: inset 0 0 0 1px rgba(255,36,66,.16); }
.upload input { display: none; }
.watermark-upload { margin-top: 14px; padding: 8px; position: relative; border: 1px dashed #c9a77a; border-radius: 13px; background: #fffaf3; }
.watermark-upload > input { display: none; }
.watermark-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.watermark-actions button { min-width: 0; min-height: 29px; padding: 0 3px; border: 1px solid #ddd5cd; border-radius: 8px; background: #fff; color: #514a44; font-size: 9px; font-weight: 750; cursor: pointer; }
.watermark-actions button.active { border-color: #202020; background: #202020; color: #fff; }
.color-row { margin-top: 11px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.color-row label { min-width: 0; padding: 8px; display: flex; align-items: center; justify-content: space-between; gap: 5px; border: 1px solid #e5ded7; border-radius: 10px; color: #6e6761; font-size: 8px; }
.color-row input { width: 27px; height: 27px; padding: 2px; flex: 0 0 auto; border: 0; border-radius: 7px; background: #f3efeb; cursor: pointer; }
.divider-toggle { margin-top: 11px; padding-top: 10px; }
.memory-panel { margin-top: 18px; padding-top: 15px; display: grid; gap: 8px; border-top: 1px solid #eee8e2; }
.memory-panel > div { padding: 7px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; border: 1px dashed #c9a77a; border-radius: 10px; background: #fffaf3; }
.memory-panel > div > button:last-child { grid-column: 1 / -1; }
.memory-panel b { color: #625b55; font-size: 9px; }
.memory-panel button { min-height: 28px; padding: 0 9px; border: 1px solid #ddd5cd; border-radius: 8px; background: #fff; color: #514a44; font-size: 8px; font-weight: 750; cursor: pointer; }
.factory-reset, .reset-settings { width: calc(100% - 26px); margin-inline: 13px; min-height: 34px; border-radius: 8px; font-size: 14px; line-height: 1; font-weight: 700; cursor: pointer; }
.factory-reset { margin-bottom: 8px; border: 1px solid var(--red); background: var(--red); color: #fff; }
.reset-settings { border: 1px solid #202020; background: #202020; color: #fff; }
.left-watermark-controls { margin-top: 8px; padding: 8px; display: grid; gap: 8px; border: 1px solid #e5ded7; border-radius: 10px; background: #faf9f7; }
.left-watermark-controls label > span { margin-bottom: 4px; display: flex; justify-content: space-between; color: #6e6761; font-size: 9px; }
.left-watermark-controls input[type="range"] { width: 100%; accent-color: var(--red); }
.subtitle-tools { margin-top: 8px; display: grid; grid-template-columns: 112px 1fr; gap: 8px; }
.subtitle-tools label { min-height: 45px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #e5ded7; border-radius: 10px; color: #6e6761; font-size: 8px; }
.subtitle-tools label:last-child { flex-direction: column; align-items: stretch; }
.subtitle-tools label:last-child span { display: flex; justify-content: space-between; }
.subtitle-tools input[type="color"] { width: 27px; height: 27px; padding: 2px; border: 0; border-radius: 7px; background: #f3efeb; cursor: pointer; }
.subtitle-tools input[type="range"] { width: 100%; accent-color: var(--red); }
.upload strong { font-size: 13px; }
.upload small { max-width: 250px; overflow: hidden; color: #9a928b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.compare-upload-panel { margin-top: 10px; padding: 10px; border: 1px solid #ddd7d1; border-radius: 15px; background: #f5f3f1; }
.compare-upload-panel > div:first-child { margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.compare-upload-panel > div:first-child strong { color: #3f3b38; font-size: 11px; }
.compare-upload-panel > div:first-child small { color: #948c85; font-size: 8px; line-height: 1.5; }
.compare-upload { border: 1.5px dashed #aaa5a0; border-radius: 12px; background: rgba(255,255,255,.75); transition: border-color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out; }
.compare-upload.dragging { border-color: var(--red); background: #fff1f3; box-shadow: inset 0 0 0 1px rgba(255,36,66,.16); }
.compare-upload > input { display: none; }
.compare-upload > button { width: 100%; min-height: 66px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.compare-upload > button strong { color: #3f3b38; font-size: 12px; }
.compare-upload > button small { max-width: 250px; overflow: hidden; color: #948c85; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.compare-upload > button:focus-visible { outline: 3px solid rgba(255,36,66,.34); outline-offset: 3px; }
.image-sync { width: 58px; min-height: 28px; padding: 0; position: absolute; z-index: 2; top: 8px; right: 8px; border: 0; border-radius: 999px; background: var(--red); color: #fff; font-size: 9px; font-weight: 750; cursor: pointer; }
.image-sync:disabled { background: #ded9d4; color: #9b948e; cursor: default; }
.field { margin-top: 14px; display: block; }
.field > span, .field-title { margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; color: #5f5954; font-size: 10px; font-weight: 700; }
.field span b, .field-title b { color: #a29b94; font-size: 9px; }
.field span b.yellow, .field-title b.yellow { color: #9b8900; }
.field-title > span { display: flex; align-items: center; gap: 6px; }
.field-control { position: relative; }
.field-control button { width: 58px; min-height: 28px; padding: 0; position: absolute; top: 8px; right: 8px; font-size: 9px; }
.field input, .field textarea { width: 100%; border: 1px solid #e1dad3; border-radius: 12px; outline: none; background: #fff; color: #24211f; font-size: 13px; }
.field input { height: 44px; padding: 0 78px 0 12px; }
.field textarea { min-height: 74px; padding: 11px 12px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,36,66,.07); }
.platforms { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.platforms button { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid #e2dbd4; border-radius: 12px; background: #fff; cursor: pointer; }
.platforms button.active { border-color: #202020; background: #202020; color: #fff; }
.platforms strong { font-size: 11px; }
.platforms span { color: #9b948d; font-size: 9px; }
.platforms button.active span { color: rgba(255,255,255,.65); }
.preset-note { margin: 8px 0 0; color: #9a938c; font-size: 9px; line-height: 1.55; }
.preview-panel { min-height: 720px; padding: 18px; background: #242321; }
.preview-toolbar { min-height: 42px; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.preview-toolbar strong { font-size: 13px; }
.preview-toolbar small { color: rgba(255,255,255,.52); font-size: 9px; }
.preview-switches { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.switch, .brand-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch { color: rgba(255,255,255,.72); font-size: 10px; }
.switch input, .brand-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch i, .brand-toggle i { width: 32px; height: 18px; padding: 2px; display: block; border-radius: 999px; background: #6b6762; }
.switch i::after, .brand-toggle i::after { content: ""; width: 14px; height: 14px; display: block; border-radius: 50%; background: #fff; transition: .16s; }
.switch input:checked + i, .brand-toggle input:checked + i { background: var(--red); }
.switch input:checked + i::after, .brand-toggle input:checked + i::after { transform: translateX(14px); }
.canvas-shell { width: min(100%, 390px); margin: 0 auto; overflow: hidden; position: relative; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: #111; box-shadow: 0 22px 54px rgba(0,0,0,.36); }
.canvas-shell.ratio-9-16 { aspect-ratio: 9/16; }
.canvas-shell.ratio-3-4 { aspect-ratio: 3/4; }
.canvas-shell canvas { width: 100%; height: 100%; display: block; }
.canvas-shell.has-image canvas { cursor: grab; touch-action: none; user-select: none; }
.canvas-shell.has-image canvas:active { cursor: grabbing; }
.mobile-touch-zone { display: none; }
.canvas-shell.is-rotating canvas, .canvas-shell.is-rotating canvas:active { cursor: ew-resize; }
.transform-hud { position: absolute; z-index: 8; left: 50%; top: 50%; min-width: 68px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; background: rgba(12,12,12,.76); color: #fff; font-size: 14px; font-weight: 800; line-height: 1; text-align: center; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.96); transition: opacity .12s, transform .12s; }
.transform-hud.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.snap-guide { position: absolute; z-index: 7; left: 50%; top: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.28); pointer-events: none; opacity: 0; }
.snap-guide.horizontal { width: 100%; height: 1px; transform: translate(-50%, -50%); }
.snap-guide.vertical { width: 1px; height: 100%; transform: translate(-50%, -50%); }
.snap-guide.visible { opacity: .9; }
.export-row { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-items: center; }
.export-row strong { color: #fff; font-size: 10px; }
.export-row small { color: rgba(255,255,255,.46); font-size: 8px; }
.export-row button { height: 38px; padding: 0 13px; border-radius: 10px; font-size: 10px; font-weight: 750; cursor: pointer; }
.export-row button { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.export-row .secondary { border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; }
.export-row .original { border: 1px solid rgba(255,45,70,.72); background: transparent; color: #ff5368; }
.export-row .primary { border: 1px solid var(--red); background: var(--red); color: #fff; }
.export-row button:disabled { opacity: .56; cursor: wait; }
.preview-tools { margin-top: 12px; display: grid; grid-template-columns: 1fr; gap: 10px; }
.compare-overlap-warning { margin: 8px 0 0; padding: 8px 10px; border: 1px solid rgba(254,232,0,.28); border-radius: 9px; background: rgba(254,232,0,.1); color: #f1e7a1; font-size: 9px; line-height: 1.5; }
.save-preview { position: fixed; inset: 0; z-index: 9999; padding: 18px; background: rgba(0,0,0,.82); overflow: auto; }
.save-preview-card { width: min(560px,100%); margin: 0 auto; padding: 16px; border-radius: 18px; background: #fff; text-align: center; }
.save-preview-card strong { font-size: 18px; }
.save-preview-card p { margin: 6px 0 12px; color: #666; font-size: 14px; }
.save-preview-card img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; background: #111; -webkit-touch-callout: default; }
.save-preview-card div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.save-preview-card button { min-height: 44px; border: 0; border-radius: 12px; background: #1f1f1f; color: #fff; font-weight: 700; }
.template-area { min-width: 0; }
.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.template { min-height: 96px; padding: 11px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; position: relative; overflow: hidden; border: 1px solid #e1dad3; border-radius: 13px; background: linear-gradient(115deg, #070707, #4a433d); color: #fff; text-align: left; cursor: pointer; }
.template::after { content: ""; width: 58px; height: 100px; position: absolute; right: 4px; bottom: -20px; border-radius: 50% 50% 8px 8px; background: linear-gradient(#5f5953, #191817); opacity: .75; }
.template i { position: absolute; z-index: 1; left: 9px; top: 8px; color: #d7b98e; font-size: 9px; font-style: normal; }
.template b, .template span { max-width: 76%; position: relative; z-index: 1; }
.template b { width: 100%; max-width: 100%; font-size: 10px; text-align: center; }
.template span { margin-top: 3px; color: rgba(255,255,255,.58); font-size: 7px; }
.template.active { border-color: var(--red); box-shadow: 0 0 0 2px rgba(255,36,66,.12); }
.template.center { align-items: center; text-align: center; }
.template.right { align-items: flex-end; background: linear-gradient(270deg, #080808, #4c4742); text-align: right; }
.template.clean { background: linear-gradient(130deg, #45413d, #161616); }
.template.bottom { background: linear-gradient(0deg, #0c0c0c, #4a433d); }
.sliders { margin-top: 20px; display: grid; gap: 14px; }
.sliders label > span, .before-controls label > span { margin-bottom: 7px; display: flex; justify-content: space-between; color: #6e6761; font-size: 10px; }
.sliders label > span b { color: #262321; }
.sliders input, .before-controls input { width: 100%; accent-color: var(--red); }
.adjustment-target { margin-top: 12px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border-radius: 11px; background: #eeeae6; }
.adjustment-target button { min-height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #625b55; font-size: 9px; font-weight: 800; cursor: pointer; }
.adjustment-target button.active { border-color: #202020; background: #202020; color: #fff; }
.before-controls { margin-top: 12px; padding: 11px; display: grid; gap: 11px; border: 1px solid #d8d2cc; border-radius: 12px; background: #f5f3f1; }
.before-controls > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.before-controls > div b { color: #33302d; font-size: 10px; }
.before-controls > div small { color: #8e8882; font-size: 8px; }
.before-reset { min-height: 32px; border: 1px solid #6d6965; border-radius: 9px; background: #6d6965; color: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }
.before-align-actions { display: grid !important; grid-template-columns: .82fr 1.18fr; gap: 6px !important; }
.before-align-actions button { min-height: 32px; padding: 0 7px; border: 1px solid #d2cbc4; border-radius: 9px; background: #fff; color: #4f4944; font-size: 8px; font-weight: 800; cursor: pointer; }
.before-align-actions button:first-child { border-color: #202020; background: #202020; color: #fff; }
.before-align-actions button:disabled { cursor: not-allowed; opacity: .42; }
.retouch-panel { padding: 12px; display: grid; gap: 11px; border: 1px dashed #c9a77a; border-radius: 12px; background: #fffaf3; }
.retouch-panel > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.retouch-panel > div b { color: #28231f; font-size: 10px; }
.retouch-panel > div span { color: #9b9188; font-size: 8px; }
.retouch-panel label { min-width: 0; }
.retouch-panel label > span { margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #6e6761; font-size: 9px; line-height: 14px; white-space: nowrap; }
.retouch-panel input[type="range"] { width: 100%; height: 16px; margin: 0; display: block; accent-color: var(--red); }
.retouch-panel > button, .retouch-panel section button { min-height: 34px; border: 1px solid #ddd5cd; border-radius: 9px; background: #fff; color: #625b55; font-size: 8px; font-weight: 750; cursor: pointer; }
.retouch-panel > button.active { border-color: var(--red); background: var(--red); color: #fff; }
.retouch-panel section { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.retouch-panel .retouch-target { padding: 3px; border-radius: 11px; background: #eeeae6; }
.retouch-panel .retouch-target button { min-height: 28px; border-color: transparent; background: transparent; }
.retouch-panel .retouch-compare button.active, .retouch-panel .retouch-target button.active { border-color: #202020; background: #202020; color: #fff; }
.retouch-panel > small { color: #9b9188; font-size: 8px; text-align: center; }
.retouch-panel button:disabled { cursor: not-allowed; opacity: .42; }
.canvas-shell.is-brushing canvas { cursor: none; touch-action: none; }
.brush-cursor { aspect-ratio: 1; position: absolute; z-index: 5; border: 1.5px solid rgba(255,255,255,.96); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.9), inset 0 0 0 1px rgba(0,0,0,.36); pointer-events: none; opacity: 0; transform: translate(-50%, -50%); transition: width .08s, opacity .08s; }
.brush-cursor.visible { opacity: 1; }
.watermark-align > span { margin-bottom: 7px; display: block; color: #6e6761; font-size: 10px; }
.watermark-align > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.watermark-align button { min-height: 34px; border: 1px solid #ddd5cd; border-radius: 9px; background: #fff; color: #625b55; font-size: 8px; font-weight: 750; cursor: pointer; }
.watermark-align button.active { border-color: #202020; background: #202020; color: #fff; }
.slider-value-control { display: inline-flex; align-items: center; gap: 4px; }
.slider-number-wrap { min-height: 26px; padding: 0 6px; display: inline-flex; align-items: center; border: 1px solid #ddd5cd; border-radius: 8px; background: #fff; color: #262321; }
.slider-number-wrap input { width: 42px !important; padding: 0; border: 0; outline: 0; background: transparent; color: #262321; font: inherit; font-weight: 800; text-align: right; appearance: textfield; }
.slider-number-wrap input::-webkit-inner-spin-button,
.slider-number-wrap input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.slider-number-wrap input:focus { color: var(--red); }
.slider-number-wrap i { font-size: 9px; font-style: normal; font-weight: 800; }
.slider-reset { min-width: 34px; min-height: 26px; padding: 0 7px; border: 1px solid #ddd5cd; border-radius: 8px; background: #f7f4f1; color: #625b55; font-size: 8px; font-weight: 800; cursor: pointer; }
.slider-reset:active { background: #e9e3dd; transform: scale(.96); }
.sliders .slider-value-control, .before-controls .slider-value-control { width: 104px; flex: 0 0 104px; display: grid; grid-template-columns: 64px 36px; }
.sliders .slider-number-wrap, .before-controls .slider-number-wrap { width: 64px; box-sizing: border-box; justify-content: flex-end; }
.sliders .slider-reset, .before-controls .slider-reset { width: 36px; min-width: 36px; padding: 0; }
.sliders input:disabled { opacity: .45; }
.title-scale-link { min-height: 30px; border: 1px solid #ddd5cd; border-radius: 9px; background: #fff; color: #6e6761; font-size: 9px; font-weight: 800; cursor: pointer; }
.title-scale-link.active { border-color: #202020; background: #202020; color: #fff; }
.brand-toggle { margin-top: 19px; padding-top: 16px; border-top: 1px solid #eee8e2; color: #615b55; font-size: 10px; }
.brand-toggle i { background: #d7d1ca; }
.standard { margin-top: 18px; padding: 27px 30px; display: grid; grid-template-columns: 210px 1fr; gap: 18px 34px; border: 1px solid var(--line); border-radius: 24px; background: #fff; }
.standard h2 { margin: 7px 0 0; font-size: 23px; letter-spacing: -.04em; }
.standard ul { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 24px; list-style: none; }
.standard li { color: #6e6761; font-size: 11px; line-height: 1.6; }
.standard li b { margin-right: 5px; color: #24211f; }
.standard > p { grid-column: 2; margin: 0; color: #99928b; font-size: 9px; line-height: 1.7; }
@media (min-width: 800px) and (pointer: fine) {
  .cover-page { padding-bottom: 8px; min-height: var(--cover-desktop-height, 100vh); zoom: var(--cover-desktop-scale, 1); }
  .studio-header { min-height: 58px; }
  .header-actions button { min-height: calc(36px / var(--cover-desktop-scale, 1)); }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 20px; }
  .studio-grid { height: calc(var(--cover-desktop-height, 100vh) - 170px); min-height: 700px; margin-top: 8px; grid-template-columns: 345px minmax(580px, 1fr) 345px; gap: 12px; align-items: stretch; }
  .panel, .preview-panel { height: 100%; min-height: 0; border-radius: 18px; }
  .panel { padding: 13px; overflow: hidden; }
  .controls { display: flex; flex-direction: column; }
  .panel-heading { margin-bottom: 8px; }
  .panel-heading > b { width: 30px; height: 30px; }
  .status { width: 100%; min-width: 0; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; font-size: 9px; }
  .copy-sync { margin-bottom: 8px; padding-top: 8px; padding-bottom: 8px; }
  .upload { min-height: 58px; padding: 8px; }
  .compare-upload-panel { margin-top: 6px; padding: 7px; }
  .compare-upload-panel > div:first-child { margin-bottom: 5px; }
  .compare-upload > button { min-height: 50px; padding: 7px; }
  .field { margin-top: 8px; }
  .field > span, .field-title { margin-bottom: 4px; }
  .field input { height: 36px; }
  .field textarea { min-height: 52px; padding-top: 8px; }
  .field-control button { top: 4px; }
  .color-row { margin-top: 7px; }
  .color-row label { padding: 5px 7px; }
  .color-row input { width: 24px; height: 24px; }
  .brand-toggle { margin-top: 8px; padding-top: 8px; }
  .subtitle-tools label { min-height: 38px; padding: 5px 8px; }
  .watermark-upload { margin-top: 8px; padding: 6px; }
  .watermark-actions button { min-height: 25px; }
  .left-watermark-controls { margin-top: 6px; padding: 6px; grid-template-columns: 1fr; gap: 5px; }
  .left-watermark-controls .watermark-align button { min-height: 23px; }
  .platforms { margin-top: 8px; }
  .platforms button { min-height: 44px; }
  .preview-panel { padding: 13px; display: flex; flex-direction: column; }
  .preview-toolbar { min-height: 32px; margin-bottom: 8px; }
  .preview-switches { gap: 9px; }
  .canvas-shell { width: auto; height: calc(100% - 326px); max-width: 100%; }
  .preview-tools { height: auto; max-width: 100%; margin: 8px auto 0; grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr); align-items: stretch; gap: 8px; }
  .preview-tools .export-row { width: auto; height: auto; margin: 0; grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
  .preview-tools .export-row button { height: auto; min-height: 0; padding: 0 6px; }
  .export-row button { height: 32px; padding: 0 9px; font-size: 9px; }
  .design { display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
  .design .panel-heading { margin-bottom: 7px; }
  .design > .factory-reset, .design > .reset-settings { width: calc(100% - 18px); margin-inline: 9px; border-radius: 10px; }
  .design > .reset-settings { margin-bottom: 10px; }
  .templates { width: 100%; height: auto; aspect-ratio: 1; gap: 6px; }
  .template { min-height: 0; aspect-ratio: 1; padding: 6px; border-radius: 9px; }
  .template::after { width: 36px; height: 58px; }
  .template b { font-size: 8px; }
  .template span { font-size: 6px; }
  .sliders { min-height: 0; margin-top: 16px; flex: 1 0 auto; grid-template-columns: 1fr; grid-template-rows: repeat(12, minmax(48px, 1fr)); align-items: center; gap: 0; }
  .controls.compare-active { overflow-y: auto; justify-content: space-between; gap: 2px; }
  .controls.compare-active > * { margin: 0; flex-shrink: 0; }
  .controls.compare-active .status, .controls.compare-active .copy-sync { padding-top: 6px; padding-bottom: 6px; }
  .controls.compare-active .upload { min-height: 48px; padding: 6px; }
  .controls.compare-active .compare-upload-panel { padding: 5px; }
  .controls.compare-active .compare-upload > button { min-height: 44px; padding: 5px; }
  .controls.compare-active .field textarea { height: 52px; padding-top: 6px; padding-bottom: 6px; display: block; }
  .controls.compare-active .subtitle-tools input[type="range"], .controls.compare-active .left-watermark-controls input[type="range"] { height: 16px; margin: 0; display: block; }
  .controls.compare-active .watermark-upload, .controls.compare-active .left-watermark-controls { padding: 4px; }
  .controls.compare-active .memory-panel { padding-top: 6px; flex: 0 0 auto; grid-template-rows: repeat(3, auto); gap: 6px; }
  .controls.compare-active .memory-panel > div { height: auto; padding-top: 4px; padding-bottom: 4px; }
  .design.compare-active { overflow-y: auto; }
  .design.compare-active .adjustment-target { margin-top: 8px; flex: 0 0 auto; }
  .design.compare-active .sliders { min-height: 0; margin-top: 8px; flex: 1 0 auto; grid-template-rows: repeat(12, minmax(48px, 1fr)); gap: 0; }
  .design.compare-active .before-controls { min-height: 0; margin-top: 8px; padding: 8px; flex: 1 0 auto; grid-template-rows: auto auto repeat(7, minmax(48px, 1fr)) auto; align-items: center; gap: 0; }
  .sliders label > span, .before-controls label > span { margin-bottom: 3px; align-items: center; font-size: 9px; }
  .sliders input[type="range"], .before-controls input[type="range"] { height: 15px; margin: 0; display: block; }
  .retouch-panel { padding: 8px; flex: 0 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .retouch-panel label > span { flex-direction: column; align-items: stretch; gap: 4px; }
  .retouch-panel .slider-value-control { display: grid; grid-template-columns: minmax(0, 1fr) 34px; }
  .retouch-panel .slider-number-wrap { min-width: 0; }
  .retouch-panel .slider-number-wrap input { width: 100% !important; min-width: 0; }
  .retouch-panel .slider-reset { padding: 0; }
  .retouch-panel > div:first-child, .retouch-panel > button { grid-column: 1 / -1; }
  .retouch-panel section button { min-height: 25px; }
  .retouch-panel .retouch-target, .retouch-panel .retouch-compare, .retouch-panel > small, .retouch-panel > section:last-child { grid-column: 1 / -1; }
  .retouch-panel > small { align-self: center; line-height: 1.35; }
  .watermark-align > span { margin-bottom: 3px; font-size: 8px; }
  .watermark-align button { min-height: 28px; }
  .memory-panel { min-height: 0; margin-top: 8px; padding-top: 8px; flex: 1; grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .memory-panel > div { height: 100%; padding: 5px; grid-template-columns: 1fr auto auto auto; gap: 4px; }
  .memory-panel > div > button:last-child, .memory-panel > div b { grid-column: auto; }
  .memory-panel button { min-height: 23px; padding: 0 4px; }
  .standard { min-height: 82px; margin-top: 8px; padding: 10px 16px; grid-template-columns: 170px 1fr; gap: 6px 18px; border-radius: 18px; }
  .standard h2 { margin-top: 3px; font-size: 17px; }
  .standard ul { grid-template-columns: repeat(3, 1fr); gap: 4px 14px; }
  .standard li { font-size: 8px; line-height: 1.35; }
  .standard > p { font-size: 7px; line-height: 1.35; }
}
@media (max-width: 799px), (pointer: coarse) {
  .studio-grid { grid-template-columns: 300px 1fr; }
  .design { grid-column: 1/-1; }
  .templates { grid-template-columns: repeat(3, 1fr); }
}

.mobile-editor-topbar,
.split-tools,
.split-tools-header,
.mobile-secondary-tools,
.mobile-primary-tools,
.mobile-export-sheet,
.mobile-editor-launcher { display: none; }

/* 跨设备编辑壳只在窄屏或触控设备生效，电脑端继续使用修改前的三栏基线。 */
@media (max-width: 1180px), (pointer: coarse) {
body.split-editor-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.studio-grid[data-cover-layout="split"] {
  overflow-x: hidden;
}

.studio-grid[data-cover-layout="split"] > .controls,
.studio-grid[data-cover-layout="split"] > .design,
.studio-grid[data-cover-layout="split"] .preview-toolbar,
.studio-grid[data-cover-layout="split"] .preview-tools {
  display: none;
}

.studio-grid[data-cover-layout="split"] .preview-panel {
  min-width: 0;
  width: 100%;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 38%);
  gap: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #171716;
}

.studio-grid[data-cover-layout="split"] .split-preview {
  min-width: 0;
  min-height: 0;
  width: auto;
  height: 100%;
  max-width: 100%;
  position: sticky;
  top: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
}

.studio-grid[data-cover-layout="split"] .split-tools {
  min-width: 0;
  min-height: 0;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 18px;
  background: rgba(28, 28, 27, .94);
  scrollbar-width: thin;
}

.studio-grid[data-cover-layout="split"] .split-tools-header {
  min-height: 44px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
}

.studio-grid[data-cover-layout="split"] .split-tools-header button {
  min-width: 72px;
  min-height: 44px;
  border: 1px solid rgba(255, 82, 106, .7);
  border-radius: 12px;
  background: rgba(255, 36, 66, .18);
  color: #fff;
  font-weight: 750;
}

.studio-grid[data-cover-layout="split"] .mobile-single-tool-control,
.studio-grid[data-cover-layout="split"] .mobile-secondary-tools,
.studio-grid[data-cover-layout="split"] .mobile-primary-tools {
  display: flex;
  flex: 0 0 auto;
}

.studio-grid[data-cover-layout="split"] .mobile-single-tool-control { display: block; max-height: none; }

.studio-grid[data-cover-layout="split"] .mobile-brush-status {
  min-height: 28px;
  margin: 0;
  padding: 5px 10px;
  position: absolute;
  z-index: 8;
  top: 14px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(26, 26, 25, .72);
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 700;
  transform: translateX(-50%);
  pointer-events: none;
}

body.mobile-editor-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .preview-panel {
  width: 100%;
  height: calc(100dvh - var(--mobile-keyboard-height, 0px));
  min-height: 0;
  padding: 0 12px;
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #171716;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .split-tools {
  display: contents;
}

.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-editor-topbar {
  min-height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 0 0;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
  align-items: center;
  gap: 8px;
  background: rgba(28, 28, 27, .88);
}

.mobile-editor-topbar strong {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.015em;
  text-align: center;
}

.mobile-editor-topbar button,
.mobile-editor-launcher,
.mobile-export-sheet button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-editor-topbar button:first-child { justify-self: start; }
.mobile-editor-topbar button:last-child { justify-self: end; color: #ff526a; }
.mobile-editor-topbar button:active,
.mobile-editor-launcher:active,
.mobile-export-sheet button:active {
  transform: scale(.96);
  background: rgba(255, 255, 255, .1);
}

.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .preview-toolbar,
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .preview-tools { display: none; }

.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .canvas-shell {
  width: auto;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  margin: 8px auto;
  flex: 1 1 auto;
}

.mobile-brush-status { display: none; }
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-brush-status {
  min-height: 28px;
  margin: 0;
  padding: 5px 10px;
  position: absolute;
  z-index: 8;
  top: 14px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(26,26,25,.72);
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
}
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-brush-status.active { border-color: rgba(255,82,106,.72); background: rgba(94,15,30,.78); color: #fff; }

.studio-grid[data-cover-layout="split"] .mobile-secondary-tools,
.studio-grid[data-cover-layout="split"] .mobile-primary-tools,
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-secondary-tools,
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-primary-tools {
  min-height: 56px;
  padding: 6px 4px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mobile-secondary-tools::-webkit-scrollbar,
.mobile-primary-tools::-webkit-scrollbar { display: none; }

.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-primary-tools {
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: rgba(28, 28, 27, .9);
}

.mobile-tool-placeholder {
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
  white-space: nowrap;
}

.mobile-single-tool-control {
  min-height: 106px;
  max-height: 132px;
  padding: 10px 8px 6px;
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(28, 28, 27, .94);
}
.mobile-single-tool-control button,
.mobile-secondary-tools button,
.mobile-primary-tools button { min-width: 44px; min-height: 44px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.78); font: inherit; font-weight: 700; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.mobile-secondary-tools button,
.mobile-primary-tools button { padding: 0 15px; flex: 0 0 auto; white-space: nowrap; }
.mobile-secondary-tools button.active,
.mobile-primary-tools button.active,
.mobile-tool-choices button.active,
.mobile-tool-toggle.active { border-color: rgba(255,82,106,.72); background: rgba(255,36,66,.2); color: #fff; }
.mobile-single-tool-control button:active,
.mobile-secondary-tools button:active,
.mobile-primary-tools button:active { transform: scale(.97); background: rgba(255,255,255,.14); }
.mobile-single-tool-control button:focus-visible,
.mobile-secondary-tools button:focus-visible,
.mobile-primary-tools button:focus-visible,
.mobile-single-tool-control input:focus-visible,
.mobile-single-tool-control textarea:focus-visible { outline: 2px solid #ff526a; outline-offset: 2px; }
.mobile-tool-panel { min-height: 86px; display: grid; align-items: center; }
.mobile-tool-range { display: grid; gap: 8px; }
.mobile-tool-range > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mobile-tool-range output { color: #fff; font-variant-numeric: tabular-nums; }
.mobile-tool-range input[type="range"] { min-width: 0; flex: 1; accent-color: #ff2442; }
.mobile-tool-exact { min-width: 78px; display: flex; align-items: center; gap: 3px; }
.mobile-tool-exact input,
.mobile-tool-text input,
.mobile-tool-text textarea { min-width: 0; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; background: rgba(255,255,255,.08); color: #fff; font-size: 16px; }
.mobile-tool-text { display: grid; gap: 7px; font-size: 13px; }
.mobile-tool-text textarea { height: 58px; resize: none; }
.mobile-tool-color,
.mobile-tool-color label,
.mobile-tool-memory { display: flex; align-items: center; gap: 8px; }
.mobile-tool-color label { flex: 1; justify-content: space-between; }
.mobile-tool-color input[type="color"] { width: 54px; min-height: 44px; padding: 4px; border: 0; border-radius: 10px; background: transparent; }
.mobile-tool-choices { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; }
.mobile-tool-choices button { padding: 0 14px; flex: 0 0 auto; }
.mobile-tool-toggle,
.mobile-tool-action { width: 100%; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; }
.mobile-tool-action { justify-content: center; }
.mobile-single-tool-control button:disabled { opacity: .42; }
.mobile-tool-memory b { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mobile-editor-launcher {
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
}

.studio-grid[data-cover-layout="compact"] .mobile-editor-launcher:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-export-sheet:not([hidden]) {
  min-height: 100dvh;
  padding: 20px 12px calc(12px + env(safe-area-inset-bottom));
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: rgba(0, 0, 0, .48);
  color: #fff;
  transition: opacity 160ms ease-out;
}

.mobile-export-sheet > div {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  background: rgba(36, 36, 35, .94);
  box-shadow: 0 -18px 44px rgba(0, 0, 0, .28);
}

.mobile-export-sheet strong { display: block; font-size: 17px; }
.mobile-export-sheet p { margin: 8px 0 14px; color: rgba(255, 255, 255, .66); font-size: 13px; line-height: 1.5; }
.mobile-export-sheet button { width: 100%; min-height: 44px; }
.mobile-export-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mobile-export-options button { border: 1px solid rgba(255,82,106,.7); border-radius: 13px; background: rgba(255,36,66,.14); color: #fff; font-weight: 750; }
.mobile-export-close { margin-top: 10px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.07); }
.mobile-export-sheet button:disabled { opacity: .48; }

.studio-grid[data-cover-layout="compact"].is-mobile-editor-open.is-keyboard-open .canvas-shell {
  min-height: 112px;
  flex: .58 1 auto;
}
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open.is-keyboard-open .mobile-single-tool-control {
  min-height: 74px;
  max-height: 88px;
}
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open.is-keyboard-open .mobile-secondary-tools,
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open.is-keyboard-open .mobile-primary-tools { min-height: 48px; padding-block: 2px; }

@media (orientation: landscape) and (max-height: 500px) {
  .studio-grid[data-cover-layout="compact"].is-mobile-editor-open .preview-panel {
    display: grid;
    grid-template-columns: minmax(180px, .78fr) minmax(0, 1.22fr);
    grid-template-rows: 56px minmax(0, 1fr) 56px 56px;
    column-gap: 10px;
  }
  .studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-editor-topbar { grid-column: 1 / -1; grid-row: 1; }
  .studio-grid[data-cover-layout="compact"].is-mobile-editor-open .canvas-shell { grid-column: 1; grid-row: 2 / 5; min-width: 120px; min-height: 213px; }
  .studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-single-tool-control { grid-column: 2; grid-row: 2; max-height: none; }
  .studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-secondary-tools { grid-column: 2; grid-row: 3; }
  .studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-primary-tools { grid-column: 2; grid-row: 4; }
}

@media (pointer: coarse) {
  .mobile-single-tool-control input:not([type="range"]):not([type="color"]),
  .mobile-single-tool-control textarea { font-size: 16px; }
}

@supports ((-webkit-backdrop-filter: blur(18px)) or (backdrop-filter: blur(18px))) {
  .mobile-editor-topbar,
  .mobile-primary-tools,
  .mobile-brush-status,
  .mobile-export-sheet > div {
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-editor-topbar button,
  .mobile-editor-launcher,
  .mobile-export-sheet { transition: none !important; }
  .mobile-editor-topbar button:active,
  .mobile-editor-launcher:active,
  .mobile-export-sheet button:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .mobile-editor-topbar,
  .mobile-primary-tools,
  .mobile-brush-status,
  .mobile-export-sheet,
  .mobile-export-sheet > div {
    background: #20201f;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
}
@media (max-width: 780px) {
  .studio-header, .studio { width: min(100% - 20px, 1480px); }
  .studio-header { min-height: 66px; }
  .header-actions span { display: none; }
  .intro { padding: 24px 22px; align-items: flex-start; flex-direction: column; border-radius: 22px; }
  .status { width: 100%; min-width: 0; }
  .studio-grid { grid-template-columns: 1fr; }
  .preview-panel { min-height: 0; order: -1; }
  .preview-toolbar { align-items: flex-start; gap: 10px; }
  .preview-switches { flex-wrap: wrap; gap: 8px 12px; }
  .canvas-shell.has-image canvas { touch-action: pan-y; }
  .canvas-shell.is-brushing canvas { touch-action: none; }
  .mobile-touch-zone.active { display: block; position: absolute; z-index: 5; left: 1.6667%; right: 1.6667%; top: 12.5%; bottom: 12.5%; touch-action: pan-y; -webkit-touch-callout: none; user-select: none; }
  .mobile-touch-zone.is-gesture-active { touch-action: none; }
  .design { grid-column: auto; }
  .templates { grid-template-columns: repeat(3, 1fr); }
  .standard { grid-template-columns: 1fr; }
  .standard ul { grid-template-columns: 1fr; }
  .standard > p { grid-column: auto; }
}
@media (max-width: 520px) {
  .access-card { padding: 36px 22px 30px; }
  .header-actions button { padding: 9px 11px; font-size: 10px; }
  .intro h1 { font-size: 32px; }
  .panel, .preview-panel { border-radius: 20px; }
  .preview-panel { padding: 13px; }
  .preview-toolbar { flex-direction: column; }
  .preview-switches { width: 100%; justify-content: space-between; }
  .export-row { grid-template-columns: 1fr 1fr; order: -1; margin: 0 0 4px; }
  .export-row > span { grid-column: 1/-1; }
  .export-row button { width: 100%; height: 48px; font-size: 12px; }
}

/* Compact 编辑必须在首次落指前接管画布；普通页面仍沿用上方的 pan-y。 */
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .canvas-shell.has-image canvas,
.studio-grid[data-cover-layout="compact"].is-mobile-editor-open .mobile-touch-zone.active {
  touch-action: none;
}

.fixed-text-hint { margin: 5px 0 8px; font-size: 10px; line-height: 1.5; color: #827b74; }

.fixed-text-toggle { position: relative; margin: 8px 0 0; padding: 0; border: 0; font-size: 10px; }
.fixed-text-toggle input { width: 32px; height: 18px; left: 0; top: 0; margin: 0; padding: 0; }
.fixed-text-toggle i { flex-shrink: 0; }
