@font-face { font-family: "D31Sans"; src: url("/editor-v2/fonts/notosanssc-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "D31Sans"; src: url("/editor-v2/fonts/notosanssc-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "D31Serif"; src: url("/editor-v2/fonts/notoserifsc-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "D31Serif"; src: url("/editor-v2/fonts/notoserifsc-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "D31Kuaile"; src: url("/editor-v2/fonts/zcoolkuaile-regular.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "D31Brush"; src: url("/editor-v2/fonts/mashanzheng-regular.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "D31Hand"; src: url("/editor-v2/fonts/longcang-regular.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #0d1424; color: #e8ecf4; font: 14px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #11192e; border-bottom: 1px solid #22304f; flex-wrap: wrap; }
.brand-logo { height: 32px; width: auto; display: block; }
.preview-sheet { position: relative; }
.preview-brand { position: absolute; bottom: 12px; right: 14px; height: 20px; width: auto; pointer-events: none; background: rgba(255,255,255,.88); padding: 5px 8px; border-radius: 6px; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.topbar .back { color: #ffb347; text-decoration: none; }
.topbar .title strong { font-size: 16px; }
.topbar .meta { color: #93a3c0; margin-left: 8px; font-size: 12px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background: #1d2a47; color: #e8ecf4; border: 1px solid #31456e; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: #ffb347; }
.btn.primary { background: #d9480f; color: #fff; border: none; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.danger { border-color: #7a2e35; color: #ff9aa2; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; margin-top: 10px; }
.file-btn { display: inline-block; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; padding: 14px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.stage-wrap { min-width: 0; }
.stage { position: relative; width: 100%; max-width: 760px; margin: 0 auto; background: #182238; border: 1px solid #2a3a5f; border-radius: 10px; overflow: hidden; touch-action: none; user-select: none; }
.tpl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.print-area { position: absolute; border: 1.5px dashed #ffb347; border-radius: 4px; pointer-events: none; z-index: 3; }
.pa-label { position: absolute; top: -1px; left: -1px; background: #ffb347; color: #22160a; font-size: 11px; padding: 1px 6px; border-radius: 0 0 6px 0; white-space: nowrap; }
.warn { position: absolute; left: 8px; bottom: 8px; z-index: 40; background: rgba(122, 20, 28, .92); color: #ffd7db; padding: 5px 10px; border-radius: 6px; font-size: 12px; }
.guide { position: absolute; background: #ff3860; z-index: 4; pointer-events: none; }
.guide.v { width: 1.5px; top: 0; bottom: 0; }
.guide.h { height: 1.5px; left: 0; right: 0; }
a.btn { text-decoration: none; display: inline-block; }
#bgTools, #photoTools .grid2 { margin-top: 10px; }
.layer { position: absolute; z-index: 5; cursor: grab; }
.layer.locked { cursor: default; }
.layer .inner { position: absolute; inset: 0; overflow: hidden; }
.layer img.ph { position: absolute; max-width: none; pointer-events: none; }
.layer .txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; }
.layer .txt .tx { white-space: pre-wrap; word-break: break-word; max-width: 100%; max-height: 100%; }
.layer .txt svg.txtsvg { display: block; }
.swatches { margin-top: 10px; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #31456e; cursor: pointer; padding: 0; }
.sw.on { border-color: #ff7a18; box-shadow: 0 0 0 1px #ff7a18; }
.sw.transparent { background: repeating-conic-gradient(#3a4a6e 0 25%, #22304f 0 50%) 0 0/10px 10px; }
#cutBgColor, #inSvgColor { width: 34px; height: 24px; padding: 0; }
#photoTools { margin-top: 10px; }
textarea, select { background: #0d1424; border: 1px solid #31456e; color: #e8ecf4; border-radius: 6px; padding: 6px 8px; width: 100%; font: inherit; resize: vertical; }
label.mini { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #aeb9d0; }
label.mini input[type="number"] { width: 64px; }
label.mini input[type="color"] { width: 34px; height: 24px; padding: 0; }
.mat-thumb { background: #1a2745; display: flex; align-items: center; justify-content: center; height: 86px; }
.fx-card .mat-thumb img { width: auto; height: auto; max-width: 88%; max-height: 78px; object-fit: contain; }
.layer.selected { outline: 1.5px solid #ff7a18; outline-offset: 1px; }
.handle { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #ff7a18; border: 2px solid #fff2df; z-index: 6; display: none; }
.layer.selected .handle { display: block; }
.handle.scale { right: -9px; bottom: -9px; cursor: nwse-resize; }
.handle.rotate { left: 50%; top: -26px; margin-left: -9px; cursor: grab; background: #ffb347; }
.stage-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px auto 0; max-width: 760px; align-items: center; }
.save-state { color: #7fe0a8; font-size: 12px; margin-left: auto; }
.hint { color: #93a3c0; font-size: 12px; }
.panel { display: flex; flex-direction: column; gap: 12px; }
.card { background: #131e36; border: 1px solid #24365c; border-radius: 10px; padding: 12px 14px; }
.card h2 { margin: 0 0 10px; font-size: 14px; }
.sel-name { color: #ffb347; font-weight: normal; font-size: 12px; }
.layers { list-style: none; margin: 0 0 10px; padding: 0; max-height: 180px; overflow: auto; }
.layers li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.layers li.on { background: #1d2a47; border-color: #ff7a18; }
.layers li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layers li .tag { font-size: 11px; color: #93a3c0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 6px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 label, label.block { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #aeb9d0; margin-bottom: 8px; }
.grid2 .unit { color: #ffb347; }
input[type="number"], input[type="text"] { background: #0d1424; border: 1px solid #31456e; color: #e8ecf4; border-radius: 6px; padding: 6px 8px; width: 100%; }
input[type="color"] { width: 100%; height: 32px; background: #0d1424; border: 1px solid #31456e; border-radius: 6px; }
.slider-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #aeb9d0; margin: 4px 0 10px; }
.slider-row input { flex: 1; }
.nudge { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; color: #aeb9d0; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #aeb9d0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { background: #1d2a47; border: 1px solid #31456e; color: #dbe4f5; border-radius: 999px; padding: 4px 11px; cursor: pointer; font-size: 12px; }
.chip.on { border-color: #ff7a18; color: #ffb347; }
.fx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-card { border: 1px solid #31456e; border-radius: 8px; overflow: hidden; cursor: pointer; background: #0d1424; }
.fx-card.on { border-color: #ff7a18; box-shadow: 0 0 0 1px #ff7a18; }
.fx-card img { width: 100%; height: 86px; object-fit: cover; display: block; }
.fx-card .fx-body { padding: 6px 8px; }
.fx-card .fx-name { font-size: 12px; display: block; }
.fx-card .fx-fee { font-size: 11px; color: #ffb84d; }
.fx-empty { color: #93a3c0; font-size: 12px; grid-column: 1 / -1; }
.overlay { position: fixed; inset: 0; background: rgba(4, 8, 18, .78); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 14px; }
.overlay[hidden] { display: none; }
.sheet { background: #131e36; border: 1px solid #2a3a5f; border-radius: 12px; padding: 16px; max-width: 720px; width: 100%; max-height: 92vh; overflow: auto; }
.sheet h3 { margin: 0 0 12px; }
.crop-stage { position: relative; margin: 0 auto; background: #0d1424; touch-action: none; user-select: none; }
.crop-stage img { width: 100%; height: 100%; display: block; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #ff7a18; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); cursor: move; }
.crop-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #ff7a18; border: 2px solid #fff2df; cursor: nwse-resize; }
#previewCanvas { width: 100%; height: auto; background: repeating-conic-gradient(#1a2745 0 25%, #141f38 0 50%) 0 0/24px 24px; border-radius: 8px; }
